Change EVP_MAC method from copy to dup
[openssl.git] / crypto / poly1305 / poly1305_meth.c
index 9248d460995aa06edd7b963aa1a2ed50ec384ca6..f1ade58b405902d9ca6770ca52b104d8987b2fd5 100644 (file)
@@ -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;
 
     *dst->ctx = *src->ctx;
 
-    return 1;
+    return dst;
 }
 
 static size_t poly1305_size(EVP_MAC_IMPL *ctx)
 }
 
 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,
 const EVP_MAC poly1305_meth = {
     EVP_MAC_POLY1305,
     poly1305_new,
-    poly1305_copy,
+    poly1305_dup,
     poly1305_free,
     poly1305_size,
     poly1305_init,
     poly1305_free,
     poly1305_size,
     poly1305_init,