Skip to content

Commit ee365a1

Browse files
committed
fips: use openssl lib context in compute_file_hmac
Before calling any openssl EVP function, libica's own openssl lib ctx must be made the current one. This was missing in compute_file_hmac. Suggested-by: Ingo Franzki <ifranzki@linux.ibm.com> Signed-off-by: Joerg Schmidbauer <jschmidb@de.ibm.com>
1 parent e46530f commit ee365a1

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

src/fips.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -400,6 +400,8 @@ static int compute_file_hmac(const char *path, void **buf, size_t *hmaclen)
400400
void *fdata = NULL;
401401
struct stat fdata_stat;
402402

403+
BEGIN_OPENSSL_LIBCTX(openssl_libctx, rc);
404+
403405
pkey = get_pkey();
404406
if (!pkey)
405407
goto end;
@@ -438,6 +440,7 @@ static int compute_file_hmac(const char *path, void **buf, size_t *hmaclen)
438440
EVP_MD_CTX_destroy(mdctx);
439441

440442
OPENSSL_cleanse(tmp, sizeof(tmp));
443+
END_OPENSSL_LIBCTX(rc);
441444

442445
return rc;
443446
}

0 commit comments

Comments
 (0)