Skip to content

client: TPM key file fixes and default public key - #1349

Open
ejohnstown wants to merge 2 commits into
wolfSSL:masterfrom
ejohnstown:example-client-keys
Open

ejohnstown wants to merge 2 commits into
wolfSSL:masterfrom
ejohnstown:example-client-keys

Conversation

@ejohnstown

Copy link
Copy Markdown
Contributor

The example client's TPM key path now checks the key file against its
buffers and wipes the key material, and the client offers its built-in
public key when no -i is given.

  • readKeyBlob bounds both parts of the key file, fails on a short read,
    and closes the file when the parse fails
  • -K values over 64 bytes are refused; the key blob, session and global
    TPM key are wiped
  • Without -i the client loads the built-in public key, so publickey
    auth works with the sample keys

Issue: F-8855, F-10558, F-10604, F-10601, F-10602, F-10603, F-13905

readKeyBlob() checks each part of the key file against its destination
before reading it, and every failure now returns an error with the file
closed. wolfSSH_TPM_InitKey() refuses a key auth that does not fit the
blob, and the key material is wiped once it is no longer needed.

- reject a public size over pubAreaBuffer, a private part over key->priv
- return BUFFER_E on a short read; parse errors go through exit
- refuse a -K value longer than the auth buffer
- wipe the key blob and session on return, the TPM key on cleanup

Issue: F-8855, F-10558, F-10604, F-10601, F-10602, F-10603
Without -i the client loads the built-in private key, so load its public
half too and publickey auth with the default keys works. A -j file or a
TPM key still supplies its own public key.

Issue: F-13905
Copilot AI balanced review requested due to automatic review settings October 29, 2026 22:07

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota.

@wolfSSL-Fenrir-bot wolfSSL-Fenrir-bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fenrir Automated Review — PR #1349

Scan targets checked: wolfssh-src, wolfssh-bugs
Coverage: 2 of 2 in-scope changed file(s) opened by the reviewer

Fenrir result: Approved ✅

No new issues found in the changed files.

Advisory only — this automated result does not count as a GitHub approval.

Review tier: Lite

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants