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 /engines | |
parent | 12048657a91b12e499d03ec9ff406b42aba67366 (diff) |
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 'engines')
-rw-r--r-- | engines/ccgost/gost_pmeth.c | 4 | ||||
-rw-r--r-- | engines/ccgost/gosthash.c | 2 | ||||
-rw-r--r-- | engines/e_atalla.c | 2 | ||||
-rw-r--r-- | engines/e_padlock.c | 2 |
4 files changed, 5 insertions, 5 deletions
diff --git a/engines/ccgost/gost_pmeth.c b/engines/ccgost/gost_pmeth.c index 253757940d..b37bcf5201 100644 --- a/engines/ccgost/gost_pmeth.c +++ b/engines/ccgost/gost_pmeth.c @@ -28,7 +28,7 @@ static int pkey_gost_init(EVP_PKEY_CTX *ctx) data = OPENSSL_malloc(sizeof(*data)); if (!data) return 0; - memset(data, 0, sizeof(struct gost_pmeth_data)); + memset(data, 0, sizeof(*data)); if (pkey && EVP_PKEY_get0(pkey)) { switch (EVP_PKEY_base_id(pkey)) { case NID_id_GostR3410_94: @@ -411,7 +411,7 @@ static int pkey_gost_mac_init(EVP_PKEY_CTX *ctx) if (!data) return 0; - memset(data, 0, sizeof(struct gost_mac_pmeth_data)); + memset(data, 0, sizeof(*data)); EVP_PKEY_CTX_set_data(ctx, data); return 1; } diff --git a/engines/ccgost/gosthash.c b/engines/ccgost/gosthash.c index 72faa24ed5..b3d80d4ac6 100644 --- a/engines/ccgost/gosthash.c +++ b/engines/ccgost/gosthash.c @@ -154,7 +154,7 @@ static int hash_step(gost_ctx * c, byte * H, const byte * M) int init_gost_hash_ctx(gost_hash_ctx * ctx, const gost_subst_block * subst_block) { - memset(ctx, 0, sizeof(gost_hash_ctx)); + memset(ctx, 0, sizeof(*ctx)); ctx->cipher_ctx = (gost_ctx *) MYALLOC(sizeof(gost_ctx)); if (!ctx->cipher_ctx) { return 0; diff --git a/engines/e_atalla.c b/engines/e_atalla.c index 278cff427a..4bde213462 100644 --- a/engines/e_atalla.c +++ b/engines/e_atalla.c @@ -492,7 +492,7 @@ static int atalla_mod_exp(BIGNUM *r, const BIGNUM *a, const BIGNUM *p, goto err; } /* Prepare the key-data */ - memset(&keydata, 0, sizeof keydata); + memset(&keydata, 0, sizeof(keydata)); numbytes = BN_num_bytes(m); memset(exponent->d, 0, numbytes); memset(modulus->d, 0, numbytes); diff --git a/engines/e_padlock.c b/engines/e_padlock.c index 9acca7d918..df636b519b 100644 --- a/engines/e_padlock.c +++ b/engines/e_padlock.c @@ -661,7 +661,7 @@ padlock_aes_init_key(EVP_CIPHER_CTX *ctx, const unsigned char *key, return 0; /* ERROR */ cdata = ALIGNED_CIPHER_DATA(ctx); - memset(cdata, 0, sizeof(struct padlock_cipher_data)); + memset(cdata, 0, sizeof(*cdata)); /* Prepare Control word. */ if (mode == EVP_CIPH_OFB_MODE || mode == EVP_CIPH_CTR_MODE) |