wolfSSH

wolfSSH is a small SSH implementation with SFTP. I added TPM 2.0 backed SSH keys so the private key never enters process memory, fixed memory-safety bugs, and cut per-connection allocation.

Role: contributor C, SSH-2, SFTP, wolfTPM wolfSSL/wolfssh
01 / What I built

Main changes

02 / Design

One design choice

The host key slot stores only the key type and an isTpm flag, with no private key bytes. The key exchange signature is made in the TPM through wolfTPM, and the matching host key algorithm is advertised automatically. For X.509, UpdateHostCertificates clears any stale software key and marks the slot TPM-backed.

03 / Debugging

A bug I fixed

In a TPM build a client could not use password or keyboard-interactive login. DoUserAuthFailure handled only publickey under WOLFSSH_TPM. I removed that special case and added a tpmPubkeyTried flag so the client tries publickey first, then falls back to password or keyboard. (#1081)

04 / Verification

How it was checked

PREvidence
#1081tpm-ssh workflow gained a hostkey axis (raw, x509); x509 cells run tpmcertserver and tpmcertclient.
#1104wolfSSH_new() allocation measured 11568 to 7472 B on 64-bit --enable-all.
#1033CI matrix of rsa and ecc keys against ibmswtpm2 and fwtpm simulators, verified with OpenSSH.
05 / Limits

What is not done yet

TPM client public key authentication is RSA only. Adding ECDSA to the client path would match the server host key support.

All my merged pull requests 7 in wolfSSL/wolfssh
  • #1104Allocate channelName dynamically to shrink WOLFSSH struct by ~4KB
  • #1103Memory-safety, zeroization, and correctness fixes across agent, SFTP, terminal, FPKI, and transport
  • #1081Add TPM-backed X.509 host certificate support and fix TPM-build client auth
  • #1046Add timeout to TPM SSH workflow to prevent multi-hour hangs
  • #1033Add TPM 2.0 resident server host keys for ECDSA and RSA
  • #884Add more CI workflows for wolfSSH
  • #754wolfSSH support for using TPM based key for authentication

all work view the repository