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

esys: Use default OpenSSL context for session HMAC operations #2721

Merged
merged 1 commit into from
Dec 13, 2023
Merged
Changes from all 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
7 changes: 6 additions & 1 deletion src/tss2-esys/esys_crypto_ossl.c
Original file line number Diff line number Diff line change
Expand Up @@ -394,9 +394,14 @@ iesys_cryptossl_hmac_start(ESYS_CRYPTO_CONTEXT_BLOB ** context,

#if OPENSSL_VERSION_NUMBER < 0x10101000L
if (!(hkey = EVP_PKEY_new_mac_key(EVP_PKEY_HMAC, NULL, key, size))) {
#else
#elif OPENSSL_VERSION_NUMBER < 0x30000000L
/* this is preferred, but available since OpenSSL 1.1.1 only */
if (!(hkey = EVP_PKEY_new_raw_private_key(EVP_PKEY_HMAC, NULL, key, size))) {
#else
/* this is nessecary from OpenSSL 3.0.0 to avoid using the TPM2 provider using
* OpenSSL in a circular dependency */
if (!(hkey = EVP_PKEY_new_raw_private_key_ex(mycontext->hash.ossl_libctx,
"HMAC", NULL, key, size))) {
#endif
goto_error(r, TSS2_ESYS_RC_GENERAL_FAILURE,
"Failed to create HMAC key", cleanup);
Expand Down
Loading