Skip to content

Commit 6831360

Browse files
authored
ssh-key: use elliptic curve crate releases (#420)
Switches from `git`-sourced dependencies to crate releases for: - `ed25519-dalek` - `p256` - `p384` - `p521`
1 parent 619c63c commit 6831360

File tree

4 files changed

+55
-56
lines changed

4 files changed

+55
-56
lines changed

Cargo.lock

Lines changed: 48 additions & 40 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -16,12 +16,3 @@ ssh-cipher = { path = "./ssh-cipher" }
1616
ssh-derive = { path = "./ssh-derive" }
1717
ssh-encoding = { path = "./ssh-encoding" }
1818
ssh-key = { path = "./ssh-key" }
19-
20-
ed25519-dalek = { git = "https://github.com/dalek-cryptography/curve25519-dalek", branch = "rand_core/v0.10-rc" }
21-
elliptic-curve = { git = "https://github.com/RustCrypto/traits" }
22-
ff = { git = "https://github.com/tarcieri/ff", branch = "rand_core/v0.10.0-rc-2" }
23-
group = { git = "https://github.com/tarcieri/group", branch = "rand_core/v0.10.0-rc-2" }
24-
p256 = { git = "https://github.com/RustCrypto/elliptic-curves" }
25-
p384 = { git = "https://github.com/RustCrypto/elliptic-curves" }
26-
p521 = { git = "https://github.com/RustCrypto/elliptic-curves" }
27-
primefield = { git = "https://github.com/RustCrypto/elliptic-curves " }

ssh-key/Cargo.toml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,12 +29,12 @@ zeroize = { version = "1", default-features = false }
2929
argon2 = { version = "0.6.0-rc.2", optional = true, default-features = false, features = ["alloc"] }
3030
bcrypt-pbkdf = { version = "0.11.0-rc.2", optional = true, default-features = false, features = ["alloc"] }
3131
dsa = { version = "0.7.0-rc.7", optional = true, default-features = false, features = ["hazmat"] }
32-
ed25519-dalek = { version = "=3.0.0-pre.1", optional = true, default-features = false }
32+
ed25519-dalek = { version = "=3.0.0-pre.2", optional = true, default-features = false }
3333
hex = { version = "0.4", optional = true, default-features = false, features = ["alloc"] }
3434
hmac = { version = "0.13.0-rc.3", optional = true }
35-
p256 = { version = "0.14.0-rc.0", optional = true, default-features = false, features = ["ecdsa"] }
36-
p384 = { version = "0.14.0-rc.0", optional = true, default-features = false, features = ["ecdsa"] }
37-
p521 = { version = "0.14.0-rc.0", optional = true, default-features = false, features = ["ecdsa"] }
35+
p256 = { version = "0.14.0-rc.1", optional = true, default-features = false, features = ["ecdsa"] }
36+
p384 = { version = "0.14.0-rc.1", optional = true, default-features = false, features = ["ecdsa"] }
37+
p521 = { version = "0.14.0-rc.1", optional = true, default-features = false, features = ["ecdsa"] }
3838
rand_core = { version = "0.10.0-rc-2", optional = true, default-features = false }
3939
rsa = { version = "0.10.0-rc.10", optional = true, default-features = false, features = ["sha2"] }
4040
sec1 = { version = "0.8.0-rc.10", optional = true, default-features = false, features = ["point"] }

ssh-key/src/private/ecdsa.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -211,7 +211,7 @@ impl EcdsaKeypair {
211211
match curve {
212212
#[cfg(feature = "p256")]
213213
EcdsaCurve::NistP256 => {
214-
let private = p256::SecretKey::random(rng);
214+
let Ok(private) = p256::SecretKey::try_from_rng(rng);
215215
let public = private.public_key();
216216
Ok(EcdsaKeypair::NistP256 {
217217
private: private.into(),
@@ -220,7 +220,7 @@ impl EcdsaKeypair {
220220
}
221221
#[cfg(feature = "p384")]
222222
EcdsaCurve::NistP384 => {
223-
let private = p384::SecretKey::random(rng);
223+
let Ok(private) = p384::SecretKey::try_from_rng(rng);
224224
let public = private.public_key();
225225
Ok(EcdsaKeypair::NistP384 {
226226
private: private.into(),
@@ -229,7 +229,7 @@ impl EcdsaKeypair {
229229
}
230230
#[cfg(feature = "p521")]
231231
EcdsaCurve::NistP521 => {
232-
let private = p521::SecretKey::random(rng);
232+
let Ok(private) = p521::SecretKey::try_from_rng(rng);
233233
let public = private.public_key();
234234
Ok(EcdsaKeypair::NistP521 {
235235
private: private.into(),

0 commit comments

Comments
 (0)