mirror of
https://github.com/guanzhi/GmSSL.git
synced 2026-05-06 16:36:16 +08:00
Fix LMS/HSS key cleanup
This commit is contained in:
@@ -46,6 +46,8 @@ int lmssign_main(int argc, char **argv)
|
||||
uint8_t sig[LMS_SIGNATURE_MAX_SIZE];
|
||||
size_t siglen;
|
||||
|
||||
memset(&key, 0, sizeof(key));
|
||||
|
||||
argc--;
|
||||
argv++;
|
||||
|
||||
@@ -160,8 +162,8 @@ bad:
|
||||
ret = 0;
|
||||
|
||||
end:
|
||||
lms_key_cleanup(&key);
|
||||
gmssl_secure_clear(keybuf, sizeof(keybuf));
|
||||
gmssl_secure_clear(&key, sizeof(key));
|
||||
gmssl_secure_clear(&ctx, sizeof(ctx));
|
||||
if (keyfp) fclose(keyfp);
|
||||
if (infp && infp != stdin) fclose(infp);
|
||||
|
||||
Reference in New Issue
Block a user