diff options
| author | bcook <> | 2016-07-17 22:01:01 +0000 |
|---|---|---|
| committer | bcook <> | 2016-07-17 22:01:01 +0000 |
| commit | c5ec86df737ed666779cf51e5f3a89a62397e0de (patch) | |
| tree | 425d51bcd426abbb2eb822c25490cd38a24aae30 | |
| parent | 45c9aa3806e0d3ab3751cd424acd1b069b6d54ee (diff) | |
| download | openbsd-c5ec86df737ed666779cf51e5f3a89a62397e0de.tar.gz openbsd-c5ec86df737ed666779cf51e5f3a89a62397e0de.tar.bz2 openbsd-c5ec86df737ed666779cf51e5f3a89a62397e0de.zip | |
use memset to initialize the union
| -rw-r--r-- | src/lib/libcrypto/bn/bn_nist.c | 6 | ||||
| -rw-r--r-- | src/lib/libssl/src/crypto/bn/bn_nist.c | 6 |
2 files changed, 8 insertions, 4 deletions
diff --git a/src/lib/libcrypto/bn/bn_nist.c b/src/lib/libcrypto/bn/bn_nist.c index 44bf0cb0ce..9a0970138d 100644 --- a/src/lib/libcrypto/bn/bn_nist.c +++ b/src/lib/libcrypto/bn/bn_nist.c | |||
| @@ -1,4 +1,4 @@ | |||
| 1 | /* $OpenBSD: bn_nist.c,v 1.16 2016/07/17 21:21:40 bcook Exp $ */ | 1 | /* $OpenBSD: bn_nist.c,v 1.17 2016/07/17 22:01:01 bcook Exp $ */ |
| 2 | /* | 2 | /* |
| 3 | * Written by Nils Larsch for the OpenSSL project | 3 | * Written by Nils Larsch for the OpenSSL project |
| 4 | */ | 4 | */ |
| @@ -59,6 +59,7 @@ | |||
| 59 | #include <machine/endian.h> | 59 | #include <machine/endian.h> |
| 60 | 60 | ||
| 61 | #include <stdint.h> | 61 | #include <stdint.h> |
| 62 | #include <string.h> | ||
| 62 | 63 | ||
| 63 | #include "bn_lcl.h" | 64 | #include "bn_lcl.h" |
| 64 | 65 | ||
| @@ -568,7 +569,8 @@ BN_nist_mod_224(BIGNUM *r, const BIGNUM *a, const BIGNUM *field, BN_CTX *ctx) | |||
| 568 | BN_ULONG bn[BN_NIST_224_TOP]; | 569 | BN_ULONG bn[BN_NIST_224_TOP]; |
| 569 | unsigned int ui[BN_NIST_224_TOP * | 570 | unsigned int ui[BN_NIST_224_TOP * |
| 570 | sizeof(BN_ULONG) / sizeof(unsigned int)]; | 571 | sizeof(BN_ULONG) / sizeof(unsigned int)]; |
| 571 | } buf = {0}; | 572 | } buf; |
| 573 | memset(&buf, 0, sizeof(buf)); | ||
| 572 | BN_ULONG c_d[BN_NIST_224_TOP], *res; | 574 | BN_ULONG c_d[BN_NIST_224_TOP], *res; |
| 573 | uintptr_t mask; | 575 | uintptr_t mask; |
| 574 | union { | 576 | union { |
diff --git a/src/lib/libssl/src/crypto/bn/bn_nist.c b/src/lib/libssl/src/crypto/bn/bn_nist.c index 44bf0cb0ce..9a0970138d 100644 --- a/src/lib/libssl/src/crypto/bn/bn_nist.c +++ b/src/lib/libssl/src/crypto/bn/bn_nist.c | |||
| @@ -1,4 +1,4 @@ | |||
| 1 | /* $OpenBSD: bn_nist.c,v 1.16 2016/07/17 21:21:40 bcook Exp $ */ | 1 | /* $OpenBSD: bn_nist.c,v 1.17 2016/07/17 22:01:01 bcook Exp $ */ |
| 2 | /* | 2 | /* |
| 3 | * Written by Nils Larsch for the OpenSSL project | 3 | * Written by Nils Larsch for the OpenSSL project |
| 4 | */ | 4 | */ |
| @@ -59,6 +59,7 @@ | |||
| 59 | #include <machine/endian.h> | 59 | #include <machine/endian.h> |
| 60 | 60 | ||
| 61 | #include <stdint.h> | 61 | #include <stdint.h> |
| 62 | #include <string.h> | ||
| 62 | 63 | ||
| 63 | #include "bn_lcl.h" | 64 | #include "bn_lcl.h" |
| 64 | 65 | ||
| @@ -568,7 +569,8 @@ BN_nist_mod_224(BIGNUM *r, const BIGNUM *a, const BIGNUM *field, BN_CTX *ctx) | |||
| 568 | BN_ULONG bn[BN_NIST_224_TOP]; | 569 | BN_ULONG bn[BN_NIST_224_TOP]; |
| 569 | unsigned int ui[BN_NIST_224_TOP * | 570 | unsigned int ui[BN_NIST_224_TOP * |
| 570 | sizeof(BN_ULONG) / sizeof(unsigned int)]; | 571 | sizeof(BN_ULONG) / sizeof(unsigned int)]; |
| 571 | } buf = {0}; | 572 | } buf; |
| 573 | memset(&buf, 0, sizeof(buf)); | ||
| 572 | BN_ULONG c_d[BN_NIST_224_TOP], *res; | 574 | BN_ULONG c_d[BN_NIST_224_TOP], *res; |
| 573 | uintptr_t mask; | 575 | uintptr_t mask; |
| 574 | union { | 576 | union { |
