diff --git a/apps/progs.h b/apps/progs.h index ac9d20804b0861aa4507c551d15926b34aa25987..5f6f07f89d16f0313023927cb2e017c65335113d 100644 --- a/apps/progs.h +++ b/apps/progs.h @@ -18,7 +18,7 @@ typedef enum FUNC_TYPE { typedef struct function_st { FUNC_TYPE type; const char *name; - int (*func)(int argc,char *argv[]); + int (*func)(int argc, char *argv[]); const OPTIONS *help; } FUNCTION; diff --git a/apps/speed.c b/apps/speed.c index 6a62ab79e3843819185578cf585b8311dff74c90..e04a440bbe222cca3a9ca98938489f3ae0a51f98 100644 --- a/apps/speed.c +++ b/apps/speed.c @@ -371,7 +371,7 @@ OPTIONS speed_options[] = { {"decrypt", OPT_DECRYPT, '-', "Time decryption instead of encryption (only EVP)"}, {"mr", OPT_MR, '-', "Produce machine readable output"}, - {"mb", OPT_MB, '-', + {"mb", OPT_MB, '-', "Enable (tls1.1) multi-block mode on evp_cipher requested with -evp"}, {"misalign", OPT_MISALIGN, 'n', "Amount to mis-align buffers"}, {"elapsed", OPT_ELAPSED, '-', @@ -1066,16 +1066,16 @@ static void *KDF1_SHA1(const void *in, size_t inlen, void *out, *outlen = SHA_DIGEST_LENGTH; return SHA1(in, inlen, out); } - #endif /* ndef OPENSSL_NO_EC */ -static int run_benchmark(int async_jobs, int (*loop_function)(void *), loopargs_t *loopargs) +static int run_benchmark(int async_jobs, + int (*loop_function)(void *), loopargs_t *loopargs) { int job_op_count = 0; int total_op_count = 0; int num_inprogress = 0; - int error = 0, i = 0, async = 0; + int error = 0, i = 0, ret = 0; OSSL_ASYNC_FD job_fd = 0; size_t num_job_fds = 0; @@ -1086,10 +1086,10 @@ static int run_benchmark(int async_jobs, int (*loop_function)(void *), loopargs_ } for (i = 0; i < async_jobs && !error; i++) { - async = ASYNC_start_job(&(loopargs[i].inprogress_job), loopargs[i].wait_ctx, - &job_op_count, loop_function, - (void *)(loopargs + i), sizeof(loopargs_t)); - switch (async) { + ret = ASYNC_start_job(&loopargs[i].inprogress_job, loopargs[i].wait_ctx, + &job_op_count, loop_function, + (void *)(loopargs + i), sizeof(loopargs_t)); + switch (ret) { case ASYNC_PAUSE: ++num_inprogress; break; @@ -1179,15 +1179,15 @@ static int run_benchmark(int async_jobs, int (*loop_function)(void *), loopargs_ continue; #elif defined(OPENSSL_SYS_WINDOWS) if (num_job_fds == 1 - && !PeekNamedPipe(job_fd, NULL, 0, NULL, &avail, NULL) + && !PeekNamedPipe(job_fd, NULL, 0, NULL, &avail, NULL) && avail > 0) continue; #endif - async = ASYNC_start_job(&(loopargs[i].inprogress_job), loopargs[i].wait_ctx, - &job_op_count, loop_function, (void *)(loopargs + i), - sizeof(loopargs_t)); - switch (async) { + ret = ASYNC_start_job(&loopargs[i].inprogress_job, + loopargs[i].wait_ctx, &job_op_count, loop_function, + (void *)(loopargs + i), sizeof(loopargs_t)); + switch (ret) { case ASYNC_PAUSE: break; case ASYNC_FINISH: diff --git a/crypto/bio/bio_cb.c b/crypto/bio/bio_cb.c index 860208be3bb97d73aacae69c327777927c6f109a..69ea3d067ee8d0291cb7f3150beb7aa73c488637 100644 --- a/crypto/bio/bio_cb.c +++ b/crypto/bio/bio_cb.c @@ -27,7 +27,7 @@ long BIO_debug_callback(BIO *bio, int cmd, const char *argp, if (BIO_CB_RETURN & cmd) r = ret; - len = BIO_snprintf(buf,sizeof buf,"BIO[%p]: ",(void *)bio); + len = BIO_snprintf(buf, sizeof buf, "BIO[%p]: ", (void *)bio); /* Ignore errors and continue printing the other information. */ if (len < 0) diff --git a/crypto/bn/bn_lib.c b/crypto/bn/bn_lib.c index b606cc9c32b58260eafce5d09475f5731f8e8123..0be42f8350e1f7b379789572c3913d0aaa9c2a9b 100644 --- a/crypto/bn/bn_lib.c +++ b/crypto/bn/bn_lib.c @@ -170,7 +170,7 @@ int BN_num_bits(const BIGNUM *a) static void bn_free_d(BIGNUM *a) { - if (BN_get_flags(a,BN_FLG_SECURE)) + if (BN_get_flags(a, BN_FLG_SECURE)) OPENSSL_secure_free(a->d); else OPENSSL_free(a->d); @@ -259,7 +259,7 @@ static BN_ULONG *bn_expand_internal(const BIGNUM *b, int words) BNerr(BN_F_BN_EXPAND_INTERNAL, BN_R_EXPAND_ON_STATIC_BIGNUM_DATA); return (NULL); } - if (BN_get_flags(b,BN_FLG_SECURE)) + if (BN_get_flags(b, BN_FLG_SECURE)) a = A = OPENSSL_secure_zalloc(words * sizeof(*a)); else a = A = OPENSSL_zalloc(words * sizeof(*a)); diff --git a/crypto/ct/ct_sct.c b/crypto/ct/ct_sct.c index 1aec3e2541db7bd5add6622eeeff8c03f23f4472..08676805bd2dc6c3f7ec197da611f140b720210f 100644 --- a/crypto/ct/ct_sct.c +++ b/crypto/ct/ct_sct.c @@ -117,7 +117,7 @@ void SCT_set_timestamp(SCT *sct, uint64_t timestamp) int SCT_set_signature_nid(SCT *sct, int nid) { - switch (nid) { + switch (nid) { case NID_sha256WithRSAEncryption: sct->hash_alg = TLSEXT_hash_sha256; sct->sig_alg = TLSEXT_signature_rsa; diff --git a/crypto/ec/ec_key.c b/crypto/ec/ec_key.c index 2d837f9c0317b967c15113d0b864858cf65a3ffe..f1f0afb466b50329666e99b7100a097b94bfa427 100644 --- a/crypto/ec/ec_key.c +++ b/crypto/ec/ec_key.c @@ -546,7 +546,7 @@ int EC_KEY_oct2key(EC_KEY *key, const unsigned char *buf, size_t len, return 1; } -size_t EC_KEY_priv2oct(const EC_KEY *eckey, +size_t EC_KEY_priv2oct(const EC_KEY *eckey, unsigned char *buf, size_t len) { if (eckey->group == NULL || eckey->group->meth == NULL) diff --git a/crypto/engine/eng_ctrl.c b/crypto/engine/eng_ctrl.c index f546caf74f5dae46b316e0f98c61636c779401f2..7925f4fadfd453082596711b30770f027c8e43b7 100644 --- a/crypto/engine/eng_ctrl.c +++ b/crypto/engine/eng_ctrl.c @@ -203,14 +203,13 @@ int ENGINE_ctrl_cmd(ENGINE *e, const char *cmd_name, { int num; - if ((e == NULL) || (cmd_name == NULL)) { + if (e == NULL || cmd_name == NULL) { ENGINEerr(ENGINE_F_ENGINE_CTRL_CMD, ERR_R_PASSED_NULL_PARAMETER); return 0; } - if ((e->ctrl == NULL) || ((num = ENGINE_ctrl(e, - ENGINE_CTRL_GET_CMD_FROM_NAME, - 0, (void *)cmd_name, - NULL)) <= 0)) { + if (e->ctrl == NULL + || (num = ENGINE_ctrl(e, ENGINE_CTRL_GET_CMD_FROM_NAME, + 0, (void *)cmd_name, NULL)) <= 0) { /* * If the command didn't *have* to be supported, we fake success. * This allows certain settings to be specified for multiple ENGINEs @@ -242,12 +241,11 @@ int ENGINE_ctrl_cmd_string(ENGINE *e, const char *cmd_name, const char *arg, long l; char *ptr; - if ((e == NULL) || (cmd_name == NULL)) { - ENGINEerr(ENGINE_F_ENGINE_CTRL_CMD_STRING, - ERR_R_PASSED_NULL_PARAMETER); + if (e == NULL || cmd_name == NULL) { + ENGINEerr(ENGINE_F_ENGINE_CTRL_CMD_STRING, ERR_R_PASSED_NULL_PARAMETER); return 0; } - if (e->ctrl == NULL + if (e->ctrl == NULL || (num = ENGINE_ctrl(e, ENGINE_CTRL_GET_CMD_FROM_NAME, 0, (void *)cmd_name, NULL)) <= 0) { /* diff --git a/crypto/evp/e_chacha20_poly1305.c b/crypto/evp/e_chacha20_poly1305.c index 26fefd9781b28cd01d09ed83a2deaae3ca853825..cf4097ba5daf1e231b2e75d8d8c32aa0de9df4fe 100644 --- a/crypto/evp/e_chacha20_poly1305.c +++ b/crypto/evp/e_chacha20_poly1305.c @@ -345,9 +345,11 @@ static int chacha20_poly1305_ctrl(EVP_CIPHER_CTX *ctx, int type, int arg, case EVP_CTRL_COPY: if (actx) { - if ((((EVP_CIPHER_CTX *)ptr)->cipher_data = - OPENSSL_memdup(actx,sizeof(*actx) + Poly1305_ctx_size())) - == NULL) { + EVP_CIPHER_CTX *dst = (EVP_CIPHER_CTX *)ptr; + + dst->cipher_data = + OPENSSL_memdup(actx, sizeof(*actx) + Poly1305_ctx_size()); + if (dst->cipher_data == NULL) { EVPerr(EVP_F_CHACHA20_POLY1305_CTRL, EVP_R_COPY_ERROR); return 0; } diff --git a/crypto/mem_clr.c b/crypto/mem_clr.c index a1a4f93009c9465c13248f862771f5d1d4a2f809..35bfb74eaebd0a4ecbcc80ad6d69e0e774b3a0c8 100644 --- a/crypto/mem_clr.c +++ b/crypto/mem_clr.c @@ -15,7 +15,7 @@ * the pointer and can't assume that it points to any function in * particular (such as memset, which it then might further "optimize") */ -typedef void *(*memset_t)(void *,int,size_t); +typedef void *(*memset_t)(void *, int, size_t); static volatile memset_t memset_func = memset; diff --git a/crypto/ppccap.c b/crypto/ppccap.c index 712ee799d6dfd830140df627f19d5e8525baaafd..ef38b172d9af9c871af9d9ccdec011994d6ef545 100644 --- a/crypto/ppccap.c +++ b/crypto/ppccap.c @@ -119,11 +119,11 @@ void poly1305_emit_fpu(void *ctx, unsigned char mac[16], int poly1305_init(void *ctx, const unsigned char key[16], void *func[2]) { if (sizeof(size_t) == 4 && (OPENSSL_ppccap_P & PPC_FPU)) { - poly1305_init_fpu(ctx,key); + poly1305_init_fpu(ctx, key); func[0] = poly1305_blocks_fpu; func[1] = poly1305_emit_fpu; } else { - poly1305_init_int(ctx,key); + poly1305_init_int(ctx, key); func[0] = poly1305_blocks; func[1] = poly1305_emit; } diff --git a/doc/crypto/BIO_s_fd.pod b/doc/crypto/BIO_s_fd.pod index aa7ba363adb2b3c2c654bd77c60ebc195a2fd0ea..79c4a5999f03754732127b13d5bbd5dc8e952158 100644 --- a/doc/crypto/BIO_s_fd.pod +++ b/doc/crypto/BIO_s_fd.pod @@ -73,7 +73,7 @@ occurred. This is a file descriptor BIO version of "Hello World": BIO *out; - + out = BIO_new_fd(fileno(stdout), BIO_NOCLOSE); BIO_printf(out, "Hello World\n"); BIO_free(out); diff --git a/doc/crypto/X509_STORE_set_verify_cb_func.pod b/doc/crypto/X509_STORE_set_verify_cb_func.pod index dd21325f74c93ba2f26fcd6e6afef8dc4e71029b..89135f4e130a5b0fca56da1061c2af06b32ebd24 100644 --- a/doc/crypto/X509_STORE_set_verify_cb_func.pod +++ b/doc/crypto/X509_STORE_set_verify_cb_func.pod @@ -148,7 +148,7 @@ It must return 0 on failure and 1 on success. I -X509_STORE_set_get_crl() sets the function to get the crl for a given +X509_STORE_set_get_crl() sets the function to get the crl for a given certificate B. When found, the crl must be assigned to B<*crl>. This function must return 0 on failure and 1 on success.