@@ -4,6 +4,82 @@ All notable changes to this project will be documented in this file.
44The format is based on [ Keep a Changelog] ( https://keepachangelog.com/en/1.0.0/ ) ,
55and 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 ] )
0 commit comments