summaryrefslogtreecommitdiff
path: root/usr.sbin/bind/lib/isc
diff options
context:
space:
mode:
authorTheo de Raadt <deraadt@cvs.openbsd.org>2011-07-05 20:05:57 +0000
committerTheo de Raadt <deraadt@cvs.openbsd.org>2011-07-05 20:05:57 +0000
commitff08a269c35183e511286891de09650df0413e6f (patch)
tree2473fc16b972ff0d64aae00bfebca53a81bb1c36 /usr.sbin/bind/lib/isc
parent80a69d1702a5e7d02728336a5646f7a53b6e119c (diff)
correct memsets of key contexts which were shorter than they needed to be
due to sizeof pointer instead of sizeof of type with tedu; some quibbles spotted by miod, ok tedu miod jsg jakob -- please push this upstream
Diffstat (limited to 'usr.sbin/bind/lib/isc')
-rw-r--r--usr.sbin/bind/lib/isc/hmacsha.c16
1 files changed, 5 insertions, 11 deletions
diff --git a/usr.sbin/bind/lib/isc/hmacsha.c b/usr.sbin/bind/lib/isc/hmacsha.c
index d6ac59ef6bd..2a3b1fe2f0e 100644
--- a/usr.sbin/bind/lib/isc/hmacsha.c
+++ b/usr.sbin/bind/lib/isc/hmacsha.c
@@ -63,9 +63,7 @@ isc_hmacsha1_init(isc_hmacsha1_t *ctx, const unsigned char *key,
void
isc_hmacsha1_invalidate(isc_hmacsha1_t *ctx) {
- isc_sha1_invalidate(&ctx->sha1ctx);
- memset(ctx->key, 0, sizeof(ctx->key));
- memset(ctx, 0, sizeof(ctx));
+ memset(ctx, 0, sizeof(*ctx));
}
/*
@@ -145,8 +143,7 @@ isc_hmacsha224_init(isc_hmacsha224_t *ctx, const unsigned char *key,
void
isc_hmacsha224_invalidate(isc_hmacsha224_t *ctx) {
- memset(ctx->key, 0, sizeof(ctx->key));
- memset(ctx, 0, sizeof(ctx));
+ memset(ctx, 0, sizeof(*ctx));
}
/*
@@ -225,8 +222,7 @@ isc_hmacsha256_init(isc_hmacsha256_t *ctx, const unsigned char *key,
void
isc_hmacsha256_invalidate(isc_hmacsha256_t *ctx) {
- memset(ctx->key, 0, sizeof(ctx->key));
- memset(ctx, 0, sizeof(ctx));
+ memset(ctx, 0, sizeof(*ctx));
}
/*
@@ -305,8 +301,7 @@ isc_hmacsha384_init(isc_hmacsha384_t *ctx, const unsigned char *key,
void
isc_hmacsha384_invalidate(isc_hmacsha384_t *ctx) {
- memset(ctx->key, 0, sizeof(ctx->key));
- memset(ctx, 0, sizeof(ctx));
+ memset(ctx, 0, sizeof(*ctx));
}
/*
@@ -385,8 +380,7 @@ isc_hmacsha512_init(isc_hmacsha512_t *ctx, const unsigned char *key,
void
isc_hmacsha512_invalidate(isc_hmacsha512_t *ctx) {
- memset(ctx->key, 0, sizeof(ctx->key));
- memset(ctx, 0, sizeof(ctx));
+ memset(ctx, 0, sizeof(*ctx));
}
/*