Check HMAC_Init_ex() return value

This commit is contained in:
Nicolas Williams
2022-01-12 21:10:45 -06:00
parent 52f3dc6aa4
commit 05e8c0ede6
11 changed files with 125 additions and 65 deletions

View File

@@ -137,8 +137,11 @@ _krb5_evp_hmac_iov(krb5_context context,
if (ctx == NULL)
return krb5_enomem(context);
HMAC_Init_ex(ctx, key->key->keyvalue.data, key->key->keyvalue.length,
md, engine);
if (HMAC_Init_ex(ctx, key->key->keyvalue.data, key->key->keyvalue.length,
md, engine) == 0) {
HMAC_CTX_free(ctx);
return krb5_enomem(context);
}
for (i = 0; i < niov; i++) {
if (_krb5_crypto_iov_should_sign(&iov[i])) {