struct aes_cnt_cipher;
typedef struct aes_cnt_cipher aes_cnt_cipher_t;
-aes_cnt_cipher_t* aes_new_cipher();
+aes_cnt_cipher_t* aes_new_cipher(void);
void aes_free_cipher(aes_cnt_cipher_t *cipher);
void aes_set_key(aes_cnt_cipher_t *cipher, const unsigned char *key, int key_bits);
void aes_crypt(aes_cnt_cipher_t *cipher, const char *input, int len, char *output);
/** Initialize dh_param_p and dh_param_g if they are not already
* set. */
-static void init_dh_param() {
+static void init_dh_param(void) {
BIGNUM *p, *g;
int r;
if (dh_param_p && dh_param_g)
/** Seed OpenSSL's random number generator with DIGEST_LEN bytes from the
* operating system. Return 0 on suuccess, -1 on failure.
*/
-int crypto_seed_rng()
+int crypto_seed_rng(void)
{
#ifdef MS_WINDOWS
static int provider_set = 0;
typedef struct crypto_dh_env_t crypto_dh_env_t;
/* global state */
-int crypto_global_init();
-int crypto_global_cleanup();
+int crypto_global_init(void);
+int crypto_global_cleanup(void);
/* environment setup */
crypto_pk_env_t *crypto_new_pk_env(void);
int base16_decode(char *dest, size_t destlen, const char *src, size_t srclen);
/* Key negotiation */
-crypto_dh_env_t *crypto_dh_new();
+crypto_dh_env_t *crypto_dh_new(void);
int crypto_dh_get_bytes(crypto_dh_env_t *dh);
int crypto_dh_generate_public(crypto_dh_env_t *dh);
int crypto_dh_get_public(crypto_dh_env_t *dh, char *pubkey_out,
/* SHA-1 */
int crypto_digest(const unsigned char *m, int len, unsigned char *digest);
-crypto_digest_env_t *crypto_new_digest_env();
+crypto_digest_env_t *crypto_new_digest_env(void);
void crypto_free_digest_env(crypto_digest_env_t *digest);
void crypto_digest_add_bytes(crypto_digest_env_t *digest, const char *data,
size_t len);
const crypto_digest_env_t *from);
/* random numbers */
-int crypto_seed_rng();
+int crypto_seed_rng(void);
int crypto_rand(unsigned int n, unsigned char *to);
void crypto_pseudo_rand(unsigned int n, unsigned char *to);
int crypto_pseudo_rand_int(unsigned int max);
/** Initialize OpenSSL, unless it has already been initialized.
*/
static void
-tor_tls_init() {
+tor_tls_init(void) {
if (!tls_library_is_initialized) {
SSL_library_init();
SSL_load_error_strings();
/** Generic resizeable array. */
typedef struct smartlist_t smartlist_t;
-smartlist_t *smartlist_create();
+smartlist_t *smartlist_create(void);
void smartlist_free(smartlist_t *sl);
void smartlist_set_capacity(smartlist_t *sl, int n);
void smartlist_clear(smartlist_t *sl);
int replace_file(const char *from, const char *to);
int spawn_func(int (*func)(void *), void *data);
-void spawn_exit();
+void spawn_exit(void);
/* Because we use threads instead of processes on Windows, we need locking on Windows.
* On Unixy platforms, these functions are no-ops. */
/********************************* buffers.c ***************************/
-buf_t *buf_new();
+buf_t *buf_new(void);
buf_t *buf_new_with_capacity(size_t size);
void buf_free(buf_t *buf);
void buf_clear(buf_t *buf);
int dirserv_add_own_fingerprint(const char *nickname, crypto_pk_env_t *pk);
int dirserv_parse_fingerprint_file(const char *fname);
int dirserv_router_fingerprint_is_known(const routerinfo_t *router);
-void dirserv_free_fingerprint_list();
+void dirserv_free_fingerprint_list(void);
const char *dirserv_get_nickname_by_digest(const char *digest);
int dirserv_add_descriptor(const char **desc);
int dirserv_load_from_directory_string(const char *dir);
-void dirserv_free_descriptors();
+void dirserv_free_descriptors(void);
void dirserv_remove_old_servers(int age);
int dirserv_dump_directory_to_string(char *s, size_t maxlen,
crypto_pk_env_t *private_key);
static char temp_dir[256];
void
-setup_directory()
+setup_directory(void)
{
static int is_setup = 0;
int r;
}
void
-remove_directory()
+remove_directory(void)
{
DIR *dirp;
struct dirent *de;
}
void
-test_buffers() {
+test_buffers(void) {
#define MAX_BUF_SIZE 1024*1024
char str[256];
char str2[256];
}
void
-test_crypto_dh()
+test_crypto_dh(void)
{
crypto_dh_env_t *dh1, *dh2;
char p1[DH_BYTES];
}
void
-test_crypto()
+test_crypto(void)
{
crypto_cipher_env_t *env1, *env2;
crypto_pk_env_t *pk1, *pk2;
}
void
-test_util() {
+test_util(void) {
struct timeval start, end;
struct tm a_time;
smartlist_t *sl;
}
void
-test_gzip() {
+test_gzip(void)
+{
char *buf1, *buf2=NULL, *buf3=NULL;
size_t len1, len2;
return (void*)(v*v);
}
-void test_strmap() {
+void test_strmap(void)
+{
strmap_t *map;
strmap_iter_t *iter;
const char *k;
strmap_free(map,NULL);
}
-void test_onion() {
+void test_onion(void)
+{
#if 0
char **names;
int i,num;
}
void
-test_onion_handshake() {
+test_onion_handshake(void)
+{
/* client-side */
crypto_dh_env_t *c_dh = NULL;
char c_buf[ONIONSKIN_CHALLENGE_LEN];
int is_obsolete_version(const char *myversion, const char *start);
void
-test_dir_format()
+test_dir_format(void)
{
char buf[8192], buf2[8192];
char platform[256];
}
-void test_rend_fns()
+void test_rend_fns(void)
{
char address1[] = "fooaddress.onion";
char address2[] = "aaaaaaaaaaaaaaaa.onion";