summaryrefslogtreecommitdiff
path: root/source4/heimdal/lib/hcrypto
diff options
context:
space:
mode:
authorAndrew Bartlett <abartlet@samba.org>2007-08-22 06:46:34 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 15:02:25 -0500
commitb39330c4873d4c3923a577e89690fc0e43b0c61a (patch)
tree882a09a9e2ef446d3662ac542d1bf60fb8e7dfb2 /source4/heimdal/lib/hcrypto
parentdb24e606f10902de49891e32600403274ece16da (diff)
downloadsamba-b39330c4873d4c3923a577e89690fc0e43b0c61a.tar.gz
samba-b39330c4873d4c3923a577e89690fc0e43b0c61a.tar.bz2
samba-b39330c4873d4c3923a577e89690fc0e43b0c61a.zip
r24614: Merge with current lorikeet-heimdal. This brings us one step closer
to an alpha release. Andrew Bartlett (This used to be commit 30e02747d511630659c59eafec8d28f58605943b)
Diffstat (limited to 'source4/heimdal/lib/hcrypto')
-rw-r--r--source4/heimdal/lib/hcrypto/hmac.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/source4/heimdal/lib/hcrypto/hmac.c b/source4/heimdal/lib/hcrypto/hmac.c
index 848b987a90..b8156e38d4 100644
--- a/source4/heimdal/lib/hcrypto/hmac.c
+++ b/source4/heimdal/lib/hcrypto/hmac.c
@@ -52,8 +52,10 @@ HMAC_Init_ex(HMAC_CTX *ctx,
if (ctx->md != md) {
ctx->md = md;
- if (ctx->buf)
+ if (ctx->buf) {
+ memset(ctx->buf, 0, ctx->key_length);
free (ctx->buf);
+ }
ctx->key_length = EVP_MD_size(ctx->md);
ctx->buf = malloc(ctx->key_length);
}
@@ -67,10 +69,14 @@ HMAC_Init_ex(HMAC_CTX *ctx,
keylen = EVP_MD_size(ctx->md);
}
- if (ctx->opad)
+ if (ctx->opad) {
+ memset(ctx->opad, 0, ctx->key_length);
free(ctx->opad);
- if (ctx->ipad)
+ }
+ if (ctx->ipad) {
+ memset(ctx->ipad, 0, ctx->key_length);
free(ctx->ipad);
+ }
ctx->opad = malloc(EVP_MD_block_size(ctx->md));
ctx->ipad = malloc(EVP_MD_block_size(ctx->md));