diff options
author | Joel Sing <jsing@cvs.openbsd.org> | 2014-06-07 17:27:15 +0000 |
---|---|---|
committer | Joel Sing <jsing@cvs.openbsd.org> | 2014-06-07 17:27:15 +0000 |
commit | db37dd011c635f593b39c0ba38da3ad4656aa372 (patch) | |
tree | b7272cdacea117eeed64c928b0ff72de04655d39 | |
parent | 746d87f20c4dc5b27afdca54d4f35a9dc72ac0ea (diff) |
Add missing NULL check after calling EVP_PKEY_new_mac_key().
Based on Adam Langley's chromium patches.
-rw-r--r-- | lib/libssl/src/ssl/t1_enc.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/lib/libssl/src/ssl/t1_enc.c b/lib/libssl/src/ssl/t1_enc.c index fba582d4ad8..59c0c487efe 100644 --- a/lib/libssl/src/ssl/t1_enc.c +++ b/lib/libssl/src/ssl/t1_enc.c @@ -487,6 +487,8 @@ tls1_change_cipher_state(SSL *s, int which) if (!(EVP_CIPHER_flags(cipher) & EVP_CIPH_FLAG_AEAD_CIPHER)) { mac_key = EVP_PKEY_new_mac_key(mac_type, NULL, mac_secret, mac_secret_size); + if (mac_key == NULL) + goto err; EVP_DigestSignInit(mac_ctx, NULL, mac, NULL, mac_key); EVP_PKEY_free(mac_key); } |