4 Sep
2026
4 Sep
'26
4:37 p.m.
Copy md_nid and md_update_status in sm2_copy so a duplicated EVP_PKEY_CTX keeps the message-digest NID and update-status flag of the source context. Signed-off-by: Weili Qian <qianweili@huawei.com> --- src/uadk_sm2.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/uadk_sm2.c b/src/uadk_sm2.c index 6472abc..1878ed4 100644 --- a/src/uadk_sm2.c +++ b/src/uadk_sm2.c @@ -1668,6 +1668,8 @@ static int sm2_copy(EVP_PKEY_CTX *dst, const EVP_PKEY_CTX *src) dctx->ctx.id_len = sctx->ctx.id_len; dctx->ctx.id_set = sctx->ctx.id_set; dctx->ctx.md = sctx->ctx.md; + dctx->md_nid = sctx->md_nid; + dctx->md_update_status = sctx->md_update_status; return 1; } -- 2.53.0.windows.2