diff options
author | Nathaniel McCallum <npmccallum@redhat.com> | 2016-06-20 09:47:11 +0200 |
---|---|---|
committer | Rich Salz <rsalz@openssl.org> | 2016-06-24 18:31:31 +0200 |
commit | 3b92e5189965b343603931d58992b8e92b212d49 (patch) | |
tree | 11c5222eabed92361996f7232b052bc022800003 /crypto/hmac | |
parent | Avoid signed overflow (diff) | |
download | openssl-3b92e5189965b343603931d58992b8e92b212d49.tar.xz openssl-3b92e5189965b343603931d58992b8e92b212d49.zip |
Teach EVP_PKEY_HMAC keys how to EVP_PKEY_cmp()
Fixes openssl/openssl#1236
Reviewed-by: Kurt Roeckx <kurt@openssl.org>
Reviewed-by: Rich Salz <rsalz@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/1237)
Diffstat (limited to 'crypto/hmac')
-rw-r--r-- | crypto/hmac/hm_ameth.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/crypto/hmac/hm_ameth.c b/crypto/hmac/hm_ameth.c index 714068dc68..78ae0ea63a 100644 --- a/crypto/hmac/hm_ameth.c +++ b/crypto/hmac/hm_ameth.c @@ -46,6 +46,11 @@ static int hmac_pkey_ctrl(EVP_PKEY *pkey, int op, long arg1, void *arg2) } } +static int hmac_pkey_public_cmp(const EVP_PKEY *a, const EVP_PKEY *b) +{ + return ASN1_OCTET_STRING_cmp(EVP_PKEY_get0(a), EVP_PKEY_get0(b)); +} + #ifdef HMAC_TEST_PRIVATE_KEY_FORMAT /* * A bogus private key format for test purposes. This is simply the HMAC key @@ -101,7 +106,7 @@ const EVP_PKEY_ASN1_METHOD hmac_asn1_meth = { "HMAC", "OpenSSL HMAC method", - 0, 0, 0, 0, + 0, 0, hmac_pkey_public_cmp, 0, 0, 0, 0, |