diff options
author | 2011-07-05 20:05:56 +0000 | |
---|---|---|
committer | 2011-07-05 20:05:56 +0000 | |
commit | a201dc7c921d1f51e5c5e0b1e7263f4633ee8adf (patch) | |
tree | 998846bca70bbd25b773800526c7340d7093627a | |
parent | IFQ_IS_EMPTY instead of fiddling with ifqueue internals (diff) | |
download | wireguard-openbsd-a201dc7c921d1f51e5c5e0b1e7263f4633ee8adf.tar.xz wireguard-openbsd-a201dc7c921d1f51e5c5e0b1e7263f4633ee8adf.zip |
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
-rw-r--r-- | usr.sbin/bind/lib/isc/hmacsha.c | 16 |
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)); } /* |