Przeglądaj źródła

Convert all zero-argument functions to '(void)'

Otherwise, in C, it becomes a K&R function declaration which doesn't actually
type-check the number of arguments.

Change-Id: I0731a9fefca46fb1c266bfb1c33d464cf451a22e
Reviewed-on: https://boringssl-review.googlesource.com/1582
Reviewed-by: Adam Langley <agl@google.com>
kris/onging/CECPQ3_patch15
David Benjamin 10 lat temu
committed by Adam Langley
rodzic
commit
c44d2f4cb8
42 zmienionych plików z 99 dodań i 95 usunięć
  1. +3
    -1
      crypto/asn1/a_strnid.c
  2. +3
    -3
      crypto/base64/base64_test.c
  3. +3
    -3
      crypto/bio/bio_test.c
  4. +1
    -1
      crypto/bio/internal.h
  5. +1
    -1
      crypto/bio/socket_helper.c
  6. +2
    -2
      crypto/bn/bn_test.c
  7. +1
    -1
      crypto/bn/rsaz_exp.h
  8. +13
    -13
      crypto/bytestring/bytestring_test.c
  9. +11
    -11
      crypto/cipher/e_aes.c
  10. +3
    -1
      crypto/cipher/e_chacha20poly1305.c
  11. +1
    -1
      crypto/cipher/e_rc4.c
  12. +1
    -1
      crypto/conf/conf.c
  13. +2
    -2
      crypto/cpu-arm.c
  14. +2
    -2
      crypto/ec/example_mul.c
  15. +1
    -1
      crypto/ec/internal.h
  16. +1
    -1
      crypto/engine/engine.c
  17. +4
    -4
      crypto/err/err.c
  18. +6
    -6
      crypto/err/err_test.c
  19. +3
    -3
      crypto/evp/evp.c
  20. +3
    -3
      crypto/evp/example_sign.c
  21. +1
    -1
      crypto/ex_data.c
  22. +1
    -1
      crypto/ex_data_impl.c
  23. +1
    -1
      crypto/lhash/lhash_test.c
  24. +1
    -1
      crypto/modes/gcm_test.c
  25. +1
    -1
      crypto/obj/obj.c
  26. +1
    -1
      crypto/rand/urandom.c
  27. +3
    -3
      crypto/rsa/rsa_test.c
  28. +1
    -1
      crypto/sha/sha1_test.c
  29. +2
    -2
      crypto/x509/pkcs7_test.c
  30. +1
    -1
      crypto/x509v3/tabtest.c
  31. +1
    -1
      crypto/x509v3/v3nametest.c
  32. +4
    -4
      include/openssl/aead.h
  33. +1
    -1
      include/openssl/conf.h
  34. +2
    -2
      include/openssl/cpu.h
  35. +1
    -1
      include/openssl/engine.h
  36. +4
    -4
      include/openssl/err.h
  37. +3
    -3
      include/openssl/evp.h
  38. +1
    -1
      include/openssl/pqueue.h
  39. +1
    -1
      include/openssl/rand.h
  40. +1
    -1
      ssl/pqueue/pqueue.c
  41. +1
    -1
      ssl/ssl_sess.c
  42. +1
    -1
      ssl/ssl_test.c

+ 3
- 1
crypto/asn1/a_strnid.c Wyświetl plik

@@ -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

+ 3
- 3
crypto/base64/base64_test.c Wyświetl plik

@@ -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()) {


+ 3
- 3
crypto/bio/bio_test.c Wyświetl plik

@@ -25,7 +25,7 @@
#include <openssl/err.h>


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()) {


+ 1
- 1
crypto/bio/internal.h Wyświetl plik

@@ -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);


+ 1
- 1
crypto/bio/socket_helper.c Wyświetl plik

@@ -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;


+ 2
- 2
crypto/bn/bn_test.c Wyświetl plik

@@ -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();


+ 1
- 1
crypto/bn/rsaz_exp.h Wyświetl plik

@@ -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],


+ 13
- 13
crypto/bytestring/bytestring_test.c Wyświetl plik

@@ -18,7 +18,7 @@
#include <openssl/bytestring.h>


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() ||


+ 11
- 11
crypto/cipher/e_aes.c Wyświetl plik

@@ -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)


+ 3
- 1
crypto/cipher/e_chacha20poly1305.c Wyświetl plik

@@ -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;
}

+ 1
- 1
crypto/cipher/e_rc4.c Wyświetl plik

@@ -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; }

+ 1
- 1
crypto/conf/conf.c Wyświetl plik

@@ -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));


+ 2
- 2
crypto/cpu-arm.c Wyświetl plik

@@ -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;
}


+ 2
- 2
crypto/ec/example_mul.c Wyświetl plik

@@ -72,7 +72,7 @@
#include <openssl/obj.h>


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;


+ 1
- 1
crypto/ec/internal.h Wyświetl plik

@@ -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);


+ 1
- 1
crypto/engine/engine.c Wyświetl plik

@@ -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;


+ 4
- 4
crypto/err/err.c Wyświetl plik

@@ -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) {}

+ 6
- 6
crypto/err/err_test.c Wyświetl plik

@@ -18,7 +18,7 @@
#include <openssl/mem.h>


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() ||


+ 3
- 3
crypto/evp/evp.c Wyświetl plik

@@ -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) {}

+ 3
- 3
crypto/evp/example_sign.c Wyświetl plik

@@ -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;


+ 1
- 1
crypto/ex_data.c Wyświetl plik

@@ -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);


+ 1
- 1
crypto/ex_data_impl.c Wyświetl plik

@@ -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);


+ 1
- 1
crypto/lhash/lhash_test.c Wyświetl plik

@@ -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;


+ 1
- 1
crypto/modes/gcm_test.c Wyświetl plik

@@ -413,7 +413,7 @@ out:
return ret;
}

int main() {
int main(void) {
int ret = 0;
unsigned i;



+ 1
- 1
crypto/obj/obj.c Wyświetl plik

@@ -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);


+ 1
- 1
crypto/rand/urandom.c Wyświetl plik

@@ -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;



+ 3
- 3
crypto/rsa/rsa_test.c Wyświetl plik

@@ -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];


+ 1
- 1
crypto/sha/sha1_test.c Wyświetl plik

@@ -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];


+ 2
- 2
crypto/x509/pkcs7_test.c Wyświetl plik

@@ -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;
}


+ 1
- 1
crypto/x509v3/tabtest.c Wyświetl plik

@@ -66,7 +66,7 @@

#include "ext_dat.h"

int main()
int main(void)
{
int i, prev = -1, bad = 0;
const X509V3_EXT_METHOD **tmp;


+ 1
- 1
crypto/x509v3/v3nametest.c Wyświetl plik

@@ -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;


+ 4
- 4
include/openssl/aead.h Wyświetl plik

@@ -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. */


+ 1
- 1
include/openssl/conf.h Wyświetl plik

@@ -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);


+ 2
- 2
include/openssl/cpu.h Wyświetl plik

@@ -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


+ 1
- 1
include/openssl/engine.h Wyświetl plik

@@ -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. */


+ 4
- 4
include/openssl/err.h Wyświetl plik

@@ -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)


+ 3
- 3
include/openssl/evp.h Wyświetl plik

@@ -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


+ 1
- 1
include/openssl/pqueue.h Wyświetl plik

@@ -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. */


+ 1
- 1
include/openssl/rand.h Wyświetl plik

@@ -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 */


+ 1
- 1
ssl/pqueue/pqueue.c Wyświetl plik

@@ -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;


+ 1
- 1
ssl/ssl_sess.c Wyświetl plik

@@ -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;
}


+ 1
- 1
ssl/ssl_test.c Wyświetl plik

@@ -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. */


Ładowanie…
Anuluj
Zapisz