-
Notifications
You must be signed in to change notification settings - Fork 90
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
wolfSSH support for using TPM based key for authentication #754
base: master
Are you sure you want to change the base?
Conversation
There was a problem hiding this 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.
…t passing make check with normal config
There was a problem hiding this 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.
|
||
#define TPM2_DEMO_STORAGE_KEY_HANDLE 0x81000200 /* Persistent Storage Key Handle (RSA) */ | ||
|
||
static const char gStorageKeyAuth[] = "ThisIsMyStorageKeyAuth"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The SRK handle and password being hard coded is not good. Both of these should be macros wrapped with #ifndef
at a minimum. Ideally they would be arguments to the example client or not needed at all.
If I were writing this example I would create the key using the endorsement primary key... then you would not need anything related to the SRK... It's a pretty easy change, mostly to your README.md to create the key under the endorsement hierarchy using -eh
.
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
Just SSH
For ssh public key auth with rsa use
./examples/echoserver/echoserver
and for client side use the command:With TPM
For tpm based public key auth with rsa use a tpm simulator and
./examples/echoserver/echoserver
and for client use the command:Note: refer to the README for detailed build steps and further information.