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.
Main changes
- Added client public key authentication with an RSA key held in a TPM.#754
- Added wolfSSH_CTX_UseTpmHostKey so a server signs the key exchange inside the TPM, for ECDSA and RSA.#1033
- Added TPM-backed X.509 host certificates and fixed a TPM-build regression that blocked password login.#1081
- Fixed memory-safety, zeroization and parsing bugs across agent, SFTP, terminal, FPKI and transport code.#1103
- Moved the channel name out of the WOLFSSH struct, saving 4096 bytes per connection.#1104
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.
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)
How it was checked
| PR | Evidence |
|---|---|
| #1081 | tpm-ssh workflow gained a hostkey axis (raw, x509); x509 cells run tpmcertserver and tpmcertclient. |
| #1104 | wolfSSH_new() allocation measured 11568 to 7472 B on 64-bit --enable-all. |
| #1033 | CI matrix of rsa and ecc keys against ibmswtpm2 and fwtpm simulators, verified with OpenSSH. |
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