diff options
author | Rich Salz <rsalz@openssl.org> | 2017-12-08 15:08:43 -0500 |
---|---|---|
committer | Rich Salz <rsalz@openssl.org> | 2017-12-08 15:08:43 -0500 |
commit | c6738fd208c143939b6bb7f7ac2061c0f5ff3272 (patch) | |
tree | a270d65f499b082d936057e1201acf76c98f570a /crypto/des | |
parent | a1daedd88445397a4aebf22ba63e92c3f1977870 (diff) |
Standardize syntax around sizeof(foo)
Reviewed-by: Andy Polyakov <appro@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/4875)
Diffstat (limited to 'crypto/des')
-rw-r--r-- | crypto/des/destest.c | 4 | ||||
-rw-r--r-- | crypto/des/ecb_enc.c | 2 | ||||
-rw-r--r-- | crypto/des/fcrypt.c | 4 | ||||
-rw-r--r-- | crypto/des/read_pwd.c | 2 | ||||
-rw-r--r-- | crypto/des/set_key.c | 2 |
5 files changed, 7 insertions, 7 deletions
diff --git a/crypto/des/destest.c b/crypto/des/destest.c index c6be342038..f2041c1e11 100644 --- a/crypto/des/destest.c +++ b/crypto/des/destest.c @@ -398,7 +398,7 @@ int main(int argc, char *argv[]) i = strlen((char *)cbc_data) + 1; /* i=((i+7)/8)*8; */ memcpy(iv3, cbc_iv, sizeof(cbc_iv)); - memset(iv2, '\0', sizeof iv2); + memset(iv2, '\0', sizeof(iv2)); DES_ede3_cbcm_encrypt(cbc_data, cbc_out, 16L, &ks, &ks2, &ks3, &iv3, &iv2, DES_ENCRYPT); @@ -412,7 +412,7 @@ int main(int argc, char *argv[]) } */ memcpy(iv3, cbc_iv, sizeof(cbc_iv)); - memset(iv2, '\0', sizeof iv2); + memset(iv2, '\0', sizeof(iv2)); DES_ede3_cbcm_encrypt(cbc_out, cbc_in, i, &ks, &ks2, &ks3, &iv3, &iv2, DES_DECRYPT); if (memcmp(cbc_in, cbc_data, strlen((char *)cbc_data) + 1) != 0) { diff --git a/crypto/des/ecb_enc.c b/crypto/des/ecb_enc.c index f97fd971dc..60470d6db7 100644 --- a/crypto/des/ecb_enc.c +++ b/crypto/des/ecb_enc.c @@ -96,7 +96,7 @@ const char *DES_options(void) size = "int"; else size = "long"; - BIO_snprintf(buf, sizeof buf, "des(%s,%s,%s,%s)", ptr, risc, unroll, + BIO_snprintf(buf, sizeof(buf), "des(%s,%s,%s,%s)", ptr, risc, unroll, size); init = 0; } diff --git a/crypto/des/fcrypt.c b/crypto/des/fcrypt.c index 111f1e4617..09f5792b1e 100644 --- a/crypto/des/fcrypt.c +++ b/crypto/des/fcrypt.c @@ -80,10 +80,10 @@ char *DES_crypt(const char *buf, const char *salt) e_salt[sizeof(e_salt) - 1] = e_buf[sizeof(e_buf) - 1] = '\0'; /* Convert the e_salt to ASCII, as that's what DES_fcrypt works on */ - ebcdic2ascii(e_salt, e_salt, sizeof e_salt); + ebcdic2ascii(e_salt, e_salt, sizeof(e_salt)); /* Convert the cleartext password to ASCII */ - ebcdic2ascii(e_buf, e_buf, sizeof e_buf); + ebcdic2ascii(e_buf, e_buf, sizeof(e_buf)); /* Encrypt it (from/to ASCII) */ ret = DES_fcrypt(e_buf, e_salt, buff); diff --git a/crypto/des/read_pwd.c b/crypto/des/read_pwd.c index 514a7063b4..080d3e8dfc 100644 --- a/crypto/des/read_pwd.c +++ b/crypto/des/read_pwd.c @@ -434,7 +434,7 @@ static void pushsig(void) # ifdef SIGACTION struct sigaction sa; - memset(&sa, 0, sizeof sa); + memset(&sa, 0, sizeof(sa)); sa.sa_handler = recsig; # endif diff --git a/crypto/des/set_key.c b/crypto/des/set_key.c index d9c5e7fcb3..0a9ddb4baa 100644 --- a/crypto/des/set_key.c +++ b/crypto/des/set_key.c @@ -377,7 +377,7 @@ void private_DES_set_key_unchecked(const_DES_cblock *key, register int i; #ifdef OPENBSD_DEV_CRYPTO - memcpy(schedule->key, key, sizeof schedule->key); + memcpy(schedule->key, key, sizeof(schedule->key)); schedule->session = NULL; #endif k = &schedule->ks->deslong[0]; |