Skip to content

Commit

Permalink
Fix cryptodev debug output
Browse files Browse the repository at this point in the history
Cryptodev has two sections for the session info struct, cipher and hash.
Our debug mode was using hash for the output even if we were using
cipher, so would output random data. Simple 'if' statement to do the
correct thing.
  • Loading branch information
LinuxJedi committed Nov 20, 2024
1 parent 5afa056 commit f5e6e17
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions wolfcrypt/src/port/devcrypto/wc_devcrypto.c
Original file line number Diff line number Diff line change
Expand Up @@ -175,8 +175,13 @@ int wc_DevCryptoCreate(WC_CRYPTODEV* ctx, int type, byte* key, word32 keySz)
WOLFSSL_MSG("Error getting session info");
return WC_DEVCRYPTO_E;
}
printf("Using %s with driver %s\n", sesInfo.hash_info.cra_name,
sesInfo.hash_info.cra_driver_name);
if (ctx->sess.cipher == 0) {
printf("Using %s with driver %s\n", sesInfo.hash_info.cra_name,
sesInfo.hash_info.cra_driver_name);
} else {
printf("Using %s with driver %s\n", sesInfo.cipher_info.cra_name,
sesInfo.cipher_info.cra_driver_name);
}
#endif
(void)key;
(void)keySz;
Expand Down

0 comments on commit f5e6e17

Please sign in to comment.