summaryrefslogtreecommitdiffstats
path: root/crypto/poly1305
diff options
context:
space:
mode:
authorKurt Roeckx <kurt@roeckx.be>2018-12-19 00:36:40 +0100
committerKurt Roeckx <kurt@roeckx.be>2019-06-06 17:41:42 +0200
commit7ed66e2634e6cfbb16a1ef975572e79a479217a8 (patch)
treecc09cf68cd6e72fe61d428842284a1f584a58a19 /crypto/poly1305
parentbe5fc053ed40bb714944f93e2d35265d2096f71f (diff)
Change EVP_MAC method from copy to dup
Reviewed-by: Tomas Mraz <tmraz@fedoraproject.org> GH: #7651
Diffstat (limited to 'crypto/poly1305')
-rw-r--r--crypto/poly1305/poly1305_meth.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/crypto/poly1305/poly1305_meth.c b/crypto/poly1305/poly1305_meth.c
index 9248d46099..f1ade58b40 100644
--- a/crypto/poly1305/poly1305_meth.c
+++ b/crypto/poly1305/poly1305_meth.c
@@ -37,11 +37,17 @@ static void poly1305_free(EVP_MAC_IMPL *ctx)
}
}
-static int poly1305_copy(EVP_MAC_IMPL *dst, EVP_MAC_IMPL *src)
+static EVP_MAC_IMPL *poly1305_dup(const EVP_MAC_IMPL *src)
{
+ EVP_MAC_IMPL *dst;
+
+ dst = poly1305_new();
+ if (dst == NULL)
+ return NULL;
+
*dst->ctx = *src->ctx;
- return 1;
+ return dst;
}
static size_t poly1305_size(EVP_MAC_IMPL *ctx)
@@ -130,7 +136,7 @@ static int poly1305_ctrl_str(EVP_MAC_IMPL *ctx,
const EVP_MAC poly1305_meth = {
EVP_MAC_POLY1305,
poly1305_new,
- poly1305_copy,
+ poly1305_dup,
poly1305_free,
poly1305_size,
poly1305_init,