diff --git a/ssh-encoding/src/decode.rs b/ssh-encoding/src/decode.rs index d524da5..d2f75fc 100644 --- a/ssh-encoding/src/decode.rs +++ b/ssh-encoding/src/decode.rs @@ -179,11 +179,14 @@ impl Decode for Vec { } } -/// Decodes `Bytes` from `byte[n]` as described in [RFC4251 § 5]: +/// Decodes `Bytes` from `string` as described in [RFC4251 § 5]: /// -/// > A byte represents an arbitrary 8-bit value (octet). Fixed length -/// > data is sometimes represented as an array of bytes, written -/// > `byte[n]`, where n is the number of bytes in the array. +/// > Arbitrary length binary string. Strings are allowed to contain +/// > arbitrary binary data, including null characters and 8-bit +/// > characters. They are stored as a uint32 containing its length +/// > (number of bytes that follow) and zero (= empty string) or more +/// > bytes that are the value of the string. Terminating null +/// > characters are not used. /// /// [RFC4251 § 5]: https://datatracker.ietf.org/doc/html/rfc4251#section-5 #[cfg(feature = "bytes")] diff --git a/ssh-encoding/src/encode.rs b/ssh-encoding/src/encode.rs index 2f79c80..44730ab 100644 --- a/ssh-encoding/src/encode.rs +++ b/ssh-encoding/src/encode.rs @@ -134,11 +134,14 @@ impl Encode for usize { } } -/// Encodes `[u8]` into `byte[n]` as described in [RFC4251 § 5]: +/// Encodes `[u8]` into `string` as described in [RFC4251 § 5]: /// -/// > A byte represents an arbitrary 8-bit value (octet). Fixed length -/// > data is sometimes represented as an array of bytes, written -/// > `byte[n]`, where n is the number of bytes in the array. +/// > Arbitrary length binary string. Strings are allowed to contain +/// > arbitrary binary data, including null characters and 8-bit +/// > characters. They are stored as a uint32 containing its length +/// > (number of bytes that follow) and zero (= empty string) or more +/// > bytes that are the value of the string. Terminating null +/// > characters are not used. /// /// [RFC4251 § 5]: https://datatracker.ietf.org/doc/html/rfc4251#section-5 impl Encode for [u8] {