diff options
Diffstat (limited to 'engines/ccgost/gost_md.c')
-rw-r--r-- | engines/ccgost/gost_md.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/engines/ccgost/gost_md.c b/engines/ccgost/gost_md.c index 445679daa9..294a624d7d 100644 --- a/engines/ccgost/gost_md.c +++ b/engines/ccgost/gost_md.c @@ -59,12 +59,15 @@ int gost_digest_final(EVP_MD_CTX *ctx,unsigned char *md) int gost_digest_copy(EVP_MD_CTX *to,const EVP_MD_CTX *from) { + if (to->md_data && from->md_data) memcpy(to->md_data,from->md_data,sizeof(struct ossl_gost_digest_ctx)); + return 1; } int gost_digest_cleanup(EVP_MD_CTX *ctx) { + if (ctx->md_data) memset(ctx->md_data,0,sizeof(struct ossl_gost_digest_ctx)); return 1; } |