mirror of
https://github.com/guanzhi/GmSSL.git
synced 2026-08-08 23:13:38 +08:00
Compatible with SDF Engine
The SDF Engine might not malloc `ctx->md_data`.
This commit is contained in:
@@ -184,6 +184,7 @@ int EVP_DigestFinal_ex(EVP_MD_CTX *ctx, unsigned char *md, unsigned int *size)
|
|||||||
ctx->digest->cleanup(ctx);
|
ctx->digest->cleanup(ctx);
|
||||||
EVP_MD_CTX_set_flags(ctx, EVP_MD_CTX_FLAG_CLEANED);
|
EVP_MD_CTX_set_flags(ctx, EVP_MD_CTX_FLAG_CLEANED);
|
||||||
}
|
}
|
||||||
|
if (ctx->md_data)
|
||||||
OPENSSL_cleanse(ctx->md_data, ctx->digest->ctx_size);
|
OPENSSL_cleanse(ctx->md_data, ctx->digest->ctx_size);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user