diff options
author | Tomas Mraz <tomas@openssl.org> | 2022-04-21 17:33:26 +0200 |
---|---|---|
committer | Pauli <pauli@openssl.org> | 2022-04-29 10:00:39 +1000 |
commit | e661cc45502e173a0d748c5310c13475546dbdf2 (patch) | |
tree | ef99c4eb26b14ba1df963ab1cd884abcb14bed9e /providers/implementations | |
parent | abe21efdf74bb83a19e5732e4ce1fb2ff3ee9ca3 (diff) |
poly1305: Properly copy the whole context on dup
Also reset the updated flag when Poly1305_Init is called.
Reviewed-by: Matt Caswell <matt@openssl.org>
Reviewed-by: Paul Dale <pauli@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/18143)
(cherry picked from commit bbe909d00e9a593bd5954dfca4d3020467977565)
Diffstat (limited to 'providers/implementations')
-rw-r--r-- | providers/implementations/macs/poly1305_prov.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/providers/implementations/macs/poly1305_prov.c b/providers/implementations/macs/poly1305_prov.c index ad67216d2a..28789d25c8 100644 --- a/providers/implementations/macs/poly1305_prov.c +++ b/providers/implementations/macs/poly1305_prov.c @@ -65,11 +65,11 @@ static void *poly1305_dup(void *vsrc) if (!ossl_prov_is_running()) return NULL; - dst = poly1305_new(src->provctx); + dst = OPENSSL_malloc(sizeof(*dst)); if (dst == NULL) return NULL; - dst->poly1305 = src->poly1305; + *dst = *src; return dst; } @@ -86,6 +86,7 @@ static int poly1305_setkey(struct poly1305_data_st *ctx, return 0; } Poly1305_Init(&ctx->poly1305, key); + ctx->updated = 0; return 1; } |