Skip to content
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

Fix demos to work with new wolfHSM API #17

Merged
merged 18 commits into from
Nov 5, 2024
Merged
Show file tree
Hide file tree
Changes from 13 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file added demo/certs/curve25519_keyAlice.der
Binary file not shown.
Binary file added demo/certs/curve25519_keyBob.der
Binary file not shown.
16 changes: 15 additions & 1 deletion demo/client/wh_demo_client_all.c
Original file line number Diff line number Diff line change
Expand Up @@ -37,12 +37,15 @@ int wh_DemoClient_All(whClientContext* clientContext)
if (rc != 0) {
return rc;
}
#ifndef NO_AES
rc = wh_DemoClient_KeystoreAes(clientContext);
if (rc != 0) {
return rc;
}
#endif

/* Crypto demos */
/**Crypto demos */
#ifndef NO_RSA
rc = wh_DemoClient_CryptoRsa(clientContext);
if (rc != 0) {
return rc;
Expand All @@ -52,7 +55,9 @@ int wh_DemoClient_All(whClientContext* clientContext)
if (rc != 0) {
return rc;
}
#endif /* !NO_RSA */

#ifdef HAVE_CURVE25519
rc = wh_DemoClient_CryptoCurve25519(clientContext);
if (rc != 0) {
return rc;
Expand All @@ -62,7 +67,9 @@ int wh_DemoClient_All(whClientContext* clientContext)
if (rc != 0) {
return rc;
}
#endif /* HAVE_CURVE25519 */

#ifdef HAVE_ECC
rc = wh_DemoClient_CryptoEcc(clientContext);
if (rc != 0) {
return rc;
Expand All @@ -72,7 +79,9 @@ int wh_DemoClient_All(whClientContext* clientContext)
if (rc != 0) {
return rc;
}
#endif /* HAVE_ECC */

#if !defined(NO_AES) && defined(HAVE_AES_CBC)
rc = wh_DemoClient_CryptoAesCbc(clientContext);
if (rc != 0) {
return rc;
Expand All @@ -82,7 +91,9 @@ int wh_DemoClient_All(whClientContext* clientContext)
if (rc != 0) {
return rc;
}
#endif /* !NO_AES && HAVE_AES_CBC */

#if !defined(NO_AES) && defined(HAVE_AESGCM)
rc = wh_DemoClient_CryptoAesGcm(clientContext);
if (rc != 0) {
return rc;
Expand All @@ -92,7 +103,9 @@ int wh_DemoClient_All(whClientContext* clientContext)
if (rc != 0) {
return rc;
}
#endif /* !NO_AES && HAVE_AESGCM */

#if defined(WOLFSSL_CMAC)
Copy link
Contributor

Choose a reason for hiding this comment

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

I think we have additional constraints on CMAC like !NO_AES and WOLFSSL_AES_DIRECT. Do you capture these in the lower level? I'd love to simplify this compile-time logic to exactly what you have written here.

rc = wh_DemoClient_CryptoCmac(clientContext);
if (rc != 0) {
return rc;
Expand All @@ -107,6 +120,7 @@ int wh_DemoClient_All(whClientContext* clientContext)
if (rc != 0) {
return rc;
}
#endif /* WOLFSSL_CMAC */

return rc;
}
Loading