X-Git-Url: https://git.openssl.org/gitweb/?p=openssl.git;a=blobdiff_plain;f=crypto%2Fpoly1305%2Fpoly1305_meth.c;h=f1ade58b405902d9ca6770ca52b104d8987b2fd5;hp=9248d460995aa06edd7b963aa1a2ed50ec384ca6;hb=7ed66e2634e6cfbb16a1ef975572e79a479217a8;hpb=be5fc053ed40bb714944f93e2d35265d2096f71f 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,