Skip to content

sshwire improvements - #64

Merged
mkj merged 12 commits into
mainfrom
pr/sshwire
Aug 2, 2026
Merged

sshwire improvements#64
mkj merged 12 commits into
mainfrom
pr/sshwire

Conversation

@mkj

@mkj mkj commented Aug 2, 2026

Copy link
Copy Markdown
Owner

sshwire-derive can now encode enum tuple and struct variants. These aren't currently used in SSH protocol, but can be used in future for inter-application encoding.

Handling of unknown variants has changed, with a new sshwire(decode_unknown_fail) attribute to return an error, so enums don't need an Unknown variant. Error::UnknownVariant now has a different meaning, EncodeUnknown is the name for the old error.

&[u8] no longer has SSHEncode since it could be unclear what it would do.

mkj added 12 commits August 2, 2026 19:44
Add some extra derive checks for sshwire(unknown) variants.
Added docs describing function purpose.
This is emitted by sshwire-derive, so doesn't really belong in packets
module.
UnknownVariant sounds similar to sunset::Error::UnknownMethod
which has a different meaning, and sshwire-derive might soon emit that.
Bring back WireError::UnknownVariant to return in the case
an unknown variant is encountered.
This is fairly rare, and instead can use .push(). This avoids
accidentally encoding expecting something like BinString.
There wasn't an equivalent SSHDecode since length is unknown.
@mkj
mkj merged commit b31b95c into main Aug 2, 2026
4 checks passed
@mkj
mkj deleted the pr/sshwire branch August 2, 2026 15:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant