mirror of
https://github.com/guanzhi/GmSSL.git
synced 2026-05-07 00:46:17 +08:00
Merge pull request #548 from liclicli/master
fix: zero length NULL should be able to be used for sm3 digest update.
This commit is contained in:
@@ -68,7 +68,7 @@ static int init(EVP_MD_CTX *ctx)
|
||||
|
||||
static int update(EVP_MD_CTX *ctx, const void *in, size_t inlen)
|
||||
{
|
||||
if (!ctx || !EVP_MD_CTX_md_data(ctx) || !in) {
|
||||
if (!ctx || !EVP_MD_CTX_md_data(ctx) || (!in && inlen != 0)) {
|
||||
return 0;
|
||||
}
|
||||
sm3_update(EVP_MD_CTX_md_data(ctx), in, inlen);
|
||||
|
||||
Reference in New Issue
Block a user