From d06c2f697bb04350206c2c4eebfd74fcac0db595 Mon Sep 17 00:00:00 2001 From: Tony Arcieri Date: Thu, 15 May 2025 11:43:24 -0600 Subject: [PATCH 1/2] base64ct: bump edition to 2024 (MSRV 1.85); add back to workspace We kept `base64ct` out of the toplevel workspace because we can't run tests on it with its previous MSRV of 1.81 because that compiler can't recognize the newer edition on all of the other crates in the workspace. We originally attempted this upgrade in #1670 but reverted it in #1702 due to complaints we received in #1695. Now that the needed MSRV of 1.85 is `N-2` of the current 1.87 stable, we can hopefully perform this upgrade without receiving as many complaints. Several other crates have bumped edition to 2024 already, and edition upgrades are a time when MSRV bumps like this should be expected. --- .github/workflows/base64ct.yml | 4 +- Cargo.lock | 20 +++- Cargo.toml | 13 +-- base64ct/Cargo.lock | 204 --------------------------------- base64ct/Cargo.toml | 6 +- base64ct/README.md | 4 +- 6 files changed, 30 insertions(+), 221 deletions(-) delete mode 100644 base64ct/Cargo.lock diff --git a/.github/workflows/base64ct.yml b/.github/workflows/base64ct.yml index 330ac2b69..3836397aa 100644 --- a/.github/workflows/base64ct.yml +++ b/.github/workflows/base64ct.yml @@ -23,7 +23,7 @@ jobs: strategy: matrix: rust: - - 1.81.0 # MSRV + - 1.85.0 # MSRV - stable target: - thumbv7em-none-eabi @@ -47,7 +47,7 @@ jobs: strategy: matrix: rust: - - 1.81.0 # MSRV + - 1.85.0 # MSRV - stable steps: - uses: actions/checkout@v4 diff --git a/Cargo.lock b/Cargo.lock index bf90bfcab..cb0c0da2c 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -136,9 +136,25 @@ dependencies = [ "proptest", ] +[[package]] +name = "base64" +version = "0.22.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "72b3254f16251a8381aa12e40e3c4d2f0199f8c6508fbecb9d91f575e0fbb8c6" + [[package]] name = "base64ct" version = "1.7.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "89e25b6adfb930f02d1981565a6e5d9c547ac15a96606256d3b59040e5cd4ca3" + +[[package]] +name = "base64ct" +version = "1.8.0-pre" +dependencies = [ + "base64", + "proptest", +] [[package]] name = "bincode" @@ -933,7 +949,7 @@ dependencies = [ name = "pem-rfc7468" version = "1.0.0-rc.2" dependencies = [ - "base64ct", + "base64ct 1.7.3", ] [[package]] @@ -1516,7 +1532,7 @@ name = "spki" version = "0.8.0-rc.1" dependencies = [ "arbitrary", - "base64ct", + "base64ct 1.7.3", "der", "digest", "hex-literal", diff --git a/Cargo.toml b/Cargo.toml index 97ad350bb..e04752ddd 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -3,7 +3,7 @@ resolver = "2" members = [ "base16ct", "base32ct", - #"base64ct", + "base64ct", "cmpv2", "cms", "const-oid", @@ -27,9 +27,6 @@ members = [ "x509-cert/test-support", "x509-ocsp" ] -exclude = [ - "base64ct", -] [profile.dev] opt-level = 2 @@ -65,7 +62,7 @@ x509-ocsp = { path = "./x509-ocsp" } # https://github.com/RustCrypto/signatures/pull/913 # https://github.com/RustCrypto/signatures/pull/923 -ecdsa = { git = "https://github.com/RustCrypto/signatures.git" } +ecdsa = { git = "https://github.com/RustCrypto/signatures.git" } rfc6979 = { git = "https://github.com/RustCrypto/signatures.git" } # https://github.com/RustCrypto/key-wraps/pull/34 # https://github.com/RustCrypto/key-wraps/pull/35 @@ -78,10 +75,10 @@ ansi-x963-kdf = { git = "https://github.com/RustCrypto/KDFs.git" } # https://github.com/RustCrypto/traits/pull/1777 -crypto-common = { git = "https://github.com/RustCrypto/traits.git" } +crypto-common = { git = "https://github.com/RustCrypto/traits.git" } elliptic-curve = { git = "https://github.com/RustCrypto/traits.git" } -signature = { git = "https://github.com/RustCrypto/traits.git" } -aead = { git = "https://github.com/RustCrypto/traits.git" } +signature = { git = "https://github.com/RustCrypto/traits.git" } +aead = { git = "https://github.com/RustCrypto/traits.git" } # https://github.com/RustCrypto/RSA/pull/478 # https://github.com/RustCrypto/RSA/pull/504 diff --git a/base64ct/Cargo.lock b/base64ct/Cargo.lock deleted file mode 100644 index 4ad0e180a..000000000 --- a/base64ct/Cargo.lock +++ /dev/null @@ -1,204 +0,0 @@ -# This file is automatically @generated by Cargo. -# It is not intended for manual editing. -version = 3 - -[[package]] -name = "autocfg" -version = "1.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ace50bade8e6234aa140d9a2f552bbee1db4d353f69b8217bc503490fc1a9f26" - -[[package]] -name = "base64" -version = "0.22.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "72b3254f16251a8381aa12e40e3c4d2f0199f8c6508fbecb9d91f575e0fbb8c6" - -[[package]] -name = "base64ct" -version = "1.7.3" -dependencies = [ - "base64", - "proptest", -] - -[[package]] -name = "bitflags" -version = "2.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5c8214115b7bf84099f1309324e63141d4c5d7cc26862f97a0a857dbefe165bd" - -[[package]] -name = "cfg-if" -version = "1.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" - -[[package]] -name = "getrandom" -version = "0.2.15" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c4567c8db10ae91089c99af84c68c38da3ec2f087c3f82960bcdbf3656b6f4d7" -dependencies = [ - "cfg-if", - "libc", - "wasi", -] - -[[package]] -name = "lazy_static" -version = "1.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bbd2bcb4c963f2ddae06a2efc7e9f3591312473c50c6685e1f298068316e66fe" - -[[package]] -name = "libc" -version = "0.2.170" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "875b3680cb2f8f71bdcf9a30f38d48282f5d3c95cbf9b3fa57269bb5d5c06828" - -[[package]] -name = "num-traits" -version = "0.2.19" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "071dfc062690e90b734c0b2273ce72ad0ffa95f0c74596bc250dcfd960262841" -dependencies = [ - "autocfg", -] - -[[package]] -name = "ppv-lite86" -version = "0.2.21" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "85eae3c4ed2f50dcfe72643da4befc30deadb458a9b590d720cde2f2b1e97da9" -dependencies = [ - "zerocopy", -] - -[[package]] -name = "proc-macro2" -version = "1.0.94" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a31971752e70b8b2686d7e46ec17fb38dad4051d94024c88df49b667caea9c84" -dependencies = [ - "unicode-ident", -] - -[[package]] -name = "proptest" -version = "1.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "14cae93065090804185d3b75f0bf93b8eeda30c7a9b4a33d3bdb3988d6229e50" -dependencies = [ - "bitflags", - "lazy_static", - "num-traits", - "rand", - "rand_chacha", - "rand_xorshift", - "regex-syntax", - "unarray", -] - -[[package]] -name = "quote" -version = "1.0.39" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c1f1914ce909e1658d9907913b4b91947430c7d9be598b15a1912935b8c04801" -dependencies = [ - "proc-macro2", -] - -[[package]] -name = "rand" -version = "0.8.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "34af8d1a0e25924bc5b7c43c079c942339d8f0a8b57c39049bef581b46327404" -dependencies = [ - "libc", - "rand_chacha", - "rand_core", -] - -[[package]] -name = "rand_chacha" -version = "0.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e6c10a63a0fa32252be49d21e7709d4d4baf8d231c2dbce1eaa8141b9b127d88" -dependencies = [ - "ppv-lite86", - "rand_core", -] - -[[package]] -name = "rand_core" -version = "0.6.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c" -dependencies = [ - "getrandom", -] - -[[package]] -name = "rand_xorshift" -version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d25bf25ec5ae4a3f1b92f929810509a2f53d7dca2f50b794ff57e3face536c8f" -dependencies = [ - "rand_core", -] - -[[package]] -name = "regex-syntax" -version = "0.8.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2b15c43186be67a4fd63bee50d0303afffcef381492ebe2c5d87f324e1b8815c" - -[[package]] -name = "syn" -version = "2.0.100" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b09a44accad81e1ba1cd74a32461ba89dee89095ba17b32f5d03683b1b1fc2a0" -dependencies = [ - "proc-macro2", - "quote", - "unicode-ident", -] - -[[package]] -name = "unarray" -version = "0.1.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eaea85b334db583fe3274d12b4cd1880032beab409c0d774be044d4480ab9a94" - -[[package]] -name = "unicode-ident" -version = "1.0.18" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5a5f39404a5da50712a4c1eecf25e90dd62b613502b7e925fd4e4d19b5c96512" - -[[package]] -name = "wasi" -version = "0.11.0+wasi-snapshot-preview1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" - -[[package]] -name = "zerocopy" -version = "0.8.23" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fd97444d05a4328b90e75e503a34bad781f14e28a823ad3557f0750df1ebcbc6" -dependencies = [ - "zerocopy-derive", -] - -[[package]] -name = "zerocopy-derive" -version = "0.8.23" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6352c01d0edd5db859a63e2605f4ea3183ddbd15e2c4a9e7d32184df75e4f154" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] diff --git a/base64ct/Cargo.toml b/base64ct/Cargo.toml index 110266c99..61f8fb448 100644 --- a/base64ct/Cargo.toml +++ b/base64ct/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "base64ct" -version = "1.7.3" +version = "1.8.0-pre" description = """ Pure Rust implementation of Base64 (RFC 4648) which avoids any usages of data-dependent branches/LUTs and thereby provides portable "best effort" @@ -14,8 +14,8 @@ repository = "https://github.com/RustCrypto/formats" categories = ["cryptography", "encoding", "no-std", "parser-implementations"] keywords = ["crypto", "base64", "pem", "phc"] readme = "README.md" -edition = "2021" -rust-version = "1.81" +edition = "2024" +rust-version = "1.85" [dev-dependencies] base64 = "0.22" diff --git a/base64ct/README.md b/base64ct/README.md index 690d84431..be00d7967 100644 --- a/base64ct/README.md +++ b/base64ct/README.md @@ -43,7 +43,7 @@ fixed-width line wrapping. ## Minimum Supported Rust Version -This crate requires **Rust 1.81** at a minimum. +This crate requires **Rust 1.85** at a minimum. We may change the MSRV in the future, but it will be accompanied by a minor version bump. @@ -72,7 +72,7 @@ dual licensed as above, without any additional terms or conditions. [build-image]: https://github.com/RustCrypto/formats/actions/workflows/base64ct.yml/badge.svg [build-link]: https://github.com/RustCrypto/formats/actions/workflows/base64ct.yml [license-image]: https://img.shields.io/badge/license-Apache2.0/MIT-blue.svg -[rustc-image]: https://img.shields.io/badge/rustc-1.81+-blue.svg +[rustc-image]: https://img.shields.io/badge/rustc-1.85+-blue.svg [chat-image]: https://img.shields.io/badge/zulip-join_chat-blue.svg [chat-link]: https://rustcrypto.zulipchat.com/#narrow/stream/300570-formats From 1daa5a0520c61337477bb090424aafc25b311aea Mon Sep 17 00:00:00 2001 From: Arthur Gautier Date: Thu, 15 May 2025 11:57:36 -0700 Subject: [PATCH 2/2] base64ct: reformat after edition change --- base64ct/src/decoder.rs | 7 +++---- base64ct/src/encoder.rs | 2 +- base64ct/src/test_vectors.rs | 6 ++---- 3 files changed, 6 insertions(+), 9 deletions(-) diff --git a/base64ct/src/decoder.rs b/base64ct/src/decoder.rs index bb92b6d70..d711906e0 100644 --- a/base64ct/src/decoder.rs +++ b/base64ct/src/decoder.rs @@ -1,11 +1,10 @@ //! Buffered Base64 decoder. use crate::{ - encoding, - line_ending::{CHAR_CR, CHAR_LF}, Encoding, Error::{self, InvalidLength}, - MIN_LINE_WIDTH, + MIN_LINE_WIDTH, encoding, + line_ending::{CHAR_CR, CHAR_LF}, }; use core::{cmp, marker::PhantomData}; @@ -545,7 +544,7 @@ impl<'i> Iterator for LineReader<'i> { #[cfg(test)] #[allow(clippy::unwrap_used)] mod tests { - use crate::{alphabet::Alphabet, test_vectors::*, Base64, Base64Unpadded, Decoder}; + use crate::{Base64, Base64Unpadded, Decoder, alphabet::Alphabet, test_vectors::*}; #[cfg(feature = "std")] use {alloc::vec::Vec, std::io::Read}; diff --git a/base64ct/src/encoder.rs b/base64ct/src/encoder.rs index e25043dbf..7fccf0dfd 100644 --- a/base64ct/src/encoder.rs +++ b/base64ct/src/encoder.rs @@ -306,7 +306,7 @@ impl LineWrapper { #[cfg(test)] #[allow(clippy::unwrap_used)] mod tests { - use crate::{alphabet::Alphabet, test_vectors::*, Base64, Base64Unpadded, Encoder, LineEnding}; + use crate::{Base64, Base64Unpadded, Encoder, LineEnding, alphabet::Alphabet, test_vectors::*}; #[test] fn encode_padded() { diff --git a/base64ct/src/test_vectors.rs b/base64ct/src/test_vectors.rs index edc2c2b2b..ebb49fa05 100644 --- a/base64ct/src/test_vectors.rs +++ b/base64ct/src/test_vectors.rs @@ -20,8 +20,7 @@ pub(crate) const UNPADDED_BIN: &[u8] = &[ ]; /// Padded multi-line Base64 example (from the `ssh-key` crate's `id_ed25519`) -pub(crate) const MULTILINE_PADDED_BASE64: &str = - "b3BlbnNzaC1rZXktdjEAAAAABG5vbmUAAAAEbm9uZQAAAAAAAAABAAAAMwAAAAtzc2gtZW\n\ +pub(crate) const MULTILINE_PADDED_BASE64: &str = "b3BlbnNzaC1rZXktdjEAAAAABG5vbmUAAAAEbm9uZQAAAAAAAAABAAAAMwAAAAtzc2gtZW\n\ QyNTUxOQAAACCzPq7zfqLffKoBDe/eo04kH2XxtSmk9D7RQyf1xUqrYgAAAJgAIAxdACAM\n\ XQAAAAtzc2gtZWQyNTUxOQAAACCzPq7zfqLffKoBDe/eo04kH2XxtSmk9D7RQyf1xUqrYg\n\ AAAEC2BsIi0QwW2uFscKTUUXNHLsYX4FxlaSDSblbAj7WR7bM+rvN+ot98qgEN796jTiQf\n\ @@ -42,8 +41,7 @@ pub(crate) const MULTILINE_PADDED_BIN: &[u8] = &[ ]; /// Unpadded multi-line Base64 example (from the `ssh-key` crate's `id_ecdsa_p256`). -pub(crate) const MULTILINE_UNPADDED_BASE64: &str = - "b3BlbnNzaC1rZXktdjEAAAAABG5vbmUAAAAEbm9uZQAAAAAAAAABAAAAaAAAABNlY2RzYS\n\ +pub(crate) const MULTILINE_UNPADDED_BASE64: &str = "b3BlbnNzaC1rZXktdjEAAAAABG5vbmUAAAAEbm9uZQAAAAAAAAABAAAAaAAAABNlY2RzYS\n\ 1zaGEyLW5pc3RwMjU2AAAACG5pc3RwMjU2AAAAQQR8H9hzDOU0V76NkkCY7DZIgw+Sqooj\n\ Y6xlb91FIfpjE+UR8YkbTp5ar44ULQatFaZqQlfz8FHYTooOL5G6gHBHAAAAsB8RBhUfEQ\n\ YVAAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBHwf2HMM5TRXvo2S\n\