Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ jobs:
all:
strategy:
matrix:
# 1.83 is an arbitrary minimum, tested to notice when it bumps
rust_version: [stable, nightly, 1.83]
# 1.85 is an arbitrary minimum, tested to notice when it bumps
rust_version: [stable, nightly, 1.85]
runs-on: ubuntu-latest
env:
RUSTUP_TOOLCHAIN: ${{ matrix.rust_version }}
Expand Down
2 changes: 1 addition & 1 deletion src/namelist.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ use sshwire::{BinString, SSHDecode, SSHEncode, SSHSink, SSHSource, WireResult};

/// Max count of LocalNames entries
///
/// Current max is for kex, [mlkem, curve25519, curve25519@libssh, ext-info, strictkex, kexguess2]
/// Current max is for kex: (mlkem, curve25519, curve25519@libssh, ext-info, strictkex, kexguess2)
pub const MAX_LOCAL_NAMES: usize = 6;
static EMPTY_LOCALNAMES: LocalNames = LocalNames::new();

Expand Down
16 changes: 16 additions & 0 deletions src/sshwire.rs
Original file line number Diff line number Diff line change
Expand Up @@ -486,6 +486,12 @@ impl SSHEncode for u32 {
}
}

impl SSHEncode for u64 {
fn enc(&self, s: &mut dyn SSHSink) -> WireResult<()> {
s.push(&self.to_be_bytes())
}
}

// no length prefix
impl SSHEncode for &[u8] {
fn enc(&self, s: &mut dyn SSHSink) -> WireResult<()> {
Expand Down Expand Up @@ -555,6 +561,16 @@ impl<'de> SSHDecode<'de> for u32 {
}
}

impl<'de> SSHDecode<'de> for u64 {
fn dec<S>(s: &mut S) -> WireResult<Self>
where
S: SSHSource<'de>,
{
let t = s.take(core::mem::size_of::<u64>())?;
Ok(u64::from_be_bytes(t.try_into().unwrap()))
}
}

/// Decodes a SSH name string. Must be ASCII
/// without control characters. RFC4251 section 6.
pub fn try_as_ascii(t: &[u8]) -> WireResult<&AsciiStr> {
Expand Down