mirror of
https://github.com/openssl/openssl.git
synced 2025-01-18 13:44:20 +08:00
Extend the provider MAC bridge for Poly1305
The previous commits added support for HMAC and SIPHASH into the provider MAC bridge. We now extend that for Poly1305 too. Reviewed-by: Paul Dale <paul.dale@oracle.com> (Merged from https://github.com/openssl/openssl/pull/12637)
This commit is contained in:
parent
8014b2a966
commit
4db71d0175
@ -151,7 +151,6 @@ static int is_legacy_alg(int id, const char *keytype)
|
||||
*/
|
||||
case EVP_PKEY_SM2:
|
||||
case EVP_PKEY_CMAC:
|
||||
case EVP_PKEY_POLY1305:
|
||||
return 1;
|
||||
default:
|
||||
return 0;
|
||||
|
@ -366,6 +366,9 @@ static const OSSL_ALGORITHM deflt_signature[] = {
|
||||
#endif
|
||||
{ "HMAC", "provider=default", mac_hmac_signature_functions },
|
||||
{ "SIPHASH", "provider=default", mac_siphash_signature_functions },
|
||||
#ifndef OPENSSL_NO_POLY1305
|
||||
{ "POLY1305", "provider=default", mac_poly1305_signature_functions },
|
||||
#endif
|
||||
{ NULL, NULL, NULL }
|
||||
};
|
||||
|
||||
@ -396,6 +399,9 @@ static const OSSL_ALGORITHM deflt_keymgmt[] = {
|
||||
{ "SCRYPT:id-scrypt", "provider=default", kdf_keymgmt_functions },
|
||||
{ "HMAC", "provider=default", mac_keymgmt_functions },
|
||||
{ "SIPHASH", "provider=default", mac_keymgmt_functions },
|
||||
#ifndef OPENSSL_NO_POLY1305
|
||||
{ "POLY1305", "provider=default", mac_keymgmt_functions },
|
||||
#endif
|
||||
{ NULL, NULL, NULL }
|
||||
};
|
||||
|
||||
|
@ -297,6 +297,7 @@ extern const OSSL_DISPATCH ed448_signature_functions[];
|
||||
extern const OSSL_DISPATCH ecdsa_signature_functions[];
|
||||
extern const OSSL_DISPATCH mac_hmac_signature_functions[];
|
||||
extern const OSSL_DISPATCH mac_siphash_signature_functions[];
|
||||
extern const OSSL_DISPATCH mac_poly1305_signature_functions[];
|
||||
|
||||
/* Asym Cipher */
|
||||
extern const OSSL_DISPATCH rsa_asym_cipher_functions[];
|
||||
|
@ -71,6 +71,7 @@ static void *mac_newctx(void *provctx, const char *propq, const char *macname)
|
||||
|
||||
MAC_NEWCTX(hmac, "HMAC")
|
||||
MAC_NEWCTX(siphash, "SIPHASH")
|
||||
MAC_NEWCTX(poly1305, "POLY1305")
|
||||
|
||||
static int mac_digest_sign_init(void *vpmacctx, const char *mdname, void *vkey)
|
||||
{
|
||||
@ -179,3 +180,4 @@ static void *mac_dupctx(void *vpmacctx)
|
||||
|
||||
MAC_SIGNATURE_FUNCTIONS(hmac)
|
||||
MAC_SIGNATURE_FUNCTIONS(siphash)
|
||||
MAC_SIGNATURE_FUNCTIONS(poly1305)
|
||||
|
Loading…
Reference in New Issue
Block a user