Skip to content

Commit 78fc706

Browse files
committed
Bump to signature 3
1 parent 90b6617 commit 78fc706

File tree

7 files changed

+41
-32
lines changed

7 files changed

+41
-32
lines changed

Cargo.lock

+14-12
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

+2-3
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ x509-ocsp = { path = "./x509-ocsp" }
6565

6666
# https://github.com/RustCrypto/signatures/pull/913
6767
# https://github.com/RustCrypto/signatures/pull/923
68-
ecdsa = { git = "https://github.com/RustCrypto/signatures.git" }
68+
ecdsa = { git = "https://github.com/baloo/signatures.git", branch = "baloo/crypto-bigint/0.7.0-pre.2" }
6969
rfc6979 = { git = "https://github.com/RustCrypto/signatures.git" }
7070
# https://github.com/RustCrypto/key-wraps/pull/34
7171
# https://github.com/RustCrypto/key-wraps/pull/35
@@ -85,14 +85,13 @@ aead = { git = "https://github.com/RustCrypto/traits.git" }
8585

8686
# https://github.com/RustCrypto/RSA/pull/478
8787
# https://github.com/RustCrypto/RSA/pull/504
88-
rsa = { git = "https://github.com/RustCrypto/RSA.git" }
88+
rsa = { git = "https://github.com/baloo/RSA.git", branch = "baloo/signature3/v3" }
8989

9090
# https://github.com/RustCrypto/password-hashes/pull/577
9191
# https://github.com/RustCrypto/password-hashes/pull/578
9292
pbkdf2 = { git = "https://github.com/RustCrypto/password-hashes.git" }
9393
scrypt = { git = "https://github.com/RustCrypto/password-hashes.git" }
9494

95-
crypto-bigint = { git = "https://github.com/RustCrypto/crypto-bigint.git" }
9695
crypto-primes = { git = "https://github.com/entropyxyz/crypto-primes.git" }
9796

9897
# https://github.com/RustCrypto/elliptic-curves/pull/1125

cms/Cargo.toml

+2-2
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ rsa = { version = "=0.10.0-pre.4", optional = true }
3232
sha1 = { version = "=0.11.0-pre.5", optional = true }
3333
sha2 = { version = "=0.11.0-pre.5", optional = true }
3434
sha3 = { version = "=0.11.0-pre.5", optional = true }
35-
signature = { version = "=2.3.0-pre.6", features = ["digest", "alloc"], optional = true }
35+
signature = { version = "=3.0.0-pre", features = ["digest", "alloc"], optional = true }
3636
zeroize = { version = "1.8.1", optional = true }
3737

3838
[dev-dependencies]
@@ -45,7 +45,7 @@ pbkdf2 = "0.13.0-pre.0"
4545
rand = "0.9"
4646
rsa = { version = "=0.10.0-pre.4", features = ["sha2"] }
4747
ecdsa = { version = "=0.17.0-pre.9", features = ["digest", "pem"] }
48-
p256 = "=0.14.0-pre.2"
48+
p256 = { version = "=0.14.0-pre.2", features = ["digest"] }
4949
tokio = { version = "1.43.1", features = ["macros", "rt"] }
5050
x509-cert = { version = "=0.3.0-pre.0", features = ["pem"] }
5151

x509-cert/Cargo.toml

+2-2
Original file line numberDiff line numberDiff line change
@@ -24,15 +24,15 @@ spki = { version = "0.8.0-rc.0", features = ["alloc"] }
2424
arbitrary = { version = "1.4", features = ["derive"], optional = true }
2525
digest = { version = "0.11.0-pre.10", optional = true, default-features = false }
2626
sha1 = { version = "0.11.0-pre.5", default-features = false, optional = true }
27-
signature = { version = "=2.3.0-pre.6", features = ["rand_core"], optional = true }
27+
signature = { version = "=3.0.0-pre", features = ["rand_core"], optional = true }
2828
tls_codec = { version = "0.4.0", default-features = false, features = ["derive"], optional = true }
2929

3030
[dev-dependencies]
3131
hex-literal = "1"
3232
rand = "0.9"
3333
rsa = { version = "=0.10.0-pre.4", features = ["sha2"] }
3434
ecdsa = { version = "=0.17.0-pre.9", features = ["digest", "pem"] }
35-
p256 = "=0.14.0-pre.2"
35+
p256 = { version = "=0.14.0-pre.2" }
3636
rstest = "0.25"
3737
sha2 = { version = "=0.11.0-pre.5", features = ["oid"] }
3838
tempfile = "3.5.0"

x509-cert/tests/builder.rs

+8-4
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,10 @@ use der::{
77
};
88
use p256::{NistP256, ecdsa::DerSignature, pkcs8::DecodePrivateKey};
99
use rand::rngs::OsRng;
10-
use rsa::pkcs1::DecodeRsaPrivateKey;
11-
use rsa::pkcs1v15::SigningKey;
10+
use rsa::{
11+
pkcs1::DecodeRsaPrivateKey,
12+
pkcs1v15::{self, SigningKey},
13+
};
1214
use sha2::Sha256;
1315
use signature::rand_core::TryRngCore;
1416
use spki::SubjectPublicKeyInfo;
@@ -46,7 +48,7 @@ fn root_ca_certificate() {
4648
let builder = CertificateBuilder::new(profile, serial_number, validity, pub_key)
4749
.expect("Create certificate");
4850

49-
let certificate = builder.build(&signer).unwrap();
51+
let certificate = builder.build::<_, pkcs1v15::Signature>(&signer).unwrap();
5052

5153
let pem = certificate.to_pem(LineEnding::LF).expect("generate pem");
5254
println!("{}", openssl::check_certificate(pem.as_bytes()));
@@ -322,7 +324,9 @@ fn dynamic_signer() {
322324
.expect("Sign request")
323325
} else {
324326
let req_signer = rsa_signer();
325-
csr_builder.build(&req_signer).expect("Sign request")
327+
csr_builder
328+
.build::<_, pkcs1v15::Signature>(&req_signer)
329+
.expect("Sign request")
326330
};
327331

328332
let csr_pem = csr.to_pem(LineEnding::LF).expect("format CSR");

x509-ocsp/Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ x509-cert = { version = "=0.3.0-pre.0", default-features = false }
2424
# Optional
2525
digest = { version = "=0.11.0-pre.10", optional = true, default-features = false, features = ["oid"] }
2626
rand_core = { version = "0.9", optional = true, default-features = false }
27-
signature = { version = "=2.3.0-pre.6", optional = true, default-features = false, features = ["digest", "rand_core"] }
27+
signature = { version = "=3.0.0-pre", optional = true, default-features = false, features = ["digest", "rand_core"] }
2828

2929
[dev-dependencies]
3030
hex-literal = "1"

x509-ocsp/tests/builder.rs

+12-8
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,11 @@
44
use der::{DateTime, Decode, Encode};
55
use hex_literal::hex;
66
use lazy_static::lazy_static;
7-
use rsa::{RsaPrivateKey, pkcs1v15::SigningKey, pkcs8::DecodePrivateKey};
7+
use rsa::{
8+
RsaPrivateKey,
9+
pkcs1v15::{self, SigningKey},
10+
pkcs8::DecodePrivateKey,
11+
};
812
use sha1::Sha1;
913
use sha2::{Sha224, Sha256, Sha384, Sha512};
1014
use x509_cert::{Certificate, name::Name, serial_number::SerialNumber};
@@ -173,7 +177,7 @@ fn encode_ocsp_req_signed() {
173177
.with_request(
174178
Request::from_issuer::<Sha1>(&ISSUER, SerialNumber::from(0x10001usize)).unwrap(),
175179
)
176-
.sign(&mut signer, Some(vec![CERT.clone()]))
180+
.sign::<_, pkcs1v15::Signature>(&mut signer, Some(vec![CERT.clone()]))
177181
.unwrap();
178182
assert_eq!(&req.to_der().unwrap(), &req_der);
179183
}
@@ -212,7 +216,7 @@ fn encode_ocsp_resp_sha1_certid() {
212216
DateTime::new(2020, 1, 1, 0, 0, 0).unwrap(),
213217
)),
214218
)
215-
.sign(
219+
.sign::<_, pkcs1v15::Signature>(
216220
&mut signer,
217221
Some(vec![ISSUER.clone()]),
218222
OcspGeneralizedTime::from(DateTime::new(2020, 1, 1, 0, 0, 0).unwrap()),
@@ -236,7 +240,7 @@ fn encode_ocsp_resp_sha256_certid() {
236240
DateTime::new(2020, 1, 1, 0, 0, 0).unwrap(),
237241
)),
238242
)
239-
.sign(
243+
.sign::<_, pkcs1v15::Signature>(
240244
&mut signer,
241245
Some(vec![ISSUER.clone()]),
242246
OcspGeneralizedTime::from(DateTime::new(2020, 1, 1, 0, 0, 0).unwrap()),
@@ -260,7 +264,7 @@ fn encode_ocsp_resp_sha512_certid() {
260264
DateTime::new(2020, 1, 1, 0, 0, 0).unwrap(),
261265
)),
262266
)
263-
.sign(
267+
.sign::<_, pkcs1v15::Signature>(
264268
&mut signer,
265269
Some(vec![ISSUER.clone()]),
266270
OcspGeneralizedTime::from(DateTime::new(2020, 1, 1, 0, 0, 0).unwrap()),
@@ -303,7 +307,7 @@ fn encode_ocsp_resp_multiple_extensions() {
303307
)
304308
.with_extension(ext1)
305309
.unwrap()
306-
.sign(
310+
.sign::<_, pkcs1v15::Signature>(
307311
&mut signer,
308312
Some(vec![ISSUER.clone()]),
309313
OcspGeneralizedTime::from(DateTime::new(2020, 1, 1, 0, 0, 0).unwrap()),
@@ -397,7 +401,7 @@ fn encode_ocsp_resp_multiple_responses() {
397401
DateTime::new(2020, 1, 1, 0, 0, 0).unwrap(),
398402
)),
399403
)
400-
.sign(
404+
.sign::<_, pkcs1v15::Signature>(
401405
&mut signer,
402406
Some(vec![ISSUER.clone()]),
403407
OcspGeneralizedTime::from(DateTime::new(2020, 1, 1, 0, 0, 0).unwrap()),
@@ -426,7 +430,7 @@ fn encode_ocsp_resp_revoked_delegated() {
426430
DateTime::new(2024, 11, 4, 1, 9, 46).unwrap(),
427431
)),
428432
)
429-
.sign(
433+
.sign::<_, pkcs1v15::Signature>(
430434
&mut signer,
431435
Some(vec![OCSP.clone()]),
432436
OcspGeneralizedTime::from(DateTime::new(2023, 11, 5, 1, 9, 46).unwrap()),

0 commit comments

Comments
 (0)