Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

poly1305: Properly copy the whole context on dup #18143

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
5 changes: 3 additions & 2 deletions providers/implementations/macs/poly1305_prov.c
Expand Up @@ -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;
}

Expand All @@ -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;
}

Expand Down