summaryrefslogtreecommitdiffstats
path: root/crypto/pkcs12
diff options
context:
space:
mode:
authorEmilia Kasper <emilia@openssl.org>2015-05-27 17:12:13 +0200
committerEmilia Kasper <emilia@openssl.org>2015-06-08 14:55:50 +0200
commit1e4a355dcabe2f75df5bb8b41b394d37037169d2 (patch)
treeaac26a71e92cf32f361342fbe2c3fe4edde4395d /crypto/pkcs12
parentIncrease buffer size for passwords in pkcs12 CLI (diff)
downloadopenssl-1e4a355dcabe2f75df5bb8b41b394d37037169d2.tar.xz
openssl-1e4a355dcabe2f75df5bb8b41b394d37037169d2.zip
Use CRYPTO_memcmp when comparing authenticators
Pointed out by Victor Vasiliev (vasilvv@mit.edu) via Adam Langley (Google). Reviewed-by: Rich Salz <rsalz@openssl.org>
Diffstat (limited to 'crypto/pkcs12')
-rw-r--r--crypto/pkcs12/p12_mutl.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/crypto/pkcs12/p12_mutl.c b/crypto/pkcs12/p12_mutl.c
index 4025e3fc41..9382b39d12 100644
--- a/crypto/pkcs12/p12_mutl.c
+++ b/crypto/pkcs12/p12_mutl.c
@@ -59,6 +59,7 @@
# include <stdio.h>
# include "internal/cryptlib.h"
+#include <openssl/crypto.h>
# include <openssl/hmac.h>
# include <openssl/rand.h>
# include <openssl/pkcs12.h>
@@ -123,7 +124,7 @@ int PKCS12_verify_mac(PKCS12 *p12, const char *pass, int passlen)
return 0;
}
if ((maclen != (unsigned int)p12->mac->dinfo->digest->length)
- || memcmp(mac, p12->mac->dinfo->digest->data, maclen))
+ || CRYPTO_memcmp(mac, p12->mac->dinfo->digest->data, maclen))
return 0;
return 1;
}