diff options
author | Rich Salz <rsalz@akamai.com> | 2015-05-04 18:00:15 -0400 |
---|---|---|
committer | Rich Salz <rsalz@openssl.org> | 2015-05-05 22:18:59 -0400 |
commit | 16f8d4ebf0fd4847fa83d9c61f4150273cb4f533 (patch) | |
tree | 3c30094cad38433c24008c30efe3d93cf38d8ae9 /demos/engines | |
parent | 12048657a91b12e499d03ec9ff406b42aba67366 (diff) | |
download | openssl-16f8d4ebf0fd4847fa83d9c61f4150273cb4f533.tar.gz |
memset, memcpy, sizeof consistency fixes
Just as with the OPENSSL_malloc calls, consistently use sizeof(*ptr)
for memset and memcpy. Remove needless casts for those functions.
For memset, replace alternative forms of zero with 0.
Reviewed-by: Richard Levitte <levitte@openssl.org>
Diffstat (limited to 'demos/engines')
-rw-r--r-- | demos/engines/ibmca/hw_ibmca.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/demos/engines/ibmca/hw_ibmca.c b/demos/engines/ibmca/hw_ibmca.c index fb5b8dbad8..5017d6490d 100644 --- a/demos/engines/ibmca/hw_ibmca.c +++ b/demos/engines/ibmca/hw_ibmca.c @@ -506,7 +506,7 @@ static int ibmca_mod_exp(BIGNUM *r, const BIGNUM *a, const BIGNUM *p, if (publKey == NULL) { goto err; } - memset(publKey, 0, sizeof(ICA_KEY_RSA_MODEXPO)); + memset(publKey, 0, sizeof(*publKey)); publKey->keyType = CORRECT_ENDIANNESS(ME_KEY_TYPE); publKey->keyLength = CORRECT_ENDIANNESS(sizeof(ICA_KEY_RSA_MODEXPO)); @@ -670,7 +670,7 @@ static int ibmca_mod_exp_crt(BIGNUM *r, const BIGNUM *a, const BIGNUM *p, /* end SAB additions */ - memset(privKey, 0, sizeof(ICA_KEY_RSA_CRT)); + memset(privKey, 0, sizeof(*privKey)); privKey->keyType = CORRECT_ENDIANNESS(CRT_KEY_TYPE); privKey->keyLength = CORRECT_ENDIANNESS(sizeof(ICA_KEY_RSA_CRT)); privKey->modulusBitLength = CORRECT_ENDIANNESS(BN_num_bytes(q) * 2 * 8); |