summaryrefslogtreecommitdiffstats
path: root/providers
diff options
context:
space:
mode:
authorMatt Caswell <matt@openssl.org>2020-08-11 15:28:07 +0100
committerPauli <paul.dale@oracle.com>2020-08-29 17:40:10 +1000
commit4db71d0175ed42586bcd4e6527caacbd18602adf (patch)
tree0b1369b7c89a6166413096b4c6a879b3e65f16a5 /providers
parent8014b2a966e0a971797d5160c082108b5618d6b3 (diff)
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)
Diffstat (limited to 'providers')
-rw-r--r--providers/defltprov.c6
-rw-r--r--providers/implementations/include/prov/implementations.h1
-rw-r--r--providers/implementations/signature/mac_legacy.c2
3 files changed, 9 insertions, 0 deletions
diff --git a/providers/defltprov.c b/providers/defltprov.c
index aaf1cfe6b0..34d2fb29f4 100644
--- a/providers/defltprov.c
+++ b/providers/defltprov.c
@@ -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 }
};
diff --git a/providers/implementations/include/prov/implementations.h b/providers/implementations/include/prov/implementations.h
index 7c6412ceb5..fe5fbef57a 100644
--- a/providers/implementations/include/prov/implementations.h
+++ b/providers/implementations/include/prov/implementations.h
@@ -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[];
diff --git a/providers/implementations/signature/mac_legacy.c b/providers/implementations/signature/mac_legacy.c
index bb3bf5b55d..cf440efc05 100644
--- a/providers/implementations/signature/mac_legacy.c
+++ b/providers/implementations/signature/mac_legacy.c
@@ -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)