Skip to content

Commit

Permalink
fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
Eugeny committed Jan 5, 2025
1 parent 7aee69d commit d5daabd
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 9 deletions.
13 changes: 7 additions & 6 deletions russh/src/cert.rs
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
use core::str;

use russh_keys::helpers::AlgorithmExt;
use russh_keys::key::PrivateKeyWithHashAlg;
use ssh_encoding::Decode;
use ssh_key::public::KeyData;
use ssh_key::{Algorithm, Certificate, HashAlg, PublicKey};
use ssh_key::{Certificate, HashAlg, PublicKey};
#[cfg(not(target_arch = "wasm32"))]
use {
russh_keys::helpers::AlgorithmExt, ssh_encoding::Decode, ssh_key::public::KeyData,
ssh_key::Algorithm,
};

#[derive(Debug)]
pub(crate) enum PublicKeyOrCertificate {
Expand All @@ -25,6 +25,7 @@ impl From<&PrivateKeyWithHashAlg> for PublicKeyOrCertificate {
}

impl PublicKeyOrCertificate {
#[cfg(not(target_arch = "wasm32"))]
pub fn decode(pubkey_algo: &str, buf: &[u8]) -> Result<Self, ssh_key::Error> {
let mut reader = buf;
match Algorithm::new_certificate_ext(pubkey_algo) {
Expand Down
2 changes: 1 addition & 1 deletion russh/src/client/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@ use std::convert::TryInto;
use std::num::Wrapping;
use std::pin::Pin;
use std::sync::Arc;
use std::time::Instant;

use async_trait::async_trait;
use futures::task::{Context, Poll};
Expand All @@ -48,6 +47,7 @@ use kex::ClientKex;
use log::{debug, error, trace};
use russh_keys::key::PrivateKeyWithHashAlg;
use russh_keys::map_err;
use russh_util::time::Instant;
use ssh_encoding::Decode;
use ssh_key::{Certificate, PrivateKey, PublicKey};
use tokio::io::{AsyncRead, AsyncWrite, AsyncWriteExt, ReadHalf, WriteHalf};
Expand Down
2 changes: 1 addition & 1 deletion russh/src/msg.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ pub const UNIMPLEMENTED: u8 = 3;
#[allow(dead_code)]
pub const DEBUG: u8 = 4;

pub const SERVICE_REQUEST: u8 = 5;
pub const SERVICE_ACCEPT: u8 = 6;
pub const EXT_INFO: u8 = 7;
pub const KEXINIT: u8 = 20;
Expand Down Expand Up @@ -73,7 +74,6 @@ mod server {
// https://tools.ietf.org/html/rfc4256#section-5
pub const USERAUTH_INFO_REQUEST: u8 = 60;
pub const USERAUTH_PK_OK: u8 = 60;
pub const SERVICE_REQUEST: u8 = 5;
pub const SSH_OPEN_ADMINISTRATIVELY_PROHIBITED: u8 = 1;
}

Expand Down
1 change: 1 addition & 0 deletions russh/src/negotiation.rs
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ pub struct Config {
#[derive(Debug, Clone)]
pub struct Names {
pub kex: kex::Name,
#[cfg_attr(target_arch = "wasm32", allow(dead_code))]
pub key: Algorithm,
pub cipher: cipher::Name,
pub client_mac: mac::Name,
Expand Down
2 changes: 1 addition & 1 deletion russh/src/server/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ use std::num::Wrapping;
use std::pin::Pin;
use std::sync::Arc;
use std::task::{Context, Poll};
use std::time::Instant;

use async_trait::async_trait;
use bytes::Bytes;
Expand All @@ -43,6 +42,7 @@ use log::{debug, error, info, warn};
use msg::is_kex_msg;
use russh_keys::map_err;
use russh_util::runtime::JoinHandle;
use russh_util::time::Instant;
use ssh_key::{Certificate, PrivateKey};
use tokio::io::{AsyncRead, AsyncWrite, AsyncWriteExt};
use tokio::net::{TcpListener, ToSocketAddrs};
Expand Down

0 comments on commit d5daabd

Please sign in to comment.