summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRich Salz <rsalz@openssl.org>2017-12-08 15:08:43 -0500
committerRich Salz <rsalz@openssl.org>2017-12-08 15:08:43 -0500
commitc6738fd208c143939b6bb7f7ac2061c0f5ff3272 (patch)
treea270d65f499b082d936057e1201acf76c98f570a
parenta1daedd88445397a4aebf22ba63e92c3f1977870 (diff)
Standardize syntax around sizeof(foo)
Reviewed-by: Andy Polyakov <appro@openssl.org> (Merged from https://github.com/openssl/openssl/pull/4875)
-rw-r--r--MacOS/Randomizer.cpp14
-rw-r--r--apps/app_rand.c4
-rw-r--r--apps/apps.c62
-rw-r--r--apps/ciphers.c2
-rw-r--r--apps/dgst.c2
-rw-r--r--apps/enc.c24
-rw-r--r--apps/errstr.c2
-rw-r--r--apps/ocsp.c2
-rw-r--r--apps/openssl.c6
-rw-r--r--apps/passwd.c14
-rw-r--r--apps/pkcs12.c10
-rw-r--r--apps/pkcs8.c4
-rw-r--r--apps/rand.c2
-rw-r--r--apps/req.c36
-rw-r--r--apps/s_client.c10
-rw-r--r--apps/s_server.c10
-rw-r--r--apps/s_socket.c6
-rw-r--r--apps/s_time.c6
-rw-r--r--apps/speed.c12
-rwxr-xr-xapps/vms_term_sock.c12
-rw-r--r--apps/winrand.c2
-rw-r--r--apps/x509.c4
-rw-r--r--crypto/asn1/a_gentm.c2
-rw-r--r--crypto/asn1/a_mbstr.c4
-rw-r--r--crypto/asn1/a_object.c4
-rw-r--r--crypto/asn1/a_strex.c8
-rw-r--r--crypto/asn1/a_time.c2
-rw-r--r--crypto/asn1/a_utctm.c4
-rw-r--r--crypto/asn1/asn1_lib.c4
-rw-r--r--crypto/asn1/asn1_par.c8
-rw-r--r--crypto/asn1/t_x509a.c4
-rw-r--r--crypto/asn1/tasn_prn.c2
-rw-r--r--crypto/bf/bftest.c6
-rw-r--r--crypto/bio/b_dump.c24
-rw-r--r--crypto/bio/b_print.c4
-rw-r--r--crypto/bio/bio_cb.c2
-rw-r--r--crypto/bio/bss_bio.c2
-rw-r--r--crypto/bio/bss_conn.c4
-rw-r--r--crypto/bio/bss_file.c10
-rw-r--r--crypto/bn/bn_print.c4
-rw-r--r--crypto/bn/bntest.c2
-rw-r--r--crypto/bn/expspeed.c2
-rw-r--r--crypto/bn/exptest.c8
-rw-r--r--crypto/conf/conf_def.c2
-rw-r--r--crypto/conf/conf_mod.c2
-rw-r--r--crypto/des/destest.c4
-rw-r--r--crypto/des/ecb_enc.c2
-rw-r--r--crypto/des/fcrypt.c4
-rw-r--r--crypto/des/read_pwd.c2
-rw-r--r--crypto/des/set_key.c2
-rw-r--r--crypto/dh/dhtest.c2
-rw-r--r--crypto/dsa/dsatest.c2
-rw-r--r--crypto/ec/ec_lib.c10
-rw-r--r--crypto/ec/ec_mult.c16
-rw-r--r--crypto/ec/ecp_nistp224.c14
-rw-r--r--crypto/ec/ecp_nistp256.c12
-rw-r--r--crypto/ec/ecp_nistp521.c8
-rw-r--r--crypto/ec/ecp_nistz256.c2
-rw-r--r--crypto/ec/ecp_smpl.c2
-rw-r--r--crypto/ec/ectest.c14
-rw-r--r--crypto/ecdh/ecdhtest.c2
-rw-r--r--crypto/engine/eng_cryptodev.c10
-rw-r--r--crypto/err/err.c4
-rw-r--r--crypto/err/err_prn.c2
-rw-r--r--crypto/evp/digest.c8
-rw-r--r--crypto/evp/evp_enc.c10
-rw-r--r--crypto/evp/evp_pbe.c4
-rwxr-xr-xcrypto/evp/evp_test.c2
-rw-r--r--crypto/evp/openbsd_hw.c6
-rw-r--r--crypto/evp/p5_crpt2.c2
-rw-r--r--crypto/hmac/hmac.c2
-rw-r--r--crypto/jpake/jpake.c12
-rw-r--r--crypto/md2/md2_dgst.c6
-rw-r--r--crypto/md4/md4.c2
-rw-r--r--crypto/mem_dbg.c8
-rwxr-xr-xcrypto/o_time.c4
-rw-r--r--crypto/objects/o_names.c4
-rw-r--r--crypto/objects/obj_dat.c2
-rw-r--r--crypto/pem/pem_info.c2
-rw-r--r--crypto/pem/pem_lib.c2
-rw-r--r--crypto/rand/md_rand.c6
-rw-r--r--crypto/rand/rand_egd.c2
-rw-r--r--crypto/rand/rand_unix.c10
-rw-r--r--crypto/rsa/rsa_crpt.c2
-rw-r--r--crypto/rsa/rsa_pss.c4
-rw-r--r--crypto/rsa/rsa_test.c2
-rw-r--r--crypto/srp/srp_grps.h28
-rw-r--r--crypto/threads/mttest.c2
-rw-r--r--crypto/ui/ui_openssl.c2
-rw-r--r--crypto/x509/x509_txt.c2
-rw-r--r--crypto/x509/x509_vpm.c2
-rw-r--r--crypto/x509v3/v3_alt.c4
-rw-r--r--crypto/x509v3/v3_info.c2
-rw-r--r--demos/easy_tls/easy-tls.c62
-rw-r--r--demos/easy_tls/test.c12
-rw-r--r--demos/engines/zencod/hw_zencod.c8
-rw-r--r--demos/spkigen.c2
-rw-r--r--demos/ssl/serv.cpp2
-rw-r--r--demos/state_machine/state_machine.c20
-rw-r--r--engines/e_atalla.c2
-rw-r--r--ssl/d1_lib.c4
-rw-r--r--ssl/d1_pkt.c4
-rw-r--r--ssl/kssl.c2
-rw-r--r--ssl/s23_srvr.c4
-rw-r--r--ssl/s2_clnt.c6
-rw-r--r--ssl/s2_enc.c2
-rw-r--r--ssl/s2_lib.c8
-rw-r--r--ssl/s2_srvr.c8
-rw-r--r--ssl/s3_clnt.c24
-rw-r--r--ssl/s3_lib.c8
-rw-r--r--ssl/s3_pkt.c6
-rw-r--r--ssl/s3_srvr.c4
-rw-r--r--ssl/ssl_cert.c10
-rw-r--r--ssl/ssl_lib.c6
-rw-r--r--ssl/ssl_sess.c8
-rw-r--r--ssl/ssltest.c22
-rw-r--r--ssl/t1_enc.c10
-rw-r--r--test/igetest.c134
118 files changed, 499 insertions, 497 deletions
diff --git a/MacOS/Randomizer.cpp b/MacOS/Randomizer.cpp
index cceb6bde44..52dc8842e8 100644
--- a/MacOS/Randomizer.cpp
+++ b/MacOS/Randomizer.cpp
@@ -266,7 +266,7 @@ void CRandomizer::AddCurrentMouse (void)
if (labs (mLastMouse.h - mouseLoc.h) > kMouseResolution/2 &&
labs (mLastMouse.v - mouseLoc.v) > kMouseResolution/2)
- AddBytes (&mouseLoc, sizeof (mouseLoc),
+ AddBytes (&mouseLoc, sizeof(mouseLoc),
kMousePositionEntropy);
if (mLastMouse.h == mouseLoc.h && mLastMouse.v == mouseLoc.v)
@@ -286,7 +286,7 @@ void CRandomizer::AddCurrentMouse (void)
(kTypicalMouseIdleTicks/(double)lastCheck);
if (entropy < 0.0)
entropy = 0.0;
- AddBytes (&mMouseStill, sizeof (mMouseStill), entropy);
+ AddBytes (&mMouseStill, sizeof(mMouseStill), entropy);
mMouseStill = 0;
}
mLastMouse = mouseLoc;
@@ -299,7 +299,7 @@ void CRandomizer::AddAbsoluteSystemStartupTime (void)
GetDateTime (&now);
now -= TickCount() / 60; // Time in ticks since machine
// startup
- AddBytes (&now, sizeof (now), kSysStartupEntropy);
+ AddBytes (&now, sizeof(now), kSysStartupEntropy);
}
void CRandomizer::AddTimeSinceMachineStartup (void)
@@ -314,7 +314,7 @@ void CRandomizer::AddAppRunningTime (void)
ProcessSerialNumber PSN;
ProcessInfoRec ProcessInfo;
- ProcessInfo.processInfoLength = sizeof (ProcessInfoRec);
+ ProcessInfo.processInfoLength = sizeof(ProcessInfoRec);
ProcessInfo.processName = nil;
ProcessInfo.processAppSpec = nil;
@@ -324,7 +324,7 @@ void CRandomizer::AddAppRunningTime (void)
// Now add the amount of time in ticks that the current process
// has been active
- AddBytes (&ProcessInfo, sizeof (ProcessInfoRec),
+ AddBytes (&ProcessInfo, sizeof(ProcessInfoRec),
kApplicationUpTimeEntropy);
}
@@ -353,7 +353,7 @@ void CRandomizer::AddStartupVolumeInfo (void)
// unpredictable, so might as well toss the whole block in. See
// comments for entropy estimate justifications.
- AddBytes (&pb, sizeof (pb),
+ AddBytes (&pb, sizeof(pb),
kVolumeBytesEntropy +
log2l (((pb.ioVTotalBytes.hi - pb.ioVFreeBytes.hi)
* 4294967296.0D +
@@ -419,7 +419,7 @@ void CRandomizer::AddBytes (void *data, long size, double entropy)
void CRandomizer::AddNow (double millisecondUncertainty)
{
long time = SysTimer();
- AddBytes (&time, sizeof (time), log2l (millisecondUncertainty *
+ AddBytes (&time, sizeof(time), log2l (millisecondUncertainty *
mTimebaseTicksPerMillisec));
}
diff --git a/apps/app_rand.c b/apps/app_rand.c
index 7f40bba764..0bbf342e7e 100644
--- a/apps/app_rand.c
+++ b/apps/app_rand.c
@@ -128,7 +128,7 @@ int app_RAND_load_file(const char *file, BIO *bio_e, int dont_warn)
#endif
if (file == NULL)
- file = RAND_file_name(buffer, sizeof buffer);
+ file = RAND_file_name(buffer, sizeof(buffer));
else if (RAND_egd(file) > 0) {
/*
* we try if the given filename is an EGD socket. if it is, we don't
@@ -203,7 +203,7 @@ int app_RAND_write_file(const char *file, BIO *bio_e)
return 0;
if (file == NULL)
- file = RAND_file_name(buffer, sizeof buffer);
+ file = RAND_file_name(buffer, sizeof(buffer));
if (file == NULL || !RAND_write_file(file)) {
BIO_printf(bio_e, "unable to write 'random state'\n");
return 0;
diff --git a/apps/apps.c b/apps/apps.c
index 29de1b75dd..c5a5152295 100644
--- a/apps/apps.c
+++ b/apps/apps.c
@@ -1738,9 +1738,9 @@ int save_serial(char *serialfile, char *suffix, BIGNUM *serial,
BUF_strlcpy(buf[0], serialfile, BSIZE);
else {
#ifndef OPENSSL_SYS_VMS
- j = BIO_snprintf(buf[0], sizeof buf[0], "%s.%s", serialfile, suffix);
+ j = BIO_snprintf(buf[0], sizeof(buf[0]), "%s.%s", serialfile, suffix);
#else
- j = BIO_snprintf(buf[0], sizeof buf[0], "%s-%s", serialfile, suffix);
+ j = BIO_snprintf(buf[0], sizeof(buf[0]), "%s-%s", serialfile, suffix);
#endif
}
#ifdef RL_DEBUG
@@ -1789,14 +1789,14 @@ int rotate_serial(char *serialfile, char *new_suffix, char *old_suffix)
goto err;
}
#ifndef OPENSSL_SYS_VMS
- j = BIO_snprintf(buf[0], sizeof buf[0], "%s.%s", serialfile, new_suffix);
+ j = BIO_snprintf(buf[0], sizeof(buf[0]), "%s.%s", serialfile, new_suffix);
#else
- j = BIO_snprintf(buf[0], sizeof buf[0], "%s-%s", serialfile, new_suffix);
+ j = BIO_snprintf(buf[0], sizeof(buf[0]), "%s-%s", serialfile, new_suffix);
#endif
#ifndef OPENSSL_SYS_VMS
- j = BIO_snprintf(buf[1], sizeof buf[1], "%s.%s", serialfile, old_suffix);
+ j = BIO_snprintf(buf[1], sizeof(buf[1]), "%s.%s", serialfile, old_suffix);
#else
- j = BIO_snprintf(buf[1], sizeof buf[1], "%s-%s", serialfile, old_suffix);
+ j = BIO_snprintf(buf[1], sizeof(buf[1]), "%s-%s", serialfile, old_suffix);
#endif
#ifdef RL_DEBUG
BIO_printf(bio_err, "DEBUG: renaming \"%s\" to \"%s\"\n",