Skip to content

Commit

Permalink
Fix wiping of hash struct in nss and nettle backend.
Browse files Browse the repository at this point in the history
  • Loading branch information
mbroz committed Jul 12, 2024
1 parent 3839e2b commit 5e04a82
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
3 changes: 1 addition & 2 deletions lib/crypto_backend/crypto_nettle.c
Original file line number Diff line number Diff line change
Expand Up @@ -284,8 +284,7 @@ int crypt_hmac_init(struct crypt_hmac **ctx, const char *name,
h = malloc(sizeof(*h));
if (!h)
return -ENOMEM;
memset(ctx, 0, sizeof(*ctx));

memset(h, 0, sizeof(*h));

h->hash = _get_alg(name);
if (!h->hash) {
Expand Down
3 changes: 1 addition & 2 deletions lib/crypto_backend/crypto_nss.c
Original file line number Diff line number Diff line change
Expand Up @@ -207,8 +207,7 @@ int crypt_hmac_init(struct crypt_hmac **ctx, const char *name,
h = malloc(sizeof(*h));
if (!h)
return -ENOMEM;
memset(ctx, 0, sizeof(*ctx));

memset(h, 0, sizeof(*h));

h->hash = _get_alg(name);
if (!h->hash)
Expand Down

0 comments on commit 5e04a82

Please sign in to comment.