memset the right length of the {i,o}pad data, memset opad not ipad in the opad case (typo)

Signed-off-by: Love Hornquist Astrand <lha@h5l.org>
This commit is contained in:
Andrew Tridge
2010-03-18 10:59:51 -07:00
committed by Love Hornquist Astrand
parent f26d6c2398
commit 6bff49a89d

View File

@@ -52,12 +52,12 @@ HMAC_CTX_cleanup(HMAC_CTX *ctx)
ctx->buf = NULL;
}
if (ctx->opad) {
memset(ctx->ipad, 0, ctx->key_length);
memset(ctx->opad, 0, EVP_MD_block_size(ctx->md));
free(ctx->opad);
ctx->opad = NULL;
}
if (ctx->ipad) {
memset(ctx->ipad, 0, ctx->key_length);
memset(ctx->ipad, 0, EVP_MD_block_size(ctx->md));
free(ctx->ipad);
ctx->ipad = NULL;
}