Skip to content

Commit d786259

Browse files
authored
ssh-encoding v0.4.0 (#668)
1 parent 50d5e48 commit d786259

6 files changed

Lines changed: 81 additions & 5 deletions

File tree

‎Cargo.lock‎

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎ssh-cipher/Cargo.toml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ aes-gcm = { version = "0.11", optional = true, default-features = false, feature
2727
ctutils = { version = "0.4.8", optional = true, default-features = false }
2828
chacha20 = { version = "0.10", optional = true, default-features = false, features = ["cipher", "legacy"] }
2929
des = { version = "0.9", optional = true, default-features = false }
30-
encoding = { package = "ssh-encoding", version = "0.4.0-rc.2", optional = true }
30+
encoding = { package = "ssh-encoding", version = "0.4", optional = true }
3131
poly1305 = { version = "0.9", optional = true, default-features = false }
3232
zeroize = { version = "1", optional = true, default-features = false }
3333

‎ssh-encoding/CHANGELOG.md‎

Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,82 @@ 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.4.0 (2026-12-04)
8+
### Added
9+
- `Decoder<R>` for bounded, nested decoding without allocation. Use `read_nested` for a
10+
known length or `read_prefixed` for an SSH length prefix ([#618])
11+
- `Mpint::is_zero` and equality comparisons for `Mpint` without the `ctutils` feature ([#622])
12+
- `MpintRef` for encoding a borrowed magnitude, `Decoder::read_mpint_bytes` for decoding into
13+
caller-provided storage, and a `Writer` impl for `&mut [u8]` ([#656])
14+
- `Decoder::from_bytes`, `from_base64`, and `from_pem`. The `base64` and `pem` features
15+
expose `Base64Decoder` and `PemDecoder` aliases. Use `pem_label()` to inspect the PEM label
16+
or `pem::PemReader` to access the reader directly ([#663])
17+
- With the `derive` feature, use `#[ssh(error = crate::Error)]` to select a derived
18+
`Decode::Error` ([#665])
19+
20+
### Changed
21+
- Raise the minimum supported Rust version from 1.85 to 1.87 ([#610])
22+
- Limit `Mpint` magnitudes to 16384 bits (2048 bytes) ([#615])
23+
- `Decode::decode` now takes `&mut Decoder<impl Reader>`. Call nested reads and completion
24+
checks on the decoder. After a read or nested decode fails, subsequent reads return
25+
`Error::Failed` ([#618])
26+
- `Mpint::from_bytes` and `as_bytes` now use unsigned big-endian magnitudes. Decoding rejects
27+
negative wire values and accepts redundant leading zeros within the wire-size limit.
28+
Encoding produces canonical SSH integers. Use `TryFrom` to convert a `Uint` to an `Mpint`
29+
and `From` for the reverse conversion ([#622])
30+
- Report buffer reservation failures as `Error::Alloc` when decoding owned values or
31+
encoding into a `Vec<u8>` ([#627])
32+
- `Decoder::new` and `Reader::into_decoder` are fallible and reject decoded binary input
33+
larger than 128 MiB, including when reading Base64 or PEM ([#628])
34+
- Decode any SSH `uint32` representable as a `usize`, lifting the previous `0xfffff` cap ([#637])
35+
- Accept SSH algorithm and method labels up to 64 bytes, up from 48 ([#639])
36+
- Limit decoding to 64 active nested scopes and return `Error::NestingDepth` at the next level ([#641])
37+
- The derives now reject previously ignored `#[ssh(...)]` attributes on enum variants ([#644])
38+
- Custom `Reader` implementations must implement `Clone`. Each clone starts at the same
39+
position and advances independently, allowing a decoder to reread the original bytes ([#659])
40+
- Update the optional `ssh-derive` dependency to v0.4 ([#667])
41+
42+
### Removed
43+
- `Mpint::from_positive_bytes`, `as_positive_bytes`, and `is_positive`. Use `from_bytes` and
44+
`as_bytes` for unsigned magnitudes and `is_zero` to test for zero ([#622])
45+
- `Reader::read_byten`. Use `Decoder::read_string_bytes` for a length-prefixed SSH string
46+
or decode `[u8; N]` for a fixed-width byte array ([#647])
47+
48+
### Fixed
49+
- Slice readers now return `Error::TrailingData` when a length-prefixed field is only partly
50+
consumed ([8cbd2a0])
51+
- Order `Mpint` values numerically with `ctutils` enabled and preserve canonical zero after
52+
zeroization ([#622])
53+
- Count four bytes for `#[repr(usize)]` enum tags in derived `Encode::encoded_len`, and
54+
allow fields named `writer`. Derived decoders now match discriminant expressions by value ([#643])
55+
- Correct the `Vec<String>` documentation to describe an SSH string containing a sequence
56+
of length-prefixed strings ([#646])
57+
58+
### Security
59+
- Require `ctutils` v0.4.8 when that optional dependency is enabled, picking up upstream
60+
constant-time fixes for mask generation and comparisons ([#610], [RUSTSEC-2026-0385])
61+
62+
[#610]: https://github.com/RustCrypto/SSH/pull/610
63+
[#615]: https://github.com/RustCrypto/SSH/pull/615
64+
[#618]: https://github.com/RustCrypto/SSH/pull/618
65+
[#622]: https://github.com/RustCrypto/SSH/pull/622
66+
[#627]: https://github.com/RustCrypto/SSH/pull/627
67+
[#628]: https://github.com/RustCrypto/SSH/pull/628
68+
[#637]: https://github.com/RustCrypto/SSH/pull/637
69+
[#639]: https://github.com/RustCrypto/SSH/pull/639
70+
[#641]: https://github.com/RustCrypto/SSH/pull/641
71+
[#643]: https://github.com/RustCrypto/SSH/pull/643
72+
[#644]: https://github.com/RustCrypto/SSH/pull/644
73+
[#646]: https://github.com/RustCrypto/SSH/pull/646
74+
[#647]: https://github.com/RustCrypto/SSH/pull/647
75+
[#656]: https://github.com/RustCrypto/SSH/pull/656
76+
[#659]: https://github.com/RustCrypto/SSH/pull/659
77+
[#663]: https://github.com/RustCrypto/SSH/pull/663
78+
[#665]: https://github.com/RustCrypto/SSH/pull/665
79+
[#667]: https://github.com/RustCrypto/SSH/pull/667
80+
[8cbd2a0]: https://github.com/RustCrypto/SSH/commit/8cbd2a001fff63aead2e3c83c8dbd95dce5a5e95
81+
[RUSTSEC-2026-0385]: https://rustsec.org/advisories/RUSTSEC-2026-0385.html
82+
783
## 0.3.0 (2026-05-25)
884
### Added
985
- `boolean` encode/decode support ([#214])

‎ssh-encoding/Cargo.toml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "ssh-encoding"
3-
version = "0.4.0-rc.2"
3+
version = "0.4.0"
44
description = "Pure Rust implementation of SSH data type decoders/encoders as described in RFC4251"
55
authors = ["RustCrypto Developers"]
66
license = "Apache-2.0 OR MIT"

‎ssh-key/Cargo.toml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ rust-version = "1.87"
1919

2020
[dependencies.encoding]
2121
package = "ssh-encoding"
22-
version = "0.4.0-rc.2"
22+
version = "0.4"
2323
features = ["base64", "derive", "digest", "pem", "ctutils", "zeroize"]
2424

2525
[dependencies]

‎ssh-protocol/Cargo.toml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ rust-version = "1.87"
1717

1818
[dependencies]
1919
cipher = { package = "ssh-cipher", version = "0.4.0-rc.0", default-features = false }
20-
encoding = { package = "ssh-encoding", version = "0.4.0-rc.2", default-features = false }
20+
encoding = { package = "ssh-encoding", version = "0.4", default-features = false }
2121
key = { package = "ssh-key", version = "0.7.0-rc.13", default-features = false }
2222

2323
[features]

0 commit comments

Comments
 (0)