diff --git a/.github/workflows/base16ct.yml b/.github/workflows/base16ct.yml index 32d675a66..3f38ba355 100644 --- a/.github/workflows/base16ct.yml +++ b/.github/workflows/base16ct.yml @@ -23,7 +23,7 @@ jobs: strategy: matrix: rust: - - 1.65.0 # MSRV + - 1.85.0 # MSRV - stable target: - thumbv7em-none-eabi @@ -47,7 +47,7 @@ jobs: strategy: matrix: rust: - - 1.65.0 # MSRV + - 1.85.0 # MSRV - stable steps: - uses: actions/checkout@v4 diff --git a/.github/workflows/base32ct.yml b/.github/workflows/base32ct.yml index 91eb9aaed..85b2d55ab 100644 --- a/.github/workflows/base32ct.yml +++ b/.github/workflows/base32ct.yml @@ -23,7 +23,7 @@ jobs: strategy: matrix: rust: - - 1.65.0 # MSRV + - 1.85.0 # MSRV - stable target: - thumbv7em-none-eabi @@ -47,7 +47,7 @@ jobs: strategy: matrix: rust: - - 1.65.0 # MSRV + - 1.85.0 # MSRV - stable steps: - uses: actions/checkout@v4 diff --git a/.github/workflows/base64ct.yml b/.github/workflows/base64ct.yml index 07f467db9..3836397aa 100644 --- a/.github/workflows/base64ct.yml +++ b/.github/workflows/base64ct.yml @@ -23,7 +23,7 @@ jobs: strategy: matrix: rust: - - 1.65.0 # MSRV + - 1.85.0 # MSRV - stable target: - thumbv7em-none-eabi @@ -47,7 +47,7 @@ jobs: strategy: matrix: rust: - - 1.65.0 # MSRV + - 1.85.0 # MSRV - stable steps: - uses: actions/checkout@v4 diff --git a/.github/workflows/const-oid.yml b/.github/workflows/const-oid.yml index 383622d2e..97bdf9f37 100644 --- a/.github/workflows/const-oid.yml +++ b/.github/workflows/const-oid.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/.github/workflows/der.yml b/.github/workflows/der.yml index d1a1da472..a1b7087d2 100644 --- a/.github/workflows/der.yml +++ b/.github/workflows/der.yml @@ -25,7 +25,7 @@ jobs: strategy: matrix: rust: - - 1.81.0 # MSRV + - 1.85.0 # MSRV - stable target: - thumbv7em-none-eabi @@ -52,7 +52,7 @@ jobs: # 32-bit Linux - targets: i686-unknown-linux-gnu platform: ubuntu-latest - rust: 1.81.0 # MSRV + rust: 1.85.0 # MSRV deps: sudo apt update && sudo apt install gcc-multilib - targets: i686-unknown-linux-gnu platform: ubuntu-latest @@ -62,7 +62,7 @@ jobs: # 64-bit Linux - targets: x86_64-unknown-linux-gnu platform: ubuntu-latest - rust: 1.81.0 # MSRV + rust: 1.85.0 # MSRV - targets: x86_64-unknown-linux-gnu platform: ubuntu-latest rust: stable @@ -71,7 +71,7 @@ jobs: # 64-bit Windows #- targets: x86_64-pc-windows-msvc # platform: windows-latest - # rust: 1.81.0 # MSRV + # rust: 1.85.0 # MSRV #- targets: x86_64-pc-windows-msvc # platform: windows-latest # rust: stable @@ -91,7 +91,7 @@ jobs: strategy: matrix: rust: - - 1.81.0 # MSRV + - 1.85.0 # MSRV - stable steps: - uses: actions/checkout@v4 diff --git a/.github/workflows/pem-rfc7468.yml b/.github/workflows/pem-rfc7468.yml index 098644271..e630764d9 100644 --- a/.github/workflows/pem-rfc7468.yml +++ b/.github/workflows/pem-rfc7468.yml @@ -24,7 +24,7 @@ jobs: strategy: matrix: rust: - - 1.81.0 # MSRV + - 1.85.0 # MSRV - stable target: - thumbv7em-none-eabi @@ -48,7 +48,7 @@ jobs: strategy: matrix: rust: - - 1.81.0 # MSRV + - 1.85.0 # MSRV - stable steps: - uses: actions/checkout@v4 diff --git a/.github/workflows/pkcs1.yml b/.github/workflows/pkcs1.yml index 030cd0b95..b506e4db1 100644 --- a/.github/workflows/pkcs1.yml +++ b/.github/workflows/pkcs1.yml @@ -27,7 +27,7 @@ jobs: strategy: matrix: rust: - - 1.81.0 # MSRV + - 1.85.0 # MSRV - stable target: - thumbv7em-none-eabi @@ -52,7 +52,7 @@ jobs: strategy: matrix: rust: - - 1.81.0 # MSRV + - 1.85.0 # MSRV - stable steps: - uses: actions/checkout@v4 diff --git a/.github/workflows/pkcs12.yml b/.github/workflows/pkcs12.yml index ea3499655..ec7c79a35 100644 --- a/.github/workflows/pkcs12.yml +++ b/.github/workflows/pkcs12.yml @@ -28,7 +28,7 @@ jobs: strategy: matrix: rust: - - 1.81.0 # MSRV + - 1.85.0 # MSRV - stable target: - thumbv7em-none-eabi @@ -53,7 +53,7 @@ jobs: strategy: matrix: rust: - - 1.81.0 # MSRV + - 1.85.0 # MSRV - stable steps: - uses: actions/checkout@v4 diff --git a/.github/workflows/pkcs5.yml b/.github/workflows/pkcs5.yml index 8ec02177d..e35df8388 100644 --- a/.github/workflows/pkcs5.yml +++ b/.github/workflows/pkcs5.yml @@ -26,7 +26,7 @@ jobs: strategy: matrix: rust: - - 1.81.0 # MSRV + - 1.85.0 # MSRV - stable target: - thumbv7em-none-eabi @@ -51,7 +51,7 @@ jobs: strategy: matrix: rust: - - 1.81.0 # MSRV + - 1.85.0 # MSRV - stable steps: - uses: actions/checkout@v4 diff --git a/.github/workflows/pkcs8.yml b/.github/workflows/pkcs8.yml index 3e0d27a20..fcdb8ad93 100644 --- a/.github/workflows/pkcs8.yml +++ b/.github/workflows/pkcs8.yml @@ -28,7 +28,7 @@ jobs: strategy: matrix: rust: - - 1.81.0 # MSRV + - 1.85.0 # MSRV - stable target: - thumbv7em-none-eabi @@ -55,7 +55,7 @@ jobs: strategy: matrix: rust: - - 1.81.0 # MSRV + - 1.85.0 # MSRV - stable steps: - uses: actions/checkout@v4 diff --git a/.github/workflows/serdect.yml b/.github/workflows/serdect.yml index 2e8855f81..f729fce61 100644 --- a/.github/workflows/serdect.yml +++ b/.github/workflows/serdect.yml @@ -24,7 +24,7 @@ jobs: strategy: matrix: rust: - - 1.70.0 # MSRV + - 1.85.0 # MSRV - stable target: - thumbv7em-none-eabi @@ -39,6 +39,7 @@ jobs: - run: cargo hack build --target ${{ matrix.target }} --feature-powerset minimal-versions: + if: false # TODO: temp disabled due to unpublished prerelease dependencies uses: RustCrypto/actions/.github/workflows/minimal-versions.yml@master with: nightly: nightly-2023-10-01 @@ -49,7 +50,7 @@ jobs: strategy: matrix: rust: - - 1.70.0 # MSRV + - 1.85.0 # MSRV - stable steps: - uses: actions/checkout@v4 diff --git a/.github/workflows/spki.yml b/.github/workflows/spki.yml index 551bcc5b3..30f44fc2f 100644 --- a/.github/workflows/spki.yml +++ b/.github/workflows/spki.yml @@ -26,7 +26,7 @@ jobs: strategy: matrix: rust: - - 1.81.0 # MSRV + - 1.85.0 # MSRV - stable target: - thumbv7em-none-eabi @@ -52,7 +52,7 @@ jobs: strategy: matrix: rust: - - 1.81.0 # MSRV + - 1.85.0 # MSRV - stable steps: - uses: actions/checkout@v4 diff --git a/.github/workflows/tai64.yml b/.github/workflows/tai64.yml index b41ed1c59..74b35defb 100644 --- a/.github/workflows/tai64.yml +++ b/.github/workflows/tai64.yml @@ -23,7 +23,7 @@ jobs: strategy: matrix: rust: - - 1.65.0 # MSRV + - 1.85.0 # MSRV - stable target: - thumbv7em-none-eabi @@ -47,7 +47,7 @@ jobs: strategy: matrix: rust: - - 1.65.0 # MSRV + - 1.85.0 # MSRV - stable steps: - uses: actions/checkout@v4 diff --git a/.github/workflows/tls_codec.yml b/.github/workflows/tls_codec.yml index d9aaa3037..3f0ef9eef 100644 --- a/.github/workflows/tls_codec.yml +++ b/.github/workflows/tls_codec.yml @@ -24,7 +24,7 @@ jobs: strategy: matrix: rust: - - 1.74.0 # MSRV + - 1.85.0 # MSRV - stable target: - wasm32-unknown-unknown @@ -50,7 +50,7 @@ jobs: include: # 32-bit Linux - targets: i686-unknown-linux-gnu - rust: 1.74.0 # MSRV + rust: 1.85.0 # MSRV deps: sudo apt update && sudo apt install gcc-multilib - targets: i686-unknown-linux-gnu rust: stable @@ -58,7 +58,7 @@ jobs: # 64-bit Linux - targets: x86_64-unknown-linux-gnu - rust: 1.74.0 # MSRV + rust: 1.85.0 # MSRV - targets: x86_64-unknown-linux-gnu rust: stable steps: diff --git a/Cargo.lock b/Cargo.lock index 74999121c..a9f60c287 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1,21 +1,6 @@ # This file is automatically @generated by Cargo. # It is not intended for manual editing. -version = 3 - -[[package]] -name = "addr2line" -version = "0.24.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dfbe277e56a376000877090da837660b4427aad530e3028d44e0bffe4f89a1c1" -dependencies = [ - "gimli", -] - -[[package]] -name = "adler2" -version = "2.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "512761e0bb2578dd7380c6baaa0f4ce03e84f95e960231d1dec8bf4d7d6e2627" +version = 4 [[package]] name = "aead" @@ -81,36 +66,12 @@ dependencies = [ "derive_arbitrary", ] -[[package]] -name = "async-signature" -version = "0.6.0-pre.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f9bdb5df8dde2bd1ec515a0981636508bb37d55984d0bae3678d4ac859125431" -dependencies = [ - "signature", -] - [[package]] name = "autocfg" version = "1.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ace50bade8e6234aa140d9a2f552bbee1db4d353f69b8217bc503490fc1a9f26" -[[package]] -name = "backtrace" -version = "0.3.74" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8d82cb332cdfaed17ae235a638438ac4d4839913cc2af585c3c6746e8f8bee1a" -dependencies = [ - "addr2line", - "cfg-if", - "libc", - "miniz_oxide", - "object", - "rustc-demangle", - "windows-targets", -] - [[package]] name = "base16ct" version = "0.2.0" @@ -181,18 +142,18 @@ checksum = "b048fb63fd8b5923fc5aa7b340d8e156aec7ec02f0c78fa8a6ddc2613f6f71de" [[package]] name = "block-buffer" -version = "0.11.0-rc.3" +version = "0.11.0-rc.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3fd016a0ddc7cb13661bf5576073ce07330a693f8608a1320b4e20561cc12cdc" +checksum = "a229bfd78e4827c91b9b95784f69492c1b77c1ab75a45a8a037b139215086f94" dependencies = [ "hybrid-array", ] [[package]] name = "block-padding" -version = "0.4.0-rc.2" +version = "0.4.0-rc.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6868e23cd7a5b2e18fb2e9a583910b88b8d645dd21017aafc5d0439cf16ae6d6" +checksum = "ee88d14c41bbae2e333f574a27fc73d96fe1039e5a356c20d06a7f2a34cd8e5a" dependencies = [ "hybrid-array", ] @@ -292,47 +253,6 @@ version = "0.7.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f46ad14479a25103f283c0f10005961cf086d8dc42205bb44c46ac563475dca6" -[[package]] -name = "cmpv2" -version = "0.3.0-pre.0" -dependencies = [ - "const-oid", - "crmf", - "der", - "hex-literal", - "spki", - "x509-cert", -] - -[[package]] -name = "cms" -version = "0.3.0-pre.0" -dependencies = [ - "aes", - "async-signature", - "cbc", - "cipher", - "const-oid", - "der", - "ecdsa", - "getrandom 0.3.1", - "hex-literal", - "p256", - "pbkdf2", - "pem-rfc7468", - "pkcs5", - "rand", - "rsa", - "sha1", - "sha2", - "sha3", - "signature", - "spki", - "tokio", - "x509-cert", - "zeroize", -] - [[package]] name = "const-oid" version = "0.10.0-rc.3" @@ -386,45 +306,19 @@ dependencies = [ "itertools", ] -[[package]] -name = "crmf" -version = "0.3.0-pre.0" -dependencies = [ - "cms", - "const-oid", - "der", - "spki", - "x509-cert", -] - [[package]] name = "crunchy" version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7a81dae078cea95a014a339291cec439d2f232ebe854a9d672b796c6afafa9b7" -[[package]] -name = "crypto-bigint" -version = "0.6.0-rc.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d748d1f5b807ee6d0df5a548d0130417295c3aaed1dcbbb3d6a2e7106e11fcca" -dependencies = [ - "hybrid-array", - "num-traits", - "rand_core 0.6.4", - "subtle", - "zeroize", -] - [[package]] name = "crypto-common" -version = "0.2.0-rc.1" +version = "0.2.0-rc.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b0b8ce8218c97789f16356e7896b3714f26c2ee1079b79c0b7ae7064bb9089fa" +checksum = "170d71b5b14dec99db7739f6fc7d6ec2db80b78c3acb77db48392ccc3d8a9ea0" dependencies = [ - "getrandom 0.2.15", "hybrid-array", - "rand_core 0.6.4", ] [[package]] @@ -497,51 +391,16 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "cf2e3d6615d99707295a9673e889bf363a04b2a466bd320c65a72536f7577379" dependencies = [ "block-buffer", - "const-oid", "crypto-common", "subtle", ] -[[package]] -name = "ecdsa" -version = "0.17.0-pre.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7e62f2041a28c40b8884b79fbd19bc7457d76c6397767831e9ff4029fc0473a9" -dependencies = [ - "der", - "digest", - "elliptic-curve", - "rfc6979", - "signature", - "spki", -] - [[package]] name = "either" version = "1.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "60b1af1c220855b6ceac025d3f6ecdd2b7c4894bfe9cd9bda4fbb4bc7c0d4cf0" -[[package]] -name = "elliptic-curve" -version = "0.14.0-rc.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cc43715037532dc2d061e5c97e81b684c28993d52a4fa4eb7d2ce2826d78f2f2" -dependencies = [ - "base16ct", - "crypto-bigint", - "digest", - "ff", - "group", - "hybrid-array", - "pem-rfc7468", - "pkcs8", - "rand_core 0.6.4", - "sec1", - "subtle", - "zeroize", -] - [[package]] name = "equivalent" version = "1.0.1" @@ -564,16 +423,6 @@ version = "2.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "37909eebbb50d72f9059c3b6d82c0463f2ff062c9e95845c43a6c9c0355411be" -[[package]] -name = "ff" -version = "0.13.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ded41244b729663b1e574f1b4fb731469f69f79c17667b5d776b16cda0479449" -dependencies = [ - "rand_core 0.6.4", - "subtle", -] - [[package]] name = "flagset" version = "0.4.6" @@ -586,49 +435,6 @@ version = "1.0.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" -[[package]] -name = "futures-core" -version = "0.3.31" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "05f29059c0c2090612e8d742178b0580d2dc940c837851ad723096f87af6663e" - -[[package]] -name = "futures-macro" -version = "0.3.31" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "162ee34ebcb7c64a8abebc059ce0fee27c2262618d7b60ed8faf72fef13c3650" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] - -[[package]] -name = "futures-task" -version = "0.3.31" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f90f7dce0722e95104fcb095585910c0977252f286e354b5e3bd38902cd99988" - -[[package]] -name = "futures-timer" -version = "3.0.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f288b0a4f20f9a56b5d1da57e2227c661b7b16168e2f72365f57b63326e29b24" - -[[package]] -name = "futures-util" -version = "0.3.31" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9fa08315bb612088cc391249efdc3bc77536f16c91f6cf495e6fbe85b20a4a81" -dependencies = [ - "futures-core", - "futures-macro", - "futures-task", - "pin-project-lite", - "pin-utils", - "slab", -] - [[package]] name = "getrandom" version = "0.2.15" @@ -662,39 +468,12 @@ dependencies = [ "polyval", ] -[[package]] -name = "gimli" -version = "0.31.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "07e28edb80900c19c28f1072f2e8aeca7fa06b23cd4169cefe1af5aa3260783f" - [[package]] name = "glob" version = "0.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a8d1add55171497b4705a648c6b583acafb01d58050a51727785f0b2c8e0a2b2" -[[package]] -name = "group" -version = "0.13.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f0f9ef7462f7c099f518d754361858f86d8a07af53ba9af0fe635bbccb151a63" -dependencies = [ - "ff", - "rand_core 0.6.4", - "subtle", -] - -[[package]] -name = "gss-api" -version = "0.2.0-pre" -dependencies = [ - "der", - "hex-literal", - "spki", - "x509-cert", -] - [[package]] name = "half" version = "2.4.1" @@ -719,9 +498,9 @@ checksum = "fbf6a919d6cf397374f7dfeeea91d974c7c0a7221d0d0f4f20d859d329e53fcc" [[package]] name = "hex-literal" -version = "0.4.1" +version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6fe2267d4ed49bc07b63801559be28c718ea06c4738b7a03c94df7386d2cde46" +checksum = "bcaaec4551594c969335c98c903c1397853d4198408ea609190f420500f6be71" [[package]] name = "hmac" @@ -734,12 +513,11 @@ dependencies = [ [[package]] name = "hybrid-array" -version = "0.2.3" +version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f2d35805454dc9f8662a98d6d61886ffe26bd465f5960e0e55345c70d5c0d2a9" +checksum = "4dab50e193aebe510fe0e40230145820e02f48dae0cf339ea4204e6e708ff7bd" dependencies = [ "typenum", - "zeroize", ] [[package]] @@ -754,9 +532,9 @@ dependencies = [ [[package]] name = "inout" -version = "0.2.0-rc.3" +version = "0.2.0-rc.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "de49db00f5add6dad75a57946b75de0f26287a6fc95f4f277d48419200422beb" +checksum = "ac5e145e8ade9f74c0a5efc60ccb4e714b0144f7e2220b7ca64254feee71c57f" dependencies = [ "block-padding", "hybrid-array", @@ -788,23 +566,11 @@ version = "1.0.14" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d75a2a4b1b190afb6f5425f10f6a8f959d2ea0b9c2b1d79553551850539e4674" -[[package]] -name = "keccak" -version = "0.2.0-pre.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a7cdd4f0dc5807b9a2b25dd48a3f58e862606fe7bd47f41ecde36e97422d7e90" -dependencies = [ - "cpufeatures", -] - [[package]] name = "lazy_static" version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bbd2bcb4c963f2ddae06a2efc7e9f3591312473c50c6685e1f298068316e66fe" -dependencies = [ - "spin", -] [[package]] name = "libc" @@ -812,12 +578,6 @@ version = "0.2.169" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b5aba8db14291edd000dfcc4d620c7ebfb122c613afb886ca8803fa4e128a20a" -[[package]] -name = "libm" -version = "0.2.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8355be11b20d696c8f18f6cc018c4e372165b1fa8126cef092399c9951984ffa" - [[package]] name = "linux-raw-sys" version = "0.4.14" @@ -830,58 +590,12 @@ version = "2.7.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "78ca9ab1a0babb1e7d5695e3530886289c18cf2f87ec19a575a0abdce112e3a3" -[[package]] -name = "miniz_oxide" -version = "0.8.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4ffbe83022cedc1d264172192511ae958937694cd57ce297164951b8b3568394" -dependencies = [ - "adler2", -] - -[[package]] -name = "num-bigint-dig" -version = "0.8.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dc84195820f291c7697304f3cbdadd1cb7199c0efc917ff5eafd71225c136151" -dependencies = [ - "byteorder", - "lazy_static", - "libm", - "num-integer", - "num-iter", - "num-traits", - "rand", - "smallvec", - "zeroize", -] - [[package]] name = "num-conv" version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "51d515d32fb182ee37cda2ccdcb92950d6a3c2893aa280e540671c2cd0f3b1d9" -[[package]] -name = "num-integer" -version = "0.1.46" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7969661fd2958a5cb096e56c8e1ad0444ac2bbcd0061bd28660485a44879858f" -dependencies = [ - "num-traits", -] - -[[package]] -name = "num-iter" -version = "0.1.45" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1429034a0490724d0075ebb2bc9e875d6503c3cf69e235a8941aa757d83ef5bf" -dependencies = [ - "autocfg", - "num-integer", - "num-traits", -] - [[package]] name = "num-traits" version = "0.2.19" @@ -889,16 +603,6 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "071dfc062690e90b734c0b2273ce72ad0ffa95f0c74596bc250dcfd960262841" dependencies = [ "autocfg", - "libm", -] - -[[package]] -name = "object" -version = "0.36.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "62948e14d923ea95ea2c7c86c71013138b66525b86bdc08d2dcc262bdb497b87" -dependencies = [ - "memchr", ] [[package]] @@ -919,18 +623,6 @@ version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c08d65885ee38876c4f86fa503fb49d7b507c2b62552df7c70b2fce627e06381" -[[package]] -name = "p256" -version = "0.14.0-pre.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "71f3fd64a9cad9c26ed7f734b152196d5e56376b9957c832bcca0de48a708080" -dependencies = [ - "ecdsa", - "elliptic-curve", - "primeorder", - "sha2", -] - [[package]] name = "paste" version = "1.0.15" @@ -954,18 +646,6 @@ dependencies = [ "base64ct 1.6.0", ] -[[package]] -name = "pin-project-lite" -version = "0.2.15" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "915a1e146535de9163f3987b8944ed8cf49a18bb0056bcebcdcece385cece4ff" - -[[package]] -name = "pin-utils" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" - [[package]] name = "pkcs1" version = "0.8.0-rc.1" @@ -978,24 +658,6 @@ dependencies = [ "tempfile", ] -[[package]] -name = "pkcs12" -version = "0.2.0-pre" -dependencies = [ - "cms", - "const-oid", - "der", - "digest", - "hex-literal", - "pkcs5", - "pkcs8", - "sha2", - "spki", - "whirlpool", - "x509-cert", - "zeroize", -] - [[package]] name = "pkcs5" version = "0.8.0-rc.3" @@ -1054,24 +716,6 @@ dependencies = [ "zerocopy 0.7.35", ] -[[package]] -name = "primeorder" -version = "0.14.0-pre.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b794117b388378d55629f78f61e64e182baa200bf59c1a8205e0c46508ce5873" -dependencies = [ - "elliptic-curve", -] - -[[package]] -name = "proc-macro-crate" -version = "3.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8ecf48c7ca261d60b74ab1a7b20da18bede46776b2e55535cb958eb595c5fa7b" -dependencies = [ - "toml_edit", -] - [[package]] name = "proc-macro2" version = "1.0.92" @@ -1194,22 +838,6 @@ version = "0.8.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2b15c43186be67a4fd63bee50d0303afffcef381492ebe2c5d87f324e1b8815c" -[[package]] -name = "relative-path" -version = "1.9.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ba39f3699c378cd8970968dcbff9c43159ea4cfbd88d43c00b22f2ef10a435d2" - -[[package]] -name = "rfc6979" -version = "0.5.0-pre.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "871ee76a3eee98b0f805e5d1caf26929f4565073c580c053a55f886fc15dea49" -dependencies = [ - "hmac", - "subtle", -] - [[package]] name = "rmp" version = "0.8.14" @@ -1232,72 +860,6 @@ dependencies = [ "serde", ] -[[package]] -name = "rsa" -version = "0.10.0-pre.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "07058e83b684989ab0559f9e22322f4e3f7e49147834ed0bae40486b9e70473c" -dependencies = [ - "const-oid", - "digest", - "num-bigint-dig", - "num-integer", - "num-traits", - "pkcs1", - "pkcs8", - "rand_core 0.6.4", - "sha2", - "signature", - "spki", - "subtle", - "zeroize", -] - -[[package]] -name = "rstest" -version = "0.24.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "03e905296805ab93e13c1ec3a03f4b6c4f35e9498a3d5fa96dc626d22c03cd89" -dependencies = [ - "futures-timer", - "futures-util", - "rstest_macros", - "rustc_version", -] - -[[package]] -name = "rstest_macros" -version = "0.24.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ef0053bbffce09062bee4bcc499b0fbe7a57b879f1efe088d6d8d4c7adcdef9b" -dependencies = [ - "cfg-if", - "glob", - "proc-macro-crate", - "proc-macro2", - "quote", - "regex", - "relative-path", - "rustc_version", - "syn", - "unicode-ident", -] - -[[package]] -name = "rustc-demangle" -version = "0.1.24" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "719b953e2095829ee67db738b3bfa9fa368c94900df327b3f07fe6e794d2fe1f" - -[[package]] -name = "rustc_version" -version = "0.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cfcb3a22ef46e85b45de6ee7e79d063319ebb6594faafcf1c225ea92ab6e9b92" -dependencies = [ - "semver", -] - [[package]] name = "rustix" version = "0.38.42" @@ -1361,24 +923,19 @@ dependencies = [ [[package]] name = "sec1" -version = "0.8.0-rc.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d1988446eff153796413a73669dfaa4caa3f5ce8b25fac89e3821a39c611772e" +version = "0.8.0-rc.4" dependencies = [ "base16ct", "der", + "hex-literal", "hybrid-array", "pkcs8", + "serdect", "subtle", + "tempfile", "zeroize", ] -[[package]] -name = "semver" -version = "1.0.24" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3cb6eb87a131f756572d7fb904f6e7b68633f09cca868c5df1c4b8d1a694bbba" - [[package]] name = "serde" version = "1.0.217" @@ -1469,47 +1026,6 @@ dependencies = [ "digest", ] -[[package]] -name = "sha3" -version = "0.11.0-pre.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e485881f388c2818d709796dc883c1ffcadde9d1f0e054f3a5c14974185261a6" -dependencies = [ - "digest", - "keccak", -] - -[[package]] -name = "signature" -version = "2.3.0-pre.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "054d71959c7051b9042c26af337f05cc930575ed2604d7d3ced3158383e59734" -dependencies = [ - "digest", - "rand_core 0.6.4", -] - -[[package]] -name = "slab" -version = "0.4.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8f92a496fb766b417c996b9c5e57daf2f7ad3b0bebe1ccfca4856390e3d3bb67" -dependencies = [ - "autocfg", -] - -[[package]] -name = "smallvec" -version = "1.13.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3c5e1a9a646d36c3599cd173a41282daf47c44583ad367b8e6837255952e5c67" - -[[package]] -name = "spin" -version = "0.9.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6980e8d7511241f8acf4aebddbb1ff938df5eebe98691418c4468d0b72a96a67" - [[package]] name = "spki" version = "0.8.0-rc.1" @@ -1625,28 +1141,6 @@ dependencies = [ "trybuild", ] -[[package]] -name = "tokio" -version = "1.43.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3d61fa4ffa3de412bfea335c6ecff681de2b609ba3c77ef3e00e521813a9ed9e" -dependencies = [ - "backtrace", - "pin-project-lite", - "tokio-macros", -] - -[[package]] -name = "tokio-macros" -version = "2.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6e06d43f1345a3bcd39f6a56dbb7dcab2ba47e68e8ac134855e7e2bdbaf8cab8" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] - [[package]] name = "toml" version = "0.8.20" @@ -1758,15 +1252,6 @@ dependencies = [ "wit-bindgen-rt", ] -[[package]] -name = "whirlpool" -version = "0.11.0-pre.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e6a50f4a23b3461a8731a33838634270ed638b266a4d5cbf0215eefce1f0fa08" -dependencies = [ - "digest", -] - [[package]] name = "winapi-util" version = "0.1.9" @@ -1867,69 +1352,6 @@ dependencies = [ "bitflags", ] -[[package]] -name = "x509-cert" -version = "0.3.0-pre.0" -dependencies = [ - "arbitrary", - "async-signature", - "const-oid", - "der", - "ecdsa", - "hex-literal", - "p256", - "rand", - "rsa", - "rstest", - "sha1", - "sha2", - "signature", - "spki", - "tempfile", - "tls_codec", - "tokio", - "x509-cert-test-support", -] - -[[package]] -name = "x509-cert-test-support" -version = "0.1.0" -dependencies = [ - "serde", - "serde_json", - "tempfile", -] - -[[package]] -name = "x509-ocsp" -version = "0.3.0-pre" -dependencies = [ - "const-oid", - "der", - "digest", - "hex-literal", - "lazy_static", - "rand", - "rand_core 0.6.4", - "rsa", - "sha1", - "sha2", - "signature", - "spki", - "x509-cert", -] - -[[package]] -name = "x509-tsp" -version = "0.2.0-pre" -dependencies = [ - "cmpv2", - "cms", - "der", - "hex-literal", - "x509-cert", -] - [[package]] name = "zerocopy" version = "0.7.35" diff --git a/Cargo.toml b/Cargo.toml index 8e487ec79..42356e73b 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -4,32 +4,40 @@ members = [ "base16ct", "base32ct", "base64ct", - "cmpv2", - "cms", + #"cmpv2", + #"cms", "const-oid", - "crmf", + #"crmf", "der", "der_derive", - "gss-api", + #"gss-api", "pem-rfc7468", "pkcs1", "pkcs5", "pkcs8", - "pkcs12", - # "sec1", + #"pkcs12", + "sec1", "serdect", "spki", "tai64", "tls_codec", "tls_codec/derive", + #"x509-tsp", + #"x509-cert", + #"x509-cert/test-support", + #"x509-ocsp" +] +exclude = [ + "cmpv2", + "cms", + "crmf", + "gss-api", + "pkcs12", "x509-tsp", "x509-cert", "x509-cert/test-support", "x509-ocsp" ] -exclude = [ - "sec1", -] [profile.dev] opt-level = 2 @@ -41,23 +49,23 @@ opt-level = 2 base16ct = { path = "./base16ct" } base32ct = { path = "./base32ct" } base64ct = { path = "./base64ct" } -cmpv2 = { path = "./cmpv2" } -cms = { path = "./cms" } +#cmpv2 = { path = "./cmpv2" } +#cms = { path = "./cms" } const-oid = { path = "./const-oid" } -crmf = { path = "./crmf" } +#crmf = { path = "./crmf" } der = { path = "./der" } der_derive = { path = "./der_derive" } pem-rfc7468 = { path = "./pem-rfc7468" } pkcs1 = { path = "./pkcs1" } pkcs5 = { path = "./pkcs5" } pkcs8 = { path = "./pkcs8" } -pkcs12 = { path = "./pkcs12" } -# sec1 = { path = "./sec1" } +#pkcs12 = { path = "./pkcs12" } +sec1 = { path = "./sec1" } serdect = { path = "./serdect" } spki = { path = "./spki" } tai64 = { path = "./tai64" } tls_codec = { path = "./tls_codec" } tls_codec_derive = { path = "./tls_codec/derive" } -x509-tsp = { path = "./x509-tsp" } -x509-cert = { path = "./x509-cert" } -x509-ocsp = { path = "./x509-ocsp" } +#x509-tsp = { path = "./x509-tsp" } +#x509-cert = { path = "./x509-cert" } +#x509-ocsp = { path = "./x509-ocsp" } diff --git a/base16ct/Cargo.toml b/base16ct/Cargo.toml index af6c3371b..4dbe56e94 100644 --- a/base16ct/Cargo.toml +++ b/base16ct/Cargo.toml @@ -14,8 +14,8 @@ repository = "https://github.com/RustCrypto/formats" categories = ["cryptography", "encoding", "no-std", "parser-implementations"] keywords = ["crypto", "hex", "hexadecimal"] readme = "README.md" -edition = "2021" -rust-version = "1.60" +edition = "2024" +rust-version = "1.85" [features] alloc = [] diff --git a/base16ct/README.md b/base16ct/README.md index 19897c283..13c2ccb17 100644 --- a/base16ct/README.md +++ b/base16ct/README.md @@ -18,13 +18,6 @@ Supports `no_std` environments and avoids heap allocations in the core API [Documentation][docs-link] -## Minimum Supported Rust Version - -This crate requires **Rust 1.60** at a minimum. - -We may change the MSRV in the future, but it will be accompanied by a minor -version bump. - ## License Licensed under either of: @@ -49,7 +42,7 @@ dual licensed as above, without any additional terms or conditions. [build-image]: https://github.com/RustCrypto/formats/actions/workflows/base16ct.yml/badge.svg [build-link]: https://github.com/RustCrypto/formats/actions/workflows/base16ct.yml [license-image]: https://img.shields.io/badge/license-Apache2.0/MIT-blue.svg -[rustc-image]: https://img.shields.io/badge/rustc-1.60+-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 diff --git a/base16ct/benches/mod.rs b/base16ct/benches/mod.rs index 75af0c9db..eccbe2ba9 100644 --- a/base16ct/benches/mod.rs +++ b/base16ct/benches/mod.rs @@ -1,7 +1,7 @@ #![feature(test)] extern crate test; -use test::{black_box, Bencher}; +use test::{Bencher, black_box}; #[bench] fn decode_lower(b: &mut Bencher) { diff --git a/base16ct/src/lower.rs b/base16ct/src/lower.rs index 63aa74db3..ab3d09275 100644 --- a/base16ct/src/lower.rs +++ b/base16ct/src/lower.rs @@ -1,6 +1,6 @@ -use crate::{decode_inner, encoded_len, Error}; +use crate::{Error, decode_inner, encoded_len}; #[cfg(feature = "alloc")] -use crate::{decoded_len, String, Vec}; +use crate::{String, Vec, decoded_len}; /// Decode a lower Base16 (hex) string into the provided destination buffer. pub fn decode(src: impl AsRef<[u8]>, dst: &mut [u8]) -> Result<&[u8], Error> { diff --git a/base16ct/src/mixed.rs b/base16ct/src/mixed.rs index 0836d3ae4..005ce6950 100644 --- a/base16ct/src/mixed.rs +++ b/base16ct/src/mixed.rs @@ -1,6 +1,6 @@ -use crate::{decode_inner, Error}; +use crate::{Error, decode_inner}; #[cfg(feature = "alloc")] -use crate::{decoded_len, Vec}; +use crate::{Vec, decoded_len}; /// Decode a mixed Base16 (hex) string into the provided destination buffer. pub fn decode(src: impl AsRef<[u8]>, dst: &mut [u8]) -> Result<&[u8], Error> { diff --git a/base16ct/src/upper.rs b/base16ct/src/upper.rs index 2b82ce68a..6334a516f 100644 --- a/base16ct/src/upper.rs +++ b/base16ct/src/upper.rs @@ -1,6 +1,6 @@ -use crate::{decode_inner, encoded_len, Error}; +use crate::{Error, decode_inner, encoded_len}; #[cfg(feature = "alloc")] -use crate::{decoded_len, String, Vec}; +use crate::{String, Vec, decoded_len}; /// Decode an upper Base16 (hex) string into the provided destination buffer. pub fn decode(src: impl AsRef<[u8]>, dst: &mut [u8]) -> Result<&[u8], Error> { diff --git a/base32ct/Cargo.toml b/base32ct/Cargo.toml index 23ab1f614..429d160f4 100644 --- a/base32ct/Cargo.toml +++ b/base32ct/Cargo.toml @@ -14,8 +14,8 @@ repository = "https://github.com/RustCrypto/formats" categories = ["cryptography", "encoding", "no-std", "parser-implementations"] keywords = ["crypto"] readme = "README.md" -edition = "2021" -rust-version = "1.60" +edition = "2024" +rust-version = "1.85" [dev-dependencies] base32 = "0.5" diff --git a/base32ct/README.md b/base32ct/README.md index b168bfdcc..5a6a55372 100644 --- a/base32ct/README.md +++ b/base32ct/README.md @@ -18,13 +18,6 @@ Supports `no_std` environments and avoids heap allocations in the core API [Documentation][docs-link] -## Minimum Supported Rust Version - -This crate requires **Rust 1.65** at a minimum. - -We may change the MSRV in the future, but it will be accompanied by a minor -version bump. - ## License Licensed under either of: @@ -49,7 +42,7 @@ dual licensed as above, without any additional terms or conditions. [build-image]: https://github.com/RustCrypto/formats/actions/workflows/base32ct.yml/badge.svg [build-link]: https://github.com/RustCrypto/formats/actions/workflows/base32ct.yml [license-image]: https://img.shields.io/badge/license-Apache2.0/MIT-blue.svg -[rustc-image]: https://img.shields.io/badge/rustc-1.65+-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 diff --git a/base32ct/src/encoding.rs b/base32ct/src/encoding.rs index c0dfec610..9c925e816 100644 --- a/base32ct/src/encoding.rs +++ b/base32ct/src/encoding.rs @@ -1,6 +1,6 @@ //! Base32 encoding trait. -use crate::{alphabet::Alphabet, Error, Result}; +use crate::{Error, Result, alphabet::Alphabet}; use core::str; #[cfg(feature = "alloc")] diff --git a/base32ct/src/lib.rs b/base32ct/src/lib.rs index cc5c8e0c4..24c032e21 100644 --- a/base32ct/src/lib.rs +++ b/base32ct/src/lib.rs @@ -59,6 +59,6 @@ mod error; pub use crate::{ alphabet::rfc4648::{Base32, Base32Unpadded, Base32Upper, Base32UpperUnpadded}, - encoding::{encoded_len, Encoding}, + encoding::{Encoding, encoded_len}, error::{Error, Result}, }; diff --git a/base64ct/Cargo.toml b/base64ct/Cargo.toml index f07a13362..97ee583c2 100644 --- a/base64ct/Cargo.toml +++ b/base64ct/Cargo.toml @@ -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.65" +edition = "2024" +rust-version = "1.85" [dev-dependencies] base64 = "0.22" diff --git a/base64ct/README.md b/base64ct/README.md index f4582e01f..64727f251 100644 --- a/base64ct/README.md +++ b/base64ct/README.md @@ -41,13 +41,6 @@ fixed-width line wrapping. - bcrypt Base64: `.`, `/`, `[A-Z]`, `[a-z]`, `[0-9]` - `crypt(3)` Base64: `.`, `-`, `[0-9]`, `[A-Z]`, `[a-z]` -## Minimum Supported Rust Version - -This crate requires **Rust 1.65** at a minimum. - -We may change the MSRV in the future, but it will be accompanied by a minor -version bump. - ## License Licensed under either of: @@ -72,7 +65,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.65+-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 diff --git a/base64ct/src/decoder.rs b/base64ct/src/decoder.rs index 03c7f4932..6bbb4f78a 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}; @@ -550,7 +549,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 crate::Error::InvalidLength; diff --git a/base64ct/src/encoder.rs b/base64ct/src/encoder.rs index 679b757c9..559a7ae97 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 61f49581e..ebb49fa05 100644 --- a/base64ct/src/test_vectors.rs +++ b/base64ct/src/test_vectors.rs @@ -1,8 +1,7 @@ //! Base64 test vectors. /// Padded Base64-encoded example -pub(crate) const PADDED_BASE64: &str = - "AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBHwf2HMM5TRXvo2SQJjsNkiDD5KqiiNjrGVv3UUh+mMT5RHxiRtOnlqvjhQtBq0VpmpCV/PwUdhOig4vkbqAcEc="; +pub(crate) const PADDED_BASE64: &str = "AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBHwf2HMM5TRXvo2SQJjsNkiDD5KqiiNjrGVv3UUh+mMT5RHxiRtOnlqvjhQtBq0VpmpCV/PwUdhOig4vkbqAcEc="; pub(crate) const PADDED_BIN: &[u8] = &[ 0, 0, 0, 19, 101, 99, 100, 115, 97, 45, 115, 104, 97, 50, 45, 110, 105, 115, 116, 112, 50, 53, 54, 0, 0, 0, 8, 110, 105, 115, 116, 112, 50, 53, 54, 0, 0, 0, 65, 4, 124, 31, 216, 115, 12, @@ -21,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\ @@ -43,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\ diff --git a/cmpv2/Cargo.lock b/cmpv2/Cargo.lock new file mode 100644 index 000000000..7b11b48ad --- /dev/null +++ b/cmpv2/Cargo.lock @@ -0,0 +1,158 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +version = 3 + +[[package]] +name = "base64ct" +version = "1.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8c3c1a368f70d6cf7302d78f8f7093da241fb8e8807c05cc9e51a125895a6d5b" + +[[package]] +name = "cmpv2" +version = "0.3.0-pre.0" +dependencies = [ + "const-oid", + "crmf", + "der", + "hex-literal", + "spki", + "x509-cert", +] + +[[package]] +name = "cms" +version = "0.3.0-pre.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "956098b1603285c33972193d6f62c8389d3d8548693a4077baa08ff0a8da97c7" +dependencies = [ + "const-oid", + "der", + "spki", + "x509-cert", +] + +[[package]] +name = "const-oid" +version = "0.10.0-rc.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "68ff6be19477a1bd5441f382916a89bc2a0b2c35db6d41e0f6e8538bf6d6463f" + +[[package]] +name = "crmf" +version = "0.3.0-pre.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d7deedb0754953b9cac4b8650735d37e83d339e98803ac0a30d417489d17e023" +dependencies = [ + "cms", + "der", + "spki", + "x509-cert", +] + +[[package]] +name = "der" +version = "0.8.0-rc.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "82db698b33305f0134faf590b9d1259dc171b5481ac41d5c8146c3b3ee7d4319" +dependencies = [ + "const-oid", + "der_derive", + "flagset", + "pem-rfc7468", + "zeroize", +] + +[[package]] +name = "der_derive" +version = "0.8.0-rc.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "211bea8bb45f5f61bc857104606913ef8ac8b5ec698143aa2aa96a7ffdc94991" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "flagset" +version = "0.4.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b3ea1ec5f8307826a5b71094dd91fc04d4ae75d5709b20ad351c7fb4815c86ec" + +[[package]] +name = "hex-literal" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6fe2267d4ed49bc07b63801559be28c718ea06c4738b7a03c94df7386d2cde46" + +[[package]] +name = "pem-rfc7468" +version = "1.0.0-rc.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c2dfbfa5c6f0906884269722c5478e72fd4d6c0e24fe600332c6d62359567ce1" +dependencies = [ + "base64ct", +] + +[[package]] +name = "proc-macro2" +version = "1.0.93" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "60946a68e5f9d28b0dc1c21bb8a97ee7d018a8b322fa57838ba31cc878e22d99" +dependencies = [ + "unicode-ident", +] + +[[package]] +name = "quote" +version = "1.0.38" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0e4dccaaaf89514f546c693ddc140f729f958c247918a13380cccc6078391acc" +dependencies = [ + "proc-macro2", +] + +[[package]] +name = "spki" +version = "0.8.0-rc.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "37ac66481418fd7afdc584adcf3be9aa572cf6c2858814494dc2a01755f050bc" +dependencies = [ + "base64ct", + "der", +] + +[[package]] +name = "syn" +version = "2.0.98" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "36147f1a48ae0ec2b5b3bc5b537d267457555a10dc06f3dbc8cb11ba3006d3b1" +dependencies = [ + "proc-macro2", + "quote", + "unicode-ident", +] + +[[package]] +name = "unicode-ident" +version = "1.0.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "00e2473a93778eb0bad35909dff6a10d28e63f792f16ed15e404fca9d5eeedbe" + +[[package]] +name = "x509-cert" +version = "0.3.0-pre.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2db382aa43c1fb5c419a960f72c3847ab0f383f635fc2e25f0bd6c5fb94371d1" +dependencies = [ + "const-oid", + "der", + "spki", +] + +[[package]] +name = "zeroize" +version = "1.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ced3678a2879b30306d323f4542626697a464a97c0a07c9aebf7ebca65cd4dde" diff --git a/cms/Cargo.lock b/cms/Cargo.lock new file mode 100644 index 000000000..09cecfedf --- /dev/null +++ b/cms/Cargo.lock @@ -0,0 +1,921 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +version = 3 + +[[package]] +name = "addr2line" +version = "0.24.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dfbe277e56a376000877090da837660b4427aad530e3028d44e0bffe4f89a1c1" +dependencies = [ + "gimli", +] + +[[package]] +name = "adler2" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "512761e0bb2578dd7380c6baaa0f4ce03e84f95e960231d1dec8bf4d7d6e2627" + +[[package]] +name = "aes" +version = "0.9.0-pre.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e7856582c758ade85d71daf27ec6bcea6c1c73913692b07b8dffea2dc03531c9" +dependencies = [ + "cfg-if", + "cipher", + "cpufeatures", +] + +[[package]] +name = "async-signature" +version = "0.6.0-pre.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f9bdb5df8dde2bd1ec515a0981636508bb37d55984d0bae3678d4ac859125431" +dependencies = [ + "signature", +] + +[[package]] +name = "autocfg" +version = "1.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ace50bade8e6234aa140d9a2f552bbee1db4d353f69b8217bc503490fc1a9f26" + +[[package]] +name = "backtrace" +version = "0.3.74" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8d82cb332cdfaed17ae235a638438ac4d4839913cc2af585c3c6746e8f8bee1a" +dependencies = [ + "addr2line", + "cfg-if", + "libc", + "miniz_oxide", + "object", + "rustc-demangle", + "windows-targets", +] + +[[package]] +name = "base16ct" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4c7f02d4ea65f2c1853089ffd8d2787bdbc63de2f0d29dedbcf8ccdfa0ccd4cf" + +[[package]] +name = "base64ct" +version = "1.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8c3c1a368f70d6cf7302d78f8f7093da241fb8e8807c05cc9e51a125895a6d5b" + +[[package]] +name = "bitflags" +version = "2.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8f68f53c83ab957f72c32642f3868eec03eb974d1fb82e453128456482613d36" + +[[package]] +name = "block-buffer" +version = "0.11.0-rc.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3fd016a0ddc7cb13661bf5576073ce07330a693f8608a1320b4e20561cc12cdc" +dependencies = [ + "hybrid-array", +] + +[[package]] +name = "block-padding" +version = "0.4.0-rc.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6868e23cd7a5b2e18fb2e9a583910b88b8d645dd21017aafc5d0439cf16ae6d6" +dependencies = [ + "hybrid-array", +] + +[[package]] +name = "byteorder" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b" + +[[package]] +name = "cbc" +version = "0.2.0-pre.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e0729a0a8422deb6056b8fcd89c42b724fe27e69458fa006f00c63cbffffd91b" +dependencies = [ + "cipher", +] + +[[package]] +name = "cfg-if" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" + +[[package]] +name = "cipher" +version = "0.5.0-pre.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5b1425e6ce000f05a73096556cabcfb6a10a3ffe3bb4d75416ca8f00819c0b6a" +dependencies = [ + "crypto-common", + "inout", +] + +[[package]] +name = "cms" +version = "0.3.0-pre.0" +dependencies = [ + "aes", + "async-signature", + "cbc", + "cipher", + "const-oid", + "der", + "ecdsa", + "getrandom 0.3.1", + "hex-literal", + "p256", + "pbkdf2", + "pem-rfc7468", + "pkcs5", + "rand", + "rsa", + "sha1", + "sha2", + "sha3", + "signature", + "spki", + "tokio", + "x509-cert", + "zeroize", +] + +[[package]] +name = "const-oid" +version = "0.10.0-rc.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "68ff6be19477a1bd5441f382916a89bc2a0b2c35db6d41e0f6e8538bf6d6463f" + +[[package]] +name = "cpufeatures" +version = "0.2.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "59ed5838eebb26a2bb2e58f6d5b5316989ae9d08bab10e0e6d103e656d1b0280" +dependencies = [ + "libc", +] + +[[package]] +name = "crypto-bigint" +version = "0.6.0-rc.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d748d1f5b807ee6d0df5a548d0130417295c3aaed1dcbbb3d6a2e7106e11fcca" +dependencies = [ + "hybrid-array", + "num-traits", + "rand_core", + "subtle", + "zeroize", +] + +[[package]] +name = "crypto-common" +version = "0.2.0-rc.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b0b8ce8218c97789f16356e7896b3714f26c2ee1079b79c0b7ae7064bb9089fa" +dependencies = [ + "getrandom 0.2.15", + "hybrid-array", + "rand_core", +] + +[[package]] +name = "der" +version = "0.8.0-rc.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "82db698b33305f0134faf590b9d1259dc171b5481ac41d5c8146c3b3ee7d4319" +dependencies = [ + "const-oid", + "der_derive", + "flagset", + "pem-rfc7468", + "zeroize", +] + +[[package]] +name = "der_derive" +version = "0.8.0-rc.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "211bea8bb45f5f61bc857104606913ef8ac8b5ec698143aa2aa96a7ffdc94991" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "digest" +version = "0.11.0-pre.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cf2e3d6615d99707295a9673e889bf363a04b2a466bd320c65a72536f7577379" +dependencies = [ + "block-buffer", + "const-oid", + "crypto-common", + "subtle", +] + +[[package]] +name = "ecdsa" +version = "0.17.0-pre.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7e62f2041a28c40b8884b79fbd19bc7457d76c6397767831e9ff4029fc0473a9" +dependencies = [ + "der", + "digest", + "elliptic-curve", + "rfc6979", + "signature", + "spki", +] + +[[package]] +name = "elliptic-curve" +version = "0.14.0-rc.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cc43715037532dc2d061e5c97e81b684c28993d52a4fa4eb7d2ce2826d78f2f2" +dependencies = [ + "base16ct", + "crypto-bigint", + "digest", + "ff", + "group", + "hybrid-array", + "pem-rfc7468", + "pkcs8", + "rand_core", + "sec1", + "subtle", + "zeroize", +] + +[[package]] +name = "ff" +version = "0.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ded41244b729663b1e574f1b4fb731469f69f79c17667b5d776b16cda0479449" +dependencies = [ + "rand_core", + "subtle", +] + +[[package]] +name = "flagset" +version = "0.4.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b3ea1ec5f8307826a5b71094dd91fc04d4ae75d5709b20ad351c7fb4815c86ec" + +[[package]] +name = "getrandom" +version = "0.2.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c4567c8db10ae91089c99af84c68c38da3ec2f087c3f82960bcdbf3656b6f4d7" +dependencies = [ + "cfg-if", + "libc", + "wasi 0.11.0+wasi-snapshot-preview1", +] + +[[package]] +name = "getrandom" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "43a49c392881ce6d5c3b8cb70f98717b7c07aabbdff06687b9030dbfbe2725f8" +dependencies = [ + "cfg-if", + "libc", + "wasi 0.13.3+wasi-0.2.2", + "windows-targets", +] + +[[package]] +name = "gimli" +version = "0.31.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "07e28edb80900c19c28f1072f2e8aeca7fa06b23cd4169cefe1af5aa3260783f" + +[[package]] +name = "group" +version = "0.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f0f9ef7462f7c099f518d754361858f86d8a07af53ba9af0fe635bbccb151a63" +dependencies = [ + "ff", + "rand_core", + "subtle", +] + +[[package]] +name = "hex-literal" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6fe2267d4ed49bc07b63801559be28c718ea06c4738b7a03c94df7386d2cde46" + +[[package]] +name = "hmac" +version = "0.13.0-pre.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e4b1fb14e4df79f9406b434b60acef9f45c26c50062cccf1346c6103b8c47d58" +dependencies = [ + "digest", +] + +[[package]] +name = "hybrid-array" +version = "0.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f2d35805454dc9f8662a98d6d61886ffe26bd465f5960e0e55345c70d5c0d2a9" +dependencies = [ + "typenum", + "zeroize", +] + +[[package]] +name = "inout" +version = "0.2.0-rc.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "de49db00f5add6dad75a57946b75de0f26287a6fc95f4f277d48419200422beb" +dependencies = [ + "block-padding", + "hybrid-array", +] + +[[package]] +name = "keccak" +version = "0.2.0-pre.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a7cdd4f0dc5807b9a2b25dd48a3f58e862606fe7bd47f41ecde36e97422d7e90" +dependencies = [ + "cpufeatures", +] + +[[package]] +name = "lazy_static" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bbd2bcb4c963f2ddae06a2efc7e9f3591312473c50c6685e1f298068316e66fe" +dependencies = [ + "spin", +] + +[[package]] +name = "libc" +version = "0.2.170" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "875b3680cb2f8f71bdcf9a30f38d48282f5d3c95cbf9b3fa57269bb5d5c06828" + +[[package]] +name = "libm" +version = "0.2.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8355be11b20d696c8f18f6cc018c4e372165b1fa8126cef092399c9951984ffa" + +[[package]] +name = "memchr" +version = "2.7.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "78ca9ab1a0babb1e7d5695e3530886289c18cf2f87ec19a575a0abdce112e3a3" + +[[package]] +name = "miniz_oxide" +version = "0.8.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8e3e04debbb59698c15bacbb6d93584a8c0ca9cc3213cb423d31f760d8843ce5" +dependencies = [ + "adler2", +] + +[[package]] +name = "num-bigint-dig" +version = "0.8.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dc84195820f291c7697304f3cbdadd1cb7199c0efc917ff5eafd71225c136151" +dependencies = [ + "byteorder", + "lazy_static", + "libm", + "num-integer", + "num-iter", + "num-traits", + "rand", + "smallvec", + "zeroize", +] + +[[package]] +name = "num-integer" +version = "0.1.46" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7969661fd2958a5cb096e56c8e1ad0444ac2bbcd0061bd28660485a44879858f" +dependencies = [ + "num-traits", +] + +[[package]] +name = "num-iter" +version = "0.1.45" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1429034a0490724d0075ebb2bc9e875d6503c3cf69e235a8941aa757d83ef5bf" +dependencies = [ + "autocfg", + "num-integer", + "num-traits", +] + +[[package]] +name = "num-traits" +version = "0.2.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "071dfc062690e90b734c0b2273ce72ad0ffa95f0c74596bc250dcfd960262841" +dependencies = [ + "autocfg", + "libm", +] + +[[package]] +name = "object" +version = "0.36.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "62948e14d923ea95ea2c7c86c71013138b66525b86bdc08d2dcc262bdb497b87" +dependencies = [ + "memchr", +] + +[[package]] +name = "p256" +version = "0.14.0-pre.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "71f3fd64a9cad9c26ed7f734b152196d5e56376b9957c832bcca0de48a708080" +dependencies = [ + "ecdsa", + "elliptic-curve", + "primeorder", + "sha2", +] + +[[package]] +name = "pbkdf2" +version = "0.13.0-pre.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "85e11753d5193f26dc27ae698e0b536b5e511b7799c5ac475ec10783f26d164a" +dependencies = [ + "digest", + "hmac", +] + +[[package]] +name = "pem-rfc7468" +version = "1.0.0-rc.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c2dfbfa5c6f0906884269722c5478e72fd4d6c0e24fe600332c6d62359567ce1" +dependencies = [ + "base64ct", +] + +[[package]] +name = "pin-project-lite" +version = "0.2.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3b3cff922bd51709b605d9ead9aa71031d81447142d828eb4a6eba76fe619f9b" + +[[package]] +name = "pkcs1" +version = "0.8.0-rc.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "226eb25e2c46c166ce498ac0f606ac623142d640064879ff445938accddff1e2" +dependencies = [ + "der", + "pkcs8", + "spki", +] + +[[package]] +name = "pkcs5" +version = "0.8.0-rc.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5aa3d51fbc9292364f5a5562f11461a85529236166f1b4b6baba894fc44119ca" +dependencies = [ + "der", + "spki", +] + +[[package]] +name = "pkcs8" +version = "0.11.0-rc.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f22636de7c995e997ed3d8d2949b7414d4faba3efa7312a6c0e75d875a14bdd4" +dependencies = [ + "der", + "spki", +] + +[[package]] +name = "ppv-lite86" +version = "0.2.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "77957b295656769bb8ad2b6a6b09d897d94f05c41b069aede1fcdaa675eaea04" +dependencies = [ + "zerocopy", +] + +[[package]] +name = "primeorder" +version = "0.14.0-pre.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b794117b388378d55629f78f61e64e182baa200bf59c1a8205e0c46508ce5873" +dependencies = [ + "elliptic-curve", +] + +[[package]] +name = "proc-macro2" +version = "1.0.93" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "60946a68e5f9d28b0dc1c21bb8a97ee7d018a8b322fa57838ba31cc878e22d99" +dependencies = [ + "unicode-ident", +] + +[[package]] +name = "quote" +version = "1.0.38" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0e4dccaaaf89514f546c693ddc140f729f958c247918a13380cccc6078391acc" +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 0.2.15", +] + +[[package]] +name = "rfc6979" +version = "0.5.0-pre.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "871ee76a3eee98b0f805e5d1caf26929f4565073c580c053a55f886fc15dea49" +dependencies = [ + "hmac", + "subtle", +] + +[[package]] +name = "rsa" +version = "0.10.0-pre.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "07058e83b684989ab0559f9e22322f4e3f7e49147834ed0bae40486b9e70473c" +dependencies = [ + "const-oid", + "digest", + "num-bigint-dig", + "num-integer", + "num-traits", + "pkcs1", + "pkcs8", + "rand_core", + "sha2", + "signature", + "spki", + "subtle", + "zeroize", +] + +[[package]] +name = "rustc-demangle" +version = "0.1.24" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "719b953e2095829ee67db738b3bfa9fa368c94900df327b3f07fe6e794d2fe1f" + +[[package]] +name = "sec1" +version = "0.8.0-rc.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d1988446eff153796413a73669dfaa4caa3f5ce8b25fac89e3821a39c611772e" +dependencies = [ + "base16ct", + "der", + "hybrid-array", + "pkcs8", + "subtle", + "zeroize", +] + +[[package]] +name = "sha1" +version = "0.11.0-pre.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9540978cef7a8498211c1b1c14e5ce920fe5bd524ea84f4a3d72d4602515ae93" +dependencies = [ + "cfg-if", + "cpufeatures", + "digest", +] + +[[package]] +name = "sha2" +version = "0.11.0-pre.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "540c0893cce56cdbcfebcec191ec8e0f470dd1889b6e7a0b503e310a94a168f5" +dependencies = [ + "cfg-if", + "cpufeatures", + "digest", +] + +[[package]] +name = "sha3" +version = "0.11.0-pre.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e485881f388c2818d709796dc883c1ffcadde9d1f0e054f3a5c14974185261a6" +dependencies = [ + "digest", + "keccak", +] + +[[package]] +name = "signature" +version = "2.3.0-pre.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "054d71959c7051b9042c26af337f05cc930575ed2604d7d3ced3158383e59734" +dependencies = [ + "digest", + "rand_core", +] + +[[package]] +name = "smallvec" +version = "1.14.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7fcf8323ef1faaee30a44a340193b1ac6814fd9b7b4e88e9d4519a3e4abe1cfd" + +[[package]] +name = "spin" +version = "0.9.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6980e8d7511241f8acf4aebddbb1ff938df5eebe98691418c4468d0b72a96a67" + +[[package]] +name = "spki" +version = "0.8.0-rc.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "37ac66481418fd7afdc584adcf3be9aa572cf6c2858814494dc2a01755f050bc" +dependencies = [ + "base64ct", + "der", +] + +[[package]] +name = "subtle" +version = "2.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "13c2bddecc57b384dee18652358fb23172facb8a2c51ccc10d74c157bdea3292" + +[[package]] +name = "syn" +version = "2.0.98" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "36147f1a48ae0ec2b5b3bc5b537d267457555a10dc06f3dbc8cb11ba3006d3b1" +dependencies = [ + "proc-macro2", + "quote", + "unicode-ident", +] + +[[package]] +name = "tls_codec" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0de2e01245e2bb89d6f05801c564fa27624dbd7b1846859876c7dad82e90bf6b" +dependencies = [ + "tls_codec_derive", + "zeroize", +] + +[[package]] +name = "tls_codec_derive" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2d2e76690929402faae40aebdda620a2c0e25dd6d3b9afe48867dfd95991f4bd" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "tokio" +version = "1.43.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3d61fa4ffa3de412bfea335c6ecff681de2b609ba3c77ef3e00e521813a9ed9e" +dependencies = [ + "backtrace", + "pin-project-lite", + "tokio-macros", +] + +[[package]] +name = "tokio-macros" +version = "2.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6e06d43f1345a3bcd39f6a56dbb7dcab2ba47e68e8ac134855e7e2bdbaf8cab8" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "typenum" +version = "1.18.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1dccffe3ce07af9386bfd29e80c0ab1a8205a2fc34e4bcd40364df902cfa8f3f" + +[[package]] +name = "unicode-ident" +version = "1.0.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "00e2473a93778eb0bad35909dff6a10d28e63f792f16ed15e404fca9d5eeedbe" + +[[package]] +name = "wasi" +version = "0.11.0+wasi-snapshot-preview1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" + +[[package]] +name = "wasi" +version = "0.13.3+wasi-0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "26816d2e1a4a36a2940b96c5296ce403917633dff8f3440e9b236ed6f6bacad2" +dependencies = [ + "wit-bindgen-rt", +] + +[[package]] +name = "windows-targets" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9b724f72796e036ab90c1021d4780d4d3d648aca59e491e6b98e725b84e99973" +dependencies = [ + "windows_aarch64_gnullvm", + "windows_aarch64_msvc", + "windows_i686_gnu", + "windows_i686_gnullvm", + "windows_i686_msvc", + "windows_x86_64_gnu", + "windows_x86_64_gnullvm", + "windows_x86_64_msvc", +] + +[[package]] +name = "windows_aarch64_gnullvm" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "32a4622180e7a0ec044bb555404c800bc9fd9ec262ec147edd5989ccd0c02cd3" + +[[package]] +name = "windows_aarch64_msvc" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "09ec2a7bb152e2252b53fa7803150007879548bc709c039df7627cabbd05d469" + +[[package]] +name = "windows_i686_gnu" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8e9b5ad5ab802e97eb8e295ac6720e509ee4c243f69d781394014ebfe8bbfa0b" + +[[package]] +name = "windows_i686_gnullvm" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0eee52d38c090b3caa76c563b86c3a4bd71ef1a819287c19d586d7334ae8ed66" + +[[package]] +name = "windows_i686_msvc" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "240948bc05c5e7c6dabba28bf89d89ffce3e303022809e73deaefe4f6ec56c66" + +[[package]] +name = "windows_x86_64_gnu" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "147a5c80aabfbf0c7d901cb5895d1de30ef2907eb21fbbab29ca94c5b08b1a78" + +[[package]] +name = "windows_x86_64_gnullvm" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "24d5b23dc417412679681396f2b49f3de8c1473deb516bd34410872eff51ed0d" + +[[package]] +name = "windows_x86_64_msvc" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec" + +[[package]] +name = "wit-bindgen-rt" +version = "0.33.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3268f3d866458b787f390cf61f4bbb563b922d091359f9608842999eaee3943c" +dependencies = [ + "bitflags", +] + +[[package]] +name = "x509-cert" +version = "0.3.0-pre.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2db382aa43c1fb5c419a960f72c3847ab0f383f635fc2e25f0bd6c5fb94371d1" +dependencies = [ + "async-signature", + "const-oid", + "der", + "sha1", + "signature", + "spki", + "tls_codec", +] + +[[package]] +name = "zerocopy" +version = "0.7.35" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1b9b4fd18abc82b8136838da5d50bae7bdea537c574d8dc1a34ed098d6c166f0" +dependencies = [ + "byteorder", + "zerocopy-derive", +] + +[[package]] +name = "zerocopy-derive" +version = "0.7.35" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fa4f8080344d4671fb4e831a13ad1e68092748387dfc4f55e356242fae12ce3e" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "zeroize" +version = "1.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ced3678a2879b30306d323f4542626697a464a97c0a07c9aebf7ebca65cd4dde" +dependencies = [ + "zeroize_derive", +] + +[[package]] +name = "zeroize_derive" +version = "1.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ce36e65b0d2999d2aafac989fb249189a141aee1f53c612c1f37d72631959f69" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] diff --git a/const-oid/Cargo.toml b/const-oid/Cargo.toml index b11f9b91d..d7cb99421 100644 --- a/const-oid/Cargo.toml +++ b/const-oid/Cargo.toml @@ -14,14 +14,14 @@ repository = "https://github.com/RustCrypto/formats" categories = ["cryptography", "data-structures", "encoding", "no-std", "parser-implementations"] keywords = ["iso", "iec", "itu", "oid"] readme = "README.md" -edition = "2021" -rust-version = "1.81" +edition = "2024" +rust-version = "1.85" [dependencies] arbitrary = { version = "1.4", optional = true, features = ["derive"] } [dev-dependencies] -hex-literal = "0.4" +hex-literal = "1" proptest = "1" regex = "1" diff --git a/const-oid/README.md b/const-oid/README.md index edecb8706..ceddab9da 100644 --- a/const-oid/README.md +++ b/const-oid/README.md @@ -55,13 +55,6 @@ obtain the BER/DER serialization of an OID, even one declared `const`. Additionally, it impls `FromStr` and `TryFrom<&[u8]>` and functions just as well as a runtime OID library. -## Minimum Supported Rust Version - -This crate requires **Rust 1.81** at a minimum. - -We may change the MSRV in the future, but it will be accompanied by a minor -version bump. - ## License Licensed under either of: @@ -84,7 +77,7 @@ dual licensed as above, without any additional terms or conditions. [docs-image]: https://docs.rs/const-oid/badge.svg [docs-link]: https://docs.rs/const-oid/ [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 [build-image]: https://github.com/RustCrypto/formats/workflows/const-oid/badge.svg?branch=master&event=push diff --git a/const-oid/oiddbgen/README.md b/const-oid/oiddbgen/README.md index 2973319f2..25b955e2b 100644 --- a/const-oid/oiddbgen/README.md +++ b/const-oid/oiddbgen/README.md @@ -7,5 +7,5 @@ This program is internal-only and is used to generate the OID database tree. If you want to generate the database yourself, from the `const-oid` directory you can just run: ``` -$ cargo run --manifest-path=oiddbgen/Cargo.toml | rustfmt > src/db/gen.rs +$ cargo run --manifest-path=oiddbgen/Cargo.toml | rustfmt > src/db/generated.rs ``` diff --git a/const-oid/src/db.rs b/const-oid/src/db.rs index d2d2c0e62..451e5fc5a 100644 --- a/const-oid/src/db.rs +++ b/const-oid/src/db.rs @@ -11,9 +11,9 @@ #![allow(clippy::arithmetic_side_effects, missing_docs)] -mod gen; +mod generated; -pub use gen::*; +pub use generated::*; use crate::{Error, ObjectIdentifier}; diff --git a/const-oid/src/db/gen.rs b/const-oid/src/db/generated.rs similarity index 100% rename from const-oid/src/db/gen.rs rename to const-oid/src/db/generated.rs diff --git a/const-oid/src/encoder.rs b/const-oid/src/encoder.rs index 3edbbf6aa..0ce7058cc 100644 --- a/const-oid/src/encoder.rs +++ b/const-oid/src/encoder.rs @@ -1,8 +1,8 @@ //! OID encoder with `const` support. use crate::{ - arcs::{ARC_MAX_FIRST, ARC_MAX_SECOND}, Arc, Buffer, Error, ObjectIdentifier, Result, + arcs::{ARC_MAX_FIRST, ARC_MAX_SECOND}, }; /// BER/DER encoder. diff --git a/const-oid/src/parser.rs b/const-oid/src/parser.rs index 5b5155b36..445f52a8b 100644 --- a/const-oid/src/parser.rs +++ b/const-oid/src/parser.rs @@ -1,6 +1,6 @@ //! OID string parser with `const` support. -use crate::{encoder::Encoder, Arc, Error, ObjectIdentifier, Result}; +use crate::{Arc, Error, ObjectIdentifier, Result, encoder::Encoder}; /// Const-friendly OID string parser. /// diff --git a/crmf/Cargo.lock b/crmf/Cargo.lock new file mode 100644 index 000000000..af2ba6d79 --- /dev/null +++ b/crmf/Cargo.lock @@ -0,0 +1,139 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +version = 3 + +[[package]] +name = "base64ct" +version = "1.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8c3c1a368f70d6cf7302d78f8f7093da241fb8e8807c05cc9e51a125895a6d5b" + +[[package]] +name = "cms" +version = "0.3.0-pre.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "956098b1603285c33972193d6f62c8389d3d8548693a4077baa08ff0a8da97c7" +dependencies = [ + "const-oid", + "der", + "spki", + "x509-cert", +] + +[[package]] +name = "const-oid" +version = "0.10.0-rc.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "68ff6be19477a1bd5441f382916a89bc2a0b2c35db6d41e0f6e8538bf6d6463f" + +[[package]] +name = "crmf" +version = "0.3.0-pre.0" +dependencies = [ + "cms", + "const-oid", + "der", + "spki", + "x509-cert", +] + +[[package]] +name = "der" +version = "0.8.0-rc.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "82db698b33305f0134faf590b9d1259dc171b5481ac41d5c8146c3b3ee7d4319" +dependencies = [ + "const-oid", + "der_derive", + "flagset", + "pem-rfc7468", + "zeroize", +] + +[[package]] +name = "der_derive" +version = "0.8.0-rc.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "211bea8bb45f5f61bc857104606913ef8ac8b5ec698143aa2aa96a7ffdc94991" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "flagset" +version = "0.4.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b3ea1ec5f8307826a5b71094dd91fc04d4ae75d5709b20ad351c7fb4815c86ec" + +[[package]] +name = "pem-rfc7468" +version = "1.0.0-rc.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c2dfbfa5c6f0906884269722c5478e72fd4d6c0e24fe600332c6d62359567ce1" +dependencies = [ + "base64ct", +] + +[[package]] +name = "proc-macro2" +version = "1.0.93" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "60946a68e5f9d28b0dc1c21bb8a97ee7d018a8b322fa57838ba31cc878e22d99" +dependencies = [ + "unicode-ident", +] + +[[package]] +name = "quote" +version = "1.0.38" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0e4dccaaaf89514f546c693ddc140f729f958c247918a13380cccc6078391acc" +dependencies = [ + "proc-macro2", +] + +[[package]] +name = "spki" +version = "0.8.0-rc.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "37ac66481418fd7afdc584adcf3be9aa572cf6c2858814494dc2a01755f050bc" +dependencies = [ + "base64ct", + "der", +] + +[[package]] +name = "syn" +version = "2.0.98" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "36147f1a48ae0ec2b5b3bc5b537d267457555a10dc06f3dbc8cb11ba3006d3b1" +dependencies = [ + "proc-macro2", + "quote", + "unicode-ident", +] + +[[package]] +name = "unicode-ident" +version = "1.0.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "00e2473a93778eb0bad35909dff6a10d28e63f792f16ed15e404fca9d5eeedbe" + +[[package]] +name = "x509-cert" +version = "0.3.0-pre.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2db382aa43c1fb5c419a960f72c3847ab0f383f635fc2e25f0bd6c5fb94371d1" +dependencies = [ + "const-oid", + "der", + "spki", +] + +[[package]] +name = "zeroize" +version = "1.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ced3678a2879b30306d323f4542626697a464a97c0a07c9aebf7ebca65cd4dde" diff --git a/der/Cargo.toml b/der/Cargo.toml index 490d25522..ee4e7341c 100644 --- a/der/Cargo.toml +++ b/der/Cargo.toml @@ -13,8 +13,8 @@ repository = "https://github.com/RustCrypto/formats" categories = ["cryptography", "data-structures", "encoding", "no-std", "parser-implementations"] keywords = ["asn1", "crypto", "itu", "pkcs"] readme = "README.md" -edition = "2021" -rust-version = "1.81" +edition = "2024" +rust-version = "1.85" [dependencies] arbitrary = { version = "1.4", features = ["derive"], optional = true } @@ -27,7 +27,7 @@ time = { version = "0.3.4", optional = true, default-features = false } zeroize = { version = "1.8", optional = true, default-features = false } [dev-dependencies] -hex-literal = "0.4.1" +hex-literal = "1" proptest = "1" [features] diff --git a/der/README.md b/der/README.md index 32d8c524b..ef32ea33e 100644 --- a/der/README.md +++ b/der/README.md @@ -47,13 +47,6 @@ encountered. There is currently no way to disable these checks. - `pem-rfc7468`: PKCS/PKIX-flavored PEM library with constant-time decoder/encoders - `time` crate: date/time library -## Minimum Supported Rust Version - -This crate requires **Rust 1.81** at a minimum. - -We may change the MSRV in the future, but it will be accompanied by a minor -version bump. - ## License Licensed under either of: @@ -78,7 +71,7 @@ dual licensed as above, without any additional terms or conditions. [build-image]: https://github.com/RustCrypto/formats/actions/workflows/der.yml/badge.svg [build-link]: https://github.com/RustCrypto/formats/actions/workflows/der.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 diff --git a/der/src/arrayvec.rs b/der/src/arrayvec.rs index 67440836e..7391c9ae7 100644 --- a/der/src/arrayvec.rs +++ b/der/src/arrayvec.rs @@ -38,7 +38,7 @@ impl ArrayVec { /// Get an element from this [`ArrayVec`]. pub fn get(&self, index: usize) -> Option<&T> { match self.elements.get(index) { - Some(Some(ref item)) => Some(item), + Some(Some(item)) => Some(item), _ => None, } } diff --git a/der/src/asn1/any.rs b/der/src/asn1/any.rs index 42ac3f669..7845698a6 100644 --- a/der/src/asn1/any.rs +++ b/der/src/asn1/any.rs @@ -161,7 +161,7 @@ pub use self::allocating::Any; #[cfg(feature = "alloc")] mod allocating { use super::*; - use crate::{referenced::*, BytesOwned}; + use crate::{BytesOwned, referenced::*}; use alloc::boxed::Box; /// ASN.1 `ANY`: represents any explicitly tagged ASN.1 value. diff --git a/der/src/asn1/boolean.rs b/der/src/asn1/boolean.rs index 3bbc03341..5fd36f5a4 100644 --- a/der/src/asn1/boolean.rs +++ b/der/src/asn1/boolean.rs @@ -1,8 +1,8 @@ //! ASN.1 `BOOLEAN` support. use crate::{ - asn1::AnyRef, ord::OrdIsValueOrd, DecodeValue, EncodeValue, Error, ErrorKind, FixedTag, Header, - Length, Reader, Result, Tag, Writer, + DecodeValue, EncodeValue, Error, ErrorKind, FixedTag, Header, Length, Reader, Result, Tag, + Writer, asn1::AnyRef, ord::OrdIsValueOrd, }; /// Byte used to encode `true` in ASN.1 DER. From X.690 Section 11.1: diff --git a/der/src/asn1/context_specific.rs b/der/src/asn1/context_specific.rs index dc6b43aa8..a3da9d534 100644 --- a/der/src/asn1/context_specific.rs +++ b/der/src/asn1/context_specific.rs @@ -1,8 +1,8 @@ //! Context-specific field. use crate::{ - asn1::AnyRef, Choice, Decode, DecodeValue, DerOrd, Encode, EncodeValue, EncodeValueRef, Error, - Header, Length, Reader, Tag, TagMode, TagNumber, Tagged, ValueOrd, Writer, + Choice, Decode, DecodeValue, DerOrd, Encode, EncodeValue, EncodeValueRef, Error, Header, + Length, Reader, Tag, TagMode, TagNumber, Tagged, ValueOrd, Writer, asn1::AnyRef, }; use core::cmp::Ordering; @@ -260,7 +260,7 @@ where #[allow(clippy::unwrap_used)] mod tests { use super::ContextSpecific; - use crate::{asn1::BitStringRef, Decode, Encode, SliceReader, TagMode, TagNumber}; + use crate::{Decode, Encode, SliceReader, TagMode, TagNumber, asn1::BitStringRef}; use hex_literal::hex; // Public key data from `pkcs8` crate's `ed25519-pkcs8-v2.der` diff --git a/der/src/asn1/generalized_time.rs b/der/src/asn1/generalized_time.rs index 7c77d26bf..c3a0be004 100644 --- a/der/src/asn1/generalized_time.rs +++ b/der/src/asn1/generalized_time.rs @@ -2,10 +2,10 @@ #![cfg_attr(feature = "arbitrary", allow(clippy::arithmetic_side_effects))] use crate::{ - datetime::{self, DateTime}, - ord::OrdIsValueOrd, DecodeValue, EncodeValue, Error, ErrorKind, FixedTag, Header, Length, Reader, Result, Tag, Writer, + datetime::{self, DateTime}, + ord::OrdIsValueOrd, }; use core::time::Duration; @@ -87,7 +87,23 @@ impl<'a> DecodeValue<'a> for GeneralizedTime { match bytes { // RFC 5280 requires mandatory seconds and Z-normalized time zone - [y1, y2, y3, y4, mon1, mon2, day1, day2, hour1, hour2, min1, min2, sec1, sec2, b'Z'] => { + [ + y1, + y2, + y3, + y4, + mon1, + mon2, + day1, + day2, + hour1, + hour2, + min1, + min2, + sec1, + sec2, + b'Z', + ] => { let year = u16::from(datetime::decode_decimal(Self::TAG, y1, y2)?) .checked_mul(100) .and_then(|y| { diff --git a/der/src/asn1/ia5_string.rs b/der/src/asn1/ia5_string.rs index a9f5886f0..b42cbb40d 100644 --- a/der/src/asn1/ia5_string.rs +++ b/der/src/asn1/ia5_string.rs @@ -1,6 +1,6 @@ //! ASN.1 `IA5String` support. -use crate::{asn1::AnyRef, FixedTag, Result, StrRef, Tag}; +use crate::{FixedTag, Result, StrRef, Tag, asn1::AnyRef}; use core::{fmt, ops::Deref}; macro_rules! impl_ia5_string { @@ -88,9 +88,9 @@ pub use self::allocation::Ia5String; mod allocation { use super::Ia5StringRef; use crate::{ + Error, FixedTag, Result, StrOwned, Tag, asn1::AnyRef, referenced::{OwnedToRef, RefToOwned}, - Error, FixedTag, Result, StrOwned, Tag, }; use alloc::string::String; use core::{fmt, ops::Deref}; diff --git a/der/src/asn1/integer/int.rs b/der/src/asn1/integer/int.rs index 04b4cf689..6dcec372a 100644 --- a/der/src/asn1/integer/int.rs +++ b/der/src/asn1/integer/int.rs @@ -2,8 +2,8 @@ use super::{is_highest_bit_set, uint, value_cmp}; use crate::{ - ord::OrdIsValueOrd, AnyRef, BytesRef, DecodeValue, EncodeValue, Error, ErrorKind, FixedTag, - Header, Length, Reader, Result, Tag, ValueOrd, Writer, + AnyRef, BytesRef, DecodeValue, EncodeValue, Error, ErrorKind, FixedTag, Header, Length, Reader, + Result, Tag, ValueOrd, Writer, ord::OrdIsValueOrd, }; use core::cmp::Ordering; @@ -176,13 +176,13 @@ impl OrdIsValueOrd for IntRef<'_> {} #[cfg(feature = "alloc")] mod allocating { - use super::{strip_leading_ones, validate_canonical, IntRef}; + use super::{IntRef, strip_leading_ones, validate_canonical}; use crate::{ + BytesOwned, DecodeValue, EncodeValue, Error, ErrorKind, FixedTag, Header, Length, Reader, + Result, Tag, Writer, asn1::Uint, ord::OrdIsValueOrd, referenced::{OwnedToRef, RefToOwned}, - BytesOwned, DecodeValue, EncodeValue, Error, ErrorKind, FixedTag, Header, Length, Reader, - Result, Tag, Writer, }; use alloc::vec::Vec; @@ -371,8 +371,8 @@ pub(crate) fn strip_leading_ones(mut bytes: &[u8]) -> &[u8] { #[cfg(test)] #[allow(clippy::unwrap_used)] mod tests { - use super::{validate_canonical, IntRef}; - use crate::{asn1::integer::tests::*, Decode, Encode, SliceWriter}; + use super::{IntRef, validate_canonical}; + use crate::{Decode, Encode, SliceWriter, asn1::integer::tests::*}; #[test] fn validate_canonical_ok() { diff --git a/der/src/asn1/integer/uint.rs b/der/src/asn1/integer/uint.rs index d06e74200..113eb6f1b 100644 --- a/der/src/asn1/integer/uint.rs +++ b/der/src/asn1/integer/uint.rs @@ -2,8 +2,8 @@ use super::value_cmp; use crate::{ - ord::OrdIsValueOrd, AnyRef, BytesRef, DecodeValue, EncodeValue, Error, ErrorKind, FixedTag, - Header, Length, Reader, Result, Tag, ValueOrd, Writer, + AnyRef, BytesRef, DecodeValue, EncodeValue, Error, ErrorKind, FixedTag, Header, Length, Reader, + Result, Tag, ValueOrd, Writer, ord::OrdIsValueOrd, }; use core::cmp::Ordering; @@ -163,12 +163,12 @@ impl OrdIsValueOrd for UintRef<'_> {} #[cfg(feature = "alloc")] mod allocating { - use super::{decode_to_slice, encoded_len, strip_leading_zeroes, UintRef}; + use super::{UintRef, decode_to_slice, encoded_len, strip_leading_zeroes}; use crate::{ - ord::OrdIsValueOrd, - referenced::{OwnedToRef, RefToOwned}, BytesOwned, DecodeValue, EncodeValue, Error, ErrorKind, FixedTag, Header, Length, Reader, Result, Tag, Writer, + ord::OrdIsValueOrd, + referenced::{OwnedToRef, RefToOwned}, }; /// Unsigned arbitrary precision ASN.1 `INTEGER` type. @@ -354,8 +354,8 @@ fn needs_leading_zero(bytes: &[u8]) -> bool { #[cfg(test)] #[allow(clippy::unwrap_used)] mod tests { - use super::{decode_to_array, UintRef}; - use crate::{asn1::integer::tests::*, AnyRef, Decode, Encode, ErrorKind, SliceWriter, Tag}; + use super::{UintRef, decode_to_array}; + use crate::{AnyRef, Decode, Encode, ErrorKind, SliceWriter, Tag, asn1::integer::tests::*}; #[test] fn decode_to_array_no_leading_zero() { diff --git a/der/src/asn1/null.rs b/der/src/asn1/null.rs index be66e02cf..0fabdfc84 100644 --- a/der/src/asn1/null.rs +++ b/der/src/asn1/null.rs @@ -1,8 +1,8 @@ //! ASN.1 `NULL` support. use crate::{ - asn1::AnyRef, ord::OrdIsValueOrd, BytesRef, DecodeValue, EncodeValue, Error, ErrorKind, - FixedTag, Header, Length, Reader, Result, Tag, Writer, + BytesRef, DecodeValue, EncodeValue, Error, ErrorKind, FixedTag, Header, Length, Reader, Result, + Tag, Writer, asn1::AnyRef, ord::OrdIsValueOrd, }; /// ASN.1 `NULL` type. diff --git a/der/src/asn1/octet_string.rs b/der/src/asn1/octet_string.rs index 08025952c..e0333b1a3 100644 --- a/der/src/asn1/octet_string.rs +++ b/der/src/asn1/octet_string.rs @@ -1,8 +1,8 @@ //! ASN.1 `OCTET STRING` support. use crate::{ - asn1::AnyRef, ord::OrdIsValueOrd, BytesRef, Decode, DecodeValue, EncodeValue, Error, ErrorKind, - FixedTag, Header, Length, Reader, Tag, Writer, + BytesRef, Decode, DecodeValue, EncodeValue, Error, ErrorKind, FixedTag, Header, Length, Reader, + Tag, Writer, asn1::AnyRef, ord::OrdIsValueOrd, }; /// ASN.1 `OCTET STRING` type: borrowed form. diff --git a/der/src/asn1/oid.rs b/der/src/asn1/oid.rs index fc72ac178..3b0e5050b 100644 --- a/der/src/asn1/oid.rs +++ b/der/src/asn1/oid.rs @@ -1,8 +1,8 @@ //! ASN.1 `OBJECT IDENTIFIER` use crate::{ - asn1::AnyRef, ord::OrdIsValueOrd, DecodeValue, EncodeValue, Error, FixedTag, Header, Length, - Reader, Result, Tag, Tagged, Writer, + DecodeValue, EncodeValue, Error, FixedTag, Header, Length, Reader, Result, Tag, Tagged, Writer, + asn1::AnyRef, ord::OrdIsValueOrd, }; use const_oid::ObjectIdentifier; diff --git a/der/src/asn1/printable_string.rs b/der/src/asn1/printable_string.rs index ca72646c6..b271e809e 100644 --- a/der/src/asn1/printable_string.rs +++ b/der/src/asn1/printable_string.rs @@ -1,6 +1,6 @@ //! ASN.1 `PrintableString` support. -use crate::{asn1::AnyRef, FixedTag, Result, StrRef, Tag}; +use crate::{FixedTag, Result, StrRef, Tag, asn1::AnyRef}; use core::{fmt, ops::Deref}; macro_rules! impl_printable_string { @@ -122,9 +122,9 @@ mod allocation { use super::PrintableStringRef; use crate::{ + BytesRef, Error, FixedTag, Result, StrOwned, Tag, asn1::AnyRef, referenced::{OwnedToRef, RefToOwned}, - BytesRef, Error, FixedTag, Result, StrOwned, Tag, }; use alloc::string::String; use core::{fmt, ops::Deref}; diff --git a/der/src/asn1/sequence_of.rs b/der/src/asn1/sequence_of.rs index 745771298..ca93926a4 100644 --- a/der/src/asn1/sequence_of.rs +++ b/der/src/asn1/sequence_of.rs @@ -1,8 +1,8 @@ //! ASN.1 `SEQUENCE OF` support. use crate::{ - arrayvec, ord::iter_cmp, ArrayVec, Decode, DecodeValue, DerOrd, Encode, EncodeValue, Error, - FixedTag, Header, Length, Reader, Tag, ValueOrd, Writer, + ArrayVec, Decode, DecodeValue, DerOrd, Encode, EncodeValue, Error, FixedTag, Header, Length, + Reader, Tag, ValueOrd, Writer, arrayvec, ord::iter_cmp, }; use core::cmp::Ordering; diff --git a/der/src/asn1/set_of.rs b/der/src/asn1/set_of.rs index 8c22a3e5f..77c11fc4d 100644 --- a/der/src/asn1/set_of.rs +++ b/der/src/asn1/set_of.rs @@ -11,8 +11,8 @@ //! ensuring they'll be in the proper order if reserialized. use crate::{ - arrayvec, ord::iter_cmp, ArrayVec, Decode, DecodeValue, DerOrd, Encode, EncodeValue, Error, - ErrorKind, FixedTag, Header, Length, Reader, Tag, ValueOrd, Writer, + ArrayVec, Decode, DecodeValue, DerOrd, Encode, EncodeValue, Error, ErrorKind, FixedTag, Header, + Length, Reader, Tag, ValueOrd, Writer, arrayvec, ord::iter_cmp, }; use core::cmp::Ordering; diff --git a/der/src/asn1/teletex_string.rs b/der/src/asn1/teletex_string.rs index 668d8252d..415cea7a2 100644 --- a/der/src/asn1/teletex_string.rs +++ b/der/src/asn1/teletex_string.rs @@ -1,6 +1,6 @@ //! ASN.1 `TeletexString` support. //! -use crate::{asn1::AnyRef, FixedTag, Result, StrRef, Tag}; +use crate::{FixedTag, Result, StrRef, Tag, asn1::AnyRef}; use core::{fmt, ops::Deref}; macro_rules! impl_teletex_string { @@ -96,9 +96,9 @@ mod allocation { use super::TeletexStringRef; use crate::{ + BytesRef, Error, FixedTag, Result, StrOwned, Tag, asn1::AnyRef, referenced::{OwnedToRef, RefToOwned}, - BytesRef, Error, FixedTag, Result, StrOwned, Tag, }; use alloc::string::String; use core::{fmt, ops::Deref}; diff --git a/der/src/asn1/utc_time.rs b/der/src/asn1/utc_time.rs index 74e8f0322..fa52ffed4 100644 --- a/der/src/asn1/utc_time.rs +++ b/der/src/asn1/utc_time.rs @@ -1,10 +1,10 @@ //! ASN.1 `UTCTime` support. use crate::{ - datetime::{self, DateTime}, - ord::OrdIsValueOrd, DecodeValue, EncodeValue, Error, ErrorKind, FixedTag, Header, Length, Reader, Result, Tag, Writer, + datetime::{self, DateTime}, + ord::OrdIsValueOrd, }; use core::time::Duration; @@ -94,7 +94,21 @@ impl<'a> DecodeValue<'a> for UtcTime { match bytes { // RFC 5280 requires mandatory seconds and Z-normalized time zone - [year1, year2, mon1, mon2, day1, day2, hour1, hour2, min1, min2, sec1, sec2, b'Z'] => { + [ + year1, + year2, + mon1, + mon2, + day1, + day2, + hour1, + hour2, + min1, + min2, + sec1, + sec2, + b'Z', + ] => { let year = u16::from(datetime::decode_decimal(Self::TAG, year1, year2)?); let month = datetime::decode_decimal(Self::TAG, mon1, mon2)?; let day = datetime::decode_decimal(Self::TAG, day1, day2)?; diff --git a/der/src/asn1/utf8_string.rs b/der/src/asn1/utf8_string.rs index b6dbcd7da..e17a26743 100644 --- a/der/src/asn1/utf8_string.rs +++ b/der/src/asn1/utf8_string.rs @@ -1,8 +1,8 @@ //! ASN.1 `UTF8String` support. use crate::{ - asn1::AnyRef, ord::OrdIsValueOrd, EncodeValue, Error, FixedTag, Length, Result, StrRef, Tag, - Writer, + EncodeValue, Error, FixedTag, Length, Result, StrRef, Tag, Writer, asn1::AnyRef, + ord::OrdIsValueOrd, }; use core::{fmt, ops::Deref, str}; diff --git a/der/src/asn1/videotex_string.rs b/der/src/asn1/videotex_string.rs index ee4c9702d..021d621ef 100644 --- a/der/src/asn1/videotex_string.rs +++ b/der/src/asn1/videotex_string.rs @@ -1,6 +1,6 @@ //! ASN.1 `VideotexString` support. -use crate::{asn1::AnyRef, FixedTag, Result, StrRef, Tag}; +use crate::{FixedTag, Result, StrRef, Tag, asn1::AnyRef}; use core::{fmt, ops::Deref}; /// ASN.1 `VideotexString` type. diff --git a/der/src/bytes_owned.rs b/der/src/bytes_owned.rs index 04ad0348b..330ac8bbd 100644 --- a/der/src/bytes_owned.rs +++ b/der/src/bytes_owned.rs @@ -2,8 +2,8 @@ //! library-level length limitation i.e. `Length::max()`. use crate::{ - referenced::OwnedToRef, BytesRef, DecodeValue, DerOrd, EncodeValue, Error, Header, Length, - Reader, Result, StrRef, Writer, + BytesRef, DecodeValue, DerOrd, EncodeValue, Error, Header, Length, Reader, Result, StrRef, + Writer, referenced::OwnedToRef, }; use alloc::{boxed::Box, vec::Vec}; use core::cmp::Ordering; diff --git a/der/src/bytes_ref.rs b/der/src/bytes_ref.rs index ce4fb800c..a7c689ae1 100644 --- a/der/src/bytes_ref.rs +++ b/der/src/bytes_ref.rs @@ -153,7 +153,7 @@ impl<'a> arbitrary::Arbitrary<'a> for BytesRef<'a> { #[cfg(feature = "alloc")] mod allocating { use super::BytesRef; - use crate::{referenced::RefToOwned, BytesOwned}; + use crate::{BytesOwned, referenced::RefToOwned}; impl<'a> RefToOwned<'a> for BytesRef<'a> { type Owned = BytesOwned; diff --git a/der/src/datetime.rs b/der/src/datetime.rs index 58919de58..39dbd11ef 100644 --- a/der/src/datetime.rs +++ b/der/src/datetime.rs @@ -270,8 +270,28 @@ impl FromStr for DateTime { fn from_str(s: &str) -> Result { match *s.as_bytes() { - [year1, year2, year3, year4, b'-', month1, month2, b'-', day1, day2, b'T', hour1, hour2, b':', min1, min2, b':', sec1, sec2, b'Z'] => - { + [ + year1, + year2, + year3, + year4, + b'-', + month1, + month2, + b'-', + day1, + day2, + b'T', + hour1, + hour2, + b':', + min1, + min2, + b':', + sec1, + sec2, + b'Z', + ] => { let tag = Tag::GeneralizedTime; let year = decode_year(&[year1, year2, year3, year4])?; let month = decode_decimal(tag, month1, month2).map_err(|_| ErrorKind::DateTime)?; diff --git a/der/src/decode.rs b/der/src/decode.rs index 4f856995c..9588a1f07 100644 --- a/der/src/decode.rs +++ b/der/src/decode.rs @@ -4,7 +4,7 @@ use crate::{EncodingRules, Error, FixedTag, Header, Reader, SliceReader}; use core::marker::PhantomData; #[cfg(feature = "pem")] -use crate::{pem::PemLabel, PemReader}; +use crate::{PemReader, pem::PemLabel}; #[cfg(doc)] use crate::{Length, Tag}; diff --git a/der/src/lib.rs b/der/src/lib.rs index c7b7c05b9..8b8757c5c 100644 --- a/der/src/lib.rs +++ b/der/src/lib.rs @@ -375,9 +375,9 @@ pub use crate::{ header::Header, length::{IndefiniteLength, Length}, ord::{DerOrd, ValueOrd}, - reader::{slice::SliceReader, Reader}, + reader::{Reader, slice::SliceReader}, tag::{Class, FixedTag, Tag, TagMode, TagNumber, Tagged}, - writer::{slice::SliceWriter, Writer}, + writer::{Writer, slice::SliceWriter}, }; #[cfg(feature = "alloc")] diff --git a/der/src/reader.rs b/der/src/reader.rs index fe77d0359..e58178cdd 100644 --- a/der/src/reader.rs +++ b/der/src/reader.rs @@ -5,8 +5,8 @@ pub(crate) mod pem; pub(crate) mod slice; use crate::{ - asn1::ContextSpecific, Decode, DecodeValue, Encode, EncodingRules, Error, ErrorKind, FixedTag, - Header, Length, Tag, TagMode, TagNumber, + Decode, DecodeValue, Encode, EncodingRules, Error, ErrorKind, FixedTag, Header, Length, Tag, + TagMode, TagNumber, asn1::ContextSpecific, }; #[cfg(feature = "alloc")] diff --git a/der/src/str_owned.rs b/der/src/str_owned.rs index 128815fa3..be9adea72 100644 --- a/der/src/str_owned.rs +++ b/der/src/str_owned.rs @@ -2,8 +2,8 @@ //! library-level length limitation i.e. `Length::max()`. use crate::{ - referenced::OwnedToRef, BytesRef, DecodeValue, EncodeValue, Error, Header, Length, Reader, - Result, StrRef, Writer, + BytesRef, DecodeValue, EncodeValue, Error, Header, Length, Reader, Result, StrRef, Writer, + referenced::OwnedToRef, }; use alloc::string::String; use core::str; diff --git a/der/src/str_ref.rs b/der/src/str_ref.rs index 3fa8619dd..5978d2f4a 100644 --- a/der/src/str_ref.rs +++ b/der/src/str_ref.rs @@ -83,7 +83,7 @@ impl EncodeValue for StrRef<'_> { #[cfg(feature = "alloc")] mod allocating { use super::StrRef; - use crate::{referenced::RefToOwned, StrOwned}; + use crate::{StrOwned, referenced::RefToOwned}; impl<'a> RefToOwned<'a> for StrRef<'a> { type Owned = StrOwned; diff --git a/der/src/tag/class.rs b/der/src/tag/class.rs index ffb2a1e75..d9c841d6a 100644 --- a/der/src/tag/class.rs +++ b/der/src/tag/class.rs @@ -1,6 +1,6 @@ //! Class of an ASN.1 tag. -use super::{TagNumber, CONSTRUCTED_FLAG}; +use super::{CONSTRUCTED_FLAG, TagNumber}; use core::fmt; /// Class of an ASN.1 tag. diff --git a/der/src/writer/slice.rs b/der/src/writer/slice.rs index fca5a18e3..43dfcf1bb 100644 --- a/der/src/writer/slice.rs +++ b/der/src/writer/slice.rs @@ -1,8 +1,8 @@ //! Slice writer. use crate::{ - asn1::*, Encode, EncodeValue, ErrorKind, Header, Length, Result, Tag, TagMode, TagNumber, - Tagged, Writer, + Encode, EncodeValue, ErrorKind, Header, Length, Result, Tag, TagMode, TagNumber, Tagged, + Writer, asn1::*, }; /// [`Writer`] which encodes DER into a mutable output byte slice. diff --git a/der/tests/datetime.rs b/der/tests/datetime.rs index 454c1f0e4..8d181689f 100644 --- a/der/tests/datetime.rs +++ b/der/tests/datetime.rs @@ -1,6 +1,6 @@ //! Tests for the [`DateTime`] type. -use der::{asn1::UtcTime, DateTime, Decode, Encode}; +use der::{DateTime, Decode, Encode, asn1::UtcTime}; use proptest::prelude::*; proptest! { @@ -44,11 +44,7 @@ fn make_datetime(year: u16, month: u8, day: u8, hour: u8, min: u8, sec: u8) -> D let max_day = if month == 2 { let is_leap_year = year % 4 == 0 && (year % 100 != 0 || year % 400 == 0); - if is_leap_year { - 29 - } else { - 28 - } + if is_leap_year { 29 } else { 28 } } else { 30 }; diff --git a/der/tests/derive.rs b/der/tests/derive.rs index 510e9a621..30062bf82 100644 --- a/der/tests/derive.rs +++ b/der/tests/derive.rs @@ -35,8 +35,8 @@ mod choice { mod explicit { use super::CustomError; use der::{ - asn1::{GeneralizedTime, UtcTime}, Choice, Decode, Encode, SliceWriter, + asn1::{GeneralizedTime, UtcTime}, }; use hex_literal::hex; use std::time::Duration; @@ -112,8 +112,8 @@ mod choice { /// `Choice` with `IMPLICIT` tagging. mod implicit { use der::{ - asn1::{BitStringRef, GeneralizedTime}, Choice, Decode, Encode, SliceWriter, + asn1::{BitStringRef, GeneralizedTime}, }; use hex_literal::hex; @@ -247,8 +247,8 @@ mod sequence { use super::CustomError; use core::marker::PhantomData; use der::{ - asn1::{AnyRef, ObjectIdentifier, SetOf}, Decode, Encode, Sequence, ValueOrd, + asn1::{AnyRef, ObjectIdentifier, SetOf}, }; use hex_literal::hex; diff --git a/der/tests/pem.rs b/der/tests/pem.rs index d2c865463..ffae99da6 100644 --- a/der/tests/pem.rs +++ b/der/tests/pem.rs @@ -3,9 +3,9 @@ #![cfg(all(feature = "derive", feature = "oid", feature = "pem"))] use der::{ + Decode, DecodePem, EncodePem, Sequence, asn1::{BitString, ObjectIdentifier}, pem::{LineEnding, PemLabel}, - Decode, DecodePem, EncodePem, Sequence, }; /// Example SPKI document encoded as DER. diff --git a/der/tests/set_of.rs b/der/tests/set_of.rs index d58399198..4f956d1b2 100644 --- a/der/tests/set_of.rs +++ b/der/tests/set_of.rs @@ -2,7 +2,7 @@ #![cfg(feature = "alloc")] -use der::{asn1::SetOfVec, DerOrd}; +use der::{DerOrd, asn1::SetOfVec}; use proptest::{prelude::*, string::*}; use std::collections::BTreeSet; @@ -26,8 +26,8 @@ proptest! { #[cfg(all(feature = "derive", feature = "oid"))] mod ordering { use der::{ - asn1::{AnyRef, ObjectIdentifier, SetOf, SetOfVec}, Decode, Sequence, ValueOrd, + asn1::{AnyRef, ObjectIdentifier, SetOf, SetOfVec}, }; use hex_literal::hex; @@ -57,7 +57,9 @@ mod ordering { /// Test to ensure ordering is handled correctly. #[test] fn ordering_regression() { - let der_bytes = hex!("3139301906035504030C12546573742055736572393031353734333830301C060A0992268993F22C640101130E3437303031303030303134373333"); + let der_bytes = hex!( + "3139301906035504030C12546573742055736572393031353734333830301C060A0992268993F22C640101130E3437303031303030303134373333" + ); let set = SetOf::, 3>::from_der(&der_bytes).unwrap(); let attr1 = set.get(0).unwrap(); assert_eq!(ObjectIdentifier::new("2.5.4.3").unwrap(), attr1.oid); diff --git a/der_derive/Cargo.toml b/der_derive/Cargo.toml index 4b097456f..45a7c2c9e 100644 --- a/der_derive/Cargo.toml +++ b/der_derive/Cargo.toml @@ -10,8 +10,8 @@ repository = "https://github.com/RustCrypto/formats" categories = ["cryptography", "data-structures", "encoding", "no-std", "parser-implementations"] keywords = ["asn1", "der", "crypto", "itu", "pkcs"] readme = "README.md" -edition = "2021" -rust-version = "1.71" +edition = "2024" +rust-version = "1.85" [lib] proc-macro = true diff --git a/der_derive/src/attributes.rs b/der_derive/src/attributes.rs index 911adcbd6..42af6898c 100644 --- a/der_derive/src/attributes.rs +++ b/der_derive/src/attributes.rs @@ -2,10 +2,10 @@ use crate::{Asn1Type, Tag, TagMode, TagNumber}; use proc_macro2::{Span, TokenStream}; -use quote::{quote, ToTokens}; +use quote::{ToTokens, quote}; use std::{fmt::Debug, str::FromStr}; use syn::punctuated::Punctuated; -use syn::{parse::Parse, parse::ParseStream, Attribute, Ident, LitStr, Path, Token}; +use syn::{Attribute, Ident, LitStr, Path, Token, parse::Parse, parse::ParseStream}; /// Error type used by the structure #[derive(Debug, Clone, Default, Eq, PartialEq)] diff --git a/der_derive/src/choice.rs b/der_derive/src/choice.rs index 8cd50ca01..4c2b8e28f 100644 --- a/der_derive/src/choice.rs +++ b/der_derive/src/choice.rs @@ -5,9 +5,9 @@ mod variant; use self::variant::ChoiceVariant; -use crate::{default_lifetime, ErrorType, TypeAttrs}; +use crate::{ErrorType, TypeAttrs, default_lifetime}; use proc_macro2::TokenStream; -use quote::{quote, ToTokens}; +use quote::{ToTokens, quote}; use syn::{DeriveInput, GenericParam, Generics, Ident, LifetimeParam}; /// Derive the `Choice` trait for an enum. diff --git a/der_derive/src/choice/variant.rs b/der_derive/src/choice/variant.rs index 2b2eadd34..458bf4493 100644 --- a/der_derive/src/choice/variant.rs +++ b/der_derive/src/choice/variant.rs @@ -154,7 +154,7 @@ impl ChoiceVariant { #[cfg(test)] mod tests { use super::ChoiceVariant; - use crate::{choice::variant::TagOrPath, Asn1Type, FieldAttrs, Tag, TagMode, TagNumber}; + use crate::{Asn1Type, FieldAttrs, Tag, TagMode, TagNumber, choice::variant::TagOrPath}; use proc_macro2::Span; use quote::quote; use syn::Ident; diff --git a/der_derive/src/enumerated.rs b/der_derive/src/enumerated.rs index 849a43081..d1abdc67d 100644 --- a/der_derive/src/enumerated.rs +++ b/der_derive/src/enumerated.rs @@ -2,9 +2,9 @@ //! the purposes of decoding/encoding ASN.1 `ENUMERATED` types as mapped to //! enum variants. -use crate::{default_lifetime, ErrorType, ATTR_NAME}; +use crate::{ATTR_NAME, ErrorType, default_lifetime}; use proc_macro2::TokenStream; -use quote::{quote, ToTokens}; +use quote::{ToTokens, quote}; use syn::{DeriveInput, Expr, ExprLit, Ident, Lit, LitInt, LitStr, Path, Variant}; /// Valid options for the `#[repr]` attribute on `Enumerated` types. diff --git a/der_derive/src/lib.rs b/der_derive/src/lib.rs index c87cd902a..ac32dc2a6 100644 --- a/der_derive/src/lib.rs +++ b/der_derive/src/lib.rs @@ -159,7 +159,7 @@ mod value_ord; use crate::{ asn1_type::Asn1Type, - attributes::{ErrorType, FieldAttrs, TypeAttrs, ATTR_NAME}, + attributes::{ATTR_NAME, ErrorType, FieldAttrs, TypeAttrs}, choice::DeriveChoice, enumerated::DeriveEnumerated, sequence::DeriveSequence, @@ -168,7 +168,7 @@ use crate::{ }; use proc_macro::TokenStream; use proc_macro2::Span; -use syn::{parse_macro_input, DeriveInput, Lifetime}; +use syn::{DeriveInput, Lifetime, parse_macro_input}; /// Get the default lifetime. fn default_lifetime() -> Lifetime { diff --git a/der_derive/src/sequence.rs b/der_derive/src/sequence.rs index f347c727f..c15ee267e 100644 --- a/der_derive/src/sequence.rs +++ b/der_derive/src/sequence.rs @@ -3,10 +3,10 @@ mod field; -use crate::{default_lifetime, ErrorType, TypeAttrs}; +use crate::{ErrorType, TypeAttrs, default_lifetime}; use field::SequenceField; use proc_macro2::TokenStream; -use quote::{quote, ToTokens}; +use quote::{ToTokens, quote}; use syn::{DeriveInput, GenericParam, Generics, Ident, LifetimeParam}; /// Derive the `Sequence` trait for a struct diff --git a/der_derive/src/sequence/field.rs b/der_derive/src/sequence/field.rs index d91599c0a..399daf42b 100644 --- a/der_derive/src/sequence/field.rs +++ b/der_derive/src/sequence/field.rs @@ -243,7 +243,7 @@ mod tests { use crate::{FieldAttrs, TagMode, TagNumber}; use proc_macro2::Span; use quote::quote; - use syn::{punctuated::Punctuated, Ident, Path, PathSegment, Type, TypePath}; + use syn::{Ident, Path, PathSegment, Type, TypePath, punctuated::Punctuated}; /// Create a [`Type::Path`]. pub fn type_path(ident: Ident) -> Type { diff --git a/der_derive/src/tag.rs b/der_derive/src/tag.rs index a1cf529cb..9889ce4ee 100644 --- a/der_derive/src/tag.rs +++ b/der_derive/src/tag.rs @@ -7,7 +7,7 @@ use std::{ fmt::{self, Display}, str::FromStr, }; -use syn::{parse::Parse, LitStr}; +use syn::{LitStr, parse::Parse}; /// Tag "IR" type. #[derive(Copy, Clone, Debug, Eq, PartialEq, PartialOrd, Ord)] diff --git a/gss-api/Cargo.lock b/gss-api/Cargo.lock new file mode 100644 index 000000000..ad6a6b5c7 --- /dev/null +++ b/gss-api/Cargo.lock @@ -0,0 +1,132 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +version = 3 + +[[package]] +name = "base64ct" +version = "1.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8c3c1a368f70d6cf7302d78f8f7093da241fb8e8807c05cc9e51a125895a6d5b" + +[[package]] +name = "const-oid" +version = "0.10.0-rc.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "68ff6be19477a1bd5441f382916a89bc2a0b2c35db6d41e0f6e8538bf6d6463f" + +[[package]] +name = "der" +version = "0.8.0-rc.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "82db698b33305f0134faf590b9d1259dc171b5481ac41d5c8146c3b3ee7d4319" +dependencies = [ + "const-oid", + "der_derive", + "flagset", + "pem-rfc7468", + "zeroize", +] + +[[package]] +name = "der_derive" +version = "0.8.0-rc.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "211bea8bb45f5f61bc857104606913ef8ac8b5ec698143aa2aa96a7ffdc94991" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "flagset" +version = "0.4.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b3ea1ec5f8307826a5b71094dd91fc04d4ae75d5709b20ad351c7fb4815c86ec" + +[[package]] +name = "gss-api" +version = "0.2.0-pre" +dependencies = [ + "der", + "hex-literal", + "spki", + "x509-cert", +] + +[[package]] +name = "hex-literal" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6fe2267d4ed49bc07b63801559be28c718ea06c4738b7a03c94df7386d2cde46" + +[[package]] +name = "pem-rfc7468" +version = "1.0.0-rc.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c2dfbfa5c6f0906884269722c5478e72fd4d6c0e24fe600332c6d62359567ce1" +dependencies = [ + "base64ct", +] + +[[package]] +name = "proc-macro2" +version = "1.0.93" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "60946a68e5f9d28b0dc1c21bb8a97ee7d018a8b322fa57838ba31cc878e22d99" +dependencies = [ + "unicode-ident", +] + +[[package]] +name = "quote" +version = "1.0.38" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0e4dccaaaf89514f546c693ddc140f729f958c247918a13380cccc6078391acc" +dependencies = [ + "proc-macro2", +] + +[[package]] +name = "spki" +version = "0.8.0-rc.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "37ac66481418fd7afdc584adcf3be9aa572cf6c2858814494dc2a01755f050bc" +dependencies = [ + "base64ct", + "der", +] + +[[package]] +name = "syn" +version = "2.0.98" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "36147f1a48ae0ec2b5b3bc5b537d267457555a10dc06f3dbc8cb11ba3006d3b1" +dependencies = [ + "proc-macro2", + "quote", + "unicode-ident", +] + +[[package]] +name = "unicode-ident" +version = "1.0.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "00e2473a93778eb0bad35909dff6a10d28e63f792f16ed15e404fca9d5eeedbe" + +[[package]] +name = "x509-cert" +version = "0.3.0-pre.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2db382aa43c1fb5c419a960f72c3847ab0f383f635fc2e25f0bd6c5fb94371d1" +dependencies = [ + "const-oid", + "der", + "spki", +] + +[[package]] +name = "zeroize" +version = "1.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ced3678a2879b30306d323f4542626697a464a97c0a07c9aebf7ebca65cd4dde" diff --git a/pem-rfc7468/Cargo.toml b/pem-rfc7468/Cargo.toml index 38f400556..b0b8393bf 100644 --- a/pem-rfc7468/Cargo.toml +++ b/pem-rfc7468/Cargo.toml @@ -15,8 +15,8 @@ repository = "https://github.com/RustCrypto/formats" categories = ["cryptography", "data-structures", "encoding", "no-std", "parser-implementations"] keywords = ["crypto", "key", "pem", "pkcs", "rsa"] readme = "README.md" -edition = "2021" -rust-version = "1.81" +edition = "2024" +rust-version = "1.85" [dependencies] base64ct = { version = "1.4" } diff --git a/pem-rfc7468/README.md b/pem-rfc7468/README.md index 5e294d30e..258fd1d8f 100644 --- a/pem-rfc7468/README.md +++ b/pem-rfc7468/README.md @@ -56,13 +56,6 @@ The paper [Util::Lookup: Exploiting key decoding in cryptographic libraries][Uti demonstrates how the leakage from non-constant-time PEM parsers can be used to practically extract RSA private keys from SGX enclaves. -## Minimum Supported Rust Version - -This crate requires **Rust 1.81** at a minimum. - -We may change the MSRV in the future, but it will be accompanied by a minor -version bump. - ## License Licensed under either of: @@ -87,7 +80,7 @@ dual licensed as above, without any additional terms or conditions. [build-image]: https://github.com/RustCrypto/formats/actions/workflows/pem-rfc7468.yml/badge.svg [build-link]: https://github.com/RustCrypto/formats/actions/workflows/pem-rfc7468.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 diff --git a/pem-rfc7468/src/decoder.rs b/pem-rfc7468/src/decoder.rs index 3c1fb9255..1fa560cd9 100644 --- a/pem-rfc7468/src/decoder.rs +++ b/pem-rfc7468/src/decoder.rs @@ -11,8 +11,8 @@ //! [RFC 4648]: https://datatracker.ietf.org/doc/html/rfc4648 use crate::{ - grammar, Base64Decoder, Error, Result, BASE64_WRAP_WIDTH, POST_ENCAPSULATION_BOUNDARY, - PRE_ENCAPSULATION_BOUNDARY, + BASE64_WRAP_WIDTH, Base64Decoder, Error, POST_ENCAPSULATION_BOUNDARY, + PRE_ENCAPSULATION_BOUNDARY, Result, grammar, }; use core::str; diff --git a/pem-rfc7468/src/encoder.rs b/pem-rfc7468/src/encoder.rs index fbc666b1c..383746184 100644 --- a/pem-rfc7468/src/encoder.rs +++ b/pem-rfc7468/src/encoder.rs @@ -1,8 +1,8 @@ //! PEM encoder. use crate::{ - grammar, Base64Encoder, Error, LineEnding, Result, BASE64_WRAP_WIDTH, - ENCAPSULATION_BOUNDARY_DELIMITER, POST_ENCAPSULATION_BOUNDARY, PRE_ENCAPSULATION_BOUNDARY, + BASE64_WRAP_WIDTH, Base64Encoder, ENCAPSULATION_BOUNDARY_DELIMITER, Error, LineEnding, + POST_ENCAPSULATION_BOUNDARY, PRE_ENCAPSULATION_BOUNDARY, Result, grammar, }; use base64ct::{Base64, Encoding}; use core::str; diff --git a/pem-rfc7468/src/grammar.rs b/pem-rfc7468/src/grammar.rs index 7d1a518ff..b309371e7 100644 --- a/pem-rfc7468/src/grammar.rs +++ b/pem-rfc7468/src/grammar.rs @@ -4,7 +4,7 @@ //! The grammar described below is intended to follow the "ABNF (Strict)" //! subset of the grammar as described in Section 3 Figure 3. -use crate::{Error, Result, PRE_ENCAPSULATION_BOUNDARY}; +use crate::{Error, PRE_ENCAPSULATION_BOUNDARY, Result}; use core::str; /// NUL char diff --git a/pem-rfc7468/src/lib.rs b/pem-rfc7468/src/lib.rs index 25c406232..a61d4eaa9 100644 --- a/pem-rfc7468/src/lib.rs +++ b/pem-rfc7468/src/lib.rs @@ -63,8 +63,8 @@ mod error; mod grammar; pub use crate::{ - decoder::{decode, decode_label, detect_base64_line_width, Decoder}, - encoder::{encapsulated_len, encapsulated_len_wrapped, encode, encoded_len, Encoder}, + decoder::{Decoder, decode, decode_label, detect_base64_line_width}, + encoder::{Encoder, encapsulated_len, encapsulated_len_wrapped, encode, encoded_len}, error::{Error, Result}, }; pub use base64ct::LineEnding; diff --git a/pkcs1/Cargo.toml b/pkcs1/Cargo.toml index eb60e48d9..e00d90a90 100644 --- a/pkcs1/Cargo.toml +++ b/pkcs1/Cargo.toml @@ -12,8 +12,8 @@ repository = "https://github.com/RustCrypto/formats" categories = ["cryptography", "data-structures", "encoding", "no-std", "parser-implementations"] keywords = ["crypto", "key", "pem", "pkcs", "rsa"] readme = "README.md" -edition = "2021" -rust-version = "1.81" +edition = "2024" +rust-version = "1.85" [dependencies] der = { version = "0.8.0-rc.0", features = ["oid"] } @@ -24,7 +24,7 @@ pkcs8 = { version = "0.11.0-rc.1", optional = true, default-features = false } [dev-dependencies] const-oid = { version = "0.10.0-rc.0", features = ["db"] } -hex-literal = "0.4" +hex-literal = "1" tempfile = "3" [features] diff --git a/pkcs1/README.md b/pkcs1/README.md index bcf235eae..7b6f263c2 100644 --- a/pkcs1/README.md +++ b/pkcs1/README.md @@ -29,13 +29,6 @@ PEM encoded RSA public keys begin with: -----BEGIN RSA PUBLIC KEY----- ``` -## Minimum Supported Rust Version - -This crate requires **Rust 1.71** at a minimum. - -We may change the MSRV in the future, but it will be accompanied by a minor -version bump. - ## License Licensed under either of: @@ -58,7 +51,7 @@ dual licensed as above, without any additional terms or conditions. [docs-image]: https://docs.rs/pkcs1/badge.svg [docs-link]: https://docs.rs/pkcs1/ [license-image]: https://img.shields.io/badge/license-Apache2.0/MIT-blue.svg -[rustc-image]: https://img.shields.io/badge/rustc-1.71+-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 [build-image]: https://github.com/RustCrypto/formats/workflows/pkcs1/badge.svg?branch=master&event=push diff --git a/pkcs1/src/lib.rs b/pkcs1/src/lib.rs index 65f216d3f..0f4980b1a 100644 --- a/pkcs1/src/lib.rs +++ b/pkcs1/src/lib.rs @@ -43,7 +43,7 @@ pub use crate::{ #[cfg(feature = "alloc")] pub use crate::{ - private_key::{other_prime_info::OtherPrimeInfo, OtherPrimeInfos}, + private_key::{OtherPrimeInfos, other_prime_info::OtherPrimeInfo}, traits::{EncodeRsaPrivateKey, EncodeRsaPublicKey}, }; diff --git a/pkcs1/src/params.rs b/pkcs1/src/params.rs index ef4425d29..53ceff974 100644 --- a/pkcs1/src/params.rs +++ b/pkcs1/src/params.rs @@ -2,10 +2,10 @@ use crate::{Error, Result}; use der::{ - asn1::{AnyRef, ContextSpecificRef, ObjectIdentifier}, - oid::AssociatedOid, Decode, DecodeValue, Encode, EncodeValue, FixedTag, Length, Reader, Sequence, Tag, TagMode, TagNumber, Writer, + asn1::{AnyRef, ContextSpecificRef, ObjectIdentifier}, + oid::AssociatedOid, }; use spki::{AlgorithmIdentifier, AlgorithmIdentifierRef}; diff --git a/pkcs1/src/private_key.rs b/pkcs1/src/private_key.rs index 327a764eb..4b1bb8eb0 100644 --- a/pkcs1/src/private_key.rs +++ b/pkcs1/src/private_key.rs @@ -6,8 +6,8 @@ pub(crate) mod other_prime_info; use crate::{Error, Result, RsaPublicKey, Version}; use core::fmt; use der::{ - asn1::{OctetStringRef, UintRef}, Decode, DecodeValue, Encode, EncodeValue, Header, Length, Reader, Sequence, Tag, Writer, + asn1::{OctetStringRef, UintRef}, }; #[cfg(feature = "alloc")] diff --git a/pkcs1/src/private_key/other_prime_info.rs b/pkcs1/src/private_key/other_prime_info.rs index b2a613572..c26828f38 100644 --- a/pkcs1/src/private_key/other_prime_info.rs +++ b/pkcs1/src/private_key/other_prime_info.rs @@ -1,7 +1,7 @@ //! PKCS#1 OtherPrimeInfo support. use der::{ - asn1::UintRef, DecodeValue, Encode, EncodeValue, Header, Length, Reader, Sequence, Writer, + DecodeValue, Encode, EncodeValue, Header, Length, Reader, Sequence, Writer, asn1::UintRef, }; /// PKCS#1 OtherPrimeInfo as defined in [RFC 8017 Appendix 1.2]. diff --git a/pkcs1/src/public_key.rs b/pkcs1/src/public_key.rs index f8bc06932..8eef118d1 100644 --- a/pkcs1/src/public_key.rs +++ b/pkcs1/src/public_key.rs @@ -2,8 +2,8 @@ use crate::{Error, Result}; use der::{ - asn1::UintRef, Decode, DecodeValue, Encode, EncodeValue, Header, Length, Reader, Sequence, - Writer, + Decode, DecodeValue, Encode, EncodeValue, Header, Length, Reader, Sequence, Writer, + asn1::UintRef, }; #[cfg(feature = "alloc")] diff --git a/pkcs1/tests/params.rs b/pkcs1/tests/params.rs index d47fbb537..0256a6166 100644 --- a/pkcs1/tests/params.rs +++ b/pkcs1/tests/params.rs @@ -2,9 +2,9 @@ use const_oid::db; use der::{ + Encode, asn1::{AnyRef, ObjectIdentifier, OctetStringRef}, oid::AssociatedOid, - Encode, }; use hex_literal::hex; use pkcs1::{RsaOaepParams, RsaPssParams, TrailerField}; @@ -12,12 +12,16 @@ use pkcs1::{RsaOaepParams, RsaPssParams, TrailerField}; /// Default PSS parameters using all default values (SHA1, MGF1) const RSA_PSS_PARAMETERS_DEFAULTS: &[u8] = &hex!("3000"); /// Example PSS parameters using SHA256 instead of SHA1 -const RSA_PSS_PARAMETERS_SHA2_256: &[u8] = &hex!("3034a00f300d06096086480165030402010500a11c301a06092a864886f70d010108300d06096086480165030402010500a203020120"); +const RSA_PSS_PARAMETERS_SHA2_256: &[u8] = &hex!( + "3034a00f300d06096086480165030402010500a11c301a06092a864886f70d010108300d06096086480165030402010500a203020120" +); /// Default OAEP parameters using all default values (SHA1, MGF1, Empty) const RSA_OAEP_PARAMETERS_DEFAULTS: &[u8] = &hex!("3000"); /// Example OAEP parameters using SHA256 instead of SHA1 -const RSA_OAEP_PARAMETERS_SHA2_256: &[u8] = &hex!("302fa00f300d06096086480165030402010500a11c301a06092a864886f70d010108300d06096086480165030402010500"); +const RSA_OAEP_PARAMETERS_SHA2_256: &[u8] = &hex!( + "302fa00f300d06096086480165030402010500a11c301a06092a864886f70d010108300d06096086480165030402010500" +); struct Sha1Mock {} impl AssociatedOid for Sha1Mock { @@ -33,21 +37,27 @@ impl AssociatedOid for Sha256Mock { fn decode_pss_param() { let param = RsaPssParams::try_from(RSA_PSS_PARAMETERS_SHA2_256).unwrap(); - assert!(param - .hash - .assert_algorithm_oid(db::rfc5912::ID_SHA_256) - .is_ok()); + assert!( + param + .hash + .assert_algorithm_oid(db::rfc5912::ID_SHA_256) + .is_ok() + ); assert_eq!(param.hash.parameters, Some(AnyRef::NULL)); - assert!(param - .mask_gen - .assert_algorithm_oid(db::rfc5912::ID_MGF_1) - .is_ok()); - assert!(param - .mask_gen - .parameters - .unwrap() - .assert_algorithm_oid(db::rfc5912::ID_SHA_256) - .is_ok()); + assert!( + param + .mask_gen + .assert_algorithm_oid(db::rfc5912::ID_MGF_1) + .is_ok() + ); + assert!( + param + .mask_gen + .parameters + .unwrap() + .assert_algorithm_oid(db::rfc5912::ID_SHA_256) + .is_ok() + ); assert_eq!(param.salt_len, 32); assert_eq!(param.trailer_field, TrailerField::BC); } @@ -66,21 +76,27 @@ fn encode_pss_param() { fn decode_pss_param_default() { let param = RsaPssParams::try_from(RSA_PSS_PARAMETERS_DEFAULTS).unwrap(); - assert!(param - .hash - .assert_algorithm_oid(db::rfc5912::ID_SHA_1) - .is_ok()); + assert!( + param + .hash + .assert_algorithm_oid(db::rfc5912::ID_SHA_1) + .is_ok() + ); assert_eq!(param.hash.parameters, Some(AnyRef::NULL)); - assert!(param - .mask_gen - .assert_algorithm_oid(db::rfc5912::ID_MGF_1) - .is_ok()); - assert!(param - .mask_gen - .parameters - .unwrap() - .assert_algorithm_oid(db::rfc5912::ID_SHA_1) - .is_ok()); + assert!( + param + .mask_gen + .assert_algorithm_oid(db::rfc5912::ID_MGF_1) + .is_ok() + ); + assert!( + param + .mask_gen + .parameters + .unwrap() + .assert_algorithm_oid(db::rfc5912::ID_SHA_1) + .is_ok() + ); assert_eq!( param.mask_gen.parameters.unwrap().parameters, Some(AnyRef::NULL) @@ -120,32 +136,42 @@ fn new_pss_param() { fn decode_oaep_param() { let param = RsaOaepParams::try_from(RSA_OAEP_PARAMETERS_SHA2_256).unwrap(); - assert!(param - .hash - .assert_algorithm_oid(db::rfc5912::ID_SHA_256) - .is_ok()); + assert!( + param + .hash + .assert_algorithm_oid(db::rfc5912::ID_SHA_256) + .is_ok() + ); assert_eq!(param.hash.parameters, Some(AnyRef::NULL)); - assert!(param - .mask_gen - .assert_algorithm_oid(db::rfc5912::ID_MGF_1) - .is_ok()); - assert!(param - .mask_gen - .parameters - .unwrap() - .assert_algorithm_oid(db::rfc5912::ID_SHA_256) - .is_ok()); - assert!(param - .p_source - .assert_algorithm_oid(db::rfc5912::ID_P_SPECIFIED) - .is_ok()); - assert!(param - .p_source - .parameters_any() - .unwrap() - .decode_as::>() - .unwrap() - .is_empty(),); + assert!( + param + .mask_gen + .assert_algorithm_oid(db::rfc5912::ID_MGF_1) + .is_ok() + ); + assert!( + param + .mask_gen + .parameters + .unwrap() + .assert_algorithm_oid(db::rfc5912::ID_SHA_256) + .is_ok() + ); + assert!( + param + .p_source + .assert_algorithm_oid(db::rfc5912::ID_P_SPECIFIED) + .is_ok() + ); + assert!( + param + .p_source + .parameters_any() + .unwrap() + .decode_as::>() + .unwrap() + .is_empty(), + ); } #[test] @@ -162,36 +188,46 @@ fn encode_oaep_param() { fn decode_oaep_param_default() { let param = RsaOaepParams::try_from(RSA_OAEP_PARAMETERS_DEFAULTS).unwrap(); - assert!(param - .hash - .assert_algorithm_oid(db::rfc5912::ID_SHA_1) - .is_ok()); + assert!( + param + .hash + .assert_algorithm_oid(db::rfc5912::ID_SHA_1) + .is_ok() + ); assert_eq!(param.hash.parameters, Some(AnyRef::NULL)); - assert!(param - .mask_gen - .assert_algorithm_oid(db::rfc5912::ID_MGF_1) - .is_ok()); - assert!(param - .mask_gen - .parameters - .unwrap() - .assert_algorithm_oid(db::rfc5912::ID_SHA_1) - .is_ok()); + assert!( + param + .mask_gen + .assert_algorithm_oid(db::rfc5912::ID_MGF_1) + .is_ok() + ); + assert!( + param + .mask_gen + .parameters + .unwrap() + .assert_algorithm_oid(db::rfc5912::ID_SHA_1) + .is_ok() + ); assert_eq!( param.mask_gen.parameters.unwrap().parameters, Some(AnyRef::NULL) ); - assert!(param - .p_source - .assert_algorithm_oid(db::rfc5912::ID_P_SPECIFIED) - .is_ok()); - assert!(param - .p_source - .parameters_any() - .unwrap() - .decode_as::>() - .unwrap() - .is_empty(),); + assert!( + param + .p_source + .assert_algorithm_oid(db::rfc5912::ID_P_SPECIFIED) + .is_ok() + ); + assert!( + param + .p_source + .parameters_any() + .unwrap() + .decode_as::>() + .unwrap() + .is_empty(), + ); assert_eq!(param, Default::default()) } diff --git a/pkcs1/tests/private_key.rs b/pkcs1/tests/private_key.rs index f650534da..9253bc07a 100644 --- a/pkcs1/tests/private_key.rs +++ b/pkcs1/tests/private_key.rs @@ -22,14 +22,49 @@ fn decode_rsa2048_der() { // Extracted using: // $ openssl asn1parse -in tests/examples/rsa2048-priv.pem - assert_eq!(key.modulus.as_bytes(), hex!("B6C42C515F10A6AAF282C63EDBE24243A170F3FA2633BD4833637F47CA4F6F36E03A5D29EFC3191AC80F390D874B39E30F414FCEC1FCA0ED81E547EDC2CD382C76F61C9018973DB9FA537972A7C701F6B77E0982DFC15FC01927EE5E7CD94B4F599FF07013A7C8281BDF22DCBC9AD7CABB7C4311C982F58EDB7213AD4558B332266D743AED8192D1884CADB8B14739A8DADA66DC970806D9C7AC450CB13D0D7C575FB198534FC61BC41BC0F0574E0E0130C7BBBFBDFDC9F6A6E2E3E2AFF1CBEAC89BA57884528D55CFB08327A1E8C89F4E003CF2888E933241D9D695BCBBACDC90B44E3E095FA37058EA25B13F5E295CBEAC6DE838AB8C50AF61E298975B872F")); + assert_eq!( + key.modulus.as_bytes(), + hex!( + "B6C42C515F10A6AAF282C63EDBE24243A170F3FA2633BD4833637F47CA4F6F36E03A5D29EFC3191AC80F390D874B39E30F414FCEC1FCA0ED81E547EDC2CD382C76F61C9018973DB9FA537972A7C701F6B77E0982DFC15FC01927EE5E7CD94B4F599FF07013A7C8281BDF22DCBC9AD7CABB7C4311C982F58EDB7213AD4558B332266D743AED8192D1884CADB8B14739A8DADA66DC970806D9C7AC450CB13D0D7C575FB198534FC61BC41BC0F0574E0E0130C7BBBFBDFDC9F6A6E2E3E2AFF1CBEAC89BA57884528D55CFB08327A1E8C89F4E003CF2888E933241D9D695BCBBACDC90B44E3E095FA37058EA25B13F5E295CBEAC6DE838AB8C50AF61E298975B872F" + ) + ); assert_eq!(key.public_exponent.as_bytes(), hex!("010001")); - assert_eq!(key.private_exponent.as_bytes(), hex!("7ECC8362C0EDB0741164215E22F74AB9D91BA06900700CF63690E5114D8EE6BDCFBB2E3F9614692A677A083F168A5E52E5968E6407B9D97C6E0E4064F82DA0B758A14F17B9B7D41F5F48E28D6551704F56E69E7AA9FA630FC76428C06D25E455DCFC55B7AC2B4F76643FDED3FE15FF78ABB27E65ACC4AAD0BDF6DB27EF60A6910C5C4A085ED43275AB19C1D997A32C6EFFCE7DF2D1935F6E601EEDE161A12B5CC27CA21F81D2C99C3D1EA08E90E3053AB09BEFA724DEF0D0C3A3C1E9740C0D9F76126A149EC0AA7D8078205484254D951DB07C4CF91FB6454C096588FD5924DBABEB359CA2025268D004F9D66EB3D6F7ADC1139BAD40F16DDE639E11647376C1")); - assert_eq!(key.prime1.as_bytes(), hex!("DCC061242D4E92AFAEE72AC513CA65B9F77036F9BD7E0E6E61461A7EF7654225EC153C7E5C31A6157A6E5A13FF6E178E8758C1CB33D9D6BBE3179EF18998E422ECDCBED78F4ECFDBE5F4FCD8AEC2C9D0DC86473CA9BD16D9D238D21FB5DDEFBEB143CA61D0BD6AA8D91F33A097790E9640DBC91085DC5F26343BA3138F6B2D67")); - assert_eq!(key.prime2.as_bytes(), hex!("D3F314757E40E954836F92BE24236AF2F0DA04A34653C180AF67E960086D93FDE65CB23EFD9D09374762F5981E361849AF68CDD75394FF6A4E06EB69B209E4228DB2DFA70E40F7F9750A528176647B788D0E5777A2CB8B22E3CD267FF70B4F3B02D3AAFB0E18C590A564B03188B0AA5FC48156B07622214243BD1227EFA7F2F9")); - assert_eq!(key.exponent1.as_bytes(), hex!("CE68B7AC1B0D100D636E55488753C5C09843FDB390E2705DF7689457C9BD8D9765E30978617E2EFC8048F4C324206DB86087B654E97BB3D464E7EE3F8CD83FE10436F7DF18E9A963C4E64911D67EDE34042F2E26E3D3A1AD346ADAD6B9B7F67708CB094E62DEE9FF4D5D6669AF988AF2255D1CE8ED317C6A7D8691DA354D12DB")); - assert_eq!(key.exponent2.as_bytes(), hex!("25F6E5944220286B4DFBBF4235C0EE5843D2198091895120D6CA7B200B826D3ECE738E2E00498FAC0A2A6CA969C7F0C3CA1AB0BC40297132BE7538D7BEDF4CB0EFC6B98EF7DBA54F56AA99AABCE534C49C27947D4678C51C63C78C7CE1687231B4C8EB587AE6EF0480CBAF4FC0173CFD587A7E67AF515FB9B9DE751118397229")); - assert_eq!(key.coefficient.as_bytes(), hex!("31995406D406207CADEAEA35B38D040C5F8A9A1AE0827E9ED06B153D83B6821935B4B36A82BE9D56C791B58C27271A5793D53A1D657C08997960B1433E5171987F452F144A7C72306D63E1D3FFC0B71B75AB08F2E45A482E988451CBE478E12EB228D07456C924B66F6CED048D853F533E31A68614F1C3CE6D8EC9983CE72AF7")); + assert_eq!( + key.private_exponent.as_bytes(), + hex!( + "7ECC8362C0EDB0741164215E22F74AB9D91BA06900700CF63690E5114D8EE6BDCFBB2E3F9614692A677A083F168A5E52E5968E6407B9D97C6E0E4064F82DA0B758A14F17B9B7D41F5F48E28D6551704F56E69E7AA9FA630FC76428C06D25E455DCFC55B7AC2B4F76643FDED3FE15FF78ABB27E65ACC4AAD0BDF6DB27EF60A6910C5C4A085ED43275AB19C1D997A32C6EFFCE7DF2D1935F6E601EEDE161A12B5CC27CA21F81D2C99C3D1EA08E90E3053AB09BEFA724DEF0D0C3A3C1E9740C0D9F76126A149EC0AA7D8078205484254D951DB07C4CF91FB6454C096588FD5924DBABEB359CA2025268D004F9D66EB3D6F7ADC1139BAD40F16DDE639E11647376C1" + ) + ); + assert_eq!( + key.prime1.as_bytes(), + hex!( + "DCC061242D4E92AFAEE72AC513CA65B9F77036F9BD7E0E6E61461A7EF7654225EC153C7E5C31A6157A6E5A13FF6E178E8758C1CB33D9D6BBE3179EF18998E422ECDCBED78F4ECFDBE5F4FCD8AEC2C9D0DC86473CA9BD16D9D238D21FB5DDEFBEB143CA61D0BD6AA8D91F33A097790E9640DBC91085DC5F26343BA3138F6B2D67" + ) + ); + assert_eq!( + key.prime2.as_bytes(), + hex!( + "D3F314757E40E954836F92BE24236AF2F0DA04A34653C180AF67E960086D93FDE65CB23EFD9D09374762F5981E361849AF68CDD75394FF6A4E06EB69B209E4228DB2DFA70E40F7F9750A528176647B788D0E5777A2CB8B22E3CD267FF70B4F3B02D3AAFB0E18C590A564B03188B0AA5FC48156B07622214243BD1227EFA7F2F9" + ) + ); + assert_eq!( + key.exponent1.as_bytes(), + hex!( + "CE68B7AC1B0D100D636E55488753C5C09843FDB390E2705DF7689457C9BD8D9765E30978617E2EFC8048F4C324206DB86087B654E97BB3D464E7EE3F8CD83FE10436F7DF18E9A963C4E64911D67EDE34042F2E26E3D3A1AD346ADAD6B9B7F67708CB094E62DEE9FF4D5D6669AF988AF2255D1CE8ED317C6A7D8691DA354D12DB" + ) + ); + assert_eq!( + key.exponent2.as_bytes(), + hex!( + "25F6E5944220286B4DFBBF4235C0EE5843D2198091895120D6CA7B200B826D3ECE738E2E00498FAC0A2A6CA969C7F0C3CA1AB0BC40297132BE7538D7BEDF4CB0EFC6B98EF7DBA54F56AA99AABCE534C49C27947D4678C51C63C78C7CE1687231B4C8EB587AE6EF0480CBAF4FC0173CFD587A7E67AF515FB9B9DE751118397229" + ) + ); + assert_eq!( + key.coefficient.as_bytes(), + hex!( + "31995406D406207CADEAEA35B38D040C5F8A9A1AE0827E9ED06B153D83B6821935B4B36A82BE9D56C791B58C27271A5793D53A1D657C08997960B1433E5171987F452F144A7C72306D63E1D3FFC0B71B75AB08F2E45A482E988451CBE478E12EB228D07456C924B66F6CED048D853F533E31A68614F1C3CE6D8EC9983CE72AF7" + ) + ); assert!(key.other_prime_infos.is_none()); } @@ -40,14 +75,49 @@ fn decode_rsa4096_der() { // Extracted using: // $ openssl asn1parse -in tests/examples/rsa4096-priv.pem - assert_eq!(key.modulus.as_bytes(), hex!("A7A74572811EA2617E49E85BD730DDE30F103F7D88EE3F765E540D3DD993BBB0BA140002859D0B40897436637F58B828EA74DF8321634077F99D4AA2D54CA375852EF597661D3713CE1EF3B4FD6A8E220238E467668A2C7EE3861D2212AE6A1EBDDFA88B62DF10F6BCF79EFF4AC298FB2563DF1B8764381AF9B1FB0CCD085E026B0AD9F6721A235177D0396B48754AD4A75242250A873BF2F6E7EE3C75DD613E365BA4F3210A6CC66B90A2FA3F762CA6884087B6BF8161EB144819F0F572F21F6C8E273E70D45A365B8B2819CE734613CC23B01329A17901F17078403861F54C52A051E2A58C75C2D9D80091BB9808A106C1F7ECB4034E15058BEEC725C5F919D62EAA234B62628D346C60BB919E70851DAB38571E6F0ED7634129F994EA368FEE7373DFDEC04445EBCA47FA20ED1540A860C948BABC98DA591CA1DE2E2E25540EF9B7CB353F60213B814A45D359EFA9B811EEFF08C65993BF8A85C2BFEAAA7ED5E6B43E18AE604464CE5F96150136E7D09F8B24FAD43D7870118CFA7BC24875506EBBC321B977E0861AEA50128620121F0B394A9CDD0A42411A1350C0770D975D71B00A90436240C967A0C3A5C20A0F6DE77F3F2CAFDA94ED0143C1F6E34F73E0CAC279EEEB7C637723A2B026C82802E1A4AEBAA8846DF98E7919498773E0D4F319956F4DE3AAD00EFB9A147D66B3AC1A01D35B2CFB48D400B0E7A80DC97551")); + assert_eq!( + key.modulus.as_bytes(), + hex!( + "A7A74572811EA2617E49E85BD730DDE30F103F7D88EE3F765E540D3DD993BBB0BA140002859D0B40897436637F58B828EA74DF8321634077F99D4AA2D54CA375852EF597661D3713CE1EF3B4FD6A8E220238E467668A2C7EE3861D2212AE6A1EBDDFA88B62DF10F6BCF79EFF4AC298FB2563DF1B8764381AF9B1FB0CCD085E026B0AD9F6721A235177D0396B48754AD4A75242250A873BF2F6E7EE3C75DD613E365BA4F3210A6CC66B90A2FA3F762CA6884087B6BF8161EB144819F0F572F21F6C8E273E70D45A365B8B2819CE734613CC23B01329A17901F17078403861F54C52A051E2A58C75C2D9D80091BB9808A106C1F7ECB4034E15058BEEC725C5F919D62EAA234B62628D346C60BB919E70851DAB38571E6F0ED7634129F994EA368FEE7373DFDEC04445EBCA47FA20ED1540A860C948BABC98DA591CA1DE2E2E25540EF9B7CB353F60213B814A45D359EFA9B811EEFF08C65993BF8A85C2BFEAAA7ED5E6B43E18AE604464CE5F96150136E7D09F8B24FAD43D7870118CFA7BC24875506EBBC321B977E0861AEA50128620121F0B394A9CDD0A42411A1350C0770D975D71B00A90436240C967A0C3A5C20A0F6DE77F3F2CAFDA94ED0143C1F6E34F73E0CAC279EEEB7C637723A2B026C82802E1A4AEBAA8846DF98E7919498773E0D4F319956F4DE3AAD00EFB9A147D66B3AC1A01D35B2CFB48D400B0E7A80DC97551" + ) + ); assert_eq!(key.public_exponent.as_bytes(), hex!("010001")); - assert_eq!(key.private_exponent.as_bytes(), hex!("9FE3097B2322B90FAB6606C017A095EBE640C39C100BCEE02F238FA14DAFF38E9E57568F1127ED4436126B904631B127EC395BB3EE127EB82C88D2562A7FB55FED8D1450B7E4E2D2F37F5742636FCC6F289963522D5B5706082CADFA01C0EE99B4D0E9274D3A992E06974CBE01694686356962AC1959FD9BD447E5B9968C0543DF1BF134742AF345CDB2FA1F9371B0D4CF61C68D16D653D8E999D4FD3A16CF978A35AA40E860CDCE09655DD8B4CF19D4141B1E92AD5E51A8E4A5C27FA745611D90E49D0E9282222AB6F126643E1C77578816FCE3B98F321D2549F294A470DF8453446BF36F985DF25ED8FDE9FDF3073FB27727DF48E9E1FC7056BC78965090B7850126406462C8253051EF84E34EE3C3CEB8F96C658C38BE45558D2F64E29D223350555FC1EFA28EC1F4AFB5BA4080F09A86CDC3538C1AD7C972E6D7A3612E6845BA9AFBDF19F09060D1A779DE9635E2D2F8E0C510BA24C6C44B30C9BDFAF85BE917AEC5D43AFAB1AA3ADD33CC83DA93CAC69218F6A36EB47F199D5424C95FD9ED7B1E8BE2AEAA6433B227241316C20EE792650CEB48BFD634446B19D286B4EA1722498DA1A36973210EC3824751A5808D9AAEF59C449E19A5077CFECA126BD9A8DD4996561D4E27B3609FF82C5B1B21E627845D44961B33B875D5C4FA9FF357EF6BE3364969E1337C91B29A07B9A913CDE40CE2D5530C900E73751685E65431")); - assert_eq!(key.prime1.as_bytes(), hex!("D0213A79425B665B719118448893EC3275600F63DBF85B77F4E8E99EF302F6E82596048F6DCA772DE6BBF1124DB84B0AFE61B03A8604AB0079ED53F3304797AD01B38C44FE27A5A45E378483A804B56A4A967F48F01A866E721E67E4C9A1048AF68927FAA43D6A85D93E7BF7074DBA797563FCABE12309B76653C6DB614DC231CC556D9F25AC4841A02D31CDF3015B212307F9D0C79FEB5D3956CE53CC8FA1651BE60761F19F74672489EAF9F215409F39956E77A82183F1F72BB2FEDDF1B9FBFC4AD89EA445809DDBD5BD595277990C0BE9366FBB2ECF7B057CC1C3DC8FB77BF8456D07BBC95B3C1815F48E62B81468C3D4D9D96C0F48DAB04993BE8D91EDE5")); - assert_eq!(key.prime2.as_bytes(), hex!("CE36C6810522ABE5D6465F36EB137DA3B9EA4A5F1D27C6614729EB8E5E2E5CB88E3EF1A473A21944B66557B3DC2CE462E4BF3446CB4990037E5672B1705CBAE81B65BAF967A266DC18EFE80F4DBBFE1A59063205CE2943CADF421CCE74AF7063FD1A83AF3C39AF84525F59BDC1FF54815F52AFD1E8D4862B2C3654F6CFA83DC08E2A9D52B9F833C646AF7694467DFC5F7D7AD7B441895FCB7FFBED526324B0154A15823F5107C89548EDDCB61DA5308C6CC834D4A0C16DFA6CA1D67B61A65677EB1719CD125D0EF0DB8802FB76CFC17577BCB2510AE294E1BF8A9173A2B85C16A6B508C98F2D770B7F3DE48D9E720C53E263680B57E7109410015745570652FD")); - assert_eq!(key.exponent1.as_bytes(), hex!("748B46CD03E55E69B22C476488FE1BF31D5ACF0361F7AE707B89B8D832C7E42E966D6CDC4BE465DC2429F5920447406E4587BA40EB2ECDFA944BDB08806E7676804F642A760F096803021F88019BB16275A5D45CA9669104638EB72A9BE538400051493BC6A04577F1F055463CA6BFD6A76F77DB5F54596A83384250322A72A5A3FFEA4485B9F5341A57745E18C7179A749D50BC222C60857148347D243D016936B816463820CBF3BDB825061512E57EC3A5F397B9641B187109DD4F6E449F9A84E9FC66C921CA259B2612C363B468D5200E5557377FBCDAEC75B1A2D56CFC97C4AC4BA35AFA23C680CE3A8548AE3F6F72C94BBBBE10C900FC5A170B4B06FE29")); - assert_eq!(key.exponent2.as_bytes(), hex!("75CA4E0B069EEE67C3C4C0C082F8C82C8C96EAD277B9EF94436D0B936FF2B59DEA0AC446B6926232A0A934B6954EC34A45F57DEBEE54DFC14F1A1C3B84BE43392FE5252F2F6651B0E941A8618D7A93C4031409E0CD093F2313F214B84D68A51F48452BF11DCAA99A40DF1C48CB1688F3B93A6719D510086F82BAAA3FAD1021EDEA872704491C209EE26379AD6AB2AE44F14D09077AE3F8672A7D01EBAC9C19449FE3B7596974B3BBAA43CC6DEE731C4F2A18162D5A8202CB27E02DBE9E61C0449171C9981D2430D39DE28C298D8D50A943B2F27C5E665CBAB2897959FF19A5E87E632C58CDC31F9BDE9BC100AFFFDF50CF210F1E63A0A6149D2BD6E8D1B3D815")); - assert_eq!(key.coefficient.as_bytes(), hex!("8C557C4835E8B4066606A5DC255DBC3EB5F1586C7328988C8E242403F9575EFB0D28012C0634B7241768AD722049382906D635AFCB1D2A05BDFFC805FE670389B7FA90D65F94AFBC2008D9BC0D3CCEE425DFC72402050603C9F579EE8510ECC693AC6DD32836B6E15E3DC520366A1BA4AFC91D3E48A4D6724CA42443F4803E3B12634B0438572D8E13BC72F1A82853B8D9FCA6199D7A90AB64D9E79F793AC287F9A19011082A5268F209332D54D98D6E19030907FD9E6B82EF124677BA08AD6797A442213D097A351C50A08928DD732D6B29A6CF6706DAF5F20F78F87170FB279403C5221B5E5C70C2BAA0E69A72E0D1F3267DBD8C9BDDFF28AFA92F37C98D36")); + assert_eq!( + key.private_exponent.as_bytes(), + hex!( + "9FE3097B2322B90FAB6606C017A095EBE640C39C100BCEE02F238FA14DAFF38E9E57568F1127ED4436126B904631B127EC395BB3EE127EB82C88D2562A7FB55FED8D1450B7E4E2D2F37F5742636FCC6F289963522D5B5706082CADFA01C0EE99B4D0E9274D3A992E06974CBE01694686356962AC1959FD9BD447E5B9968C0543DF1BF134742AF345CDB2FA1F9371B0D4CF61C68D16D653D8E999D4FD3A16CF978A35AA40E860CDCE09655DD8B4CF19D4141B1E92AD5E51A8E4A5C27FA745611D90E49D0E9282222AB6F126643E1C77578816FCE3B98F321D2549F294A470DF8453446BF36F985DF25ED8FDE9FDF3073FB27727DF48E9E1FC7056BC78965090B7850126406462C8253051EF84E34EE3C3CEB8F96C658C38BE45558D2F64E29D223350555FC1EFA28EC1F4AFB5BA4080F09A86CDC3538C1AD7C972E6D7A3612E6845BA9AFBDF19F09060D1A779DE9635E2D2F8E0C510BA24C6C44B30C9BDFAF85BE917AEC5D43AFAB1AA3ADD33CC83DA93CAC69218F6A36EB47F199D5424C95FD9ED7B1E8BE2AEAA6433B227241316C20EE792650CEB48BFD634446B19D286B4EA1722498DA1A36973210EC3824751A5808D9AAEF59C449E19A5077CFECA126BD9A8DD4996561D4E27B3609FF82C5B1B21E627845D44961B33B875D5C4FA9FF357EF6BE3364969E1337C91B29A07B9A913CDE40CE2D5530C900E73751685E65431" + ) + ); + assert_eq!( + key.prime1.as_bytes(), + hex!( + "D0213A79425B665B719118448893EC3275600F63DBF85B77F4E8E99EF302F6E82596048F6DCA772DE6BBF1124DB84B0AFE61B03A8604AB0079ED53F3304797AD01B38C44FE27A5A45E378483A804B56A4A967F48F01A866E721E67E4C9A1048AF68927FAA43D6A85D93E7BF7074DBA797563FCABE12309B76653C6DB614DC231CC556D9F25AC4841A02D31CDF3015B212307F9D0C79FEB5D3956CE53CC8FA1651BE60761F19F74672489EAF9F215409F39956E77A82183F1F72BB2FEDDF1B9FBFC4AD89EA445809DDBD5BD595277990C0BE9366FBB2ECF7B057CC1C3DC8FB77BF8456D07BBC95B3C1815F48E62B81468C3D4D9D96C0F48DAB04993BE8D91EDE5" + ) + ); + assert_eq!( + key.prime2.as_bytes(), + hex!( + "CE36C6810522ABE5D6465F36EB137DA3B9EA4A5F1D27C6614729EB8E5E2E5CB88E3EF1A473A21944B66557B3DC2CE462E4BF3446CB4990037E5672B1705CBAE81B65BAF967A266DC18EFE80F4DBBFE1A59063205CE2943CADF421CCE74AF7063FD1A83AF3C39AF84525F59BDC1FF54815F52AFD1E8D4862B2C3654F6CFA83DC08E2A9D52B9F833C646AF7694467DFC5F7D7AD7B441895FCB7FFBED526324B0154A15823F5107C89548EDDCB61DA5308C6CC834D4A0C16DFA6CA1D67B61A65677EB1719CD125D0EF0DB8802FB76CFC17577BCB2510AE294E1BF8A9173A2B85C16A6B508C98F2D770B7F3DE48D9E720C53E263680B57E7109410015745570652FD" + ) + ); + assert_eq!( + key.exponent1.as_bytes(), + hex!( + "748B46CD03E55E69B22C476488FE1BF31D5ACF0361F7AE707B89B8D832C7E42E966D6CDC4BE465DC2429F5920447406E4587BA40EB2ECDFA944BDB08806E7676804F642A760F096803021F88019BB16275A5D45CA9669104638EB72A9BE538400051493BC6A04577F1F055463CA6BFD6A76F77DB5F54596A83384250322A72A5A3FFEA4485B9F5341A57745E18C7179A749D50BC222C60857148347D243D016936B816463820CBF3BDB825061512E57EC3A5F397B9641B187109DD4F6E449F9A84E9FC66C921CA259B2612C363B468D5200E5557377FBCDAEC75B1A2D56CFC97C4AC4BA35AFA23C680CE3A8548AE3F6F72C94BBBBE10C900FC5A170B4B06FE29" + ) + ); + assert_eq!( + key.exponent2.as_bytes(), + hex!( + "75CA4E0B069EEE67C3C4C0C082F8C82C8C96EAD277B9EF94436D0B936FF2B59DEA0AC446B6926232A0A934B6954EC34A45F57DEBEE54DFC14F1A1C3B84BE43392FE5252F2F6651B0E941A8618D7A93C4031409E0CD093F2313F214B84D68A51F48452BF11DCAA99A40DF1C48CB1688F3B93A6719D510086F82BAAA3FAD1021EDEA872704491C209EE26379AD6AB2AE44F14D09077AE3F8672A7D01EBAC9C19449FE3B7596974B3BBAA43CC6DEE731C4F2A18162D5A8202CB27E02DBE9E61C0449171C9981D2430D39DE28C298D8D50A943B2F27C5E665CBAB2897959FF19A5E87E632C58CDC31F9BDE9BC100AFFFDF50CF210F1E63A0A6149D2BD6E8D1B3D815" + ) + ); + assert_eq!( + key.coefficient.as_bytes(), + hex!( + "8C557C4835E8B4066606A5DC255DBC3EB5F1586C7328988C8E242403F9575EFB0D28012C0634B7241768AD722049382906D635AFCB1D2A05BDFFC805FE670389B7FA90D65F94AFBC2008D9BC0D3CCEE425DFC72402050603C9F579EE8510ECC693AC6DD32836B6E15E3DC520366A1BA4AFC91D3E48A4D6724CA42443F4803E3B12634B0438572D8E13BC72F1A82853B8D9FCA6199D7A90AB64D9E79F793AC287F9A19011082A5268F209332D54D98D6E19030907FD9E6B82EF124677BA08AD6797A442213D097A351C50A08928DD732D6B29A6CF6706DAF5F20F78F87170FB279403C5221B5E5C70C2BAA0E69A72E0D1F3267DBD8C9BDDFF28AFA92F37C98D36" + ) + ); assert!(key.other_prime_infos.is_none()); } @@ -66,20 +136,70 @@ fn decode_rsa2048_multi_prime_der() { // Extracted using: // $ openssl asn1parse -in tests/examples/rsa2048-priv-3prime.pem - assert_eq!(key.modulus.as_bytes(), hex!("E8BF46480D9144E93D0E7971554F7EF45FB25B83A1069416DB8EC7C654EB489C695A3274EE4B5F3A08E35BA6D1FF2EC487CE544641EA0C0994CC554D2201308E3AC6491326183F477D30F165001800B38771BF96F69DE6D461A6E2F88057104FCDD6C6A1B69E7F95A27DAC0CBAE39CC1F9264C09DFEEA68477482C2816133012BA29A0D617FA6C6B70FAC3BEDCB020CB1F6EA3375163988E7F8C9474B5462C24D2B56BC03F9ED002E43C764B1E7B05C31EC7D8E91582CEC0942F396DAB94F3162D1AAA041DA99CEE90B81FF408BB75B7B233B19D34E504E258C1D774706E4C5FC2B11F97C9E4CEEAC345F8C57C3D3702F73FC98F7EED688812BE9B560618C245")); + assert_eq!( + key.modulus.as_bytes(), + hex!( + "E8BF46480D9144E93D0E7971554F7EF45FB25B83A1069416DB8EC7C654EB489C695A3274EE4B5F3A08E35BA6D1FF2EC487CE544641EA0C0994CC554D2201308E3AC6491326183F477D30F165001800B38771BF96F69DE6D461A6E2F88057104FCDD6C6A1B69E7F95A27DAC0CBAE39CC1F9264C09DFEEA68477482C2816133012BA29A0D617FA6C6B70FAC3BEDCB020CB1F6EA3375163988E7F8C9474B5462C24D2B56BC03F9ED002E43C764B1E7B05C31EC7D8E91582CEC0942F396DAB94F3162D1AAA041DA99CEE90B81FF408BB75B7B233B19D34E504E258C1D774706E4C5FC2B11F97C9E4CEEAC345F8C57C3D3702F73FC98F7EED688812BE9B560618C245" + ) + ); assert_eq!(key.public_exponent.as_bytes(), hex!("010001")); - assert_eq!(key.private_exponent.as_bytes(), hex!("51ADA6656CD579207CFBD2649272B673DE0D828E1BF96A08E77E20DF9A3783A0D85BFDEF091D4C4ADA89A74550D6C3BBD688F30C40DF78DFF7E7095C6B3D8DA3AC3E9FB067A304B9FAD62D30ABAAC0BC40210C025759A374034864308AF6E444C6BEEA4FEA12DB78A9705A0F0C8B732B3FD733C5877A871ECC58FAB25D4236D0C91F207D6FC79ED5568658623984EF992C85EA7BFFC7F8C18368E644289198B64CF368C0FDEFFA7E24B65D895B701F8AF70AEAB0BB7D2E14C4354E15BE4723EC885DF146D7B0C6D2844C14DF639DDA9C7933FFFBD5AE2308B2A9CE7E6C52E3766106B8FEF8D593B88491BCED68632045E0E2FB889A58ED2FF28B6E5E2082BB01")); - assert_eq!(key.prime1.as_bytes(), hex!("07EA41E3B0B6FA6337D8D254B21F06C237FDAA6442B3B2756A479B27273CECCFBB5F472AA5D941E11DA1AAEB176450FC044EA639EF6E6B77B530D98A43ACF2D39571714EED516BBF43A7079E640CA46AE640CCAE46B5")); - assert_eq!(key.prime2.as_bytes(), hex!("077E9210399453F1F9D6AD862B4D83EE8651F92354BC4F22B1A5376ED36FE80DCFDDF73CEEB326972265B5CAC21E2F5FF22F09E6EA0AF358540004D6D1EF3A82BE214D206B25F98F0F3BAF8CD4F25D7169ACC99809A9")); - assert_eq!(key.exponent1.as_bytes(), hex!("02362298C27C2D73615C345033C0557C1876C88FE0CF227289F25DD84FAF471F3764049756E55FF1CCFCA9ABABCA7C921D85F80DC1E72121BE3F5AD8B5D5F1B6CA4F7AF0298091514C4EB3E33E6305E1545A109634ED")); - assert_eq!(key.exponent2.as_bytes(), hex!("830FFD55C1A13E6D7FD1D8D18A7911C9513E40C0A02093D128E53187F62417157527579D42D5C70B4D816EB976106C7081F01E3B2CC654E9601AF485E0DED161A5AABC2535B1E7A8F5BDD75410BE7B69E9A8D7DF09")); - assert_eq!(key.coefficient.as_bytes(), hex!("03B54C52199604D9A920B1B7AB95F0B474BA46796CC46C3E63C483499071BFADC0D27321EBD53E09271F28646B7590C97102F9E458A93B3A024A03565BCAFFA15F73C05BBF9653BE23224A1E35524A9895641C76FD2E")); + assert_eq!( + key.private_exponent.as_bytes(), + hex!( + "51ADA6656CD579207CFBD2649272B673DE0D828E1BF96A08E77E20DF9A3783A0D85BFDEF091D4C4ADA89A74550D6C3BBD688F30C40DF78DFF7E7095C6B3D8DA3AC3E9FB067A304B9FAD62D30ABAAC0BC40210C025759A374034864308AF6E444C6BEEA4FEA12DB78A9705A0F0C8B732B3FD733C5877A871ECC58FAB25D4236D0C91F207D6FC79ED5568658623984EF992C85EA7BFFC7F8C18368E644289198B64CF368C0FDEFFA7E24B65D895B701F8AF70AEAB0BB7D2E14C4354E15BE4723EC885DF146D7B0C6D2844C14DF639DDA9C7933FFFBD5AE2308B2A9CE7E6C52E3766106B8FEF8D593B88491BCED68632045E0E2FB889A58ED2FF28B6E5E2082BB01" + ) + ); + assert_eq!( + key.prime1.as_bytes(), + hex!( + "07EA41E3B0B6FA6337D8D254B21F06C237FDAA6442B3B2756A479B27273CECCFBB5F472AA5D941E11DA1AAEB176450FC044EA639EF6E6B77B530D98A43ACF2D39571714EED516BBF43A7079E640CA46AE640CCAE46B5" + ) + ); + assert_eq!( + key.prime2.as_bytes(), + hex!( + "077E9210399453F1F9D6AD862B4D83EE8651F92354BC4F22B1A5376ED36FE80DCFDDF73CEEB326972265B5CAC21E2F5FF22F09E6EA0AF358540004D6D1EF3A82BE214D206B25F98F0F3BAF8CD4F25D7169ACC99809A9" + ) + ); + assert_eq!( + key.exponent1.as_bytes(), + hex!( + "02362298C27C2D73615C345033C0557C1876C88FE0CF227289F25DD84FAF471F3764049756E55FF1CCFCA9ABABCA7C921D85F80DC1E72121BE3F5AD8B5D5F1B6CA4F7AF0298091514C4EB3E33E6305E1545A109634ED" + ) + ); + assert_eq!( + key.exponent2.as_bytes(), + hex!( + "830FFD55C1A13E6D7FD1D8D18A7911C9513E40C0A02093D128E53187F62417157527579D42D5C70B4D816EB976106C7081F01E3B2CC654E9601AF485E0DED161A5AABC2535B1E7A8F5BDD75410BE7B69E9A8D7DF09" + ) + ); + assert_eq!( + key.coefficient.as_bytes(), + hex!( + "03B54C52199604D9A920B1B7AB95F0B474BA46796CC46C3E63C483499071BFADC0D27321EBD53E09271F28646B7590C97102F9E458A93B3A024A03565BCAFFA15F73C05BBF9653BE23224A1E35524A9895641C76FD2E" + ) + ); let other_prime_infos = key.other_prime_infos.unwrap(); assert_eq!(other_prime_infos.len(), 1); - assert_eq!(other_prime_infos[0].prime.as_bytes(), hex!("03EC75532FB0D2CA142632618EA698548D8489FE30A868D637A1D53895C79F16A63ADB60DB217DDC0D95694A3D95D029D1A9A2DF548ED105B2C6A84855739EDBC3CE82906500241D518A3172F8D470FADD4E1DFE5969")); - assert_eq!(other_prime_infos[0].exponent.as_bytes(), hex!("03A11508A3E52FA4412CEF8EF34EBF39FE48690758647DCC1F5B2E890F69BC8A4BA9C73F78912B047F00038AEB1A069897D90BD0FD3AB8B6479D9F0C8115D80BB8BAEC63B9387F2F2B3BE2EF509FD7FD02F47DA3C579")); - assert_eq!(other_prime_infos[0].coefficient.as_bytes(), hex!("39EA226CABFB317E41A5593B9168D1A0124993B45D9CD14A22BD1557CDCB43D28024AC26ED2C8530B53E9B93A878F428807C5282EBB811399F913017CDF2149013D80CDF73F609D6C692475EB7A123D0E93E6A60FC")); + assert_eq!( + other_prime_infos[0].prime.as_bytes(), + hex!( + "03EC75532FB0D2CA142632618EA698548D8489FE30A868D637A1D53895C79F16A63ADB60DB217DDC0D95694A3D95D029D1A9A2DF548ED105B2C6A84855739EDBC3CE82906500241D518A3172F8D470FADD4E1DFE5969" + ) + ); + assert_eq!( + other_prime_infos[0].exponent.as_bytes(), + hex!( + "03A11508A3E52FA4412CEF8EF34EBF39FE48690758647DCC1F5B2E890F69BC8A4BA9C73F78912B047F00038AEB1A069897D90BD0FD3AB8B6479D9F0C8115D80BB8BAEC63B9387F2F2B3BE2EF509FD7FD02F47DA3C579" + ) + ); + assert_eq!( + other_prime_infos[0].coefficient.as_bytes(), + hex!( + "39EA226CABFB317E41A5593B9168D1A0124993B45D9CD14A22BD1557CDCB43D28024AC26ED2C8530B53E9B93A878F428807C5282EBB811399F913017CDF2149013D80CDF73F609D6C692475EB7A123D0E93E6A60FC" + ) + ); } #[test] @@ -89,6 +209,11 @@ fn private_key_to_public_key() { // Extracted using: // $ openssl asn1parse -in tests/examples/rsa2048-pub.pem - assert_eq!(public_key.modulus.as_bytes(), hex!("B6C42C515F10A6AAF282C63EDBE24243A170F3FA2633BD4833637F47CA4F6F36E03A5D29EFC3191AC80F390D874B39E30F414FCEC1FCA0ED81E547EDC2CD382C76F61C9018973DB9FA537972A7C701F6B77E0982DFC15FC01927EE5E7CD94B4F599FF07013A7C8281BDF22DCBC9AD7CABB7C4311C982F58EDB7213AD4558B332266D743AED8192D1884CADB8B14739A8DADA66DC970806D9C7AC450CB13D0D7C575FB198534FC61BC41BC0F0574E0E0130C7BBBFBDFDC9F6A6E2E3E2AFF1CBEAC89BA57884528D55CFB08327A1E8C89F4E003CF2888E933241D9D695BCBBACDC90B44E3E095FA37058EA25B13F5E295CBEAC6DE838AB8C50AF61E298975B872F")); + assert_eq!( + public_key.modulus.as_bytes(), + hex!( + "B6C42C515F10A6AAF282C63EDBE24243A170F3FA2633BD4833637F47CA4F6F36E03A5D29EFC3191AC80F390D874B39E30F414FCEC1FCA0ED81E547EDC2CD382C76F61C9018973DB9FA537972A7C701F6B77E0982DFC15FC01927EE5E7CD94B4F599FF07013A7C8281BDF22DCBC9AD7CABB7C4311C982F58EDB7213AD4558B332266D743AED8192D1884CADB8B14739A8DADA66DC970806D9C7AC450CB13D0D7C575FB198534FC61BC41BC0F0574E0E0130C7BBBFBDFDC9F6A6E2E3E2AFF1CBEAC89BA57884528D55CFB08327A1E8C89F4E003CF2888E933241D9D695BCBBACDC90B44E3E095FA37058EA25B13F5E295CBEAC6DE838AB8C50AF61E298975B872F" + ) + ); assert_eq!(public_key.public_exponent.as_bytes(), hex!("010001")); } diff --git a/pkcs1/tests/public_key.rs b/pkcs1/tests/public_key.rs index cde6e41ff..f3e480e82 100644 --- a/pkcs1/tests/public_key.rs +++ b/pkcs1/tests/public_key.rs @@ -26,7 +26,12 @@ fn decode_rsa2048_der() { // Extracted using: // $ openssl asn1parse -in tests/examples/rsa2048-pub.pem - assert_eq!(key.modulus.as_bytes(), hex!("B6C42C515F10A6AAF282C63EDBE24243A170F3FA2633BD4833637F47CA4F6F36E03A5D29EFC3191AC80F390D874B39E30F414FCEC1FCA0ED81E547EDC2CD382C76F61C9018973DB9FA537972A7C701F6B77E0982DFC15FC01927EE5E7CD94B4F599FF07013A7C8281BDF22DCBC9AD7CABB7C4311C982F58EDB7213AD4558B332266D743AED8192D1884CADB8B14739A8DADA66DC970806D9C7AC450CB13D0D7C575FB198534FC61BC41BC0F0574E0E0130C7BBBFBDFDC9F6A6E2E3E2AFF1CBEAC89BA57884528D55CFB08327A1E8C89F4E003CF2888E933241D9D695BCBBACDC90B44E3E095FA37058EA25B13F5E295CBEAC6DE838AB8C50AF61E298975B872F")); + assert_eq!( + key.modulus.as_bytes(), + hex!( + "B6C42C515F10A6AAF282C63EDBE24243A170F3FA2633BD4833637F47CA4F6F36E03A5D29EFC3191AC80F390D874B39E30F414FCEC1FCA0ED81E547EDC2CD382C76F61C9018973DB9FA537972A7C701F6B77E0982DFC15FC01927EE5E7CD94B4F599FF07013A7C8281BDF22DCBC9AD7CABB7C4311C982F58EDB7213AD4558B332266D743AED8192D1884CADB8B14739A8DADA66DC970806D9C7AC450CB13D0D7C575FB198534FC61BC41BC0F0574E0E0130C7BBBFBDFDC9F6A6E2E3E2AFF1CBEAC89BA57884528D55CFB08327A1E8C89F4E003CF2888E933241D9D695BCBBACDC90B44E3E095FA37058EA25B13F5E295CBEAC6DE838AB8C50AF61E298975B872F" + ) + ); assert_eq!(key.public_exponent.as_bytes(), hex!("010001")); } @@ -36,7 +41,12 @@ fn decode_rsa4096_der() { // Extracted using: // $ openssl asn1parse -in tests/examples/rsa4096-pub.pem - assert_eq!(key.modulus.as_bytes(), hex!("A7A74572811EA2617E49E85BD730DDE30F103F7D88EE3F765E540D3DD993BBB0BA140002859D0B40897436637F58B828EA74DF8321634077F99D4AA2D54CA375852EF597661D3713CE1EF3B4FD6A8E220238E467668A2C7EE3861D2212AE6A1EBDDFA88B62DF10F6BCF79EFF4AC298FB2563DF1B8764381AF9B1FB0CCD085E026B0AD9F6721A235177D0396B48754AD4A75242250A873BF2F6E7EE3C75DD613E365BA4F3210A6CC66B90A2FA3F762CA6884087B6BF8161EB144819F0F572F21F6C8E273E70D45A365B8B2819CE734613CC23B01329A17901F17078403861F54C52A051E2A58C75C2D9D80091BB9808A106C1F7ECB4034E15058BEEC725C5F919D62EAA234B62628D346C60BB919E70851DAB38571E6F0ED7634129F994EA368FEE7373DFDEC04445EBCA47FA20ED1540A860C948BABC98DA591CA1DE2E2E25540EF9B7CB353F60213B814A45D359EFA9B811EEFF08C65993BF8A85C2BFEAAA7ED5E6B43E18AE604464CE5F96150136E7D09F8B24FAD43D7870118CFA7BC24875506EBBC321B977E0861AEA50128620121F0B394A9CDD0A42411A1350C0770D975D71B00A90436240C967A0C3A5C20A0F6DE77F3F2CAFDA94ED0143C1F6E34F73E0CAC279EEEB7C637723A2B026C82802E1A4AEBAA8846DF98E7919498773E0D4F319956F4DE3AAD00EFB9A147D66B3AC1A01D35B2CFB48D400B0E7A80DC97551")); + assert_eq!( + key.modulus.as_bytes(), + hex!( + "A7A74572811EA2617E49E85BD730DDE30F103F7D88EE3F765E540D3DD993BBB0BA140002859D0B40897436637F58B828EA74DF8321634077F99D4AA2D54CA375852EF597661D3713CE1EF3B4FD6A8E220238E467668A2C7EE3861D2212AE6A1EBDDFA88B62DF10F6BCF79EFF4AC298FB2563DF1B8764381AF9B1FB0CCD085E026B0AD9F6721A235177D0396B48754AD4A75242250A873BF2F6E7EE3C75DD613E365BA4F3210A6CC66B90A2FA3F762CA6884087B6BF8161EB144819F0F572F21F6C8E273E70D45A365B8B2819CE734613CC23B01329A17901F17078403861F54C52A051E2A58C75C2D9D80091BB9808A106C1F7ECB4034E15058BEEC725C5F919D62EAA234B62628D346C60BB919E70851DAB38571E6F0ED7634129F994EA368FEE7373DFDEC04445EBCA47FA20ED1540A860C948BABC98DA591CA1DE2E2E25540EF9B7CB353F60213B814A45D359EFA9B811EEFF08C65993BF8A85C2BFEAAA7ED5E6B43E18AE604464CE5F96150136E7D09F8B24FAD43D7870118CFA7BC24875506EBBC321B977E0861AEA50128620121F0B394A9CDD0A42411A1350C0770D975D71B00A90436240C967A0C3A5C20A0F6DE77F3F2CAFDA94ED0143C1F6E34F73E0CAC279EEEB7C637723A2B026C82802E1A4AEBAA8846DF98E7919498773E0D4F319956F4DE3AAD00EFB9A147D66B3AC1A01D35B2CFB48D400B0E7A80DC97551" + ) + ); assert_eq!(key.public_exponent.as_bytes(), hex!("010001")); } diff --git a/pkcs12/Cargo.lock b/pkcs12/Cargo.lock new file mode 100644 index 000000000..a692f5172 --- /dev/null +++ b/pkcs12/Cargo.lock @@ -0,0 +1,600 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +version = 3 + +[[package]] +name = "aead" +version = "0.6.0-rc.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b5f451b77e2f92932dc411da6ef9f3d33efad68a6f14a7a83e559453458e85ac" +dependencies = [ + "crypto-common", +] + +[[package]] +name = "aes" +version = "0.9.0-pre.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e7856582c758ade85d71daf27ec6bcea6c1c73913692b07b8dffea2dc03531c9" +dependencies = [ + "cfg-if", + "cipher", + "cpufeatures", +] + +[[package]] +name = "aes-gcm" +version = "0.11.0-pre.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0cce27af05d45b901bb28da33ff8b2b2b2044f595b24fc0f36d4882dae91d484" +dependencies = [ + "aead", + "aes", + "cipher", + "ctr", + "ghash", + "subtle", +] + +[[package]] +name = "base64ct" +version = "1.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8c3c1a368f70d6cf7302d78f8f7093da241fb8e8807c05cc9e51a125895a6d5b" + +[[package]] +name = "bitflags" +version = "2.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8f68f53c83ab957f72c32642f3868eec03eb974d1fb82e453128456482613d36" + +[[package]] +name = "block-buffer" +version = "0.11.0-rc.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3fd016a0ddc7cb13661bf5576073ce07330a693f8608a1320b4e20561cc12cdc" +dependencies = [ + "hybrid-array", +] + +[[package]] +name = "block-padding" +version = "0.4.0-rc.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6868e23cd7a5b2e18fb2e9a583910b88b8d645dd21017aafc5d0439cf16ae6d6" +dependencies = [ + "hybrid-array", +] + +[[package]] +name = "cbc" +version = "0.2.0-pre.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e0729a0a8422deb6056b8fcd89c42b724fe27e69458fa006f00c63cbffffd91b" +dependencies = [ + "cipher", +] + +[[package]] +name = "cfg-if" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" + +[[package]] +name = "cipher" +version = "0.5.0-pre.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5b1425e6ce000f05a73096556cabcfb6a10a3ffe3bb4d75416ca8f00819c0b6a" +dependencies = [ + "crypto-common", + "inout", +] + +[[package]] +name = "cms" +version = "0.3.0-pre.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "956098b1603285c33972193d6f62c8389d3d8548693a4077baa08ff0a8da97c7" +dependencies = [ + "const-oid", + "der", + "spki", + "x509-cert", +] + +[[package]] +name = "const-oid" +version = "0.10.0-rc.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "68ff6be19477a1bd5441f382916a89bc2a0b2c35db6d41e0f6e8538bf6d6463f" + +[[package]] +name = "cpufeatures" +version = "0.2.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "59ed5838eebb26a2bb2e58f6d5b5316989ae9d08bab10e0e6d103e656d1b0280" +dependencies = [ + "libc", +] + +[[package]] +name = "crypto-common" +version = "0.2.0-rc.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b0b8ce8218c97789f16356e7896b3714f26c2ee1079b79c0b7ae7064bb9089fa" +dependencies = [ + "getrandom 0.2.15", + "hybrid-array", + "rand_core 0.6.4", +] + +[[package]] +name = "ctr" +version = "0.10.0-pre.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "77e1482d284b80d7fddb211666d513dc5e23b0cc3a03ad398ff70543827c789f" +dependencies = [ + "cipher", +] + +[[package]] +name = "der" +version = "0.8.0-rc.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "82db698b33305f0134faf590b9d1259dc171b5481ac41d5c8146c3b3ee7d4319" +dependencies = [ + "const-oid", + "der_derive", + "flagset", + "pem-rfc7468", + "zeroize", +] + +[[package]] +name = "der_derive" +version = "0.8.0-rc.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "211bea8bb45f5f61bc857104606913ef8ac8b5ec698143aa2aa96a7ffdc94991" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "des" +version = "0.9.0-pre.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "76239c731adb4b5204cfeec47bd06ec1071d9477a0d32bbb83dc7d8c599efe63" +dependencies = [ + "cipher", +] + +[[package]] +name = "digest" +version = "0.11.0-pre.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cf2e3d6615d99707295a9673e889bf363a04b2a466bd320c65a72536f7577379" +dependencies = [ + "block-buffer", + "const-oid", + "crypto-common", + "subtle", +] + +[[package]] +name = "flagset" +version = "0.4.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b3ea1ec5f8307826a5b71094dd91fc04d4ae75d5709b20ad351c7fb4815c86ec" + +[[package]] +name = "getrandom" +version = "0.2.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c4567c8db10ae91089c99af84c68c38da3ec2f087c3f82960bcdbf3656b6f4d7" +dependencies = [ + "cfg-if", + "libc", + "wasi 0.11.0+wasi-snapshot-preview1", +] + +[[package]] +name = "getrandom" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "43a49c392881ce6d5c3b8cb70f98717b7c07aabbdff06687b9030dbfbe2725f8" +dependencies = [ + "cfg-if", + "libc", + "wasi 0.13.3+wasi-0.2.2", + "windows-targets", +] + +[[package]] +name = "ghash" +version = "0.6.0-rc.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3b92860fda25ab571512af210134cde2c42732cd53253bcee3f21b288b7afbc4" +dependencies = [ + "opaque-debug", + "polyval", +] + +[[package]] +name = "hex-literal" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6fe2267d4ed49bc07b63801559be28c718ea06c4738b7a03c94df7386d2cde46" + +[[package]] +name = "hmac" +version = "0.13.0-pre.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e4b1fb14e4df79f9406b434b60acef9f45c26c50062cccf1346c6103b8c47d58" +dependencies = [ + "digest", +] + +[[package]] +name = "hybrid-array" +version = "0.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f2d35805454dc9f8662a98d6d61886ffe26bd465f5960e0e55345c70d5c0d2a9" +dependencies = [ + "typenum", +] + +[[package]] +name = "inout" +version = "0.2.0-rc.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "de49db00f5add6dad75a57946b75de0f26287a6fc95f4f277d48419200422beb" +dependencies = [ + "block-padding", + "hybrid-array", +] + +[[package]] +name = "libc" +version = "0.2.170" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "875b3680cb2f8f71bdcf9a30f38d48282f5d3c95cbf9b3fa57269bb5d5c06828" + +[[package]] +name = "opaque-debug" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c08d65885ee38876c4f86fa503fb49d7b507c2b62552df7c70b2fce627e06381" + +[[package]] +name = "pbkdf2" +version = "0.13.0-pre.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "85e11753d5193f26dc27ae698e0b536b5e511b7799c5ac475ec10783f26d164a" +dependencies = [ + "digest", + "hmac", +] + +[[package]] +name = "pem-rfc7468" +version = "1.0.0-rc.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c2dfbfa5c6f0906884269722c5478e72fd4d6c0e24fe600332c6d62359567ce1" +dependencies = [ + "base64ct", +] + +[[package]] +name = "pkcs12" +version = "0.2.0-pre" +dependencies = [ + "cms", + "const-oid", + "der", + "digest", + "hex-literal", + "pkcs5", + "pkcs8", + "sha2", + "spki", + "whirlpool", + "x509-cert", + "zeroize", +] + +[[package]] +name = "pkcs5" +version = "0.8.0-rc.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5aa3d51fbc9292364f5a5562f11461a85529236166f1b4b6baba894fc44119ca" +dependencies = [ + "aes", + "aes-gcm", + "cbc", + "der", + "des", + "pbkdf2", + "rand_core 0.9.2", + "scrypt", + "sha2", + "spki", +] + +[[package]] +name = "pkcs8" +version = "0.11.0-rc.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f22636de7c995e997ed3d8d2949b7414d4faba3efa7312a6c0e75d875a14bdd4" +dependencies = [ + "der", + "pkcs5", + "rand_core 0.9.2", + "spki", +] + +[[package]] +name = "polyval" +version = "0.7.0-rc.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b01cbf5c028f9f862c6f7f5a5544307d7858634df190488d432ec470c8fbc063" +dependencies = [ + "cfg-if", + "cpufeatures", + "opaque-debug", + "universal-hash", +] + +[[package]] +name = "proc-macro2" +version = "1.0.93" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "60946a68e5f9d28b0dc1c21bb8a97ee7d018a8b322fa57838ba31cc878e22d99" +dependencies = [ + "unicode-ident", +] + +[[package]] +name = "quote" +version = "1.0.38" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0e4dccaaaf89514f546c693ddc140f729f958c247918a13380cccc6078391acc" +dependencies = [ + "proc-macro2", +] + +[[package]] +name = "rand_core" +version = "0.6.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c" +dependencies = [ + "getrandom 0.2.15", +] + +[[package]] +name = "rand_core" +version = "0.9.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7a509b1a2ffbe92afab0e55c8fd99dea1c280e8171bd2d88682bb20bc41cbc2c" +dependencies = [ + "getrandom 0.3.1", + "zerocopy", +] + +[[package]] +name = "salsa20" +version = "0.11.0-pre.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1affa54a576c40080654b494bb3f3198fa2fe46e0954b85196d122e3561c2fd0" +dependencies = [ + "cfg-if", + "cipher", +] + +[[package]] +name = "scrypt" +version = "0.12.0-pre.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8a91394d9fa36fde88b8b976973db9fe6a0e4b32eea79f0ca13ba1b818daa3b2" +dependencies = [ + "pbkdf2", + "salsa20", + "sha2", +] + +[[package]] +name = "sha2" +version = "0.11.0-pre.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "540c0893cce56cdbcfebcec191ec8e0f470dd1889b6e7a0b503e310a94a168f5" +dependencies = [ + "cfg-if", + "cpufeatures", + "digest", +] + +[[package]] +name = "spki" +version = "0.8.0-rc.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "37ac66481418fd7afdc584adcf3be9aa572cf6c2858814494dc2a01755f050bc" +dependencies = [ + "base64ct", + "der", +] + +[[package]] +name = "subtle" +version = "2.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "13c2bddecc57b384dee18652358fb23172facb8a2c51ccc10d74c157bdea3292" + +[[package]] +name = "syn" +version = "2.0.98" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "36147f1a48ae0ec2b5b3bc5b537d267457555a10dc06f3dbc8cb11ba3006d3b1" +dependencies = [ + "proc-macro2", + "quote", + "unicode-ident", +] + +[[package]] +name = "typenum" +version = "1.18.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1dccffe3ce07af9386bfd29e80c0ab1a8205a2fc34e4bcd40364df902cfa8f3f" + +[[package]] +name = "unicode-ident" +version = "1.0.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "00e2473a93778eb0bad35909dff6a10d28e63f792f16ed15e404fca9d5eeedbe" + +[[package]] +name = "universal-hash" +version = "0.6.0-rc.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3517d72c5ca6d60f9f2e85d2c772e2652830062a685105a528d19dd823cf87d5" +dependencies = [ + "crypto-common", + "subtle", +] + +[[package]] +name = "wasi" +version = "0.11.0+wasi-snapshot-preview1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" + +[[package]] +name = "wasi" +version = "0.13.3+wasi-0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "26816d2e1a4a36a2940b96c5296ce403917633dff8f3440e9b236ed6f6bacad2" +dependencies = [ + "wit-bindgen-rt", +] + +[[package]] +name = "whirlpool" +version = "0.11.0-pre.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e6a50f4a23b3461a8731a33838634270ed638b266a4d5cbf0215eefce1f0fa08" +dependencies = [ + "digest", +] + +[[package]] +name = "windows-targets" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9b724f72796e036ab90c1021d4780d4d3d648aca59e491e6b98e725b84e99973" +dependencies = [ + "windows_aarch64_gnullvm", + "windows_aarch64_msvc", + "windows_i686_gnu", + "windows_i686_gnullvm", + "windows_i686_msvc", + "windows_x86_64_gnu", + "windows_x86_64_gnullvm", + "windows_x86_64_msvc", +] + +[[package]] +name = "windows_aarch64_gnullvm" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "32a4622180e7a0ec044bb555404c800bc9fd9ec262ec147edd5989ccd0c02cd3" + +[[package]] +name = "windows_aarch64_msvc" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "09ec2a7bb152e2252b53fa7803150007879548bc709c039df7627cabbd05d469" + +[[package]] +name = "windows_i686_gnu" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8e9b5ad5ab802e97eb8e295ac6720e509ee4c243f69d781394014ebfe8bbfa0b" + +[[package]] +name = "windows_i686_gnullvm" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0eee52d38c090b3caa76c563b86c3a4bd71ef1a819287c19d586d7334ae8ed66" + +[[package]] +name = "windows_i686_msvc" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "240948bc05c5e7c6dabba28bf89d89ffce3e303022809e73deaefe4f6ec56c66" + +[[package]] +name = "windows_x86_64_gnu" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "147a5c80aabfbf0c7d901cb5895d1de30ef2907eb21fbbab29ca94c5b08b1a78" + +[[package]] +name = "windows_x86_64_gnullvm" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "24d5b23dc417412679681396f2b49f3de8c1473deb516bd34410872eff51ed0d" + +[[package]] +name = "windows_x86_64_msvc" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec" + +[[package]] +name = "wit-bindgen-rt" +version = "0.33.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3268f3d866458b787f390cf61f4bbb563b922d091359f9608842999eaee3943c" +dependencies = [ + "bitflags", +] + +[[package]] +name = "x509-cert" +version = "0.3.0-pre.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2db382aa43c1fb5c419a960f72c3847ab0f383f635fc2e25f0bd6c5fb94371d1" +dependencies = [ + "const-oid", + "der", + "spki", +] + +[[package]] +name = "zerocopy" +version = "0.8.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dde3bb8c68a8f3f1ed4ac9221aad6b10cece3e60a8e2ea54a6a2dec806d0084c" +dependencies = [ + "zerocopy-derive", +] + +[[package]] +name = "zerocopy-derive" +version = "0.8.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "eea57037071898bf96a6da35fd626f4f27e9cee3ead2a6c703cf09d472b2e700" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "zeroize" +version = "1.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ced3678a2879b30306d323f4542626697a464a97c0a07c9aebf7ebca65cd4dde" diff --git a/pkcs12/Cargo.toml b/pkcs12/Cargo.toml index caf669e56..af3995764 100644 --- a/pkcs12/Cargo.toml +++ b/pkcs12/Cargo.toml @@ -12,8 +12,8 @@ repository = "https://github.com/RustCrypto/formats" categories = ["cryptography", "encoding", "no-std", "parser-implementations"] keywords = ["crypto", "key", "pkcs", "private"] readme = "README.md" -edition = "2021" -rust-version = "1.81" +edition = "2024" +rust-version = "1.85" [dependencies] der = { version = "0.8.0-rc.0", features = ["alloc", "derive", "oid", "pem"] } @@ -27,7 +27,7 @@ digest = { version = "0.11.0-pre.9", features = ["alloc"], optional = true } zeroize = { version = "1.8.1", optional = true, default-features = false } [dev-dependencies] -hex-literal = "0.4" +hex-literal = "1" pkcs8 = { version = "0.11.0-rc.1", features = ["pkcs5", "getrandom"] } pkcs5 = { version = "0.8.0-rc.0", features = ["pbes2", "3des"] } sha2 = "=0.11.0-pre.4" diff --git a/pkcs12/README.md b/pkcs12/README.md index a599ce994..deafa0f87 100644 --- a/pkcs12/README.md +++ b/pkcs12/README.md @@ -12,13 +12,6 @@ Personal Information Exchange Syntax v1.1 ([RFC7292]). [Documentation][docs-link] -## Minimum Supported Rust Version - -This crate requires **Rust 1.75** at a minimum. - -We may change the MSRV in the future, but it will be accompanied by a minor -version bump. - ## License Licensed under either of: @@ -41,7 +34,7 @@ dual licensed as above, without any additional terms or conditions. [docs-image]: https://docs.rs/pkcs12/badge.svg [docs-link]: https://docs.rs/pkcs12/ [license-image]: https://img.shields.io/badge/license-Apache2.0/MIT-blue.svg -[rustc-image]: https://img.shields.io/badge/rustc-1.75+-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 [build-image]: https://github.com/RustCrypto/formats/workflows/pkcs12/badge.svg?branch=master&event=push diff --git a/pkcs12/src/cert_type.rs b/pkcs12/src/cert_type.rs index 7261c337e..7002867dc 100644 --- a/pkcs12/src/cert_type.rs +++ b/pkcs12/src/cert_type.rs @@ -1,7 +1,7 @@ //! CertBag-related types -use der::asn1::{ObjectIdentifier, OctetString}; use der::Sequence; +use der::asn1::{ObjectIdentifier, OctetString}; /// The `CertBag` type is defined in [RFC 7292 Section 4.2.3]. /// diff --git a/pkcs12/src/crl_type.rs b/pkcs12/src/crl_type.rs index b93ce5a6b..59beafdd9 100644 --- a/pkcs12/src/crl_type.rs +++ b/pkcs12/src/crl_type.rs @@ -1,7 +1,7 @@ //! CertBag-related types -use der::asn1::{ObjectIdentifier, OctetString}; use der::Sequence; +use der::asn1::{ObjectIdentifier, OctetString}; /// The `CertBag` type is defined in [RFC 7292 Section 4.2.4]. /// diff --git a/pkcs12/src/digest_info.rs b/pkcs12/src/digest_info.rs index 2753ed3b2..75f3d88d0 100644 --- a/pkcs12/src/digest_info.rs +++ b/pkcs12/src/digest_info.rs @@ -1,6 +1,6 @@ //! DigestInfo-related types -use der::{asn1::OctetString, Sequence, ValueOrd}; +use der::{Sequence, ValueOrd, asn1::OctetString}; use spki::AlgorithmIdentifierOwned; /// ```text diff --git a/pkcs12/src/kdf.rs b/pkcs12/src/kdf.rs index 7c774f9cf..8443ae570 100644 --- a/pkcs12/src/kdf.rs +++ b/pkcs12/src/kdf.rs @@ -16,7 +16,7 @@ use alloc::{vec, vec::Vec}; use der::asn1::BmpString; -use digest::{core_api::BlockSizeUser, Digest, FixedOutputReset, OutputSizeUser, Update}; +use digest::{Digest, FixedOutputReset, OutputSizeUser, Update, core_api::BlockSizeUser}; use zeroize::{Zeroize, Zeroizing}; /// Specify the usage type of the generated key diff --git a/pkcs12/src/mac_data.rs b/pkcs12/src/mac_data.rs index 14a697fb0..8d0eea808 100644 --- a/pkcs12/src/mac_data.rs +++ b/pkcs12/src/mac_data.rs @@ -1,7 +1,7 @@ //! MacData-related types use crate::digest_info::DigestInfo; -use der::{asn1::OctetString, Sequence, ValueOrd}; +use der::{Sequence, ValueOrd, asn1::OctetString}; /// The `MacData` type is defined in [RFC 7292 Section 4]. /// diff --git a/pkcs12/src/pbe_params.rs b/pkcs12/src/pbe_params.rs index 2687d8c8b..6f0b04ecd 100644 --- a/pkcs12/src/pbe_params.rs +++ b/pkcs12/src/pbe_params.rs @@ -1,6 +1,6 @@ //! pkcs-12PbeParams implementation -use der::{asn1::OctetString, Sequence, ValueOrd}; +use der::{Sequence, ValueOrd, asn1::OctetString}; use spki::AlgorithmIdentifierOwned; /// The `pkcs-12PbeParams` type is defined in [RFC 7292 Appendix C]. diff --git a/pkcs12/tests/cert_tests.rs b/pkcs12/tests/cert_tests.rs index c25f8d390..44e55fe64 100644 --- a/pkcs12/tests/cert_tests.rs +++ b/pkcs12/tests/cert_tests.rs @@ -4,16 +4,16 @@ use const_oid::db::{ rfc5912::ID_SHA_256, }; use der::{ - asn1::{ContextSpecific, OctetString}, Decode, Encode, + asn1::{ContextSpecific, OctetString}, }; use hex_literal::hex; use pkcs8::{ + EncryptedPrivateKeyInfoRef, pkcs5::{ self, pbes2::{AES_256_CBC_OID, HMAC_WITH_SHA256_OID, PBES2_OID, PBKDF2_OID}, }, - EncryptedPrivateKeyInfoRef, }; use spki::AlgorithmIdentifierOwned; @@ -261,7 +261,12 @@ fn decode_sample_pfx() { // process mac data let mac_data = pfx.mac_data.unwrap(); assert_eq!(ID_SHA_256, mac_data.mac.algorithm.oid); - assert_eq!(hex!("10 06 A1 92 F8 EE F8 A4 A2 46 6F EB 87 16 69 57 B9 63 CD CB C9 DC D7 73 6F 47 3C BB 11 EC 00 D7"), mac_data.mac.digest.as_bytes()); + assert_eq!( + hex!( + "10 06 A1 92 F8 EE F8 A4 A2 46 6F EB 87 16 69 57 B9 63 CD CB C9 DC D7 73 6F 47 3C BB 11 EC 00 D7" + ), + mac_data.mac.digest.as_bytes() + ); assert_eq!( hex!("FF 08 ED 21 81 C8 A8 E3"), mac_data.mac_salt.as_bytes() @@ -648,7 +653,12 @@ fn decode_sample_pfx2() { // process mac data let mac_data = pfx.mac_data.unwrap(); assert_eq!(ID_SHA_256, mac_data.mac.algorithm.oid); - assert_eq!(hex!("BC 79 0E 04 37 14 F1 8F 9C 07 66 1D FE 53 82 E3 E7 F4 31 13 27 E4 C8 E7 61 D0 BA 7A EA 54 A8 A8"), mac_data.mac.digest.as_bytes()); + assert_eq!( + hex!( + "BC 79 0E 04 37 14 F1 8F 9C 07 66 1D FE 53 82 E3 E7 F4 31 13 27 E4 C8 E7 61 D0 BA 7A EA 54 A8 A8" + ), + mac_data.mac.digest.as_bytes() + ); assert_eq!( hex!("E1 14 4F 8C B4 AF B2 FE"), mac_data.mac_salt.as_bytes() diff --git a/pkcs12/tests/kdf.rs b/pkcs12/tests/kdf.rs index 8271380d5..6c5004125 100644 --- a/pkcs12/tests/kdf.rs +++ b/pkcs12/tests/kdf.rs @@ -4,7 +4,7 @@ /// See https://github.com/xemwebe/test_pkcs12_kdf for a sample program. /// use hex_literal::hex; -use pkcs12::kdf::{derive_key_utf8, Pkcs12KeyType}; +use pkcs12::kdf::{Pkcs12KeyType, derive_key_utf8}; #[test] fn pkcs12_key_derive_sha256() { @@ -105,13 +105,31 @@ fn pkcs12_key_derive_sha256() { ); assert_eq!( - derive_key_utf8::(PASS_SHORT, &SALT_INC, Pkcs12KeyType::EncryptionKey, 1000, 100).unwrap(), - hex!("2b95a0569b63f641fae1efca32e84db3699ab74540628ba66283b58cf5400527d8d0ebe2ccbf768c51c4d8fbd1bb156be06c1c59cbb69e44052ffc37376fdb47b2de7f9e543de9d096d8e5474b220410ff1c5d8bb7e5bc0f61baeaa12fd0da1d7a970172") + derive_key_utf8::( + PASS_SHORT, + &SALT_INC, + Pkcs12KeyType::EncryptionKey, + 1000, + 100 + ) + .unwrap(), + hex!( + "2b95a0569b63f641fae1efca32e84db3699ab74540628ba66283b58cf5400527d8d0ebe2ccbf768c51c4d8fbd1bb156be06c1c59cbb69e44052ffc37376fdb47b2de7f9e543de9d096d8e5474b220410ff1c5d8bb7e5bc0f61baeaa12fd0da1d7a970172" + ) ); assert_eq!( - derive_key_utf8::(PASS_SHORT, &SALT_INC, Pkcs12KeyType::EncryptionKey, 1000, 200).unwrap(), - hex!("2b95a0569b63f641fae1efca32e84db3699ab74540628ba66283b58cf5400527d8d0ebe2ccbf768c51c4d8fbd1bb156be06c1c59cbb69e44052ffc37376fdb47b2de7f9e543de9d096d8e5474b220410ff1c5d8bb7e5bc0f61baeaa12fd0da1d7a9701729cea6014d7fe62a2ed926dc36b61307f119d64edbceb5a9c58133bbf75ba0bef000a1a5180e4b1de7d89c89528bcb7899a1e46fd4da0d9de8f8e65e8d0d775e33d1247e76d596a34303161b219f39afda448bf518a2835fc5e28f0b55a1b6137a2c70cf7") + derive_key_utf8::( + PASS_SHORT, + &SALT_INC, + Pkcs12KeyType::EncryptionKey, + 1000, + 200 + ) + .unwrap(), + hex!( + "2b95a0569b63f641fae1efca32e84db3699ab74540628ba66283b58cf5400527d8d0ebe2ccbf768c51c4d8fbd1bb156be06c1c59cbb69e44052ffc37376fdb47b2de7f9e543de9d096d8e5474b220410ff1c5d8bb7e5bc0f61baeaa12fd0da1d7a9701729cea6014d7fe62a2ed926dc36b61307f119d64edbceb5a9c58133bbf75ba0bef000a1a5180e4b1de7d89c89528bcb7899a1e46fd4da0d9de8f8e65e8d0d775e33d1247e76d596a34303161b219f39afda448bf518a2835fc5e28f0b55a1b6137a2c70cf7" + ) ); } @@ -156,12 +174,14 @@ fn pkcs12_key_derive_special_chars() { const PASS_SHORT: &str = "🔥"; const SALT_INC: [u8; 8] = [0x1, 0x2, 0x3, 0x4, 0x5, 0x6, 0x7, 0x8]; - assert!(derive_key_utf8::( - PASS_SHORT, - &SALT_INC, - Pkcs12KeyType::EncryptionKey, - 100, - 32 - ) - .is_err()); // Emoji is not in the Basic Multilingual Plane + assert!( + derive_key_utf8::( + PASS_SHORT, + &SALT_INC, + Pkcs12KeyType::EncryptionKey, + 100, + 32 + ) + .is_err() + ); // Emoji is not in the Basic Multilingual Plane } diff --git a/pkcs5/Cargo.toml b/pkcs5/Cargo.toml index 6a24e8e2c..ce844a92c 100644 --- a/pkcs5/Cargo.toml +++ b/pkcs5/Cargo.toml @@ -12,8 +12,8 @@ repository = "https://github.com/RustCrypto/formats" categories = ["cryptography", "data-structures", "encoding", "no-std"] keywords = ["crypto", "key", "pkcs", "password"] readme = "README.md" -edition = "2021" -rust-version = "1.81" +edition = "2024" +rust-version = "1.85" [dependencies] der = { version = "0.8.0-rc.0", features = ["oid"] } @@ -31,7 +31,7 @@ sha1 = { version = "=0.11.0-pre.4", optional = true, default-features = false } sha2 = { version = "=0.11.0-pre.4", optional = true, default-features = false } [dev-dependencies] -hex-literal = "0.4" +hex-literal = "1" [features] alloc = [] diff --git a/pkcs5/README.md b/pkcs5/README.md index d0ae1f2ad..fe02a1770 100644 --- a/pkcs5/README.md +++ b/pkcs5/README.md @@ -12,13 +12,6 @@ Password-Based Cryptography Specification Version 2.1 ([RFC 8018]). [Documentation][docs-link] -## Minimum Supported Rust Version - -This crate requires **Rust 1.71** at a minimum. - -We may change the MSRV in the future, but it will be accompanied by a minor -version bump. - ## License Licensed under either of: diff --git a/pkcs5/src/pbes1.rs b/pkcs5/src/pbes1.rs index f68f485e4..b5e4afeaa 100644 --- a/pkcs5/src/pbes1.rs +++ b/pkcs5/src/pbes1.rs @@ -4,8 +4,8 @@ use crate::AlgorithmIdentifierRef; use der::{ - asn1::{AnyRef, ObjectIdentifier, OctetStringRef}, Decode, DecodeValue, Encode, EncodeValue, ErrorKind, Length, Reader, Sequence, Tag, Writer, + asn1::{AnyRef, ObjectIdentifier, OctetStringRef}, }; /// `pbeWithMD2AndDES-CBC` Object Identifier (OID). diff --git a/pkcs5/src/pbes2.rs b/pkcs5/src/pbes2.rs index 45df06be7..8e6c73057 100644 --- a/pkcs5/src/pbes2.rs +++ b/pkcs5/src/pbes2.rs @@ -8,14 +8,14 @@ mod kdf; mod encryption; pub use self::kdf::{ - Kdf, Pbkdf2Params, Pbkdf2Prf, Salt, ScryptParams, HMAC_WITH_SHA1_OID, HMAC_WITH_SHA256_OID, - PBKDF2_OID, SCRYPT_OID, + HMAC_WITH_SHA1_OID, HMAC_WITH_SHA256_OID, Kdf, PBKDF2_OID, Pbkdf2Params, Pbkdf2Prf, SCRYPT_OID, + Salt, ScryptParams, }; use crate::{AlgorithmIdentifierRef, Error, Result}; use der::{ - asn1::{AnyRef, ObjectIdentifier, OctetStringRef}, Decode, DecodeValue, Encode, EncodeValue, ErrorKind, Length, Reader, Sequence, Tag, Writer, + asn1::{AnyRef, ObjectIdentifier, OctetStringRef}, }; #[cfg(feature = "rand_core")] diff --git a/pkcs5/src/pbes2/encryption.rs b/pkcs5/src/pbes2/encryption.rs index 7413644f0..432f96a37 100644 --- a/pkcs5/src/pbes2/encryption.rs +++ b/pkcs5/src/pbes2/encryption.rs @@ -4,18 +4,18 @@ use super::{EncryptionScheme, Kdf, Parameters, Pbkdf2Params, Pbkdf2Prf, ScryptPa use crate::{Error, Result}; use aes_gcm::{AeadInPlace, KeyInit as GcmKeyInit, Nonce, Tag}; use cbc::cipher::{ - block_padding::Pkcs7, BlockCipherDecrypt, BlockCipherEncrypt, BlockModeDecrypt, - BlockModeEncrypt, KeyInit, KeyIvInit, + BlockCipherDecrypt, BlockCipherEncrypt, BlockModeDecrypt, BlockModeEncrypt, KeyInit, KeyIvInit, + block_padding::Pkcs7, }; use pbkdf2::{ hmac::{ + EagerHash, digest::{ + HashMarker, block_buffer::Eager, core_api::{BlockSizeUser, BufferKindUser, FixedOutputCore, UpdateCore}, typenum::{IsLess, Le, NonZero, U12, U16, U256}, - HashMarker, }, - EagerHash, }, pbkdf2_hmac, }; @@ -196,7 +196,7 @@ impl EncryptionKey { Pbkdf2Prf::HmacWithSha1 => { return Err(Error::UnsupportedAlgorithm { oid: super::HMAC_WITH_SHA1_OID, - }) + }); } Pbkdf2Prf::HmacWithSha224 => EncryptionKey::derive_with_pbkdf2::( password, diff --git a/pkcs5/src/pbes2/kdf.rs b/pkcs5/src/pbes2/kdf.rs index af39d7580..e17aad84b 100644 --- a/pkcs5/src/pbes2/kdf.rs +++ b/pkcs5/src/pbes2/kdf.rs @@ -6,9 +6,9 @@ pub use self::salt::Salt; use crate::{AlgorithmIdentifierRef, Error, Result}; use der::{ - asn1::{AnyRef, ObjectIdentifier}, Decode, DecodeValue, Encode, EncodeValue, ErrorKind, Length, Reader, Sequence, Tag, Tagged, Writer, + asn1::{AnyRef, ObjectIdentifier}, }; #[cfg(feature = "pbes2")] diff --git a/pkcs8/Cargo.toml b/pkcs8/Cargo.toml index 3a5300ece..d9b7aca90 100644 --- a/pkcs8/Cargo.toml +++ b/pkcs8/Cargo.toml @@ -13,8 +13,8 @@ repository = "https://github.com/RustCrypto/formats" categories = ["cryptography", "data-structures", "encoding", "no-std", "parser-implementations"] keywords = ["crypto", "key", "pkcs", "private"] readme = "README.md" -edition = "2021" -rust-version = "1.81" +edition = "2024" +rust-version = "1.85" [dependencies] der = { version = "0.8.0-rc.0", features = ["oid"] } @@ -26,7 +26,7 @@ pkcs5 = { version = "0.8.0-rc.0", optional = true, features = ["rand_core"] } subtle = { version = "2", optional = true, default-features = false } [dev-dependencies] -hex-literal = "0.4.1" +hex-literal = "1" tempfile = "3" [features] diff --git a/pkcs8/README.md b/pkcs8/README.md index a0629fc47..a66e84f6a 100644 --- a/pkcs8/README.md +++ b/pkcs8/README.md @@ -52,13 +52,6 @@ OpenSSL for the following algorithms: Please open an issue if you encounter trouble using it with a particular algorithm, including the ones listed above or other algorithms. -## Minimum Supported Rust Version - -This crate requires **Rust 1.71** at a minimum. - -We may change the MSRV in the future, but it will be accompanied by a minor -version bump. - ## License Licensed under either of: @@ -81,7 +74,7 @@ dual licensed as above, without any additional terms or conditions. [docs-image]: https://docs.rs/pkcs8/badge.svg [docs-link]: https://docs.rs/pkcs8/ [license-image]: https://img.shields.io/badge/license-Apache2.0/MIT-blue.svg -[rustc-image]: https://img.shields.io/badge/rustc-1.71+-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 [build-image]: https://github.com/RustCrypto/formats/workflows/pkcs8/badge.svg?branch=master&event=push diff --git a/pkcs8/src/encrypted_private_key_info.rs b/pkcs8/src/encrypted_private_key_info.rs index 423566d69..c32c25000 100644 --- a/pkcs8/src/encrypted_private_key_info.rs +++ b/pkcs8/src/encrypted_private_key_info.rs @@ -3,13 +3,13 @@ use crate::{Error, Result}; use core::fmt; use der::{ - asn1::OctetStringRef, Decode, DecodeValue, Encode, EncodeValue, FixedTag, Header, Length, - Reader, Sequence, Writer, + Decode, DecodeValue, Encode, EncodeValue, FixedTag, Header, Length, Reader, Sequence, Writer, + asn1::OctetStringRef, }; use pkcs5::EncryptionScheme; #[cfg(feature = "alloc")] -use der::{asn1::OctetString, SecretDocument}; +use der::{SecretDocument, asn1::OctetString}; #[cfg(feature = "encryption")] use {pkcs5::pbes2, rand_core::CryptoRng}; diff --git a/pkcs8/src/private_key_info.rs b/pkcs8/src/private_key_info.rs index 8fe923c81..343ce25c2 100644 --- a/pkcs8/src/private_key_info.rs +++ b/pkcs8/src/private_key_info.rs @@ -3,16 +3,16 @@ use crate::{Error, Result, Version}; use core::fmt; use der::{ - asn1::{AnyRef, BitStringRef, ContextSpecific, OctetStringRef}, Decode, DecodeValue, Encode, EncodeValue, FixedTag, Header, Length, Reader, Sequence, TagMode, TagNumber, Writer, + asn1::{AnyRef, BitStringRef, ContextSpecific, OctetStringRef}, }; use spki::AlgorithmIdentifier; #[cfg(feature = "alloc")] use der::{ - asn1::{Any, BitString, OctetString}, SecretDocument, + asn1::{Any, BitString, OctetString}, }; #[cfg(feature = "encryption")] diff --git a/pkcs8/tests/encrypted_private_key.rs b/pkcs8/tests/encrypted_private_key.rs index a1560d37c..e8af6a9ab 100644 --- a/pkcs8/tests/encrypted_private_key.rs +++ b/pkcs8/tests/encrypted_private_key.rs @@ -4,7 +4,7 @@ use der::asn1::OctetStringRef; use hex_literal::hex; -use pkcs8::{pkcs5::pbes2, EncryptedPrivateKeyInfoRef, PrivateKeyInfoRef}; +use pkcs8::{EncryptedPrivateKeyInfoRef, pkcs5::pbes2}; #[cfg(feature = "alloc")] use der::Encode; @@ -13,7 +13,7 @@ use der::Encode; use der::EncodePem; #[cfg(feature = "encryption")] -use pkcs8::EncryptedPrivateKeyInfoOwned; +use pkcs8::{EncryptedPrivateKeyInfoOwned, PrivateKeyInfoRef}; /// Ed25519 PKCS#8 private key plaintext encoded as ASN.1 DER #[cfg(feature = "encryption")] diff --git a/pkcs8/tests/private_key.rs b/pkcs8/tests/private_key.rs index 5bb4ce605..14e012b4e 100644 --- a/pkcs8/tests/private_key.rs +++ b/pkcs8/tests/private_key.rs @@ -8,7 +8,7 @@ use pkcs8::{PrivateKeyInfoRef, Version}; use der::Encode; #[cfg(feature = "pem")] -use der::{pem::LineEnding, EncodePem}; +use der::{EncodePem, pem::LineEnding}; /// Elliptic Curve (P-256) PKCS#8 private key encoded as ASN.1 DER const EC_P256_DER_EXAMPLE: &[u8] = include_bytes!("examples/p256-priv.der"); @@ -65,7 +65,12 @@ fn decode_ec_p256_der() { // Extracted with: // $ openssl asn1parse -inform der -in tests/examples/p256-priv.der - assert_eq!(pk.private_key.as_ref(), &hex!("306B020101042069624171561A63340DE0E7D869F2A05492558E1A04868B6A9F854A866788188DA144034200041CACFFB55F2F2CEFD89D89EB374B2681152452802DEEA09916068137D839CF7FC481A44492304D7EF66AC117BEFE83A8D08F155F2B52F9F618DD447029048E0F")[..]); + assert_eq!( + pk.private_key.as_ref(), + &hex!( + "306B020101042069624171561A63340DE0E7D869F2A05492558E1A04868B6A9F854A866788188DA144034200041CACFFB55F2F2CEFD89D89EB374B2681152452802DEEA09916068137D839CF7FC481A44492304D7EF66AC117BEFE83A8D08F155F2B52F9F618DD447029048E0F" + )[..] + ); } #[test] @@ -142,7 +147,12 @@ fn decode_rsa_2048_der() { // Extracted with: // $ openssl asn1parse -inform der -in tests/examples/rsa2048-priv.der - assert_eq!(pk.private_key.as_ref(), &hex!("308204A30201000282010100B6C42C515F10A6AAF282C63EDBE24243A170F3FA2633BD4833637F47CA4F6F36E03A5D29EFC3191AC80F390D874B39E30F414FCEC1FCA0ED81E547EDC2CD382C76F61C9018973DB9FA537972A7C701F6B77E0982DFC15FC01927EE5E7CD94B4F599FF07013A7C8281BDF22DCBC9AD7CABB7C4311C982F58EDB7213AD4558B332266D743AED8192D1884CADB8B14739A8DADA66DC970806D9C7AC450CB13D0D7C575FB198534FC61BC41BC0F0574E0E0130C7BBBFBDFDC9F6A6E2E3E2AFF1CBEAC89BA57884528D55CFB08327A1E8C89F4E003CF2888E933241D9D695BCBBACDC90B44E3E095FA37058EA25B13F5E295CBEAC6DE838AB8C50AF61E298975B872F0203010001028201007ECC8362C0EDB0741164215E22F74AB9D91BA06900700CF63690E5114D8EE6BDCFBB2E3F9614692A677A083F168A5E52E5968E6407B9D97C6E0E4064F82DA0B758A14F17B9B7D41F5F48E28D6551704F56E69E7AA9FA630FC76428C06D25E455DCFC55B7AC2B4F76643FDED3FE15FF78ABB27E65ACC4AAD0BDF6DB27EF60A6910C5C4A085ED43275AB19C1D997A32C6EFFCE7DF2D1935F6E601EEDE161A12B5CC27CA21F81D2C99C3D1EA08E90E3053AB09BEFA724DEF0D0C3A3C1E9740C0D9F76126A149EC0AA7D8078205484254D951DB07C4CF91FB6454C096588FD5924DBABEB359CA2025268D004F9D66EB3D6F7ADC1139BAD40F16DDE639E11647376C102818100DCC061242D4E92AFAEE72AC513CA65B9F77036F9BD7E0E6E61461A7EF7654225EC153C7E5C31A6157A6E5A13FF6E178E8758C1CB33D9D6BBE3179EF18998E422ECDCBED78F4ECFDBE5F4FCD8AEC2C9D0DC86473CA9BD16D9D238D21FB5DDEFBEB143CA61D0BD6AA8D91F33A097790E9640DBC91085DC5F26343BA3138F6B2D6702818100D3F314757E40E954836F92BE24236AF2F0DA04A34653C180AF67E960086D93FDE65CB23EFD9D09374762F5981E361849AF68CDD75394FF6A4E06EB69B209E4228DB2DFA70E40F7F9750A528176647B788D0E5777A2CB8B22E3CD267FF70B4F3B02D3AAFB0E18C590A564B03188B0AA5FC48156B07622214243BD1227EFA7F2F902818100CE68B7AC1B0D100D636E55488753C5C09843FDB390E2705DF7689457C9BD8D9765E30978617E2EFC8048F4C324206DB86087B654E97BB3D464E7EE3F8CD83FE10436F7DF18E9A963C4E64911D67EDE34042F2E26E3D3A1AD346ADAD6B9B7F67708CB094E62DEE9FF4D5D6669AF988AF2255D1CE8ED317C6A7D8691DA354D12DB02818025F6E5944220286B4DFBBF4235C0EE5843D2198091895120D6CA7B200B826D3ECE738E2E00498FAC0A2A6CA969C7F0C3CA1AB0BC40297132BE7538D7BEDF4CB0EFC6B98EF7DBA54F56AA99AABCE534C49C27947D4678C51C63C78C7CE1687231B4C8EB587AE6EF0480CBAF4FC0173CFD587A7E67AF515FB9B9DE75111839722902818031995406D406207CADEAEA35B38D040C5F8A9A1AE0827E9ED06B153D83B6821935B4B36A82BE9D56C791B58C27271A5793D53A1D657C08997960B1433E5171987F452F144A7C72306D63E1D3FFC0B71B75AB08F2E45A482E988451CBE478E12EB228D07456C924B66F6CED048D853F533E31A68614F1C3CE6D8EC9983CE72AF7")[..]); + assert_eq!( + pk.private_key.as_ref(), + &hex!( + "308204A30201000282010100B6C42C515F10A6AAF282C63EDBE24243A170F3FA2633BD4833637F47CA4F6F36E03A5D29EFC3191AC80F390D874B39E30F414FCEC1FCA0ED81E547EDC2CD382C76F61C9018973DB9FA537972A7C701F6B77E0982DFC15FC01927EE5E7CD94B4F599FF07013A7C8281BDF22DCBC9AD7CABB7C4311C982F58EDB7213AD4558B332266D743AED8192D1884CADB8B14739A8DADA66DC970806D9C7AC450CB13D0D7C575FB198534FC61BC41BC0F0574E0E0130C7BBBFBDFDC9F6A6E2E3E2AFF1CBEAC89BA57884528D55CFB08327A1E8C89F4E003CF2888E933241D9D695BCBBACDC90B44E3E095FA37058EA25B13F5E295CBEAC6DE838AB8C50AF61E298975B872F0203010001028201007ECC8362C0EDB0741164215E22F74AB9D91BA06900700CF63690E5114D8EE6BDCFBB2E3F9614692A677A083F168A5E52E5968E6407B9D97C6E0E4064F82DA0B758A14F17B9B7D41F5F48E28D6551704F56E69E7AA9FA630FC76428C06D25E455DCFC55B7AC2B4F76643FDED3FE15FF78ABB27E65ACC4AAD0BDF6DB27EF60A6910C5C4A085ED43275AB19C1D997A32C6EFFCE7DF2D1935F6E601EEDE161A12B5CC27CA21F81D2C99C3D1EA08E90E3053AB09BEFA724DEF0D0C3A3C1E9740C0D9F76126A149EC0AA7D8078205484254D951DB07C4CF91FB6454C096588FD5924DBABEB359CA2025268D004F9D66EB3D6F7ADC1139BAD40F16DDE639E11647376C102818100DCC061242D4E92AFAEE72AC513CA65B9F77036F9BD7E0E6E61461A7EF7654225EC153C7E5C31A6157A6E5A13FF6E178E8758C1CB33D9D6BBE3179EF18998E422ECDCBED78F4ECFDBE5F4FCD8AEC2C9D0DC86473CA9BD16D9D238D21FB5DDEFBEB143CA61D0BD6AA8D91F33A097790E9640DBC91085DC5F26343BA3138F6B2D6702818100D3F314757E40E954836F92BE24236AF2F0DA04A34653C180AF67E960086D93FDE65CB23EFD9D09374762F5981E361849AF68CDD75394FF6A4E06EB69B209E4228DB2DFA70E40F7F9750A528176647B788D0E5777A2CB8B22E3CD267FF70B4F3B02D3AAFB0E18C590A564B03188B0AA5FC48156B07622214243BD1227EFA7F2F902818100CE68B7AC1B0D100D636E55488753C5C09843FDB390E2705DF7689457C9BD8D9765E30978617E2EFC8048F4C324206DB86087B654E97BB3D464E7EE3F8CD83FE10436F7DF18E9A963C4E64911D67EDE34042F2E26E3D3A1AD346ADAD6B9B7F67708CB094E62DEE9FF4D5D6669AF988AF2255D1CE8ED317C6A7D8691DA354D12DB02818025F6E5944220286B4DFBBF4235C0EE5843D2198091895120D6CA7B200B826D3ECE738E2E00498FAC0A2A6CA969C7F0C3CA1AB0BC40297132BE7538D7BEDF4CB0EFC6B98EF7DBA54F56AA99AABCE534C49C27947D4678C51C63C78C7CE1687231B4C8EB587AE6EF0480CBAF4FC0173CFD587A7E67AF515FB9B9DE75111839722902818031995406D406207CADEAEA35B38D040C5F8A9A1AE0827E9ED06B153D83B6821935B4B36A82BE9D56C791B58C27271A5793D53A1D657C08997960B1433E5171987F452F144A7C72306D63E1D3FFC0B71B75AB08F2E45A482E988451CBE478E12EB228D07456C924B66F6CED048D853F533E31A68614F1C3CE6D8EC9983CE72AF7" + )[..] + ); } #[test] diff --git a/serdect/Cargo.toml b/serdect/Cargo.toml index 9a89e7a7a..417892d25 100644 --- a/serdect/Cargo.toml +++ b/serdect/Cargo.toml @@ -12,8 +12,8 @@ repository = "https://github.com/RustCrypto/formats" categories = ["cryptography", "encoding", "no-std", "parsing"] keywords = ["crypto", "constant-time", "serde"] readme = "README.md" -edition = "2021" -rust-version = "1.70" +edition = "2024" +rust-version = "1.85" [dependencies] base16ct = { version = "0.2", default-features = false } @@ -25,7 +25,7 @@ zeroize = { version = "1", optional = true, default-features = false } [dev-dependencies] bincode = "1" ciborium = "0.2" -hex-literal = "0.4" +hex-literal = "1" proptest = "1" rmp-serde = "1" serde = { version = "1.0.184", default-features = false, features = ["derive"] } diff --git a/serdect/README.md b/serdect/README.md index 89e5a1580..94fc057f6 100644 --- a/serdect/README.md +++ b/serdect/README.md @@ -39,14 +39,6 @@ help reduce the overall timing variability. - [`toml`](https://crates.io/crates/toml) v0.7 -## Minimum Supported Rust Version - -Rust **1.70** or newer. - -In the future, we reserve the right to change MSRV (i.e. MSRV is out-of-scope -for this crate's SemVer guarantees), however when we do it will be accompanied by -a minor version bump. - ## License Licensed under either of: @@ -69,7 +61,7 @@ dual licensed as above, without any additional terms or conditions. [docs-image]: https://docs.rs/serdect/badge.svg [docs-link]: https://docs.rs/serdect/ [license-image]: https://img.shields.io/badge/license-Apache2.0/MIT-blue.svg -[msrv-image]: https://img.shields.io/badge/rustc-1.70+-blue.svg +[msrv-image]: https://img.shields.io/badge/rustc-1.85+-blue.svg [build-image]: https://github.com/RustCrypto/formats/actions/workflows/serdect.yml/badge.svg [build-link]: https://github.com/RustCrypto/formats/actions/workflows/serdect.yml diff --git a/serdect/src/common.rs b/serdect/src/common.rs index ce6509a72..04fbdb8b4 100644 --- a/serdect/src/common.rs +++ b/serdect/src/common.rs @@ -2,8 +2,8 @@ use core::fmt; use core::marker::PhantomData; use serde::{ - de::{Error, Unexpected, Visitor}, Serializer, + de::{Error, Unexpected, Visitor}, }; #[cfg(feature = "alloc")] diff --git a/spki/Cargo.toml b/spki/Cargo.toml index 0efaa4af1..02b26324d 100644 --- a/spki/Cargo.toml +++ b/spki/Cargo.toml @@ -12,8 +12,8 @@ repository = "https://github.com/RustCrypto/formats" categories = ["cryptography", "data-structures", "encoding", "no-std"] keywords = ["crypto", "x509"] readme = "README.md" -edition = "2021" -rust-version = "1.81" +edition = "2024" +rust-version = "1.85" [dependencies] der = { version = "0.8.0-rc.0", features = ["oid"] } @@ -24,7 +24,7 @@ base64ct = { version = "1", optional = true, default-features = false } sha2 = { version = "=0.11.0-pre.4", optional = true, default-features = false } [dev-dependencies] -hex-literal = "0.4" +hex-literal = "1" tempfile = "3" [features] diff --git a/spki/README.md b/spki/README.md index d6da64b52..ee987cbbf 100644 --- a/spki/README.md +++ b/spki/README.md @@ -14,13 +14,6 @@ Specified in [RFC 5280 § 4.1]. [Documentation][docs-link] -## Minimum Supported Rust Version - -This crate requires **Rust 1.71** at a minimum. - -We may change the MSRV in the future, but it will be accompanied by a minor -version bump. - ## License Licensed under either of: @@ -45,7 +38,7 @@ dual licensed as above, without any additional terms or conditions. [build-image]: https://github.com/RustCrypto/formats/actions/workflows/spki.yml/badge.svg [build-link]: https://github.com/RustCrypto/formats/actions/workflows/spki.yml [license-image]: https://img.shields.io/badge/license-Apache2.0/MIT-blue.svg -[rustc-image]: https://img.shields.io/badge/rustc-1.71+-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 diff --git a/spki/src/algorithm.rs b/spki/src/algorithm.rs index 5cbc8b655..403bf942b 100644 --- a/spki/src/algorithm.rs +++ b/spki/src/algorithm.rs @@ -3,9 +3,9 @@ use crate::{Error, Result}; use core::cmp::Ordering; use der::{ - asn1::{AnyRef, Choice, ObjectIdentifier}, Decode, DecodeValue, DerOrd, Encode, EncodeValue, Header, Length, Reader, Sequence, ValueOrd, Writer, + asn1::{AnyRef, Choice, ObjectIdentifier}, }; #[cfg(feature = "alloc")] diff --git a/spki/src/spki.rs b/spki/src/spki.rs index b3f95346f..78fd5eac7 100644 --- a/spki/src/spki.rs +++ b/spki/src/spki.rs @@ -3,19 +3,19 @@ use crate::{AlgorithmIdentifier, Error, Result}; use core::cmp::Ordering; use der::{ - asn1::{AnyRef, BitStringRef}, Choice, Decode, DecodeValue, DerOrd, Encode, EncodeValue, FixedTag, Header, Length, Reader, Sequence, ValueOrd, Writer, + asn1::{AnyRef, BitStringRef}, }; #[cfg(feature = "alloc")] use der::{ - asn1::{Any, BitString}, Document, + asn1::{Any, BitString}, }; #[cfg(feature = "fingerprint")] -use crate::{fingerprint, FingerprintBytes}; +use crate::{FingerprintBytes, fingerprint}; #[cfg(feature = "pem")] use der::pem::PemLabel; diff --git a/spki/src/traits.rs b/spki/src/traits.rs index cf60bbde8..726974a1f 100644 --- a/spki/src/traits.rs +++ b/spki/src/traits.rs @@ -6,7 +6,7 @@ use der::{EncodeValue, Tagged}; #[cfg(feature = "alloc")] use { crate::AlgorithmIdentifierOwned, - der::{asn1::BitString, Any, Document}, + der::{Any, Document, asn1::BitString}, }; #[cfg(feature = "pem")] diff --git a/spki/tests/spki.rs b/spki/tests/spki.rs index 0b03f9fb6..f65fe15c0 100644 --- a/spki/tests/spki.rs +++ b/spki/tests/spki.rs @@ -11,7 +11,7 @@ use { }; #[cfg(feature = "pem")] -use der::{pem::LineEnding, EncodePem}; +use der::{EncodePem, pem::LineEnding}; /// Elliptic Curve (P-256) `SubjectPublicKeyInfo` encoded as ASN.1 DER const EC_P256_DER_EXAMPLE: &[u8] = include_bytes!("examples/p256-pub.der"); @@ -63,7 +63,12 @@ fn decode_ec_p256_der() { "1.2.840.10045.3.1.7".parse().unwrap() ); - assert_eq!(spki.subject_public_key.raw_bytes(), &hex!("041CACFFB55F2F2CEFD89D89EB374B2681152452802DEEA09916068137D839CF7FC481A44492304D7EF66AC117BEFE83A8D08F155F2B52F9F618DD447029048E0F")[..]); + assert_eq!( + spki.subject_public_key.raw_bytes(), + &hex!( + "041CACFFB55F2F2CEFD89D89EB374B2681152452802DEEA09916068137D839CF7FC481A44492304D7EF66AC117BEFE83A8D08F155F2B52F9F618DD447029048E0F" + )[..] + ); } #[test] @@ -112,7 +117,12 @@ fn decode_rsa_2048_der() { assert_eq!(spki.algorithm.oid, "1.2.840.113549.1.1.1".parse().unwrap()); assert!(spki.algorithm.parameters.unwrap().is_null()); - assert_eq!(spki.subject_public_key.raw_bytes(), &hex!("3082010A0282010100B6C42C515F10A6AAF282C63EDBE24243A170F3FA2633BD4833637F47CA4F6F36E03A5D29EFC3191AC80F390D874B39E30F414FCEC1FCA0ED81E547EDC2CD382C76F61C9018973DB9FA537972A7C701F6B77E0982DFC15FC01927EE5E7CD94B4F599FF07013A7C8281BDF22DCBC9AD7CABB7C4311C982F58EDB7213AD4558B332266D743AED8192D1884CADB8B14739A8DADA66DC970806D9C7AC450CB13D0D7C575FB198534FC61BC41BC0F0574E0E0130C7BBBFBDFDC9F6A6E2E3E2AFF1CBEAC89BA57884528D55CFB08327A1E8C89F4E003CF2888E933241D9D695BCBBACDC90B44E3E095FA37058EA25B13F5E295CBEAC6DE838AB8C50AF61E298975B872F0203010001")[..]); + assert_eq!( + spki.subject_public_key.raw_bytes(), + &hex!( + "3082010A0282010100B6C42C515F10A6AAF282C63EDBE24243A170F3FA2633BD4833637F47CA4F6F36E03A5D29EFC3191AC80F390D874B39E30F414FCEC1FCA0ED81E547EDC2CD382C76F61C9018973DB9FA537972A7C701F6B77E0982DFC15FC01927EE5E7CD94B4F599FF07013A7C8281BDF22DCBC9AD7CABB7C4311C982F58EDB7213AD4558B332266D743AED8192D1884CADB8B14739A8DADA66DC970806D9C7AC450CB13D0D7C575FB198534FC61BC41BC0F0574E0E0130C7BBBFBDFDC9F6A6E2E3E2AFF1CBEAC89BA57884528D55CFB08327A1E8C89F4E003CF2888E933241D9D695BCBBACDC90B44E3E095FA37058EA25B13F5E295CBEAC6DE838AB8C50AF61E298975B872F0203010001" + )[..] + ); } #[test] diff --git a/tai64/Cargo.toml b/tai64/Cargo.toml index 5ada6e0ce..a0938af9c 100644 --- a/tai64/Cargo.toml +++ b/tai64/Cargo.toml @@ -9,8 +9,8 @@ repository = "https://github.com/RustCrypto/formats" readme = "README.md" categories = ["date-and-time", "internationalization", "network-programming", "no-std", "parser-implementations"] keywords = ["tai64", "time", "timestamps"] -edition = "2021" -rust-version = "1.60" +edition = "2024" +rust-version = "1.85" [dependencies] serde = { version = "1", optional = true, default-features = false } diff --git a/tai64/README.md b/tai64/README.md index 68fedb298..856bbbb55 100644 --- a/tai64/README.md +++ b/tai64/README.md @@ -11,14 +11,6 @@ format in Rust. [Documentation][docs-link] -## Minimum Supported Rust Version - -Rust **1.60** or newer. - -In the future, we reserve the right to change MSRV (i.e. MSRV is out-of-scope -for this crate's SemVer guarantees), however when we do it will be accompanied by -a minor version bump. - ## License Licensed under either of: @@ -41,7 +33,7 @@ dual licensed as above, without any additional terms or conditions. [docs-image]: https://docs.rs/tai64/badge.svg [docs-link]: https://docs.rs/tai64/ [license-image]: https://img.shields.io/badge/license-Apache2.0/MIT-blue.svg -[rustc-image]: https://img.shields.io/badge/rustc-1.60+-blue.svg +[rustc-image]: https://img.shields.io/badge/rustc-1.85+-blue.svg [build-image]: https://github.com/RustCrypto/formats/actions/workflows/tai64.yml/badge.svg [build-link]: https://github.com/RustCrypto/formats/actions/workflows/tai64.yml diff --git a/tai64/src/lib.rs b/tai64/src/lib.rs index 2ffcfc618..c2a62d3b7 100644 --- a/tai64/src/lib.rs +++ b/tai64/src/lib.rs @@ -20,7 +20,7 @@ extern crate std; use core::{fmt, ops, time::Duration}; #[cfg(feature = "serde")] -use serde::{de, ser, Deserialize, Serialize}; +use serde::{Deserialize, Serialize, de, ser}; #[cfg(feature = "std")] use std::time::{SystemTime, UNIX_EPOCH}; diff --git a/tls_codec/Cargo.toml b/tls_codec/Cargo.toml index 57ac3ed9d..4b57d6ff4 100644 --- a/tls_codec/Cargo.toml +++ b/tls_codec/Cargo.toml @@ -8,8 +8,8 @@ description = "A pure Rust implementation of the TLS (de)serialization" readme = "README.md" homepage = "https://github.com/RustCrypto/formats/tree/master/tls_codec" repository = "https://github.com/RustCrypto/formats" -edition = "2021" -rust-version = "1.74" +edition = "2024" +rust-version = "1.85" [dependencies] zeroize = { version = "1.8", default-features = false, features = [ diff --git a/tls_codec/README.md b/tls_codec/README.md index be0b94f89..76b522edc 100644 --- a/tls_codec/README.md +++ b/tls_codec/README.md @@ -35,13 +35,6 @@ serialization/deserialization - Serialize for `(T, U)` and `(T, U, V)` where `T, U, V` implement Serialize` - Deserialize for `(T, U)` and `(T, U, V)` where `T, U, V` implement Deserialize` -## Minimum Supported Rust Version - -This crate requires **Rust 1.74.0** at a minimum. - -We may change the MSRV in the future, but it will be accompanied by a minor -version bump. - ## License Licensed under either of: @@ -62,7 +55,7 @@ dual licensed as above, without any additional terms or conditions. [chat-image]: https://img.shields.io/badge/zulip-join_chat-blue.svg?style=for-the-badge [chat-link]: https://rustcrypto.zulipchat.com/#narrow/stream/300570-formats [license-image]: https://img.shields.io/badge/license-Apache2.0-blue.svg?style=for-the-badge -[rustc-image]: https://img.shields.io/badge/rustc-1.70+-blue.svg?style=for-the-badge +[rustc-image]: https://img.shields.io/badge/rustc-1.85+-blue.svg?style=for-the-badge [//]: # (links) diff --git a/tls_codec/benches/quic_vec.rs b/tls_codec/benches/quic_vec.rs index f73fbbfb1..18e8f4491 100644 --- a/tls_codec/benches/quic_vec.rs +++ b/tls_codec/benches/quic_vec.rs @@ -1,5 +1,5 @@ -use criterion::{criterion_group, criterion_main}; use criterion::{BatchSize, Criterion}; +use criterion::{criterion_group, criterion_main}; use tls_codec::*; diff --git a/tls_codec/benches/tls_vec.rs b/tls_codec/benches/tls_vec.rs index 5fd017a0e..dea7112c1 100644 --- a/tls_codec/benches/tls_vec.rs +++ b/tls_codec/benches/tls_vec.rs @@ -1,5 +1,5 @@ -use criterion::{criterion_group, criterion_main}; use criterion::{BatchSize, Criterion}; +use criterion::{criterion_group, criterion_main}; /// Length of the test bytes vector. const N: usize = 0xFFFF; diff --git a/tls_codec/derive/Cargo.toml b/tls_codec/derive/Cargo.toml index b15c45fea..c99730ae2 100644 --- a/tls_codec/derive/Cargo.toml +++ b/tls_codec/derive/Cargo.toml @@ -8,8 +8,8 @@ description = "Derive macros for the tls_codec trait" readme = "../README.md" homepage = "https://github.com/RustCrypto/formats/tree/master/tls_codec/derive" repository = "https://github.com/RustCrypto/formats" -edition = "2021" -rust-version = "1.74" +edition = "2024" +rust-version = "1.85" [lib] proc-macro = true diff --git a/tls_codec/derive/src/lib.rs b/tls_codec/derive/src/lib.rs index 29ad53388..f38ca838f 100644 --- a/tls_codec/derive/src/lib.rs +++ b/tls_codec/derive/src/lib.rs @@ -268,12 +268,12 @@ use proc_macro::TokenStream; use proc_macro2::{Span, TokenStream as TokenStream2}; use quote::quote; use syn::{ - self, parse_macro_input, punctuated::Punctuated, token::Comma, Attribute, Data, DeriveInput, - Expr, ExprLit, ExprPath, Field, Generics, Ident, Lit, Member, Meta, Result, Token, Type, + self, Attribute, Data, DeriveInput, Expr, ExprLit, ExprPath, Field, Generics, Ident, Lit, + Member, Meta, Result, Token, Type, parse_macro_input, punctuated::Punctuated, token::Comma, }; #[cfg(feature = "conditional_deserialization")] -use syn::{parse_quote, ConstParam, ImplGenerics, ItemStruct, TypeGenerics}; +use syn::{ConstParam, ImplGenerics, ItemStruct, TypeGenerics, parse_quote}; /// Attribute name to identify attributes to be processed by derive-macros in this crate. const ATTR_IDENT: &str = "tls_codec"; @@ -369,14 +369,14 @@ impl TlsAttr { /// `#[tls_codec(discriminant = )]`, and `#[tls_codec(skip)]`. fn parse(attr: &Attribute) -> Result> { fn lit(e: &Expr) -> Result<&Lit> { - if let Expr::Lit(ExprLit { ref lit, .. }) = e { + if let Expr::Lit(ExprLit { lit, .. }) = e { Ok(lit) } else { Err(syn::Error::new_spanned(e, "expected literal")) } } - if attr.path().get_ident().map_or(true, |id| id != ATTR_IDENT) { + if attr.path().get_ident().is_none_or(|id| id != ATTR_IDENT) { return Ok(Vec::new()); } attr.parse_args_with(Punctuated::::parse_terminated)? @@ -738,8 +738,8 @@ fn define_discriminant_constants( Span::call_site(), "The tls_codec discriminant attribute is missing. \ Once you start using paths in #[tls_codec(discriminant = \"path::to::const::or::enum::variant\"], \ - You **have** to provide the discriminant attribute on every single variant.") - ); + You **have** to provide the discriminant attribute on every single variant.", + )); } else { quote! { #[allow(non_upper_case_globals)] @@ -1335,8 +1335,8 @@ fn set_cd_fields_generic( value: proc_macro2::TokenStream, ) -> ItemStruct { use syn::{ - parse::{Parse, Parser}, AngleBracketedGenericArguments, PathArguments, + parse::{Parse, Parser}, }; item_struct.fields.iter_mut().for_each(|field| { @@ -1345,8 +1345,7 @@ fn set_cd_fields_generic( if let Type::Path(path) = &mut field.ty { // If there is already an AngleBracketedGenericArguments, we just add the const generic at the end. if let Some(segment) = path.path.segments.last_mut() { - if let PathArguments::AngleBracketed(ref mut argument) = &mut segment.arguments - { + if let PathArguments::AngleBracketed(argument) = &mut segment.arguments { argument.args.push(parse_quote! {#value}); } else { // If there is no AngleBracketedGenericArguments, we create one and add the const generic. diff --git a/tls_codec/derive/tests/decode.rs b/tls_codec/derive/tests/decode.rs index c594eae49..17536c1f9 100644 --- a/tls_codec/derive/tests/decode.rs +++ b/tls_codec/derive/tests/decode.rs @@ -1,7 +1,7 @@ #![cfg(feature = "std")] use tls_codec::{ - Deserialize, DeserializeBytes, Error, Serialize, Size, TlsSliceU16, TlsVecU16, TlsVecU32, - TlsVecU8, VLBytes, + Deserialize, DeserializeBytes, Error, Serialize, Size, TlsSliceU16, TlsVecU8, TlsVecU16, + TlsVecU32, VLBytes, }; use tls_codec_derive::{TlsDeserialize, TlsDeserializeBytes, TlsSerialize, TlsSize}; @@ -531,7 +531,7 @@ fn type_with_unknowns() { #[cfg(feature = "conditional_deserialization")] mod conditional_deserialization { use tls_codec::{Deserialize, DeserializeBytes, Serialize, Size}; - use tls_codec_derive::{conditionally_deserializable, TlsSerialize, TlsSize}; + use tls_codec_derive::{TlsSerialize, TlsSize, conditionally_deserializable}; #[test] fn conditionally_deserializable_struct() { diff --git a/tls_codec/fuzz/Cargo.toml b/tls_codec/fuzz/Cargo.toml index b722697b5..6f51142a4 100644 --- a/tls_codec/fuzz/Cargo.toml +++ b/tls_codec/fuzz/Cargo.toml @@ -2,7 +2,7 @@ name = "tls_codec-fuzz" version = "0.0.0" publish = false -edition = "2021" +edition = "2024" [package.metadata] cargo-fuzz = true diff --git a/tls_codec/src/lib.rs b/tls_codec/src/lib.rs index e662691d7..2a8cbb244 100644 --- a/tls_codec/src/lib.rs +++ b/tls_codec/src/lib.rs @@ -41,14 +41,14 @@ mod quic_vec; mod tls_vec; pub use tls_vec::{ - SecretTlsVecU16, SecretTlsVecU24, SecretTlsVecU32, SecretTlsVecU8, TlsByteSliceU16, - TlsByteSliceU24, TlsByteSliceU32, TlsByteSliceU8, TlsByteVecU16, TlsByteVecU24, TlsByteVecU32, - TlsByteVecU8, TlsSliceU16, TlsSliceU24, TlsSliceU32, TlsSliceU8, TlsVecU16, TlsVecU24, - TlsVecU32, TlsVecU8, + SecretTlsVecU8, SecretTlsVecU16, SecretTlsVecU24, SecretTlsVecU32, TlsByteSliceU8, + TlsByteSliceU16, TlsByteSliceU24, TlsByteSliceU32, TlsByteVecU8, TlsByteVecU16, TlsByteVecU24, + TlsByteVecU32, TlsSliceU8, TlsSliceU16, TlsSliceU24, TlsSliceU32, TlsVecU8, TlsVecU16, + TlsVecU24, TlsVecU32, }; #[cfg(feature = "std")] -pub use quic_vec::{rw as vlen, SecretVLBytes}; +pub use quic_vec::{SecretVLBytes, rw as vlen}; pub use quic_vec::{VLByteSlice, VLBytes}; #[cfg(feature = "derive")] diff --git a/tls_codec/src/primitives.rs b/tls_codec/src/primitives.rs index 63e21d931..5a0c3dc00 100644 --- a/tls_codec/src/primitives.rs +++ b/tls_codec/src/primitives.rs @@ -80,14 +80,15 @@ impl Deserialize for Option { let mut some_or_none = [0u8; 1]; bytes.read_exact(&mut some_or_none)?; match some_or_none[0] { - 0 => { - Ok(None) - }, + 0 => Ok(None), 1 => { let element = T::tls_deserialize(bytes)?; Ok(Some(element)) - }, - _ => Err(Error::DecodingError(format!("Trying to decode Option with {} for option. It must be 0 for None and 1 for Some.", some_or_none[0]))) + } + _ => Err(Error::DecodingError(format!( + "Trying to decode Option with {} for option. It must be 0 for None and 1 for Some.", + some_or_none[0] + ))), } } } @@ -97,14 +98,15 @@ impl DeserializeBytes for Option { fn tls_deserialize_bytes(bytes: &[u8]) -> Result<(Self, &[u8]), Error> { let (some_or_none, remainder) = ::tls_deserialize_bytes(bytes)?; match some_or_none { - 0 => { - Ok((None, remainder)) - }, + 0 => Ok((None, remainder)), 1 => { let (element, remainder) = T::tls_deserialize_bytes(remainder)?; Ok((Some(element), remainder)) - }, - _ => Err(Error::DecodingError(alloc::format!("Trying to decode Option with {} for option. It must be 0 for None and 1 for Some.", some_or_none))) + } + _ => Err(Error::DecodingError(alloc::format!( + "Trying to decode Option with {} for option. It must be 0 for None and 1 for Some.", + some_or_none + ))), } } } diff --git a/tls_codec/tests/decode.rs b/tls_codec/tests/decode.rs index aa7ba6dbb..8beac3874 100644 --- a/tls_codec/tests/decode.rs +++ b/tls_codec/tests/decode.rs @@ -1,8 +1,8 @@ #![cfg(feature = "std")] use tls_codec::{ - Error, Serialize, Size, TlsByteSliceU16, TlsByteVecU16, TlsByteVecU8, TlsSliceU16, TlsVecU16, - TlsVecU32, TlsVecU8, VLByteSlice, VLBytes, U24, + Error, Serialize, Size, TlsByteSliceU16, TlsByteVecU8, TlsByteVecU16, TlsSliceU16, TlsVecU8, + TlsVecU16, TlsVecU32, U24, VLByteSlice, VLBytes, }; #[test] diff --git a/tls_codec/tests/decode_bytes.rs b/tls_codec/tests/decode_bytes.rs index 67b104805..413ed4ee9 100644 --- a/tls_codec/tests/decode_bytes.rs +++ b/tls_codec/tests/decode_bytes.rs @@ -1,4 +1,4 @@ -use tls_codec::{DeserializeBytes, TlsByteVecU16, TlsByteVecU24, TlsByteVecU32, TlsByteVecU8}; +use tls_codec::{DeserializeBytes, TlsByteVecU8, TlsByteVecU16, TlsByteVecU24, TlsByteVecU32}; #[test] fn deserialize_tls_byte_vec_u8() { diff --git a/tls_codec/tests/encode.rs b/tls_codec/tests/encode.rs index 1c232a2f2..1d04de751 100644 --- a/tls_codec/tests/encode.rs +++ b/tls_codec/tests/encode.rs @@ -1,6 +1,6 @@ #![cfg(feature = "std")] -use tls_codec::{Serialize, TlsVecU16, TlsVecU24, VLByteSlice, VLBytes, U24}; +use tls_codec::{Serialize, TlsVecU16, TlsVecU24, U24, VLByteSlice, VLBytes}; #[test] fn serialize_primitives() { diff --git a/tls_codec/tests/encode_bytes.rs b/tls_codec/tests/encode_bytes.rs index febc9b15e..50e3a33b6 100644 --- a/tls_codec/tests/encode_bytes.rs +++ b/tls_codec/tests/encode_bytes.rs @@ -1,4 +1,4 @@ -use tls_codec::{SerializeBytes, TlsByteVecU16, TlsByteVecU24, TlsByteVecU32, TlsByteVecU8, U24}; +use tls_codec::{SerializeBytes, TlsByteVecU8, TlsByteVecU16, TlsByteVecU24, TlsByteVecU32, U24}; #[test] fn serialize_primitives() { diff --git a/x509-cert/Cargo.lock b/x509-cert/Cargo.lock new file mode 100644 index 000000000..f58b485af --- /dev/null +++ b/x509-cert/Cargo.lock @@ -0,0 +1,1165 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +version = 3 + +[[package]] +name = "addr2line" +version = "0.24.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dfbe277e56a376000877090da837660b4427aad530e3028d44e0bffe4f89a1c1" +dependencies = [ + "gimli", +] + +[[package]] +name = "adler2" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "512761e0bb2578dd7380c6baaa0f4ce03e84f95e960231d1dec8bf4d7d6e2627" + +[[package]] +name = "aho-corasick" +version = "1.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8e60d3430d3a69478ad0993f19238d2df97c507009a52b3c10addcd7f6bcb916" +dependencies = [ + "memchr", +] + +[[package]] +name = "arbitrary" +version = "1.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dde20b3d026af13f561bdd0f15edf01fc734f0dafcedbaf42bba506a9517f223" +dependencies = [ + "derive_arbitrary", +] + +[[package]] +name = "async-signature" +version = "0.6.0-pre.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f9bdb5df8dde2bd1ec515a0981636508bb37d55984d0bae3678d4ac859125431" +dependencies = [ + "signature", +] + +[[package]] +name = "autocfg" +version = "1.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ace50bade8e6234aa140d9a2f552bbee1db4d353f69b8217bc503490fc1a9f26" + +[[package]] +name = "backtrace" +version = "0.3.74" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8d82cb332cdfaed17ae235a638438ac4d4839913cc2af585c3c6746e8f8bee1a" +dependencies = [ + "addr2line", + "cfg-if", + "libc", + "miniz_oxide", + "object", + "rustc-demangle", + "windows-targets", +] + +[[package]] +name = "base16ct" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4c7f02d4ea65f2c1853089ffd8d2787bdbc63de2f0d29dedbcf8ccdfa0ccd4cf" + +[[package]] +name = "base64ct" +version = "1.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8c3c1a368f70d6cf7302d78f8f7093da241fb8e8807c05cc9e51a125895a6d5b" + +[[package]] +name = "bitflags" +version = "2.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8f68f53c83ab957f72c32642f3868eec03eb974d1fb82e453128456482613d36" + +[[package]] +name = "block-buffer" +version = "0.11.0-rc.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3fd016a0ddc7cb13661bf5576073ce07330a693f8608a1320b4e20561cc12cdc" +dependencies = [ + "hybrid-array", +] + +[[package]] +name = "byteorder" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b" + +[[package]] +name = "cfg-if" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" + +[[package]] +name = "const-oid" +version = "0.10.0-rc.3" +source = "git+https://github.com/RustCrypto/formats.git#967574cfc0d189d3c75aee4f6a0bc098fa532ed0" +dependencies = [ + "arbitrary", +] + +[[package]] +name = "cpufeatures" +version = "0.2.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "59ed5838eebb26a2bb2e58f6d5b5316989ae9d08bab10e0e6d103e656d1b0280" +dependencies = [ + "libc", +] + +[[package]] +name = "crypto-bigint" +version = "0.6.0-rc.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d748d1f5b807ee6d0df5a548d0130417295c3aaed1dcbbb3d6a2e7106e11fcca" +dependencies = [ + "hybrid-array", + "num-traits", + "rand_core", + "subtle", + "zeroize", +] + +[[package]] +name = "crypto-common" +version = "0.2.0-rc.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b0b8ce8218c97789f16356e7896b3714f26c2ee1079b79c0b7ae7064bb9089fa" +dependencies = [ + "getrandom 0.2.15", + "hybrid-array", + "rand_core", +] + +[[package]] +name = "der" +version = "0.8.0-rc.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "82db698b33305f0134faf590b9d1259dc171b5481ac41d5c8146c3b3ee7d4319" +dependencies = [ + "arbitrary", + "const-oid", + "der_derive", + "flagset", + "pem-rfc7468", + "zeroize", +] + +[[package]] +name = "der_derive" +version = "0.8.0-rc.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "211bea8bb45f5f61bc857104606913ef8ac8b5ec698143aa2aa96a7ffdc94991" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "derive_arbitrary" +version = "1.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "30542c1ad912e0e3d22a1935c290e12e8a29d704a420177a31faad4a601a0800" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "digest" +version = "0.11.0-pre.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cf2e3d6615d99707295a9673e889bf363a04b2a466bd320c65a72536f7577379" +dependencies = [ + "block-buffer", + "const-oid", + "crypto-common", + "subtle", +] + +[[package]] +name = "ecdsa" +version = "0.17.0-pre.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7e62f2041a28c40b8884b79fbd19bc7457d76c6397767831e9ff4029fc0473a9" +dependencies = [ + "der", + "digest", + "elliptic-curve", + "rfc6979", + "signature", + "spki", +] + +[[package]] +name = "elliptic-curve" +version = "0.14.0-rc.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cc43715037532dc2d061e5c97e81b684c28993d52a4fa4eb7d2ce2826d78f2f2" +dependencies = [ + "base16ct", + "crypto-bigint", + "digest", + "ff", + "group", + "hybrid-array", + "pem-rfc7468", + "pkcs8", + "rand_core", + "sec1", + "subtle", + "zeroize", +] + +[[package]] +name = "equivalent" +version = "1.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "877a4ace8713b0bcf2a4e7eec82529c029f1d0619886d18145fea96c3ffe5c0f" + +[[package]] +name = "errno" +version = "0.3.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "33d852cb9b869c2a9b3df2f71a3074817f01e1844f839a144f5fcef059a4eb5d" +dependencies = [ + "libc", + "windows-sys", +] + +[[package]] +name = "fastrand" +version = "2.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "37909eebbb50d72f9059c3b6d82c0463f2ff062c9e95845c43a6c9c0355411be" + +[[package]] +name = "ff" +version = "0.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ded41244b729663b1e574f1b4fb731469f69f79c17667b5d776b16cda0479449" +dependencies = [ + "rand_core", + "subtle", +] + +[[package]] +name = "flagset" +version = "0.4.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b3ea1ec5f8307826a5b71094dd91fc04d4ae75d5709b20ad351c7fb4815c86ec" + +[[package]] +name = "futures-core" +version = "0.3.31" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "05f29059c0c2090612e8d742178b0580d2dc940c837851ad723096f87af6663e" + +[[package]] +name = "futures-macro" +version = "0.3.31" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "162ee34ebcb7c64a8abebc059ce0fee27c2262618d7b60ed8faf72fef13c3650" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "futures-task" +version = "0.3.31" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f90f7dce0722e95104fcb095585910c0977252f286e354b5e3bd38902cd99988" + +[[package]] +name = "futures-timer" +version = "3.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f288b0a4f20f9a56b5d1da57e2227c661b7b16168e2f72365f57b63326e29b24" + +[[package]] +name = "futures-util" +version = "0.3.31" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9fa08315bb612088cc391249efdc3bc77536f16c91f6cf495e6fbe85b20a4a81" +dependencies = [ + "futures-core", + "futures-macro", + "futures-task", + "pin-project-lite", + "pin-utils", + "slab", +] + +[[package]] +name = "getrandom" +version = "0.2.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c4567c8db10ae91089c99af84c68c38da3ec2f087c3f82960bcdbf3656b6f4d7" +dependencies = [ + "cfg-if", + "libc", + "wasi 0.11.0+wasi-snapshot-preview1", +] + +[[package]] +name = "getrandom" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "43a49c392881ce6d5c3b8cb70f98717b7c07aabbdff06687b9030dbfbe2725f8" +dependencies = [ + "cfg-if", + "libc", + "wasi 0.13.3+wasi-0.2.2", + "windows-targets", +] + +[[package]] +name = "gimli" +version = "0.31.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "07e28edb80900c19c28f1072f2e8aeca7fa06b23cd4169cefe1af5aa3260783f" + +[[package]] +name = "glob" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a8d1add55171497b4705a648c6b583acafb01d58050a51727785f0b2c8e0a2b2" + +[[package]] +name = "group" +version = "0.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f0f9ef7462f7c099f518d754361858f86d8a07af53ba9af0fe635bbccb151a63" +dependencies = [ + "ff", + "rand_core", + "subtle", +] + +[[package]] +name = "hashbrown" +version = "0.15.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bf151400ff0baff5465007dd2f3e717f3fe502074ca563069ce3a6629d07b289" + +[[package]] +name = "hex-literal" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6fe2267d4ed49bc07b63801559be28c718ea06c4738b7a03c94df7386d2cde46" + +[[package]] +name = "hmac" +version = "0.13.0-pre.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e4b1fb14e4df79f9406b434b60acef9f45c26c50062cccf1346c6103b8c47d58" +dependencies = [ + "digest", +] + +[[package]] +name = "hybrid-array" +version = "0.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f2d35805454dc9f8662a98d6d61886ffe26bd465f5960e0e55345c70d5c0d2a9" +dependencies = [ + "typenum", + "zeroize", +] + +[[package]] +name = "indexmap" +version = "2.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8c9c992b02b5b4c94ea26e32fe5bccb7aa7d9f390ab5c1221ff895bc7ea8b652" +dependencies = [ + "equivalent", + "hashbrown", +] + +[[package]] +name = "itoa" +version = "1.0.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d75a2a4b1b190afb6f5425f10f6a8f959d2ea0b9c2b1d79553551850539e4674" + +[[package]] +name = "lazy_static" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bbd2bcb4c963f2ddae06a2efc7e9f3591312473c50c6685e1f298068316e66fe" +dependencies = [ + "spin", +] + +[[package]] +name = "libc" +version = "0.2.170" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "875b3680cb2f8f71bdcf9a30f38d48282f5d3c95cbf9b3fa57269bb5d5c06828" + +[[package]] +name = "libm" +version = "0.2.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8355be11b20d696c8f18f6cc018c4e372165b1fa8126cef092399c9951984ffa" + +[[package]] +name = "linux-raw-sys" +version = "0.4.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d26c52dbd32dccf2d10cac7725f8eae5296885fb5703b261f7d0a0739ec807ab" + +[[package]] +name = "memchr" +version = "2.7.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "78ca9ab1a0babb1e7d5695e3530886289c18cf2f87ec19a575a0abdce112e3a3" + +[[package]] +name = "miniz_oxide" +version = "0.8.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8e3e04debbb59698c15bacbb6d93584a8c0ca9cc3213cb423d31f760d8843ce5" +dependencies = [ + "adler2", +] + +[[package]] +name = "num-bigint-dig" +version = "0.8.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dc84195820f291c7697304f3cbdadd1cb7199c0efc917ff5eafd71225c136151" +dependencies = [ + "byteorder", + "lazy_static", + "libm", + "num-integer", + "num-iter", + "num-traits", + "rand", + "smallvec", + "zeroize", +] + +[[package]] +name = "num-integer" +version = "0.1.46" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7969661fd2958a5cb096e56c8e1ad0444ac2bbcd0061bd28660485a44879858f" +dependencies = [ + "num-traits", +] + +[[package]] +name = "num-iter" +version = "0.1.45" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1429034a0490724d0075ebb2bc9e875d6503c3cf69e235a8941aa757d83ef5bf" +dependencies = [ + "autocfg", + "num-integer", + "num-traits", +] + +[[package]] +name = "num-traits" +version = "0.2.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "071dfc062690e90b734c0b2273ce72ad0ffa95f0c74596bc250dcfd960262841" +dependencies = [ + "autocfg", + "libm", +] + +[[package]] +name = "object" +version = "0.36.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "62948e14d923ea95ea2c7c86c71013138b66525b86bdc08d2dcc262bdb497b87" +dependencies = [ + "memchr", +] + +[[package]] +name = "once_cell" +version = "1.20.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "945462a4b81e43c4e3ba96bd7b49d834c6f61198356aa858733bc4acf3cbe62e" + +[[package]] +name = "p256" +version = "0.14.0-pre.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "71f3fd64a9cad9c26ed7f734b152196d5e56376b9957c832bcca0de48a708080" +dependencies = [ + "ecdsa", + "elliptic-curve", + "primeorder", + "sha2", +] + +[[package]] +name = "pem-rfc7468" +version = "1.0.0-rc.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c2dfbfa5c6f0906884269722c5478e72fd4d6c0e24fe600332c6d62359567ce1" +dependencies = [ + "base64ct", +] + +[[package]] +name = "pin-project-lite" +version = "0.2.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3b3cff922bd51709b605d9ead9aa71031d81447142d828eb4a6eba76fe619f9b" + +[[package]] +name = "pin-utils" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" + +[[package]] +name = "pkcs1" +version = "0.8.0-rc.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "226eb25e2c46c166ce498ac0f606ac623142d640064879ff445938accddff1e2" +dependencies = [ + "der", + "pkcs8", + "spki", +] + +[[package]] +name = "pkcs8" +version = "0.11.0-rc.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f22636de7c995e997ed3d8d2949b7414d4faba3efa7312a6c0e75d875a14bdd4" +dependencies = [ + "der", + "spki", +] + +[[package]] +name = "ppv-lite86" +version = "0.2.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "77957b295656769bb8ad2b6a6b09d897d94f05c41b069aede1fcdaa675eaea04" +dependencies = [ + "zerocopy", +] + +[[package]] +name = "primeorder" +version = "0.14.0-pre.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b794117b388378d55629f78f61e64e182baa200bf59c1a8205e0c46508ce5873" +dependencies = [ + "elliptic-curve", +] + +[[package]] +name = "proc-macro-crate" +version = "3.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8ecf48c7ca261d60b74ab1a7b20da18bede46776b2e55535cb958eb595c5fa7b" +dependencies = [ + "toml_edit", +] + +[[package]] +name = "proc-macro2" +version = "1.0.93" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "60946a68e5f9d28b0dc1c21bb8a97ee7d018a8b322fa57838ba31cc878e22d99" +dependencies = [ + "unicode-ident", +] + +[[package]] +name = "quote" +version = "1.0.38" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0e4dccaaaf89514f546c693ddc140f729f958c247918a13380cccc6078391acc" +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 0.2.15", +] + +[[package]] +name = "regex" +version = "1.11.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b544ef1b4eac5dc2db33ea63606ae9ffcfac26c1416a2806ae0bf5f56b201191" +dependencies = [ + "aho-corasick", + "memchr", + "regex-automata", + "regex-syntax", +] + +[[package]] +name = "regex-automata" +version = "0.4.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "809e8dc61f6de73b46c85f4c96486310fe304c434cfa43669d7b40f711150908" +dependencies = [ + "aho-corasick", + "memchr", + "regex-syntax", +] + +[[package]] +name = "regex-syntax" +version = "0.8.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2b15c43186be67a4fd63bee50d0303afffcef381492ebe2c5d87f324e1b8815c" + +[[package]] +name = "relative-path" +version = "1.9.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ba39f3699c378cd8970968dcbff9c43159ea4cfbd88d43c00b22f2ef10a435d2" + +[[package]] +name = "rfc6979" +version = "0.5.0-pre.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "871ee76a3eee98b0f805e5d1caf26929f4565073c580c053a55f886fc15dea49" +dependencies = [ + "hmac", + "subtle", +] + +[[package]] +name = "rsa" +version = "0.10.0-pre.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "07058e83b684989ab0559f9e22322f4e3f7e49147834ed0bae40486b9e70473c" +dependencies = [ + "const-oid", + "digest", + "num-bigint-dig", + "num-integer", + "num-traits", + "pkcs1", + "pkcs8", + "rand_core", + "sha2", + "signature", + "spki", + "subtle", + "zeroize", +] + +[[package]] +name = "rstest" +version = "0.24.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "03e905296805ab93e13c1ec3a03f4b6c4f35e9498a3d5fa96dc626d22c03cd89" +dependencies = [ + "futures-timer", + "futures-util", + "rstest_macros", + "rustc_version", +] + +[[package]] +name = "rstest_macros" +version = "0.24.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ef0053bbffce09062bee4bcc499b0fbe7a57b879f1efe088d6d8d4c7adcdef9b" +dependencies = [ + "cfg-if", + "glob", + "proc-macro-crate", + "proc-macro2", + "quote", + "regex", + "relative-path", + "rustc_version", + "syn", + "unicode-ident", +] + +[[package]] +name = "rustc-demangle" +version = "0.1.24" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "719b953e2095829ee67db738b3bfa9fa368c94900df327b3f07fe6e794d2fe1f" + +[[package]] +name = "rustc_version" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cfcb3a22ef46e85b45de6ee7e79d063319ebb6594faafcf1c225ea92ab6e9b92" +dependencies = [ + "semver", +] + +[[package]] +name = "rustix" +version = "0.38.44" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fdb5bc1ae2baa591800df16c9ca78619bf65c0488b41b96ccec5d11220d8c154" +dependencies = [ + "bitflags", + "errno", + "libc", + "linux-raw-sys", + "windows-sys", +] + +[[package]] +name = "ryu" +version = "1.0.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6ea1a2d0a644769cc99faa24c3ad26b379b786fe7c36fd3c546254801650e6dd" + +[[package]] +name = "sec1" +version = "0.8.0-rc.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d1988446eff153796413a73669dfaa4caa3f5ce8b25fac89e3821a39c611772e" +dependencies = [ + "base16ct", + "der", + "hybrid-array", + "pkcs8", + "subtle", + "zeroize", +] + +[[package]] +name = "semver" +version = "1.0.25" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f79dfe2d285b0488816f30e700a7438c5a73d816b5b7d3ac72fbc48b0d185e03" + +[[package]] +name = "serde" +version = "1.0.218" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e8dfc9d19bdbf6d17e22319da49161d5d0108e4188e8b680aef6299eed22df60" +dependencies = [ + "serde_derive", +] + +[[package]] +name = "serde_derive" +version = "1.0.218" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f09503e191f4e797cb8aac08e9a4a4695c5edf6a2e70e376d961ddd5c969f82b" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "serde_json" +version = "1.0.139" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "44f86c3acccc9c65b153fe1b85a3be07fe5515274ec9f0653b4a0875731c72a6" +dependencies = [ + "itoa", + "memchr", + "ryu", + "serde", +] + +[[package]] +name = "sha1" +version = "0.11.0-pre.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9540978cef7a8498211c1b1c14e5ce920fe5bd524ea84f4a3d72d4602515ae93" +dependencies = [ + "cfg-if", + "cpufeatures", + "digest", +] + +[[package]] +name = "sha2" +version = "0.11.0-pre.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "540c0893cce56cdbcfebcec191ec8e0f470dd1889b6e7a0b503e310a94a168f5" +dependencies = [ + "cfg-if", + "cpufeatures", + "digest", +] + +[[package]] +name = "signature" +version = "2.3.0-pre.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "054d71959c7051b9042c26af337f05cc930575ed2604d7d3ced3158383e59734" +dependencies = [ + "digest", + "rand_core", +] + +[[package]] +name = "slab" +version = "0.4.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8f92a496fb766b417c996b9c5e57daf2f7ad3b0bebe1ccfca4856390e3d3bb67" +dependencies = [ + "autocfg", +] + +[[package]] +name = "smallvec" +version = "1.14.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7fcf8323ef1faaee30a44a340193b1ac6814fd9b7b4e88e9d4519a3e4abe1cfd" + +[[package]] +name = "spin" +version = "0.9.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6980e8d7511241f8acf4aebddbb1ff938df5eebe98691418c4468d0b72a96a67" + +[[package]] +name = "spki" +version = "0.8.0-rc.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "37ac66481418fd7afdc584adcf3be9aa572cf6c2858814494dc2a01755f050bc" +dependencies = [ + "arbitrary", + "base64ct", + "der", + "sha2", +] + +[[package]] +name = "subtle" +version = "2.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "13c2bddecc57b384dee18652358fb23172facb8a2c51ccc10d74c157bdea3292" + +[[package]] +name = "syn" +version = "2.0.98" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "36147f1a48ae0ec2b5b3bc5b537d267457555a10dc06f3dbc8cb11ba3006d3b1" +dependencies = [ + "proc-macro2", + "quote", + "unicode-ident", +] + +[[package]] +name = "tempfile" +version = "3.17.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "22e5a0acb1f3f55f65cc4a866c361b2fb2a0ff6366785ae6fbb5f85df07ba230" +dependencies = [ + "cfg-if", + "fastrand", + "getrandom 0.3.1", + "once_cell", + "rustix", + "windows-sys", +] + +[[package]] +name = "tls_codec" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0de2e01245e2bb89d6f05801c564fa27624dbd7b1846859876c7dad82e90bf6b" +dependencies = [ + "tls_codec_derive", + "zeroize", +] + +[[package]] +name = "tls_codec_derive" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2d2e76690929402faae40aebdda620a2c0e25dd6d3b9afe48867dfd95991f4bd" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "tokio" +version = "1.43.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3d61fa4ffa3de412bfea335c6ecff681de2b609ba3c77ef3e00e521813a9ed9e" +dependencies = [ + "backtrace", + "pin-project-lite", + "tokio-macros", +] + +[[package]] +name = "tokio-macros" +version = "2.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6e06d43f1345a3bcd39f6a56dbb7dcab2ba47e68e8ac134855e7e2bdbaf8cab8" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "toml_datetime" +version = "0.6.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0dd7358ecb8fc2f8d014bf86f6f638ce72ba252a2c3a2572f2a795f1d23efb41" + +[[package]] +name = "toml_edit" +version = "0.22.24" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "17b4795ff5edd201c7cd6dca065ae59972ce77d1b80fa0a84d94950ece7d1474" +dependencies = [ + "indexmap", + "toml_datetime", + "winnow", +] + +[[package]] +name = "typenum" +version = "1.18.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1dccffe3ce07af9386bfd29e80c0ab1a8205a2fc34e4bcd40364df902cfa8f3f" + +[[package]] +name = "unicode-ident" +version = "1.0.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "00e2473a93778eb0bad35909dff6a10d28e63f792f16ed15e404fca9d5eeedbe" + +[[package]] +name = "wasi" +version = "0.11.0+wasi-snapshot-preview1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" + +[[package]] +name = "wasi" +version = "0.13.3+wasi-0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "26816d2e1a4a36a2940b96c5296ce403917633dff8f3440e9b236ed6f6bacad2" +dependencies = [ + "wit-bindgen-rt", +] + +[[package]] +name = "windows-sys" +version = "0.59.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1e38bc4d79ed67fd075bcc251a1c39b32a1776bbe92e5bef1f0bf1f8c531853b" +dependencies = [ + "windows-targets", +] + +[[package]] +name = "windows-targets" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9b724f72796e036ab90c1021d4780d4d3d648aca59e491e6b98e725b84e99973" +dependencies = [ + "windows_aarch64_gnullvm", + "windows_aarch64_msvc", + "windows_i686_gnu", + "windows_i686_gnullvm", + "windows_i686_msvc", + "windows_x86_64_gnu", + "windows_x86_64_gnullvm", + "windows_x86_64_msvc", +] + +[[package]] +name = "windows_aarch64_gnullvm" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "32a4622180e7a0ec044bb555404c800bc9fd9ec262ec147edd5989ccd0c02cd3" + +[[package]] +name = "windows_aarch64_msvc" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "09ec2a7bb152e2252b53fa7803150007879548bc709c039df7627cabbd05d469" + +[[package]] +name = "windows_i686_gnu" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8e9b5ad5ab802e97eb8e295ac6720e509ee4c243f69d781394014ebfe8bbfa0b" + +[[package]] +name = "windows_i686_gnullvm" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0eee52d38c090b3caa76c563b86c3a4bd71ef1a819287c19d586d7334ae8ed66" + +[[package]] +name = "windows_i686_msvc" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "240948bc05c5e7c6dabba28bf89d89ffce3e303022809e73deaefe4f6ec56c66" + +[[package]] +name = "windows_x86_64_gnu" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "147a5c80aabfbf0c7d901cb5895d1de30ef2907eb21fbbab29ca94c5b08b1a78" + +[[package]] +name = "windows_x86_64_gnullvm" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "24d5b23dc417412679681396f2b49f3de8c1473deb516bd34410872eff51ed0d" + +[[package]] +name = "windows_x86_64_msvc" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec" + +[[package]] +name = "winnow" +version = "0.7.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0e7f4ea97f6f78012141bcdb6a216b2609f0979ada50b20ca5b52dde2eac2bb1" +dependencies = [ + "memchr", +] + +[[package]] +name = "wit-bindgen-rt" +version = "0.33.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3268f3d866458b787f390cf61f4bbb563b922d091359f9608842999eaee3943c" +dependencies = [ + "bitflags", +] + +[[package]] +name = "x509-cert" +version = "0.3.0-pre.0" +dependencies = [ + "arbitrary", + "async-signature", + "const-oid", + "der", + "ecdsa", + "hex-literal", + "p256", + "rand", + "rsa", + "rstest", + "sha1", + "sha2", + "signature", + "spki", + "tempfile", + "tls_codec", + "tokio", + "x509-cert-test-support", +] + +[[package]] +name = "x509-cert-test-support" +version = "0.1.0" +dependencies = [ + "serde", + "serde_json", + "tempfile", +] + +[[package]] +name = "zerocopy" +version = "0.7.35" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1b9b4fd18abc82b8136838da5d50bae7bdea537c574d8dc1a34ed098d6c166f0" +dependencies = [ + "byteorder", + "zerocopy-derive", +] + +[[package]] +name = "zerocopy-derive" +version = "0.7.35" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fa4f8080344d4671fb4e831a13ad1e68092748387dfc4f55e356242fae12ce3e" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "zeroize" +version = "1.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ced3678a2879b30306d323f4542626697a464a97c0a07c9aebf7ebca65cd4dde" +dependencies = [ + "zeroize_derive", +] + +[[package]] +name = "zeroize_derive" +version = "1.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ce36e65b0d2999d2aafac989fb249189a141aee1f53c612c1f37d72631959f69" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] diff --git a/x509-cert/Cargo.toml b/x509-cert/Cargo.toml index 2c66a7938..a565414eb 100644 --- a/x509-cert/Cargo.toml +++ b/x509-cert/Cargo.toml @@ -54,3 +54,6 @@ base64 = ["spki/base64"] [package.metadata.docs.rs] all-features = true rustdoc-args = ["--cfg", "docsrs"] + +[patch.crates-io] +const-oid = { git = "https://github.com/RustCrypto/formats.git" } diff --git a/x509-cert/test-support/Cargo.lock b/x509-cert/test-support/Cargo.lock new file mode 100644 index 000000000..4e3a98571 --- /dev/null +++ b/x509-cert/test-support/Cargo.lock @@ -0,0 +1,273 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +version = 4 + +[[package]] +name = "bitflags" +version = "2.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8f68f53c83ab957f72c32642f3868eec03eb974d1fb82e453128456482613d36" + +[[package]] +name = "cfg-if" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" + +[[package]] +name = "errno" +version = "0.3.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "33d852cb9b869c2a9b3df2f71a3074817f01e1844f839a144f5fcef059a4eb5d" +dependencies = [ + "libc", + "windows-sys", +] + +[[package]] +name = "fastrand" +version = "2.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "37909eebbb50d72f9059c3b6d82c0463f2ff062c9e95845c43a6c9c0355411be" + +[[package]] +name = "getrandom" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "43a49c392881ce6d5c3b8cb70f98717b7c07aabbdff06687b9030dbfbe2725f8" +dependencies = [ + "cfg-if", + "libc", + "wasi", + "windows-targets", +] + +[[package]] +name = "itoa" +version = "1.0.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d75a2a4b1b190afb6f5425f10f6a8f959d2ea0b9c2b1d79553551850539e4674" + +[[package]] +name = "libc" +version = "0.2.170" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "875b3680cb2f8f71bdcf9a30f38d48282f5d3c95cbf9b3fa57269bb5d5c06828" + +[[package]] +name = "linux-raw-sys" +version = "0.4.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d26c52dbd32dccf2d10cac7725f8eae5296885fb5703b261f7d0a0739ec807ab" + +[[package]] +name = "memchr" +version = "2.7.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "78ca9ab1a0babb1e7d5695e3530886289c18cf2f87ec19a575a0abdce112e3a3" + +[[package]] +name = "once_cell" +version = "1.20.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "945462a4b81e43c4e3ba96bd7b49d834c6f61198356aa858733bc4acf3cbe62e" + +[[package]] +name = "proc-macro2" +version = "1.0.93" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "60946a68e5f9d28b0dc1c21bb8a97ee7d018a8b322fa57838ba31cc878e22d99" +dependencies = [ + "unicode-ident", +] + +[[package]] +name = "quote" +version = "1.0.38" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0e4dccaaaf89514f546c693ddc140f729f958c247918a13380cccc6078391acc" +dependencies = [ + "proc-macro2", +] + +[[package]] +name = "rustix" +version = "0.38.44" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fdb5bc1ae2baa591800df16c9ca78619bf65c0488b41b96ccec5d11220d8c154" +dependencies = [ + "bitflags", + "errno", + "libc", + "linux-raw-sys", + "windows-sys", +] + +[[package]] +name = "ryu" +version = "1.0.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6ea1a2d0a644769cc99faa24c3ad26b379b786fe7c36fd3c546254801650e6dd" + +[[package]] +name = "serde" +version = "1.0.218" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e8dfc9d19bdbf6d17e22319da49161d5d0108e4188e8b680aef6299eed22df60" +dependencies = [ + "serde_derive", +] + +[[package]] +name = "serde_derive" +version = "1.0.218" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f09503e191f4e797cb8aac08e9a4a4695c5edf6a2e70e376d961ddd5c969f82b" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "serde_json" +version = "1.0.139" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "44f86c3acccc9c65b153fe1b85a3be07fe5515274ec9f0653b4a0875731c72a6" +dependencies = [ + "itoa", + "memchr", + "ryu", + "serde", +] + +[[package]] +name = "syn" +version = "2.0.98" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "36147f1a48ae0ec2b5b3bc5b537d267457555a10dc06f3dbc8cb11ba3006d3b1" +dependencies = [ + "proc-macro2", + "quote", + "unicode-ident", +] + +[[package]] +name = "tempfile" +version = "3.17.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "22e5a0acb1f3f55f65cc4a866c361b2fb2a0ff6366785ae6fbb5f85df07ba230" +dependencies = [ + "cfg-if", + "fastrand", + "getrandom", + "once_cell", + "rustix", + "windows-sys", +] + +[[package]] +name = "unicode-ident" +version = "1.0.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "00e2473a93778eb0bad35909dff6a10d28e63f792f16ed15e404fca9d5eeedbe" + +[[package]] +name = "wasi" +version = "0.13.3+wasi-0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "26816d2e1a4a36a2940b96c5296ce403917633dff8f3440e9b236ed6f6bacad2" +dependencies = [ + "wit-bindgen-rt", +] + +[[package]] +name = "windows-sys" +version = "0.59.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1e38bc4d79ed67fd075bcc251a1c39b32a1776bbe92e5bef1f0bf1f8c531853b" +dependencies = [ + "windows-targets", +] + +[[package]] +name = "windows-targets" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9b724f72796e036ab90c1021d4780d4d3d648aca59e491e6b98e725b84e99973" +dependencies = [ + "windows_aarch64_gnullvm", + "windows_aarch64_msvc", + "windows_i686_gnu", + "windows_i686_gnullvm", + "windows_i686_msvc", + "windows_x86_64_gnu", + "windows_x86_64_gnullvm", + "windows_x86_64_msvc", +] + +[[package]] +name = "windows_aarch64_gnullvm" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "32a4622180e7a0ec044bb555404c800bc9fd9ec262ec147edd5989ccd0c02cd3" + +[[package]] +name = "windows_aarch64_msvc" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "09ec2a7bb152e2252b53fa7803150007879548bc709c039df7627cabbd05d469" + +[[package]] +name = "windows_i686_gnu" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8e9b5ad5ab802e97eb8e295ac6720e509ee4c243f69d781394014ebfe8bbfa0b" + +[[package]] +name = "windows_i686_gnullvm" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0eee52d38c090b3caa76c563b86c3a4bd71ef1a819287c19d586d7334ae8ed66" + +[[package]] +name = "windows_i686_msvc" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "240948bc05c5e7c6dabba28bf89d89ffce3e303022809e73deaefe4f6ec56c66" + +[[package]] +name = "windows_x86_64_gnu" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "147a5c80aabfbf0c7d901cb5895d1de30ef2907eb21fbbab29ca94c5b08b1a78" + +[[package]] +name = "windows_x86_64_gnullvm" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "24d5b23dc417412679681396f2b49f3de8c1473deb516bd34410872eff51ed0d" + +[[package]] +name = "windows_x86_64_msvc" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec" + +[[package]] +name = "wit-bindgen-rt" +version = "0.33.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3268f3d866458b787f390cf61f4bbb563b922d091359f9608842999eaee3943c" +dependencies = [ + "bitflags", +] + +[[package]] +name = "x509-cert-test-support" +version = "0.1.0" +dependencies = [ + "serde", + "serde_json", + "tempfile", +] diff --git a/x509-ocsp/Cargo.lock b/x509-ocsp/Cargo.lock new file mode 100644 index 000000000..8cfeb52ea --- /dev/null +++ b/x509-ocsp/Cargo.lock @@ -0,0 +1,475 @@ +# 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 = "base64ct" +version = "1.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8c3c1a368f70d6cf7302d78f8f7093da241fb8e8807c05cc9e51a125895a6d5b" + +[[package]] +name = "block-buffer" +version = "0.11.0-rc.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3fd016a0ddc7cb13661bf5576073ce07330a693f8608a1320b4e20561cc12cdc" +dependencies = [ + "hybrid-array", +] + +[[package]] +name = "byteorder" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b" + +[[package]] +name = "cfg-if" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" + +[[package]] +name = "const-oid" +version = "0.10.0-rc.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "68ff6be19477a1bd5441f382916a89bc2a0b2c35db6d41e0f6e8538bf6d6463f" + +[[package]] +name = "cpufeatures" +version = "0.2.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "59ed5838eebb26a2bb2e58f6d5b5316989ae9d08bab10e0e6d103e656d1b0280" +dependencies = [ + "libc", +] + +[[package]] +name = "crypto-common" +version = "0.2.0-rc.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b0b8ce8218c97789f16356e7896b3714f26c2ee1079b79c0b7ae7064bb9089fa" +dependencies = [ + "hybrid-array", +] + +[[package]] +name = "der" +version = "0.8.0-rc.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "82db698b33305f0134faf590b9d1259dc171b5481ac41d5c8146c3b3ee7d4319" +dependencies = [ + "const-oid", + "der_derive", + "flagset", + "zeroize", +] + +[[package]] +name = "der_derive" +version = "0.8.0-rc.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "211bea8bb45f5f61bc857104606913ef8ac8b5ec698143aa2aa96a7ffdc94991" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "digest" +version = "0.11.0-pre.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cf2e3d6615d99707295a9673e889bf363a04b2a466bd320c65a72536f7577379" +dependencies = [ + "block-buffer", + "const-oid", + "crypto-common", +] + +[[package]] +name = "flagset" +version = "0.4.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b3ea1ec5f8307826a5b71094dd91fc04d4ae75d5709b20ad351c7fb4815c86ec" + +[[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 = "hex-literal" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6fe2267d4ed49bc07b63801559be28c718ea06c4738b7a03c94df7386d2cde46" + +[[package]] +name = "hybrid-array" +version = "0.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f2d35805454dc9f8662a98d6d61886ffe26bd465f5960e0e55345c70d5c0d2a9" +dependencies = [ + "typenum", +] + +[[package]] +name = "lazy_static" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bbd2bcb4c963f2ddae06a2efc7e9f3591312473c50c6685e1f298068316e66fe" +dependencies = [ + "spin", +] + +[[package]] +name = "libc" +version = "0.2.170" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "875b3680cb2f8f71bdcf9a30f38d48282f5d3c95cbf9b3fa57269bb5d5c06828" + +[[package]] +name = "libm" +version = "0.2.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8355be11b20d696c8f18f6cc018c4e372165b1fa8126cef092399c9951984ffa" + +[[package]] +name = "num-bigint-dig" +version = "0.8.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dc84195820f291c7697304f3cbdadd1cb7199c0efc917ff5eafd71225c136151" +dependencies = [ + "byteorder", + "lazy_static", + "libm", + "num-integer", + "num-iter", + "num-traits", + "rand", + "smallvec", + "zeroize", +] + +[[package]] +name = "num-integer" +version = "0.1.46" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7969661fd2958a5cb096e56c8e1ad0444ac2bbcd0061bd28660485a44879858f" +dependencies = [ + "num-traits", +] + +[[package]] +name = "num-iter" +version = "0.1.45" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1429034a0490724d0075ebb2bc9e875d6503c3cf69e235a8941aa757d83ef5bf" +dependencies = [ + "autocfg", + "num-integer", + "num-traits", +] + +[[package]] +name = "num-traits" +version = "0.2.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "071dfc062690e90b734c0b2273ce72ad0ffa95f0c74596bc250dcfd960262841" +dependencies = [ + "autocfg", + "libm", +] + +[[package]] +name = "pkcs1" +version = "0.8.0-rc.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "226eb25e2c46c166ce498ac0f606ac623142d640064879ff445938accddff1e2" +dependencies = [ + "der", + "pkcs8", + "spki", +] + +[[package]] +name = "pkcs8" +version = "0.11.0-rc.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f22636de7c995e997ed3d8d2949b7414d4faba3efa7312a6c0e75d875a14bdd4" +dependencies = [ + "der", + "spki", +] + +[[package]] +name = "ppv-lite86" +version = "0.2.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "77957b295656769bb8ad2b6a6b09d897d94f05c41b069aede1fcdaa675eaea04" +dependencies = [ + "zerocopy", +] + +[[package]] +name = "proc-macro2" +version = "1.0.93" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "60946a68e5f9d28b0dc1c21bb8a97ee7d018a8b322fa57838ba31cc878e22d99" +dependencies = [ + "unicode-ident", +] + +[[package]] +name = "quote" +version = "1.0.38" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0e4dccaaaf89514f546c693ddc140f729f958c247918a13380cccc6078391acc" +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 = "rsa" +version = "0.10.0-pre.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "07058e83b684989ab0559f9e22322f4e3f7e49147834ed0bae40486b9e70473c" +dependencies = [ + "const-oid", + "digest", + "num-bigint-dig", + "num-integer", + "num-traits", + "pkcs1", + "pkcs8", + "rand_core", + "sha2", + "signature", + "spki", + "subtle", + "zeroize", +] + +[[package]] +name = "sha1" +version = "0.11.0-pre.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9540978cef7a8498211c1b1c14e5ce920fe5bd524ea84f4a3d72d4602515ae93" +dependencies = [ + "cfg-if", + "cpufeatures", + "digest", +] + +[[package]] +name = "sha2" +version = "0.11.0-pre.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "540c0893cce56cdbcfebcec191ec8e0f470dd1889b6e7a0b503e310a94a168f5" +dependencies = [ + "cfg-if", + "cpufeatures", + "digest", +] + +[[package]] +name = "signature" +version = "2.3.0-pre.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "054d71959c7051b9042c26af337f05cc930575ed2604d7d3ced3158383e59734" +dependencies = [ + "digest", + "rand_core", +] + +[[package]] +name = "smallvec" +version = "1.14.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7fcf8323ef1faaee30a44a340193b1ac6814fd9b7b4e88e9d4519a3e4abe1cfd" + +[[package]] +name = "spin" +version = "0.9.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6980e8d7511241f8acf4aebddbb1ff938df5eebe98691418c4468d0b72a96a67" + +[[package]] +name = "spki" +version = "0.8.0-rc.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "37ac66481418fd7afdc584adcf3be9aa572cf6c2858814494dc2a01755f050bc" +dependencies = [ + "base64ct", + "der", +] + +[[package]] +name = "subtle" +version = "2.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "13c2bddecc57b384dee18652358fb23172facb8a2c51ccc10d74c157bdea3292" + +[[package]] +name = "syn" +version = "2.0.98" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "36147f1a48ae0ec2b5b3bc5b537d267457555a10dc06f3dbc8cb11ba3006d3b1" +dependencies = [ + "proc-macro2", + "quote", + "unicode-ident", +] + +[[package]] +name = "tls_codec" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0de2e01245e2bb89d6f05801c564fa27624dbd7b1846859876c7dad82e90bf6b" +dependencies = [ + "tls_codec_derive", + "zeroize", +] + +[[package]] +name = "tls_codec_derive" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2d2e76690929402faae40aebdda620a2c0e25dd6d3b9afe48867dfd95991f4bd" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "typenum" +version = "1.18.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1dccffe3ce07af9386bfd29e80c0ab1a8205a2fc34e4bcd40364df902cfa8f3f" + +[[package]] +name = "unicode-ident" +version = "1.0.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "00e2473a93778eb0bad35909dff6a10d28e63f792f16ed15e404fca9d5eeedbe" + +[[package]] +name = "wasi" +version = "0.11.0+wasi-snapshot-preview1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" + +[[package]] +name = "x509-cert" +version = "0.3.0-pre.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2db382aa43c1fb5c419a960f72c3847ab0f383f635fc2e25f0bd6c5fb94371d1" +dependencies = [ + "const-oid", + "der", + "spki", + "tls_codec", +] + +[[package]] +name = "x509-ocsp" +version = "0.3.0-pre" +dependencies = [ + "const-oid", + "der", + "digest", + "hex-literal", + "lazy_static", + "rand", + "rand_core", + "rsa", + "sha1", + "sha2", + "signature", + "spki", + "x509-cert", +] + +[[package]] +name = "zerocopy" +version = "0.7.35" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1b9b4fd18abc82b8136838da5d50bae7bdea537c574d8dc1a34ed098d6c166f0" +dependencies = [ + "byteorder", + "zerocopy-derive", +] + +[[package]] +name = "zerocopy-derive" +version = "0.7.35" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fa4f8080344d4671fb4e831a13ad1e68092748387dfc4f55e356242fae12ce3e" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "zeroize" +version = "1.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ced3678a2879b30306d323f4542626697a464a97c0a07c9aebf7ebca65cd4dde" +dependencies = [ + "zeroize_derive", +] + +[[package]] +name = "zeroize_derive" +version = "1.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ce36e65b0d2999d2aafac989fb249189a141aee1f53c612c1f37d72631959f69" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] diff --git a/x509-tsp/Cargo.lock b/x509-tsp/Cargo.lock new file mode 100644 index 000000000..7de5cc5e3 --- /dev/null +++ b/x509-tsp/Cargo.lock @@ -0,0 +1,169 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +version = 3 + +[[package]] +name = "base64ct" +version = "1.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8c3c1a368f70d6cf7302d78f8f7093da241fb8e8807c05cc9e51a125895a6d5b" + +[[package]] +name = "cmpv2" +version = "0.3.0-pre.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "07797f3a854fc23b7aaf8f3d89b343bbcf42b7234f63d00c9d34524229940225" +dependencies = [ + "crmf", + "der", + "spki", + "x509-cert", +] + +[[package]] +name = "cms" +version = "0.3.0-pre.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "956098b1603285c33972193d6f62c8389d3d8548693a4077baa08ff0a8da97c7" +dependencies = [ + "const-oid", + "der", + "spki", + "x509-cert", +] + +[[package]] +name = "const-oid" +version = "0.10.0-rc.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "68ff6be19477a1bd5441f382916a89bc2a0b2c35db6d41e0f6e8538bf6d6463f" + +[[package]] +name = "crmf" +version = "0.3.0-pre.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d7deedb0754953b9cac4b8650735d37e83d339e98803ac0a30d417489d17e023" +dependencies = [ + "cms", + "der", + "spki", + "x509-cert", +] + +[[package]] +name = "der" +version = "0.8.0-rc.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "82db698b33305f0134faf590b9d1259dc171b5481ac41d5c8146c3b3ee7d4319" +dependencies = [ + "const-oid", + "der_derive", + "flagset", + "pem-rfc7468", + "zeroize", +] + +[[package]] +name = "der_derive" +version = "0.8.0-rc.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "211bea8bb45f5f61bc857104606913ef8ac8b5ec698143aa2aa96a7ffdc94991" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "flagset" +version = "0.4.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b3ea1ec5f8307826a5b71094dd91fc04d4ae75d5709b20ad351c7fb4815c86ec" + +[[package]] +name = "hex-literal" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6fe2267d4ed49bc07b63801559be28c718ea06c4738b7a03c94df7386d2cde46" + +[[package]] +name = "pem-rfc7468" +version = "1.0.0-rc.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c2dfbfa5c6f0906884269722c5478e72fd4d6c0e24fe600332c6d62359567ce1" +dependencies = [ + "base64ct", +] + +[[package]] +name = "proc-macro2" +version = "1.0.93" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "60946a68e5f9d28b0dc1c21bb8a97ee7d018a8b322fa57838ba31cc878e22d99" +dependencies = [ + "unicode-ident", +] + +[[package]] +name = "quote" +version = "1.0.38" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0e4dccaaaf89514f546c693ddc140f729f958c247918a13380cccc6078391acc" +dependencies = [ + "proc-macro2", +] + +[[package]] +name = "spki" +version = "0.8.0-rc.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "37ac66481418fd7afdc584adcf3be9aa572cf6c2858814494dc2a01755f050bc" +dependencies = [ + "base64ct", + "der", +] + +[[package]] +name = "syn" +version = "2.0.98" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "36147f1a48ae0ec2b5b3bc5b537d267457555a10dc06f3dbc8cb11ba3006d3b1" +dependencies = [ + "proc-macro2", + "quote", + "unicode-ident", +] + +[[package]] +name = "unicode-ident" +version = "1.0.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "00e2473a93778eb0bad35909dff6a10d28e63f792f16ed15e404fca9d5eeedbe" + +[[package]] +name = "x509-cert" +version = "0.3.0-pre.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2db382aa43c1fb5c419a960f72c3847ab0f383f635fc2e25f0bd6c5fb94371d1" +dependencies = [ + "const-oid", + "der", + "spki", +] + +[[package]] +name = "x509-tsp" +version = "0.2.0-pre" +dependencies = [ + "cmpv2", + "cms", + "der", + "hex-literal", + "x509-cert", +] + +[[package]] +name = "zeroize" +version = "1.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ced3678a2879b30306d323f4542626697a464a97c0a07c9aebf7ebca65cd4dde"