diff options
author | jsing <> | 2014-06-07 17:27:14 +0000 |
---|---|---|
committer | jsing <> | 2014-06-07 17:27:14 +0000 |
commit | ffcbdf8a3fda87b9b0d60403b8bda401683595e1 (patch) | |
tree | 54fecf049db8f8d90628b934ac00163e146d140d /src | |
parent | ac7554180458e6a678c9bc571314514246cb0fc0 (diff) | |
download | openbsd-ffcbdf8a3fda87b9b0d60403b8bda401683595e1.tar.gz openbsd-ffcbdf8a3fda87b9b0d60403b8bda401683595e1.tar.bz2 openbsd-ffcbdf8a3fda87b9b0d60403b8bda401683595e1.zip |
Add missing NULL check after calling EVP_PKEY_new_mac_key().
Based on Adam Langley's chromium patches.
Diffstat (limited to 'src')
-rw-r--r-- | src/lib/libssl/src/ssl/t1_enc.c | 2 | ||||
-rw-r--r-- | src/lib/libssl/t1_enc.c | 2 |
2 files changed, 4 insertions, 0 deletions
diff --git a/src/lib/libssl/src/ssl/t1_enc.c b/src/lib/libssl/src/ssl/t1_enc.c index fba582d4ad..59c0c487ef 100644 --- a/src/lib/libssl/src/ssl/t1_enc.c +++ b/src/lib/libssl/src/ssl/t1_enc.c | |||
@@ -487,6 +487,8 @@ tls1_change_cipher_state(SSL *s, int which) | |||
487 | if (!(EVP_CIPHER_flags(cipher) & EVP_CIPH_FLAG_AEAD_CIPHER)) { | 487 | if (!(EVP_CIPHER_flags(cipher) & EVP_CIPH_FLAG_AEAD_CIPHER)) { |
488 | mac_key = EVP_PKEY_new_mac_key(mac_type, NULL, | 488 | mac_key = EVP_PKEY_new_mac_key(mac_type, NULL, |
489 | mac_secret, mac_secret_size); | 489 | mac_secret, mac_secret_size); |
490 | if (mac_key == NULL) | ||
491 | goto err; | ||
490 | EVP_DigestSignInit(mac_ctx, NULL, mac, NULL, mac_key); | 492 | EVP_DigestSignInit(mac_ctx, NULL, mac, NULL, mac_key); |
491 | EVP_PKEY_free(mac_key); | 493 | EVP_PKEY_free(mac_key); |
492 | } | 494 | } |
diff --git a/src/lib/libssl/t1_enc.c b/src/lib/libssl/t1_enc.c index fba582d4ad..59c0c487ef 100644 --- a/src/lib/libssl/t1_enc.c +++ b/src/lib/libssl/t1_enc.c | |||
@@ -487,6 +487,8 @@ tls1_change_cipher_state(SSL *s, int which) | |||
487 | if (!(EVP_CIPHER_flags(cipher) & EVP_CIPH_FLAG_AEAD_CIPHER)) { | 487 | if (!(EVP_CIPHER_flags(cipher) & EVP_CIPH_FLAG_AEAD_CIPHER)) { |
488 | mac_key = EVP_PKEY_new_mac_key(mac_type, NULL, | 488 | mac_key = EVP_PKEY_new_mac_key(mac_type, NULL, |
489 | mac_secret, mac_secret_size); | 489 | mac_secret, mac_secret_size); |
490 | if (mac_key == NULL) | ||
491 | goto err; | ||
490 | EVP_DigestSignInit(mac_ctx, NULL, mac, NULL, mac_key); | 492 | EVP_DigestSignInit(mac_ctx, NULL, mac, NULL, mac_key); |
491 | EVP_PKEY_free(mac_key); | 493 | EVP_PKEY_free(mac_key); |
492 | } | 494 | } |