diff --git a/Cargo.lock b/Cargo.lock index 5af1009d..01e0f338 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -851,7 +851,7 @@ dependencies = [ [[package]] name = "ssh-derive" -version = "0.4.0-rc.0" +version = "0.4.0" dependencies = [ "proc-macro2", "quote", diff --git a/ssh-derive/CHANGELOG.md b/ssh-derive/CHANGELOG.md index 09a78980..1e7ecfee 100644 --- a/ssh-derive/CHANGELOG.md +++ b/ssh-derive/CHANGELOG.md @@ -4,5 +4,29 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## 0.4.0 (2026-12-04) +### Added +- Use `#[ssh(error = crate::Error)]` on a struct or enum to select its derived `Decode::Error`. The default is `ssh_encoding::Error` ([#665]) + +### Changed +- Upgrade the `syn` dependency from v2 to v3 ([#576]) +- Derived `Decode::decode` implementations now take `&mut Decoder` to match + the `ssh-encoding` 0.4 API ([#618]) +- Both derives now reject `#[ssh(...)]` attributes on enum variants at compile time. + Earlier versions silently ignored these attributes ([#644]) + +### Fixed +- Use the four-byte SSH wire length for `#[repr(usize)]` enum discriminants on 64-bit + targets and preserve unknown `usize` tags in `Error::InvalidDiscriminant` ([#643]) +- Match enum discriminants by their evaluated value when decoding. For example, a variant + declared with `1 | 2` accepts only the wire tag `3` ([#643]) +- Allow enum variants with a field named `writer` to derive `Encode` ([#643]) + +[#576]: https://github.com/RustCrypto/SSH/pull/576 +[#618]: https://github.com/RustCrypto/SSH/pull/618 +[#643]: https://github.com/RustCrypto/SSH/pull/643 +[#644]: https://github.com/RustCrypto/SSH/pull/644 +[#665]: https://github.com/RustCrypto/SSH/pull/665 + ## 0.3.0 (2026-05-10) Initial release. Earlier versions skipped to match v0.3 release of `ssh-cipher`/`ssh-encoding`. diff --git a/ssh-derive/Cargo.toml b/ssh-derive/Cargo.toml index 7540bfb5..285d1c5a 100644 --- a/ssh-derive/Cargo.toml +++ b/ssh-derive/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "ssh-derive" -version = "0.4.0-rc.0" +version = "0.4.0" description = "Custom derive support for the `ssh-encoding` crate" authors = ["RustCrypto Developers"] license = "Apache-2.0 OR MIT" diff --git a/ssh-encoding/Cargo.toml b/ssh-encoding/Cargo.toml index f0b05e3e..9336681a 100644 --- a/ssh-encoding/Cargo.toml +++ b/ssh-encoding/Cargo.toml @@ -19,7 +19,7 @@ bytes = { version = "1.11", optional = true, default-features = false } ctutils = { version = "0.4.8", optional = true, default-features = false } digest = { version = "0.11", optional = true, default-features = false } pem-rfc7468 = { version = "1", optional = true } -ssh-derive = { version = "0.4.0-rc.0", optional = true } +ssh-derive = { version = "0.4", optional = true } zeroize = { version = "1.8", optional = true, default-features = false } [dev-dependencies]