diff --git a/lib/crypto_backend/crypto_nettle.c b/lib/crypto_backend/crypto_nettle.c index e31cedc6..36a9d05e 100644 --- a/lib/crypto_backend/crypto_nettle.c +++ b/lib/crypto_backend/crypto_nettle.c @@ -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) { diff --git a/lib/crypto_backend/crypto_nss.c b/lib/crypto_backend/crypto_nss.c index f07a1dda..0c05da11 100644 --- a/lib/crypto_backend/crypto_nss.c +++ b/lib/crypto_backend/crypto_nss.c @@ -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)