Skip to content

Commit 665e6e9

Browse files
authored
ssh-key v0.7.0 (#670)
1 parent 13fcde7 commit 665e6e9

4 files changed

Lines changed: 193 additions & 16 deletions

File tree

‎Cargo.lock‎

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

‎ssh-key/CHANGELOG.md‎

Lines changed: 184 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -4,21 +4,195 @@ All notable changes to this project will be documented in this file.
44
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
55
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
66

7-
## 0.6.6 (2024-04-11)
7+
## 0.7.0 (2026-12-04)
88
### Added
9-
- impl `decode_as` for `KeypairData` ([#211])
9+
- Decode a certificate or public key after reading its algorithm name with
10+
`Certificate::decode_as` and `public::KeyData::decode_as` ([#233])
11+
- Find, read, and write keys in a user's SSH directory with `DotSsh` under `std` ([#257], [#259])
12+
- Parse legacy `ssh-rsa` (RSA/SHA-1) signatures ([#263])
13+
- Serialize and deserialize `SshSig` with `serde`, using PEM for human-readable
14+
formats and the SSH binary encoding for other formats ([#264])
15+
- Implement `core::error::Error` for `ssh_key::Error` in `no_std` builds ([#303])
16+
- Recognize the `rsa-sha2-256-cert-v01@openssh.com` and `rsa-sha2-512-cert-v01@openssh.com`
17+
certificate algorithm names ([#311])
18+
- Verify and explicitly select legacy RSA/SHA-1 signatures with the `rsa` and `sha1`
19+
features. The default RSA signer uses SHA-512 ([#315], [#323])
20+
- Read encrypted and unencrypted PuTTY PPK v2 and v3 private keys with
21+
`PrivateKey::from_ppk` under the new `ppk` feature ([#324])
22+
- Implement `Hash` for `Fingerprint` ([#330])
23+
- Preserve non-UTF-8 comments in OpenSSH private keys ([#347])
24+
- Read and write OpenSSH public and private keys through `std::io::Read` and
25+
`Write` with `read_openssh` and `write_openssh` ([#378])
26+
- Re-export `ssh-cipher` and `ssh-encoding` as `ssh_key::cipher` and `ssh_key::encoding` ([#379])
27+
- Sign and verify SSHSIG messages using a precomputed hash or a streaming digest with
28+
the `*_prehash` and `*_digest` methods and `AssociatedHashAlg` ([#384], [#385])
29+
- Decode certificates embedded in public keys as `KeyData::Certificate`. Use
30+
`certificate()` or `into_certificate()` to extract one ([#449])
31+
- Support `ssh-mldsa44-ed25519` composite keys, signatures, and certificates,
32+
interoperable with OpenSSH 10.6 ([#583])
33+
- Support `ssh-mldsa87-p384` composite keys, signatures, and certificates from
34+
`draft-ietf-sshm-composite-sigs-01` ([#654])
35+
- Generate keys, sign, and verify with either composite algorithm without `alloc`.
36+
Enable them independently with `mldsa44-ed25519` and `mldsa87-p384` ([#655], [#661])
1037

1138
### Changed
12-
- clarify SSH vs OpenSSH formats ([#206])
39+
- Certificate validity timestamps use the full SSH `u64` range. The `valid_after_time`
40+
and `valid_before_time` accessors now return `Option<SystemTime>` ([#209])
41+
- P-521 signing uses deterministic nonces and no longer requires operating-system randomness ([#225])
42+
- RSA and DSA key components are private. Use their constructors and accessors in
43+
place of struct literals and field access. RSA keys also expose `key_size()` ([#269], [#274], [#275])
44+
- Switch to Rust 2024 edition ([#354])
45+
- Move `Mpint` into `ssh-encoding` and retain the `ssh_key::Mpint` re-export ([#359])
46+
- Public and private key `comment()` accessors now require `alloc` and return `&Comment`.
47+
Use `as_bytes()`, `as_str()`, or `as_str_lossy()` to select a representation ([#360])
48+
- Key encryption and KDF initialization accept fallible RNGs and report `Error::RngFailure` ([#362])
49+
- With `rsa` or `dsa` enabled, `Mpint` conversions use `encoding::Uint`
50+
(`crypto_bigint::BoxedUint`) in place of `num_bigint_dig::BigUint` ([#362])
51+
- File-based key readers and writers accept `impl AsRef<Path>` ([#378], [#383])
52+
- The `std` feature no longer enables `std` in the underlying cryptographic backends ([#394])
53+
- Upgrade `rand_core` to v0.10, `sec1` to v0.8, and `sha1` and `sha2` to v0.11 ([#466], [#476], [#480], [#481])
54+
- Upgrade `bcrypt-pbkdf` to v0.11 and the `signature` traits to v3 ([#494], [#501])
55+
- Replace `subtle::ConstantTimeEq` implementations with `ctutils::CtEq` ([#507])
56+
- Upgrade `hmac` to v0.13 ([#519])
57+
- Report signature errors without an underlying `ssh_key::Error` as `Error::Signature` ([#523])
58+
- Upgrade `dsa` to v0.7, `ed25519-dalek` to v3, the NIST curve crates to v0.14,
59+
and `argon2` to v0.6 ([#571], [#572], [#573], [#582])
60+
- Make `sha2` optional and enable it by default. With defaults disabled, enable
61+
`sha2` for fingerprints and certificate validation. The SSHSIG digest and prehash
62+
methods still work with an application-supplied SHA-2 implementation ([#602])
63+
- Raise the minimum supported Rust version from 1.65 to 1.87 ([#610])
64+
- Key and certificate `Decode` and `decode_as` implementations take `&mut Decoder<impl Reader>` ([#618])
65+
- `Mpint` stores unsigned magnitudes of up to 16,384 bits. Decoding rejects negative
66+
values and encoding writes canonical SSH integers ([#622])
67+
- Raise the default bcrypt-PBKDF cost for new encrypted OpenSSH keys from 16 to 32 rounds ([#624])
68+
- Reject decoded binary input larger than 128 MiB ([#628])
69+
- Limit certificates to 256 principals when building or decoding them ([#633])
70+
- Use `ssh-encoding`'s decoder constructors and derives for key types, preserving their
71+
wire formats and validation ([#663], [#664], [#666])
72+
- Upgrade `ssh-encoding` and `ssh-cipher` to v0.4 ([#668], [#669])
1373

14-
### Fixed
15-
- fix `certificate::OptionsMap` encoding ([#207])
16-
- fixup `EcdsaPrivateKey` Debug impl ([#210])
74+
### Removed
75+
- Remove the crate's separate 2,048-bit RSA minimum for generation and conversion.
76+
Those operations now use the `rsa` backend's size policy ([#412])
77+
- Remove `Mpint::from_positive_bytes` and `as_positive_bytes`. Use `from_bytes`
78+
and `as_bytes` for unsigned big-endian magnitudes ([#622])
1779

18-
[#206]: https://github.com/RustCrypto/SSH/pull/206
19-
[#207]: https://github.com/RustCrypto/SSH/pull/207
20-
[#210]: https://github.com/RustCrypto/SSH/pull/210
21-
[#211]: https://github.com/RustCrypto/SSH/pull/211
80+
### Fixed
81+
- Read OpenSSH private keys with an empty comment and no padding ([#216])
82+
- Preserve both distinct prime factors when converting an SSH keypair to an RSA private key ([#218])
83+
- Detect the Base64 line width when reading PEM-wrapped OpenSSH private keys ([#252])
84+
- Accept the extra padding PuTTYgen writes on unencrypted OpenSSH private keys ([#321])
85+
- Decode short P-521 private scalars ([#351])
86+
- Encode a certificate held in `KeyData` with its certificate algorithm name exactly once ([#451])
87+
- Handle OpenSSH's `u64::MAX` no-expiry sentinel in certificate system-time conversion ([#504])
88+
- Encode the flags and counter for `sk-ecdsa-sha2-nistp256@openssh.com` signatures
89+
after the length-prefixed ECDSA signature ([#532])
90+
- Restore the `getrandom` feature and re-export the matching `getrandom` crate ([#539])
91+
- Accept repeated spaces, tabs, and leading whitespace in `known_hosts` entries ([#619])
92+
- Accept ECDSA private scalars as short as 24 bytes, padding them to the curve size ([#623])
93+
- Reject custom certificate algorithms with an empty name or domain ([#629])
94+
- Reject trailing bytes in `Signature::try_from(&[u8])` and binary `SshSig`
95+
deserialization with `serde` ([#631])
96+
- Include the CRT coefficient `iqmp` when comparing RSA private keys ([#635])
97+
98+
### Security
99+
- Reject certificates used as CA keys when decoding or signing certificates ([#604])
100+
- Require `ctutils` v0.4.8, which includes constant-time mask generation and
101+
comparison fixes ([#610], [RUSTSEC-2026-0385])
102+
- Upgrade the optional `rsa` backend to v0.10, which fixes the upstream RSA
103+
decryption timing issue ([#613], [RUSTSEC-2023-0071])
104+
- Check that bcrypt-PBKDF rounds are in `1..=1_048_576` when reading or writing the
105+
KDF parameters and before deriving an OpenSSH encryption key ([#624], [#625])
106+
- Bound Argon2 parameters from PuTTY PPK files to 1 GiB of memory, 1,024 passes,
107+
and 64 lanes before running the KDF ([#626])
108+
- Keep private key material out of PPK parse errors by omitting the input text ([#636])
109+
- Verify and re-encode certificates using the exact bytes signed by the CA.
110+
This preserves valid signatures over noncanonical field encodings and rejects
111+
changes to signed bytes that decode to the same value ([#659])
112+
- Raise the `curve25519-dalek` minimum to v5.1 for `ed25519` and `mldsa44-ed25519`.
113+
This fixes an arithmetic error in the x86-64 AVX-512 backend ([RUSTSEC-2026-0620])
114+
115+
[#209]: https://github.com/RustCrypto/SSH/pull/209
116+
[#216]: https://github.com/RustCrypto/SSH/pull/216
117+
[#218]: https://github.com/RustCrypto/SSH/pull/218
118+
[#225]: https://github.com/RustCrypto/SSH/pull/225
119+
[#233]: https://github.com/RustCrypto/SSH/pull/233
120+
[#252]: https://github.com/RustCrypto/SSH/pull/252
121+
[#257]: https://github.com/RustCrypto/SSH/pull/257
122+
[#259]: https://github.com/RustCrypto/SSH/pull/259
123+
[#263]: https://github.com/RustCrypto/SSH/pull/263
124+
[#264]: https://github.com/RustCrypto/SSH/pull/264
125+
[#269]: https://github.com/RustCrypto/SSH/pull/269
126+
[#274]: https://github.com/RustCrypto/SSH/pull/274
127+
[#275]: https://github.com/RustCrypto/SSH/pull/275
128+
[#303]: https://github.com/RustCrypto/SSH/pull/303
129+
[#311]: https://github.com/RustCrypto/SSH/pull/311
130+
[#315]: https://github.com/RustCrypto/SSH/pull/315
131+
[#321]: https://github.com/RustCrypto/SSH/pull/321
132+
[#323]: https://github.com/RustCrypto/SSH/pull/323
133+
[#324]: https://github.com/RustCrypto/SSH/pull/324
134+
[#330]: https://github.com/RustCrypto/SSH/pull/330
135+
[#347]: https://github.com/RustCrypto/SSH/pull/347
136+
[#351]: https://github.com/RustCrypto/SSH/pull/351
137+
[#354]: https://github.com/RustCrypto/SSH/pull/354
138+
[#359]: https://github.com/RustCrypto/SSH/pull/359
139+
[#360]: https://github.com/RustCrypto/SSH/pull/360
140+
[#362]: https://github.com/RustCrypto/SSH/pull/362
141+
[#378]: https://github.com/RustCrypto/SSH/pull/378
142+
[#379]: https://github.com/RustCrypto/SSH/pull/379
143+
[#383]: https://github.com/RustCrypto/SSH/pull/383
144+
[#384]: https://github.com/RustCrypto/SSH/pull/384
145+
[#385]: https://github.com/RustCrypto/SSH/pull/385
146+
[#394]: https://github.com/RustCrypto/SSH/pull/394
147+
[#412]: https://github.com/RustCrypto/SSH/pull/412
148+
[#449]: https://github.com/RustCrypto/SSH/pull/449
149+
[#451]: https://github.com/RustCrypto/SSH/pull/451
150+
[#466]: https://github.com/RustCrypto/SSH/pull/466
151+
[#476]: https://github.com/RustCrypto/SSH/pull/476
152+
[#480]: https://github.com/RustCrypto/SSH/pull/480
153+
[#481]: https://github.com/RustCrypto/SSH/pull/481
154+
[#494]: https://github.com/RustCrypto/SSH/pull/494
155+
[#501]: https://github.com/RustCrypto/SSH/pull/501
156+
[#504]: https://github.com/RustCrypto/SSH/pull/504
157+
[#507]: https://github.com/RustCrypto/SSH/pull/507
158+
[#519]: https://github.com/RustCrypto/SSH/pull/519
159+
[#523]: https://github.com/RustCrypto/SSH/pull/523
160+
[#532]: https://github.com/RustCrypto/SSH/pull/532
161+
[#539]: https://github.com/RustCrypto/SSH/pull/539
162+
[#571]: https://github.com/RustCrypto/SSH/pull/571
163+
[#572]: https://github.com/RustCrypto/SSH/pull/572
164+
[#573]: https://github.com/RustCrypto/SSH/pull/573
165+
[#582]: https://github.com/RustCrypto/SSH/pull/582
166+
[#583]: https://github.com/RustCrypto/SSH/pull/583
167+
[#602]: https://github.com/RustCrypto/SSH/pull/602
168+
[#604]: https://github.com/RustCrypto/SSH/pull/604
169+
[#610]: https://github.com/RustCrypto/SSH/pull/610
170+
[#613]: https://github.com/RustCrypto/SSH/pull/613
171+
[#618]: https://github.com/RustCrypto/SSH/pull/618
172+
[#619]: https://github.com/RustCrypto/SSH/pull/619
173+
[#622]: https://github.com/RustCrypto/SSH/pull/622
174+
[#623]: https://github.com/RustCrypto/SSH/pull/623
175+
[#624]: https://github.com/RustCrypto/SSH/pull/624
176+
[#625]: https://github.com/RustCrypto/SSH/pull/625
177+
[#626]: https://github.com/RustCrypto/SSH/pull/626
178+
[#628]: https://github.com/RustCrypto/SSH/pull/628
179+
[#629]: https://github.com/RustCrypto/SSH/pull/629
180+
[#631]: https://github.com/RustCrypto/SSH/pull/631
181+
[#633]: https://github.com/RustCrypto/SSH/pull/633
182+
[#635]: https://github.com/RustCrypto/SSH/pull/635
183+
[#636]: https://github.com/RustCrypto/SSH/pull/636
184+
[#654]: https://github.com/RustCrypto/SSH/pull/654
185+
[#655]: https://github.com/RustCrypto/SSH/pull/655
186+
[#659]: https://github.com/RustCrypto/SSH/pull/659
187+
[#661]: https://github.com/RustCrypto/SSH/pull/661
188+
[#663]: https://github.com/RustCrypto/SSH/pull/663
189+
[#664]: https://github.com/RustCrypto/SSH/pull/664
190+
[#666]: https://github.com/RustCrypto/SSH/pull/666
191+
[#668]: https://github.com/RustCrypto/SSH/pull/668
192+
[#669]: https://github.com/RustCrypto/SSH/pull/669
193+
[RUSTSEC-2023-0071]: https://rustsec.org/advisories/RUSTSEC-2023-0071.html
194+
[RUSTSEC-2026-0385]: https://rustsec.org/advisories/RUSTSEC-2026-0385.html
195+
[RUSTSEC-2026-0620]: https://rustsec.org/advisories/RUSTSEC-2026-0620.html
22196

23197
## 0.6.7 (2024-10-15)
24198
### Fixed

‎ssh-key/Cargo.toml‎

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "ssh-key"
3-
version = "0.7.0-rc.13"
3+
version = "0.7.0"
44
description = """
55
Pure Rust implementation of SSH key file format decoders/encoders as described
66
in RFC4251/RFC4253 and OpenSSH key formats, as well as "sshsig" signatures and
@@ -31,6 +31,8 @@ zeroize = { version = "1.9", default-features = false }
3131
# optional dependencies
3232
argon2 = { version = "0.6", optional = true, default-features = false, features = ["alloc"] }
3333
bcrypt-pbkdf = { version = "0.11", optional = true, default-features = false, features = ["alloc"] }
34+
# ed25519-dalek 3.0.0 allows curve25519-dalek 5.0.0, affected by RUSTSEC-2026-0620.
35+
curve25519-dalek = { version = "5.1", optional = true, default-features = false }
3436
dsa = { version = "0.7", optional = true, default-features = false, features = ["hazmat"] }
3537
ed25519-dalek = { version = "3", optional = true, default-features = false }
3638
hex = { version = "0.4", optional = true, default-features = false, features = ["alloc"] }
@@ -59,7 +61,7 @@ std = ["alloc"]
5961
crypto = ["ed25519", "p256", "p384", "p521", "rsa"] # NOTE: `dsa` is obsolete/weak
6062
dsa = ["dep:dsa", "dep:sha1", "alloc", "encoding/bigint", "signature/rand_core"]
6163
ecdsa = ["dep:sec1"]
62-
ed25519 = ["dep:ed25519-dalek", "rand_core", "sha2"]
64+
ed25519 = ["dep:curve25519-dalek", "dep:ed25519-dalek", "rand_core", "sha2"]
6365
encryption = [
6466
"dep:bcrypt-pbkdf",
6567
"alloc",

‎ssh-protocol/Cargo.toml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ rust-version = "1.87"
1818
[dependencies]
1919
cipher = { package = "ssh-cipher", version = "0.4", default-features = false }
2020
encoding = { package = "ssh-encoding", version = "0.4", default-features = false }
21-
key = { package = "ssh-key", version = "0.7.0-rc.13", default-features = false }
21+
key = { package = "ssh-key", version = "0.7", default-features = false }
2222

2323
[features]
2424
default = ["std"]

0 commit comments

Comments
 (0)