Skip to content

Conversation

@aidangarske
Copy link
Contributor

@aidangarske aidangarske commented Dec 13, 2024

Description

wolfSSH tpm support using client side public key authentication with rsa. Code working just like the non tpm public key authentication with rsa

Testing

Github CI test tpm-ssh.yml

Just SSH

For ssh public key auth with rsa use ./examples/echoserver/echoserver and for client side use the command:

./examples/client/client -u hansel -i ./keys/hansel-key-rsa.der -j ./keys/hansel-key-rsa.pub

With TPM

For tpm based public key auth with rsa use a tpm simulator and ./examples/echoserver/echoserver and for client use the command:

./examples/client/client -i ../wolfTPM/keyblob.bin -u hansel -K ThisIsMyKeyAuth

Note: refer to the README for detailed build steps and further information.

Copy link
Contributor

@dgarske dgarske left a comment

Choose a reason for hiding this comment

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

Various errors building without TPM:

src/ssh.c:1810:15: error: call to undeclared function 'wc_PubKeyPemToDer'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
        ret = wc_PubKeyPemToDer(in, inSz, newKey, newKeySz);
              ^
src/ssh.c:1810:15: note: did you mean 'wc_KeyPemToDer'?
/Users/runner/work/wolfssh/wolfssh/build-dir/include/wolfssl/wolfcrypt/asn_public.h:692:21: note: 'wc_KeyPemToDer' declared here
    WOLFSSL_API int wc_KeyPemToDer(const unsigned char* pem, int pemSz,
                    ^
1 error generated.
make[1]: *** [src/libwolfssh_la-ssh.lo] Error 1
make[1]: *** Waiting for unfinished jobs....
src/internal.c:12950:25: error: unused variable 'sigSz' [-Werror,-Wunused-variable]
                    int sigSz;
                        ^
1 error generated.

Copy link
Contributor

@dgarske dgarske left a comment

Choose a reason for hiding this comment

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

This PR is very close to ready. Let's change it to use endorsement primary key are parent to avoid the SRK handle/auth.

@aidangarske aidangarske requested a review from dgarske March 28, 2025 21:05
Copy link
Contributor

@dgarske dgarske left a comment

Choose a reason for hiding this comment

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

PR is great! Please add a GitHub CI action test based on the READM.md. That way this can be tested continuously to make sure it doesn't break.

@aidangarske aidangarske requested a review from dgarske April 1, 2025 23:26
@aidangarske aidangarske requested a review from dgarske April 2, 2025 05:06
@aidangarske aidangarske requested a review from dgarske April 2, 2025 17:33
@dgarske dgarske merged commit 90b69ff into wolfSSL:master Apr 2, 2025
87 checks passed
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.

2 participants