summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorjsing <>2014-06-07 17:27:14 +0000
committerjsing <>2014-06-07 17:27:14 +0000
commitffcbdf8a3fda87b9b0d60403b8bda401683595e1 (patch)
tree54fecf049db8f8d90628b934ac00163e146d140d /src
parentac7554180458e6a678c9bc571314514246cb0fc0 (diff)
downloadopenbsd-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.c2
-rw-r--r--src/lib/libssl/t1_enc.c2
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 }