diff --git a/crypto/asn1/a_strnid.c b/crypto/asn1/a_strnid.c index ded339a11..e61de70c5 100644 --- a/crypto/asn1/a_strnid.c +++ b/crypto/asn1/a_strnid.c @@ -251,7 +251,8 @@ static void st_free(ASN1_STRING_TABLE *tbl) #ifdef STRING_TABLE_TEST -main() +int +main(void) { ASN1_STRING_TABLE *tmp; int i, last_nid = -1; @@ -278,6 +279,7 @@ main() printf("Index %d, NID %d, Name=%s\n", i, tmp->nid, OBJ_nid2ln(tmp->nid)); + return 0; } #endif diff --git a/crypto/base64/base64_test.c b/crypto/base64/base64_test.c index 0cd2b6ecd..e8a8bd07c 100644 --- a/crypto/base64/base64_test.c +++ b/crypto/base64/base64_test.c @@ -37,7 +37,7 @@ static const TEST_VECTOR test_vectors[] = { static const size_t kNumTests = sizeof(test_vectors) / sizeof(test_vectors[0]); -static int test_encode() { +static int test_encode(void) { uint8_t out[9]; size_t i; ssize_t len; @@ -55,7 +55,7 @@ static int test_encode() { return 1; } -static int test_decode() { +static int test_decode(void) { uint8_t out[6]; size_t i; ssize_t len; @@ -90,7 +90,7 @@ static int test_decode() { return 1; } -int main() { +int main(void) { ERR_load_crypto_strings(); if (!test_encode()) { diff --git a/crypto/bio/bio_test.c b/crypto/bio/bio_test.c index f3075b811..75399df5a 100644 --- a/crypto/bio/bio_test.c +++ b/crypto/bio/bio_test.c @@ -25,7 +25,7 @@ #include -static int test_socket_connect() { +static int test_socket_connect(void) { int listening_sock = socket(AF_INET, SOCK_STREAM, 0); int sock; struct sockaddr_in sin; @@ -94,7 +94,7 @@ static int test_socket_connect() { return 1; } -static int test_printf() { +static int test_printf(void) { /* Test a short output, a very long one, and various sizes around * 256 (the size of the buffer) to ensure edge cases are correct. */ static const size_t kLengths[] = { 5, 250, 251, 252, 253, 254, 1023 }; @@ -144,7 +144,7 @@ static int test_printf() { return 1; } -int main() { +int main(void) { ERR_load_crypto_strings(); if (!test_socket_connect()) { diff --git a/crypto/bio/internal.h b/crypto/bio/internal.h index dd3d8007a..ba28839ac 100644 --- a/crypto/bio/internal.h +++ b/crypto/bio/internal.h @@ -92,7 +92,7 @@ int bio_socket_nbio(int sock, int on); /* BIO_clear_socket_error clears the last system socket error. * * TODO(fork): remove all callers of this. */ -void bio_clear_socket_error(); +void bio_clear_socket_error(void); /* BIO_sock_error returns the last socket error on |sock|. */ int bio_sock_error(int sock); diff --git a/crypto/bio/socket_helper.c b/crypto/bio/socket_helper.c index 0d7d21a67..ba65a1a43 100644 --- a/crypto/bio/socket_helper.c +++ b/crypto/bio/socket_helper.c @@ -97,7 +97,7 @@ int bio_socket_nbio(int sock, int on) { #endif } -void bio_clear_socket_error() {} +void bio_clear_socket_error(void) {} int bio_sock_error(int sock) { int error; diff --git a/crypto/bn/bn_test.c b/crypto/bn/bn_test.c index 440e1b65f..d50b6b5cb 100644 --- a/crypto/bn/bn_test.c +++ b/crypto/bn/bn_test.c @@ -99,7 +99,7 @@ int test_mod_exp(BIO *bp, BN_CTX *ctx); int test_mod_exp_mont_consttime(BIO *bp, BN_CTX *ctx); int test_exp(BIO *bp, BN_CTX *ctx); int test_mod_sqrt(BIO *bp, BN_CTX *ctx); -static int test_exp_mod_zero(); +static int test_exp_mod_zero(void); int test_small_prime(BIO *bp,BN_CTX *ctx); int test_mod_exp_mont5(BIO *bp, BN_CTX *ctx); int test_sqrt(BIO *bp, BN_CTX *ctx); @@ -1129,7 +1129,7 @@ int test_exp(BIO *bp, BN_CTX *ctx) { } /* test_exp_mod_zero tests that x**0 mod 1 == 0. */ -static int test_exp_mod_zero() { +static int test_exp_mod_zero(void) { BIGNUM a, p, m; BIGNUM r; BN_CTX *ctx = BN_CTX_new(); diff --git a/crypto/bn/rsaz_exp.h b/crypto/bn/rsaz_exp.h index 4241a1fe7..0bb6b0c9f 100644 --- a/crypto/bn/rsaz_exp.h +++ b/crypto/bn/rsaz_exp.h @@ -36,7 +36,7 @@ void RSAZ_1024_mod_exp_avx2(BN_ULONG result[16], const BN_ULONG base_norm[16], const BN_ULONG exponent[16], const BN_ULONG m_norm[16], const BN_ULONG RR[16], BN_ULONG k0); -int rsaz_avx2_eligible(); +int rsaz_avx2_eligible(void); void RSAZ_512_mod_exp(BN_ULONG result[8], const BN_ULONG base_norm[8], const BN_ULONG exponent[8], diff --git a/crypto/bytestring/bytestring_test.c b/crypto/bytestring/bytestring_test.c index 20ce57180..29d26e8c0 100644 --- a/crypto/bytestring/bytestring_test.c +++ b/crypto/bytestring/bytestring_test.c @@ -18,7 +18,7 @@ #include -static int test_skip() { +static int test_skip(void) { static const uint8_t kData[] = {1, 2, 3}; CBS data; @@ -31,7 +31,7 @@ static int test_skip() { !CBS_skip(&data, 1); } -static int test_get_u() { +static int test_get_u(void) { static const uint8_t kData[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10}; uint8_t u8; uint16_t u16; @@ -50,7 +50,7 @@ static int test_get_u() { !CBS_get_u8(&data, &u8); } -static int test_get_prefixed() { +static int test_get_prefixed(void) { static const uint8_t kData[] = {1, 2, 0, 2, 3, 4, 0, 0, 3, 3, 2, 1}; uint8_t u8; uint16_t u16; @@ -72,7 +72,7 @@ static int test_get_prefixed() { u32 == 0x30201; } -static int test_get_prefixed_bad() { +static int test_get_prefixed_bad(void) { static const uint8_t kData1[] = {2, 1}; static const uint8_t kData2[] = {0, 2, 1}; static const uint8_t kData3[] = {0, 0, 2, 1}; @@ -96,7 +96,7 @@ static int test_get_prefixed_bad() { return 1; } -static int test_get_asn1() { +static int test_get_asn1(void) { static const uint8_t kData1[] = {0x30, 2, 1, 2}; static const uint8_t kData2[] = {0x30, 3, 1, 2}; static const uint8_t kData3[] = {0x30, 0x80}; @@ -145,7 +145,7 @@ static int test_get_asn1() { return 1; } -static int test_get_indef() { +static int test_get_indef(void) { static const uint8_t kData1[] = {0x30, 0x80, 0x00, 0x00}; static const uint8_t kDataWithoutEOC[] = {0x30, 0x80, 0x01, 0x00}; static const uint8_t kDataWithBadInternalLength[] = {0x30, 0x80, 0x01, 0x01}; @@ -200,7 +200,7 @@ static int test_get_indef() { return 1; } -static int test_cbb_basic() { +static int test_cbb_basic(void) { static const uint8_t kExpected[] = {1, 2, 3, 4, 5, 6, 7, 8}; uint8_t *buf; size_t buf_len; @@ -226,7 +226,7 @@ static int test_cbb_basic() { return ok; } -static int test_cbb_fixed() { +static int test_cbb_fixed(void) { CBB cbb; uint8_t buf[1]; uint8_t *out_buf; @@ -253,7 +253,7 @@ static int test_cbb_fixed() { return 1; } -static int test_cbb_finish_child() { +static int test_cbb_finish_child(void) { CBB cbb, child; uint8_t *out_buf; size_t out_size; @@ -271,7 +271,7 @@ static int test_cbb_finish_child() { return 1; } -static int test_cbb_prefixed() { +static int test_cbb_prefixed(void) { static const uint8_t kExpected[] = {0, 1, 1, 0, 2, 2, 3, 0, 0, 3, 4, 5, 6, 5, 4, 1, 0, 1, 2}; uint8_t *buf; @@ -301,7 +301,7 @@ static int test_cbb_prefixed() { return ok; } -static int test_cbb_misuse() { +static int test_cbb_misuse(void) { CBB cbb, child, contents; uint8_t *buf; size_t buf_len; @@ -337,7 +337,7 @@ static int test_cbb_misuse() { return 1; } -static int test_cbb_asn1() { +static int test_cbb_asn1(void) { static const uint8_t kExpected[] = {0x30, 3, 1, 2, 3}; uint8_t *buf, *test_data; size_t buf_len; @@ -405,7 +405,7 @@ static int test_cbb_asn1() { return 1; } -int main() { +int main(void) { if (!test_skip() || !test_get_u() || !test_get_prefixed() || diff --git a/crypto/cipher/e_aes.c b/crypto/cipher/e_aes.c index 15a886cec..d22274e15 100644 --- a/crypto/cipher/e_aes.c +++ b/crypto/cipher/e_aes.c @@ -92,13 +92,13 @@ typedef struct { #define VPAES extern unsigned int OPENSSL_ia32cap_P[]; -static char vpaes_capable() { +static char vpaes_capable(void) { return (OPENSSL_ia32cap_P[1] & (1 << (41 - 32))) != 0; } #if defined(OPENSSL_X86_64) #define BSAES -static char bsaes_capable() { +static char bsaes_capable(void) { return vpaes_capable(); } #endif @@ -107,7 +107,7 @@ static char bsaes_capable() { #include "../arm_arch.h" #if __ARM_ARCH__ >= 7 #define BSAES -static char bsaes_capable() { +static char bsaes_capable(void) { return CRYPTO_is_NEON_capable(); } #endif /* __ARM_ARCH__ >= 7 */ @@ -121,7 +121,7 @@ void bsaes_cbc_encrypt(const uint8_t *in, uint8_t *out, size_t length, void bsaes_ctr32_encrypt_blocks(const uint8_t *in, uint8_t *out, size_t len, const AES_KEY *key, const uint8_t ivec[16]); #else -static char bsaes_capable() { +static char bsaes_capable(void) { return 0; } @@ -150,7 +150,7 @@ void vpaes_decrypt(const uint8_t *in, uint8_t *out, const AES_KEY *key); void vpaes_cbc_encrypt(const uint8_t *in, uint8_t *out, size_t length, const AES_KEY *key, uint8_t *ivec, int enc); #else -static char vpaes_capable() { +static char vpaes_capable(void) { return 0; } @@ -658,7 +658,7 @@ static const EVP_CIPHER aes_256_gcm = { /* AES-NI section. */ -static char aesni_capable() { +static char aesni_capable(void) { return (OPENSSL_ia32cap_P[1] & (1 << (57 - 32))) != 0; } @@ -812,7 +812,7 @@ static const EVP_CIPHER aesni_256_gcm = { #else /* ^^^ OPENSSL_X86_64 || OPENSSL_X86 */ -static char aesni_capable() { +static char aesni_capable(void) { return 0; } @@ -1004,9 +1004,9 @@ static const EVP_AEAD aead_aes_256_gcm = { aead_aes_gcm_seal, aead_aes_gcm_open, }; -const EVP_AEAD *EVP_aead_aes_128_gcm() { return &aead_aes_128_gcm; } +const EVP_AEAD *EVP_aead_aes_128_gcm(void) { return &aead_aes_128_gcm; } -const EVP_AEAD *EVP_aead_aes_256_gcm() { return &aead_aes_256_gcm; } +const EVP_AEAD *EVP_aead_aes_256_gcm(void) { return &aead_aes_256_gcm; } /* AES Key Wrap is specified in @@ -1268,9 +1268,9 @@ static const EVP_AEAD aead_aes_256_key_wrap = { aead_aes_key_wrap_seal, aead_aes_key_wrap_open, }; -const EVP_AEAD *EVP_aead_aes_128_key_wrap() { return &aead_aes_128_key_wrap; } +const EVP_AEAD *EVP_aead_aes_128_key_wrap(void) { return &aead_aes_128_key_wrap; } -const EVP_AEAD *EVP_aead_aes_256_key_wrap() { return &aead_aes_256_key_wrap; } +const EVP_AEAD *EVP_aead_aes_256_key_wrap(void) { return &aead_aes_256_key_wrap; } int EVP_has_aes_hardware(void) { #if defined(OPENSSL_X86) || defined(OPENSSL_X86_64) diff --git a/crypto/cipher/e_chacha20poly1305.c b/crypto/cipher/e_chacha20poly1305.c index 8b6d378a9..e656cd78a 100644 --- a/crypto/cipher/e_chacha20poly1305.c +++ b/crypto/cipher/e_chacha20poly1305.c @@ -217,4 +217,6 @@ static const EVP_AEAD aead_chacha20_poly1305 = { aead_chacha20_poly1305_seal, aead_chacha20_poly1305_open, }; -const EVP_AEAD *EVP_aead_chacha20_poly1305() { return &aead_chacha20_poly1305; } +const EVP_AEAD *EVP_aead_chacha20_poly1305(void) { + return &aead_chacha20_poly1305; +} diff --git a/crypto/cipher/e_rc4.c b/crypto/cipher/e_rc4.c index df1bc11ed..f1d4c5089 100644 --- a/crypto/cipher/e_rc4.c +++ b/crypto/cipher/e_rc4.c @@ -366,4 +366,4 @@ static const EVP_AEAD aead_rc4_md5_tls = { aead_rc4_md5_tls_seal, aead_rc4_md5_tls_open, }; -const EVP_AEAD *EVP_aead_rc4_md5_tls() { return &aead_rc4_md5_tls; } +const EVP_AEAD *EVP_aead_rc4_md5_tls(void) { return &aead_rc4_md5_tls; } diff --git a/crypto/conf/conf.c b/crypto/conf/conf.c index 1630c933d..520416ae8 100644 --- a/crypto/conf/conf.c +++ b/crypto/conf/conf.c @@ -90,7 +90,7 @@ static int conf_value_cmp(const CONF_VALUE *a, const CONF_VALUE *b) { } } -CONF *NCONF_new() { +CONF *NCONF_new(void) { CONF *conf; conf = OPENSSL_malloc(sizeof(CONF)); diff --git a/crypto/cpu-arm.c b/crypto/cpu-arm.c index 814df2661..dac7e1e5a 100644 --- a/crypto/cpu-arm.c +++ b/crypto/cpu-arm.c @@ -69,7 +69,7 @@ uint32_t OPENSSL_armcap_P = ARMV7_NEON | ARMV7_NEON_FUNCTIONAL; uint32_t OPENSSL_armcap_P = ARMV7_NEON_FUNCTIONAL; #endif -char CRYPTO_is_NEON_capable() { +char CRYPTO_is_NEON_capable(void) { return (OPENSSL_armcap_P & ARMV7_NEON) != 0; } @@ -81,7 +81,7 @@ void CRYPTO_set_NEON_capable(char neon_capable) { } } -char CRYPTO_is_NEON_functional() { +char CRYPTO_is_NEON_functional(void) { static const uint32_t kWantFlags = ARMV7_NEON | ARMV7_NEON_FUNCTIONAL; return (OPENSSL_armcap_P & kWantFlags) == kWantFlags; } diff --git a/crypto/ec/example_mul.c b/crypto/ec/example_mul.c index 1e83d6198..d65c3a171 100644 --- a/crypto/ec/example_mul.c +++ b/crypto/ec/example_mul.c @@ -72,7 +72,7 @@ #include -int example_EC_POINT_mul() { +int example_EC_POINT_mul(void) { /* This example ensures that 10×∞ + G = G, in P-256. */ EC_GROUP *group = NULL; EC_POINT *p = NULL, *result = NULL; @@ -119,7 +119,7 @@ err: return ret; } -int main() { +int main(void) { if (!example_EC_POINT_mul()) { fprintf(stderr, "failed\n"); return 1; diff --git a/crypto/ec/internal.h b/crypto/ec/internal.h index 76c3a8003..5c3be55cd 100644 --- a/crypto/ec/internal.h +++ b/crypto/ec/internal.h @@ -186,7 +186,7 @@ struct ec_method_st { int (*field_set_to_one)(const EC_GROUP *, BIGNUM *r, BN_CTX *); } /* EC_METHOD */; -const EC_METHOD* EC_GFp_mont_method(); +const EC_METHOD* EC_GFp_mont_method(void); struct ec_pre_comp_st; void ec_pre_comp_free(struct ec_pre_comp_st *pre_comp); diff --git a/crypto/engine/engine.c b/crypto/engine/engine.c index bb0886e22..c9b8823c8 100644 --- a/crypto/engine/engine.c +++ b/crypto/engine/engine.c @@ -29,7 +29,7 @@ struct engine_st { ECDSA_METHOD *ecdsa_method; }; -ENGINE *ENGINE_new() { +ENGINE *ENGINE_new(void) { ENGINE *engine = OPENSSL_malloc(sizeof(ENGINE)); if (engine == NULL) { return NULL; diff --git a/crypto/err/err.c b/crypto/err/err.c index fd3a76bf5..53ee5cb5e 100644 --- a/crypto/err/err.c +++ b/crypto/err/err.c @@ -298,7 +298,7 @@ void ERR_remove_thread_state(const CRYPTO_THREADID *tid) { OPENSSL_free(state); } -int ERR_get_next_error_library() { +int ERR_get_next_error_library(void) { err_fns_check(); return ERRFN(get_next_library)(); } @@ -760,11 +760,11 @@ void ERR_load_strings(const ERR_STRING_DATA *str) { } } -void ERR_load_crypto_strings() { err_load_strings(); } +void ERR_load_crypto_strings(void) { err_load_strings(); } -void ERR_free_strings() { +void ERR_free_strings(void) { err_fns_check(); ERRFN(shutdown)(); } -void ERR_load_BIO_strings() {} +void ERR_load_BIO_strings(void) {} diff --git a/crypto/err/err_test.c b/crypto/err/err_test.c index 540ea07b7..14217f72f 100644 --- a/crypto/err/err_test.c +++ b/crypto/err/err_test.c @@ -18,7 +18,7 @@ #include -static int test_overflow() { +static int test_overflow(void) { unsigned i; for (i = 0; i < ERR_NUM_ERRORS*2; i++) { @@ -40,7 +40,7 @@ static int test_overflow() { return 1; } -static int test_put_error() { +static int test_put_error(void) { uint32_t packed_error; int line, flags; const char *file; @@ -72,7 +72,7 @@ static int test_put_error() { return 1; } -static int test_clear_error() { +static int test_clear_error(void) { if (ERR_get_error() != 0) { fprintf(stderr, "ERR_get_error returned value before an error was added.\n"); return 0; @@ -89,7 +89,7 @@ static int test_clear_error() { return 1; } -static int test_print() { +static int test_print(void) { size_t i; char buf[256]; uint32_t packed_error; @@ -105,13 +105,13 @@ static int test_print() { return 1; } -static int test_release() { +static int test_release(void) { ERR_put_error(1, 2, 3, "test", 4); ERR_remove_thread_state(NULL); return 1; } -int main() { +int main(void) { if (!test_overflow() || !test_put_error() || !test_clear_error() || diff --git a/crypto/evp/evp.c b/crypto/evp/evp.c index 06fdabfaf..c7c4ffbde 100644 --- a/crypto/evp/evp.c +++ b/crypto/evp/evp.c @@ -74,7 +74,7 @@ extern const EVP_PKEY_ASN1_METHOD ec_asn1_meth; extern const EVP_PKEY_ASN1_METHOD hmac_asn1_meth; extern const EVP_PKEY_ASN1_METHOD rsa_asn1_meth; -EVP_PKEY *EVP_PKEY_new() { +EVP_PKEY *EVP_PKEY_new(void) { EVP_PKEY *ret; ret = OPENSSL_malloc(sizeof(EVP_PKEY)); @@ -427,6 +427,6 @@ int EVP_PKEY_CTX_get_signature_md(EVP_PKEY_CTX *ctx, const EVP_MD **out_md) { 0, (void *)out_md); } -void OpenSSL_add_all_algorithms() {} +void OpenSSL_add_all_algorithms(void) {} -void EVP_cleanup() {} +void EVP_cleanup(void) {} diff --git a/crypto/evp/example_sign.c b/crypto/evp/example_sign.c index df7156bb9..847330dc5 100644 --- a/crypto/evp/example_sign.c +++ b/crypto/evp/example_sign.c @@ -95,7 +95,7 @@ static const uint8_t kSignature[] = { }; -int example_EVP_DigestSignInit() { +int example_EVP_DigestSignInit(void) { int ret = 0; EVP_PKEY *pkey = NULL; RSA *rsa = NULL; @@ -154,7 +154,7 @@ out: return ret; } -int example_EVP_DigestVerifyInit() { +int example_EVP_DigestVerifyInit(void) { int ret = 0; EVP_PKEY *pkey = NULL; RSA *rsa = NULL; @@ -193,7 +193,7 @@ out: return ret; } -int main() { +int main(void) { if (!example_EVP_DigestSignInit()) { fprintf(stderr, "EVP_DigestSignInit failed\n"); return 1; diff --git a/crypto/ex_data.c b/crypto/ex_data.c index 00b8ff399..820f48d1d 100644 --- a/crypto/ex_data.c +++ b/crypto/ex_data.c @@ -123,7 +123,7 @@ static const CRYPTO_EX_DATA_IMPL *global_impl = NULL; extern const CRYPTO_EX_DATA_IMPL ex_data_default_impl; /* get_impl returns the current ex_data implementatation. */ -static const CRYPTO_EX_DATA_IMPL *get_impl() { +static const CRYPTO_EX_DATA_IMPL *get_impl(void) { const CRYPTO_EX_DATA_IMPL *impl; CRYPTO_r_lock(CRYPTO_LOCK_EX_DATA); diff --git a/crypto/ex_data_impl.c b/crypto/ex_data_impl.c index 23d1fac9b..ddc6b8a73 100644 --- a/crypto/ex_data_impl.c +++ b/crypto/ex_data_impl.c @@ -171,7 +171,7 @@ static void class_free(EX_CLASS_ITEM *item) { sk_CRYPTO_EX_DATA_FUNCS_pop_free(item->meth, data_funcs_free); } -static LHASH_OF(EX_CLASS_ITEM) *get_classes() { +static LHASH_OF(EX_CLASS_ITEM) *get_classes(void) { LHASH_OF(EX_CLASS_ITEM) *ret; CRYPTO_r_lock(CRYPTO_LOCK_EX_DATA); diff --git a/crypto/lhash/lhash_test.c b/crypto/lhash/lhash_test.c index 2aa90c33c..9a94a8836 100644 --- a/crypto/lhash/lhash_test.c +++ b/crypto/lhash/lhash_test.c @@ -99,7 +99,7 @@ static char *dummy_lh_delete(struct dummy_lhash *lh, const void *s) { return NULL; } -static char *rand_string() { +static char *rand_string(void) { unsigned len = 1 + (rand() % 3); char *ret = malloc(len + 1); unsigned i; diff --git a/crypto/modes/gcm_test.c b/crypto/modes/gcm_test.c index 8c52b85af..a112431ac 100644 --- a/crypto/modes/gcm_test.c +++ b/crypto/modes/gcm_test.c @@ -413,7 +413,7 @@ out: return ret; } -int main() { +int main(void) { int ret = 0; unsigned i; diff --git a/crypto/obj/obj.c b/crypto/obj/obj.c index 6bbac9273..8a7a584e3 100644 --- a/crypto/obj/obj.c +++ b/crypto/obj/obj.c @@ -76,7 +76,7 @@ static LHASH_OF(ASN1_OBJECT) *global_added_by_long_name = NULL; static unsigned global_next_nid = NUM_NID; -static int obj_next_nid() { +static int obj_next_nid(void) { int ret; CRYPTO_w_lock(CRYPTO_LOCK_OBJ); diff --git a/crypto/rand/urandom.c b/crypto/rand/urandom.c index 6cd92719d..2ad4af060 100644 --- a/crypto/rand/urandom.c +++ b/crypto/rand/urandom.c @@ -87,7 +87,7 @@ static int urandom_buffering = 0; /* urandom_get_fd_locked returns a file descriptor to /dev/urandom. The caller * of this function must hold CRYPTO_LOCK_RAND. */ -static int urandom_get_fd_locked() { +static int urandom_get_fd_locked(void) { if (urandom_fd != -2) return urandom_fd; diff --git a/crypto/rsa/rsa_test.c b/crypto/rsa/rsa_test.c index 4a0069cf7..897bb610e 100644 --- a/crypto/rsa/rsa_test.c +++ b/crypto/rsa/rsa_test.c @@ -237,7 +237,7 @@ static int key3(RSA *key, unsigned char *c) { SetKey; } -static int test_bad_key() { +static int test_bad_key(void) { RSA *key = RSA_new(); BIGNUM e; @@ -267,7 +267,7 @@ static int test_bad_key() { return 1; } -static int test_only_d_given() { +static int test_only_d_given(void) { RSA *key = RSA_new(); uint8_t buf[64]; unsigned buf_len = sizeof(buf); @@ -312,7 +312,7 @@ err: return ret; } -static int test_recover_crt_params() { +static int test_recover_crt_params(void) { RSA *key1, *key2; BIGNUM *e = BN_new(); uint8_t buf[128]; diff --git a/crypto/sha/sha1_test.c b/crypto/sha/sha1_test.c index 72ef9e1d0..a0df062b0 100644 --- a/crypto/sha/sha1_test.c +++ b/crypto/sha/sha1_test.c @@ -67,7 +67,7 @@ static const char *const expected[] = { "a9993e364706816aba3e25717850c26c9cd0d89d", "84983e441c3bd26ebaae4aa1f95129e5e54670f1", }; -static int test_incremental() { +static int test_incremental(void) { EVP_MD_CTX ctx; char buf[1000]; uint8_t md[SHA_DIGEST_LENGTH]; diff --git a/crypto/x509/pkcs7_test.c b/crypto/x509/pkcs7_test.c index eb2668f02..014ec87d8 100644 --- a/crypto/x509/pkcs7_test.c +++ b/crypto/x509/pkcs7_test.c @@ -267,7 +267,7 @@ static const uint8_t kPKCS7DER[] = { 0x00, 0x00, 0x00, }; -static int test_reparse() { +static int test_reparse(void) { CBS pkcs7; CBB cbb; STACK_OF(X509) *certs = sk_X509_new_null(); @@ -331,7 +331,7 @@ static int test_reparse() { return 1; } -int main() { +int main(void) { if (!test_reparse()) { return 1; } diff --git a/crypto/x509v3/tabtest.c b/crypto/x509v3/tabtest.c index aa27c1e20..06a692e39 100644 --- a/crypto/x509v3/tabtest.c +++ b/crypto/x509v3/tabtest.c @@ -66,7 +66,7 @@ #include "ext_dat.h" -int main() +int main(void) { int i, prev = -1, bad = 0; const X509V3_EXT_METHOD **tmp; diff --git a/crypto/x509v3/v3nametest.c b/crypto/x509v3/v3nametest.c index d0d97ff44..326b1f932 100644 --- a/crypto/x509v3/v3nametest.c +++ b/crypto/x509v3/v3nametest.c @@ -285,7 +285,7 @@ static const struct set_name_fn name_fns[] = {NULL, NULL, 0} }; -static X509 *make_cert() +static X509 *make_cert(void) { X509 *ret = NULL; X509 *crt = NULL; diff --git a/include/openssl/aead.h b/include/openssl/aead.h index 6f66e9c46..ad2bbf7d5 100644 --- a/include/openssl/aead.h +++ b/include/openssl/aead.h @@ -99,7 +99,7 @@ OPENSSL_EXPORT const EVP_AEAD *EVP_aead_aes_128_gcm(void); OPENSSL_EXPORT const EVP_AEAD *EVP_aead_aes_256_gcm(void); /* EVP_aead_chacha20_poly1305 is an AEAD built from ChaCha20 and Poly1305. */ -OPENSSL_EXPORT const EVP_AEAD *EVP_aead_chacha20_poly1305(); +OPENSSL_EXPORT const EVP_AEAD *EVP_aead_chacha20_poly1305(void); /* EVP_aead_aes_128_key_wrap is AES-128 Key Wrap mode. This should never be * used except to interoperate with existing systems that use this mode. @@ -107,13 +107,13 @@ OPENSSL_EXPORT const EVP_AEAD *EVP_aead_chacha20_poly1305(); * If the nonce is emtpy then the default nonce will be used, otherwise it must * be eight bytes long. The input must be a multiple of eight bytes long. No * additional data can be given to this mode. */ -OPENSSL_EXPORT const EVP_AEAD *EVP_aead_aes_128_key_wrap(); +OPENSSL_EXPORT const EVP_AEAD *EVP_aead_aes_128_key_wrap(void); /* EVP_aead_aes_256_key_wrap is AES-256 in Key Wrap mode. This should never be * used except to interoperate with existing systems that use this mode. * * See |EVP_aead_aes_128_key_wrap| for details. */ -OPENSSL_EXPORT const EVP_AEAD *EVP_aead_aes_256_key_wrap(); +OPENSSL_EXPORT const EVP_AEAD *EVP_aead_aes_256_key_wrap(void); /* EVP_has_aes_hardware returns one if we enable hardware support for fast and * constant-time AES-GCM. */ @@ -129,7 +129,7 @@ OPENSSL_EXPORT int EVP_has_aes_hardware(void); /* EVP_aead_rc4_md5_tls uses RC4 and HMAC(MD5) in MAC-then-encrypt mode. Unlike * a standard AEAD, this is stateful as the RC4 state is carried from operation * to operation. */ -OPENSSL_EXPORT const EVP_AEAD *EVP_aead_rc4_md5_tls(); +OPENSSL_EXPORT const EVP_AEAD *EVP_aead_rc4_md5_tls(void); /* Utility functions. */ diff --git a/include/openssl/conf.h b/include/openssl/conf.h index 51c552535..c67e023d2 100644 --- a/include/openssl/conf.h +++ b/include/openssl/conf.h @@ -91,7 +91,7 @@ struct conf_st { /* NCONF_new returns a fresh, empty |CONF|, or NULL on error. */ -CONF *NCONF_new(); +CONF *NCONF_new(void); /* NCONF_free frees all the data owned by |conf| and then |conf| itself. */ void NCONF_free(CONF *conf); diff --git a/include/openssl/cpu.h b/include/openssl/cpu.h index 3cc1e5ea8..5f6075447 100644 --- a/include/openssl/cpu.h +++ b/include/openssl/cpu.h @@ -90,7 +90,7 @@ extern uint32_t OPENSSL_ia32cap_P[4]; /* CRYPTO_is_NEON_capable returns true if the current CPU has a NEON unit. Note * that |OPENSSL_armcap_P| also exists and contains the same information in a * form that's easier for assembly to use. */ -OPENSSL_EXPORT char CRYPTO_is_NEON_capable(); +OPENSSL_EXPORT char CRYPTO_is_NEON_capable(void); /* CRYPTO_set_NEON_capable sets the return value of |CRYPTO_is_NEON_capable|. * By default, unless the code was compiled with |-mfpu=neon|, NEON is assumed @@ -101,7 +101,7 @@ OPENSSL_EXPORT void CRYPTO_set_NEON_capable(char neon_capable); /* CRYPTO_is_NEON_functional returns true if the current CPU has a /working/ * NEON unit. Some phones have a NEON unit, but the Poly1305 NEON code causes * it to fail. See https://code.google.com/p/chromium/issues/detail?id=341598 */ -OPENSSL_EXPORT char CRYPTO_is_NEON_functional(); +OPENSSL_EXPORT char CRYPTO_is_NEON_functional(void); /* CRYPTO_set_NEON_functional sets the "NEON functional" flag. For * |CRYPTO_is_NEON_functional| to return true, both this flag and the NEON flag diff --git a/include/openssl/engine.h b/include/openssl/engine.h index f2916b370..367e98ea3 100644 --- a/include/openssl/engine.h +++ b/include/openssl/engine.h @@ -37,7 +37,7 @@ extern "C" { /* ENGINE_new returns an empty ENGINE that uses the default method for all * algorithms. */ -OPENSSL_EXPORT ENGINE *ENGINE_new(); +OPENSSL_EXPORT ENGINE *ENGINE_new(void); /* ENGINE_free decrements the reference counts for all methods linked from * |engine| and frees |engine| itself. */ diff --git a/include/openssl/err.h b/include/openssl/err.h index d8e7cd525..67a26010a 100644 --- a/include/openssl/err.h +++ b/include/openssl/err.h @@ -146,11 +146,11 @@ extern "C" { * values. If this is not called then the string forms of errors produced by * the functions below will contain numeric identifiers rather than * human-readable strings. */ -OPENSSL_EXPORT void ERR_load_crypto_strings(); +OPENSSL_EXPORT void ERR_load_crypto_strings(void); /* ERR_free_strings frees any internal error values that have been loaded. This * should only be called at process shutdown. */ -OPENSSL_EXPORT void ERR_free_strings(); +OPENSSL_EXPORT void ERR_free_strings(void); /* Reading and formatting errors. */ @@ -266,7 +266,7 @@ OPENSSL_EXPORT void ERR_remove_thread_state(const CRYPTO_THREADID *tid); /* ERR_get_next_error_library returns a value suitable for passing as the * |library| argument to |ERR_put_error|. This is intended for code that wishes * to push its own, non-standard errors to the error queue. */ -OPENSSL_EXPORT int ERR_get_next_error_library(); +OPENSSL_EXPORT int ERR_get_next_error_library(void); /* Private functions. */ @@ -515,7 +515,7 @@ struct ERR_FNS_st { /* ERR_load_BIO_strings does nothing. * * TODO(fork): remove. libjingle calls this. */ -OPENSSL_EXPORT void ERR_load_BIO_strings(); +OPENSSL_EXPORT void ERR_load_BIO_strings(void); #if defined(__cplusplus) diff --git a/include/openssl/evp.h b/include/openssl/evp.h index edeb850c7..091912f2d 100644 --- a/include/openssl/evp.h +++ b/include/openssl/evp.h @@ -83,7 +83,7 @@ extern "C" { /* EVP_PKEY_new creates a new, empty public-key object and returns it or NULL * on allocation failure. */ -OPENSSL_EXPORT EVP_PKEY *EVP_PKEY_new(); +OPENSSL_EXPORT EVP_PKEY *EVP_PKEY_new(void); /* EVP_PKEY_free frees all data referenced by |pkey| and then frees |pkey| * itself. */ @@ -708,10 +708,10 @@ OPENSSL_EXPORT int EVP_PKEY_CTX_get0_rsa_oaep_label(EVP_PKEY_CTX *ctx, /* Private functions */ /* OpenSSL_add_all_algorithms does nothing. */ -OPENSSL_EXPORT void OpenSSL_add_all_algorithms(); +OPENSSL_EXPORT void OpenSSL_add_all_algorithms(void); /* EVP_cleanup does nothing. */ -OPENSSL_EXPORT void EVP_cleanup(); +OPENSSL_EXPORT void EVP_cleanup(void); /* EVP_PKEY_asn1_find returns the ASN.1 method table for the given |nid|, which * should be one of the |EVP_PKEY_*| values. It returns NULL if |nid| is diff --git a/include/openssl/pqueue.h b/include/openssl/pqueue.h index 8ad023aa4..af6f7f184 100644 --- a/include/openssl/pqueue.h +++ b/include/openssl/pqueue.h @@ -84,7 +84,7 @@ typedef struct _pitem *piterator; /* pqueue_new allocates a fresh, empty priority queue object and returns it, or * NULL on error. */ -pqueue pqueue_new(); +pqueue pqueue_new(void); /* pqueue_free frees |pq| but not any of the items it points to. Thus |pq| must * be empty or a memory leak will occur. */ diff --git a/include/openssl/rand.h b/include/openssl/rand.h index d17c3eac8..5a84a898f 100644 --- a/include/openssl/rand.h +++ b/include/openssl/rand.h @@ -28,7 +28,7 @@ OPENSSL_EXPORT int RAND_bytes(uint8_t *buf, size_t len); /* RAND_cleanup frees any resources used by the RNG. This is not safe if other * threads might still be calling |RAND_bytes|. */ -OPENSSL_EXPORT void RAND_cleanup(); +OPENSSL_EXPORT void RAND_cleanup(void); /* Deprecated functions */ diff --git a/ssl/pqueue/pqueue.c b/ssl/pqueue/pqueue.c index e8d0ac548..4c68cb1f8 100644 --- a/ssl/pqueue/pqueue.c +++ b/ssl/pqueue/pqueue.c @@ -87,7 +87,7 @@ void pitem_free(pitem *item) { OPENSSL_free(item); } -pqueue pqueue_new() { +pqueue pqueue_new(void) { pqueue_s *pq = (pqueue_s *)OPENSSL_malloc(sizeof(pqueue_s)); if (pq == NULL) { return NULL; diff --git a/ssl/ssl_sess.c b/ssl/ssl_sess.c index a9f7f9e43..888104273 100644 --- a/ssl/ssl_sess.c +++ b/ssl/ssl_sess.c @@ -152,7 +152,7 @@ static void SSL_SESSION_list_remove(SSL_CTX *ctx, SSL_SESSION *s); static void SSL_SESSION_list_add(SSL_CTX *ctx,SSL_SESSION *s); static int remove_session_lock(SSL_CTX *ctx, SSL_SESSION *c, int lck); -SSL_SESSION *SSL_magic_pending_session_ptr() +SSL_SESSION *SSL_magic_pending_session_ptr(void) { return (SSL_SESSION*) &g_pending_session_magic; } diff --git a/ssl/ssl_test.c b/ssl/ssl_test.c index 4652e8501..97a1967f2 100644 --- a/ssl/ssl_test.c +++ b/ssl/ssl_test.c @@ -16,7 +16,7 @@ #include "openssl/ssl.h" -int main() { +int main(void) { /* Some error codes are special, but the make_errors.go script doesn't know * this. This test will catch the case where something regenerates the error * codes with the script but doesn't fix up the special ones. */