提交 3b92e518 编写于 作者: N Nathaniel McCallum 提交者: Rich Salz

Teach EVP_PKEY_HMAC keys how to EVP_PKEY_cmp()

Fixes openssl/openssl#1236
Reviewed-by: NKurt Roeckx <kurt@openssl.org>
Reviewed-by: NRich Salz <rsalz@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/1237)
上级 5bea15eb
...@@ -46,6 +46,11 @@ static int hmac_pkey_ctrl(EVP_PKEY *pkey, int op, long arg1, void *arg2) ...@@ -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 #ifdef HMAC_TEST_PRIVATE_KEY_FORMAT
/* /*
* A bogus private key format for test purposes. This is simply the HMAC key * 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 = { ...@@ -101,7 +106,7 @@ const EVP_PKEY_ASN1_METHOD hmac_asn1_meth = {
"HMAC", "HMAC",
"OpenSSL HMAC method", "OpenSSL HMAC method",
0, 0, 0, 0, 0, 0, hmac_pkey_public_cmp, 0,
0, 0, 0, 0, 0, 0,
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册