Skip to main content

Crate puressh

Crate puressh 

Source
Expand description

puressh — a pure-Rust SSH (Secure Shell) protocol library.

Built on purecrypto for all cryptographic primitives, with no foreign code in the dependency tree.

The crate is split along the layers of RFC 4251–4254:

  • format — SSH wire format primitives (mpint, string, name-list).
  • transport — binary packet protocol, version exchange, KEX state machine.
  • kex — key-exchange algorithms (curve25519-sha256, ecdh-sha2-nistp*).
  • cipher — symmetric ciphers (aes*-ctr, aes*-gcm, chacha20-poly1305).
  • mac — message authentication codes (hmac-sha2-*, *-etm).
  • hostkey — host-key/signature algorithms (ssh-ed25519, ecdsa-sha2-*, rsa-sha2-*).
  • auth — userauth (RFC 4252).
  • channel — channels (RFC 4254).
  • key — OpenSSH key file parsing and serialisation.
  • client — high-level client API (feature client).
  • server — high-level server API (feature server).

Re-exports§

pub use error::Error;
pub use error::Result;

Modules§

agent
OpenSSH ssh-agent client.
auth
User authentication — RFC 4252 (with RFC 4256 keyboard-interactive).
channel
Connection protocol — RFC 4254.
cipher
SSH cipher suite adapters over purecrypto::cipher.
client
High-level synchronous SSH client over std::net::TcpStream.
compress
SSH packet payload compression (RFC 4253 §6.2).
error
Crate-wide error type.
format
SSH wire-format primitives (RFC 4251 §5).
forwarding
Port-forwarding building blocks used by puressh::server (and client in a follow-up commit).
hostkey
Host-key / public-key signature algorithms (RFC 4253 §6.6, RFC 8332).
kex
Key-exchange algorithms.
key
OpenSSH key file parsing and serialisation.
known_hosts
OpenSSH known_hosts format: parse, store, lookup, and rewrite.
mac
Message Authentication Codes over purecrypto::hash (HMAC family).
scp
SCP (Secure CoPy) protocol — the wire format spoken by scp -t / scp -f between a local and a remote OpenSSH scp binary. The protocol predates SFTP and is loosely specified (the closest thing to a reference is OpenSSH’s own scp.c); the encoding is line-headers + raw payload + single-byte acks, transported over any Read+Write stream — typically a crate::client::ClientChannelStream driving the remote scp -t/scp -f helper.
server
High-level blocking SSH server over std::net::TcpListener.
sftp
SFTP v3 protocol implementation (draft-ietf-secsh-filexfer-02).
shared
Owned-handle wrapper around Client that supports multiple concurrent channel sessions of every type on a single SSH connection — SFTP, exec, interactive shells, and direct-tcpip forwards all coexisting on the same transport.
stream
Cross-cutting bidirectional channel adapter used by server-side crate::server::SubsystemHandler / crate::server::DirectTcpipHandler plumbing AND by the client-side multi-channel event loop (crate::client::Client::serve).
transport
SSH transport layer — RFC 4253.