From 6e16ad06cd3a53a408f722d061e4e30e2b70f8d2 Mon Sep 17 00:00:00 2001 From: jsing Date: Sun, 11 May 2014 12:20:20 +0000 Subject: [PATCH] More KNF. --- lib/libcrypto/evp/bio_b64.c | 2 +- lib/libcrypto/evp/bio_enc.c | 2 +- lib/libcrypto/evp/e_old.c | 33 +++++++++++++++++++---------- lib/libcrypto/evp/evp_err.c | 4 ++-- lib/libcrypto/evp/evp_key.c | 2 +- lib/libssl/src/crypto/evp/bio_b64.c | 2 +- lib/libssl/src/crypto/evp/bio_enc.c | 2 +- lib/libssl/src/crypto/evp/e_old.c | 33 +++++++++++++++++++---------- lib/libssl/src/crypto/evp/evp_err.c | 4 ++-- lib/libssl/src/crypto/evp/evp_key.c | 2 +- 10 files changed, 54 insertions(+), 32 deletions(-) diff --git a/lib/libcrypto/evp/bio_b64.c b/lib/libcrypto/evp/bio_b64.c index f963b606d2a..465753cf16f 100644 --- a/lib/libcrypto/evp/bio_b64.c +++ b/lib/libcrypto/evp/bio_b64.c @@ -147,7 +147,7 @@ b64_free(BIO *a) static int b64_read(BIO *b, char *out, int outl) { - int ret = 0, i, ii, j,k, x,n, num, ret_code = 0; + int ret = 0, i, ii, j, k, x, n, num, ret_code = 0; BIO_B64_CTX *ctx; unsigned char *p, *q; diff --git a/lib/libcrypto/evp/bio_enc.c b/lib/libcrypto/evp/bio_enc.c index 46cd2a6a60b..df817b9d8fe 100644 --- a/lib/libcrypto/evp/bio_enc.c +++ b/lib/libcrypto/evp/bio_enc.c @@ -419,7 +419,7 @@ BIO_set_cipher(BIO *b, const EVP_CIPHER *c, const unsigned char *k, b->init = 1; ctx = (BIO_ENC_CTX *)b->ptr; - EVP_CipherInit_ex(&(ctx->cipher), c,NULL, k, i, e); + EVP_CipherInit_ex(&(ctx->cipher), c, NULL, k, i, e); if (b->callback != NULL) b->callback(b, BIO_CB_CTRL, (const char *)c, BIO_CTRL_SET, e, 1L); diff --git a/lib/libcrypto/evp/e_old.c b/lib/libcrypto/evp/e_old.c index c27b61a4bfc..6d63ea4269e 100644 --- a/lib/libcrypto/evp/e_old.c +++ b/lib/libcrypto/evp/e_old.c @@ -71,7 +71,8 @@ static void *dummy = &dummy; #ifndef OPENSSL_NO_BF #undef EVP_bf_cfb const EVP_CIPHER *EVP_bf_cfb(void); -const EVP_CIPHER *EVP_bf_cfb(void) +const EVP_CIPHER * +EVP_bf_cfb(void) { return EVP_bf_cfb64(); } @@ -80,19 +81,22 @@ const EVP_CIPHER *EVP_bf_cfb(void) #ifndef OPENSSL_NO_DES #undef EVP_des_cfb const EVP_CIPHER *EVP_des_cfb(void); -const EVP_CIPHER *EVP_des_cfb(void) +const EVP_CIPHER * +EVP_des_cfb(void) { return EVP_des_cfb64(); } #undef EVP_des_ede3_cfb const EVP_CIPHER *EVP_des_ede3_cfb(void); -const EVP_CIPHER *EVP_des_ede3_cfb(void) +const EVP_CIPHER * +EVP_des_ede3_cfb(void) { return EVP_des_ede3_cfb64(); } #undef EVP_des_ede_cfb const EVP_CIPHER *EVP_des_ede_cfb(void); -const EVP_CIPHER *EVP_des_ede_cfb(void) +const EVP_CIPHER * +EVP_des_ede_cfb(void) { return EVP_des_ede_cfb64(); } @@ -101,7 +105,8 @@ const EVP_CIPHER *EVP_des_ede_cfb(void) #ifndef OPENSSL_NO_IDEA #undef EVP_idea_cfb const EVP_CIPHER *EVP_idea_cfb(void); -const EVP_CIPHER *EVP_idea_cfb(void) +const EVP_CIPHER * +EVP_idea_cfb(void) { return EVP_idea_cfb64(); } @@ -110,7 +115,8 @@ const EVP_CIPHER *EVP_idea_cfb(void) #ifndef OPENSSL_NO_RC2 #undef EVP_rc2_cfb const EVP_CIPHER *EVP_rc2_cfb(void); -const EVP_CIPHER *EVP_rc2_cfb(void) +const EVP_CIPHER * +EVP_rc2_cfb(void) { return EVP_rc2_cfb64(); } @@ -119,7 +125,8 @@ const EVP_CIPHER *EVP_rc2_cfb(void) #ifndef OPENSSL_NO_CAST #undef EVP_cast5_cfb const EVP_CIPHER *EVP_cast5_cfb(void); -const EVP_CIPHER *EVP_cast5_cfb(void) +const EVP_CIPHER * +EVP_cast5_cfb(void) { return EVP_cast5_cfb64(); } @@ -128,7 +135,8 @@ const EVP_CIPHER *EVP_cast5_cfb(void) #ifndef OPENSSL_NO_RC5 #undef EVP_rc5_32_12_16_cfb const EVP_CIPHER *EVP_rc5_32_12_16_cfb(void); -const EVP_CIPHER *EVP_rc5_32_12_16_cfb(void) +const EVP_CIPHER * +EVP_rc5_32_12_16_cfb(void) { return EVP_rc5_32_12_16_cfb64(); } @@ -137,19 +145,22 @@ const EVP_CIPHER *EVP_rc5_32_12_16_cfb(void) #ifndef OPENSSL_NO_AES #undef EVP_aes_128_cfb const EVP_CIPHER *EVP_aes_128_cfb(void); -const EVP_CIPHER *EVP_aes_128_cfb(void) +const EVP_CIPHER * +EVP_aes_128_cfb(void) { return EVP_aes_128_cfb128(); } #undef EVP_aes_192_cfb const EVP_CIPHER *EVP_aes_192_cfb(void); -const EVP_CIPHER *EVP_aes_192_cfb(void) +const EVP_CIPHER * +EVP_aes_192_cfb(void) { return EVP_aes_192_cfb128(); } #undef EVP_aes_256_cfb const EVP_CIPHER *EVP_aes_256_cfb(void); -const EVP_CIPHER *EVP_aes_256_cfb(void) +const EVP_CIPHER * +EVP_aes_256_cfb(void) { return EVP_aes_256_cfb128(); } diff --git a/lib/libcrypto/evp/evp_err.c b/lib/libcrypto/evp/evp_err.c index 790459fab40..80247319389 100644 --- a/lib/libcrypto/evp/evp_err.c +++ b/lib/libcrypto/evp/evp_err.c @@ -68,7 +68,7 @@ #define ERR_FUNC(func) ERR_PACK(ERR_LIB_EVP,func,0) #define ERR_REASON(reason) ERR_PACK(ERR_LIB_EVP,0,reason) -static ERR_STRING_DATA EVP_str_functs[]= { +static ERR_STRING_DATA EVP_str_functs[] = { {ERR_FUNC(EVP_F_AESNI_INIT_KEY), "AESNI_INIT_KEY"}, {ERR_FUNC(EVP_F_AESNI_XTS_CIPHER), "AESNI_XTS_CIPHER"}, {ERR_FUNC(EVP_F_AES_INIT_KEY), "AES_INIT_KEY"}, @@ -149,7 +149,7 @@ static ERR_STRING_DATA EVP_str_functs[]= { {0, NULL} }; -static ERR_STRING_DATA EVP_str_reasons[]= { +static ERR_STRING_DATA EVP_str_reasons[] = { {ERR_REASON(EVP_R_AES_IV_SETUP_FAILED) , "aes iv setup failed"}, {ERR_REASON(EVP_R_AES_KEY_SETUP_FAILED) , "aes key setup failed"}, {ERR_REASON(EVP_R_ASN1_LIB) , "asn1 lib"}, diff --git a/lib/libcrypto/evp/evp_key.c b/lib/libcrypto/evp/evp_key.c index 445456d3a74..48d8d411897 100644 --- a/lib/libcrypto/evp/evp_key.c +++ b/lib/libcrypto/evp/evp_key.c @@ -105,7 +105,7 @@ EVP_read_pw_string_min(char *buf, int min, int len, const char *prompt, if ((prompt == NULL) && (prompt_string[0] != '\0')) prompt = prompt_string; ui = UI_new(); - UI_add_input_string(ui, prompt, 0,buf, min, + UI_add_input_string(ui, prompt, 0, buf, min, (len >= BUFSIZ) ? BUFSIZ - 1 : len); if (verify) UI_add_verify_string(ui, prompt, 0, buff, min, diff --git a/lib/libssl/src/crypto/evp/bio_b64.c b/lib/libssl/src/crypto/evp/bio_b64.c index f963b606d2a..465753cf16f 100644 --- a/lib/libssl/src/crypto/evp/bio_b64.c +++ b/lib/libssl/src/crypto/evp/bio_b64.c @@ -147,7 +147,7 @@ b64_free(BIO *a) static int b64_read(BIO *b, char *out, int outl) { - int ret = 0, i, ii, j,k, x,n, num, ret_code = 0; + int ret = 0, i, ii, j, k, x, n, num, ret_code = 0; BIO_B64_CTX *ctx; unsigned char *p, *q; diff --git a/lib/libssl/src/crypto/evp/bio_enc.c b/lib/libssl/src/crypto/evp/bio_enc.c index 46cd2a6a60b..df817b9d8fe 100644 --- a/lib/libssl/src/crypto/evp/bio_enc.c +++ b/lib/libssl/src/crypto/evp/bio_enc.c @@ -419,7 +419,7 @@ BIO_set_cipher(BIO *b, const EVP_CIPHER *c, const unsigned char *k, b->init = 1; ctx = (BIO_ENC_CTX *)b->ptr; - EVP_CipherInit_ex(&(ctx->cipher), c,NULL, k, i, e); + EVP_CipherInit_ex(&(ctx->cipher), c, NULL, k, i, e); if (b->callback != NULL) b->callback(b, BIO_CB_CTRL, (const char *)c, BIO_CTRL_SET, e, 1L); diff --git a/lib/libssl/src/crypto/evp/e_old.c b/lib/libssl/src/crypto/evp/e_old.c index c27b61a4bfc..6d63ea4269e 100644 --- a/lib/libssl/src/crypto/evp/e_old.c +++ b/lib/libssl/src/crypto/evp/e_old.c @@ -71,7 +71,8 @@ static void *dummy = &dummy; #ifndef OPENSSL_NO_BF #undef EVP_bf_cfb const EVP_CIPHER *EVP_bf_cfb(void); -const EVP_CIPHER *EVP_bf_cfb(void) +const EVP_CIPHER * +EVP_bf_cfb(void) { return EVP_bf_cfb64(); } @@ -80,19 +81,22 @@ const EVP_CIPHER *EVP_bf_cfb(void) #ifndef OPENSSL_NO_DES #undef EVP_des_cfb const EVP_CIPHER *EVP_des_cfb(void); -const EVP_CIPHER *EVP_des_cfb(void) +const EVP_CIPHER * +EVP_des_cfb(void) { return EVP_des_cfb64(); } #undef EVP_des_ede3_cfb const EVP_CIPHER *EVP_des_ede3_cfb(void); -const EVP_CIPHER *EVP_des_ede3_cfb(void) +const EVP_CIPHER * +EVP_des_ede3_cfb(void) { return EVP_des_ede3_cfb64(); } #undef EVP_des_ede_cfb const EVP_CIPHER *EVP_des_ede_cfb(void); -const EVP_CIPHER *EVP_des_ede_cfb(void) +const EVP_CIPHER * +EVP_des_ede_cfb(void) { return EVP_des_ede_cfb64(); } @@ -101,7 +105,8 @@ const EVP_CIPHER *EVP_des_ede_cfb(void) #ifndef OPENSSL_NO_IDEA #undef EVP_idea_cfb const EVP_CIPHER *EVP_idea_cfb(void); -const EVP_CIPHER *EVP_idea_cfb(void) +const EVP_CIPHER * +EVP_idea_cfb(void) { return EVP_idea_cfb64(); } @@ -110,7 +115,8 @@ const EVP_CIPHER *EVP_idea_cfb(void) #ifndef OPENSSL_NO_RC2 #undef EVP_rc2_cfb const EVP_CIPHER *EVP_rc2_cfb(void); -const EVP_CIPHER *EVP_rc2_cfb(void) +const EVP_CIPHER * +EVP_rc2_cfb(void) { return EVP_rc2_cfb64(); } @@ -119,7 +125,8 @@ const EVP_CIPHER *EVP_rc2_cfb(void) #ifndef OPENSSL_NO_CAST #undef EVP_cast5_cfb const EVP_CIPHER *EVP_cast5_cfb(void); -const EVP_CIPHER *EVP_cast5_cfb(void) +const EVP_CIPHER * +EVP_cast5_cfb(void) { return EVP_cast5_cfb64(); } @@ -128,7 +135,8 @@ const EVP_CIPHER *EVP_cast5_cfb(void) #ifndef OPENSSL_NO_RC5 #undef EVP_rc5_32_12_16_cfb const EVP_CIPHER *EVP_rc5_32_12_16_cfb(void); -const EVP_CIPHER *EVP_rc5_32_12_16_cfb(void) +const EVP_CIPHER * +EVP_rc5_32_12_16_cfb(void) { return EVP_rc5_32_12_16_cfb64(); } @@ -137,19 +145,22 @@ const EVP_CIPHER *EVP_rc5_32_12_16_cfb(void) #ifndef OPENSSL_NO_AES #undef EVP_aes_128_cfb const EVP_CIPHER *EVP_aes_128_cfb(void); -const EVP_CIPHER *EVP_aes_128_cfb(void) +const EVP_CIPHER * +EVP_aes_128_cfb(void) { return EVP_aes_128_cfb128(); } #undef EVP_aes_192_cfb const EVP_CIPHER *EVP_aes_192_cfb(void); -const EVP_CIPHER *EVP_aes_192_cfb(void) +const EVP_CIPHER * +EVP_aes_192_cfb(void) { return EVP_aes_192_cfb128(); } #undef EVP_aes_256_cfb const EVP_CIPHER *EVP_aes_256_cfb(void); -const EVP_CIPHER *EVP_aes_256_cfb(void) +const EVP_CIPHER * +EVP_aes_256_cfb(void) { return EVP_aes_256_cfb128(); } diff --git a/lib/libssl/src/crypto/evp/evp_err.c b/lib/libssl/src/crypto/evp/evp_err.c index 790459fab40..80247319389 100644 --- a/lib/libssl/src/crypto/evp/evp_err.c +++ b/lib/libssl/src/crypto/evp/evp_err.c @@ -68,7 +68,7 @@ #define ERR_FUNC(func) ERR_PACK(ERR_LIB_EVP,func,0) #define ERR_REASON(reason) ERR_PACK(ERR_LIB_EVP,0,reason) -static ERR_STRING_DATA EVP_str_functs[]= { +static ERR_STRING_DATA EVP_str_functs[] = { {ERR_FUNC(EVP_F_AESNI_INIT_KEY), "AESNI_INIT_KEY"}, {ERR_FUNC(EVP_F_AESNI_XTS_CIPHER), "AESNI_XTS_CIPHER"}, {ERR_FUNC(EVP_F_AES_INIT_KEY), "AES_INIT_KEY"}, @@ -149,7 +149,7 @@ static ERR_STRING_DATA EVP_str_functs[]= { {0, NULL} }; -static ERR_STRING_DATA EVP_str_reasons[]= { +static ERR_STRING_DATA EVP_str_reasons[] = { {ERR_REASON(EVP_R_AES_IV_SETUP_FAILED) , "aes iv setup failed"}, {ERR_REASON(EVP_R_AES_KEY_SETUP_FAILED) , "aes key setup failed"}, {ERR_REASON(EVP_R_ASN1_LIB) , "asn1 lib"}, diff --git a/lib/libssl/src/crypto/evp/evp_key.c b/lib/libssl/src/crypto/evp/evp_key.c index 445456d3a74..48d8d411897 100644 --- a/lib/libssl/src/crypto/evp/evp_key.c +++ b/lib/libssl/src/crypto/evp/evp_key.c @@ -105,7 +105,7 @@ EVP_read_pw_string_min(char *buf, int min, int len, const char *prompt, if ((prompt == NULL) && (prompt_string[0] != '\0')) prompt = prompt_string; ui = UI_new(); - UI_add_input_string(ui, prompt, 0,buf, min, + UI_add_input_string(ui, prompt, 0, buf, min, (len >= BUFSIZ) ? BUFSIZ - 1 : len); if (verify) UI_add_verify_string(ui, prompt, 0, buff, min, -- 2.20.1