Fix sha1_digest bug

This commit is contained in:
Zhi Guan
2023-10-13 17:43:54 +08:00
parent 87a4477ee9
commit b2a90982d9

View File

@@ -167,5 +167,6 @@ void sha1_digest(const unsigned char *data, size_t datalen,
SHA1_CTX ctx; SHA1_CTX ctx;
sha1_init(&ctx); sha1_init(&ctx);
sha1_update(&ctx, data, datalen); sha1_update(&ctx, data, datalen);
sha1_finish(&ctx, dgst);
memset(&ctx, 0, sizeof(ctx)); memset(&ctx, 0, sizeof(ctx));
} }