Merge remote-tracking branch 'teor/bug16115-minor-fixes'

This commit is contained in:
Nick Mathewson
2015-06-02 14:51:13 -04:00
12 changed files with 50 additions and 10 deletions
+2 -1
View File
@@ -50,7 +50,8 @@ static pthread_attr_t attr_detached;
static int threads_initialized = 0;
/** Minimalist interface to run a void function in the background. On
* Unix calls fork, on win32 calls beginthread. Returns -1 on failure.
* Unix calls pthread_create, on win32 calls beginthread. Returns -1 on
* failure.
* func should not return, but rather should call spawn_exit.
*
* NOTE: if <b>data</b> is used, it should not be allocated on the stack,
+2
View File
@@ -1444,6 +1444,8 @@ find_cipher_by_id(const SSL *ssl, const SSL_METHOD *m, uint16_t cipher)
}
#endif
(void) ssl;
(void) m;
(void) cipher;
return 1; /* No way to search */
}
+7 -3
View File
@@ -2193,7 +2193,7 @@ getinfo_helper_onions(control_connection_t *control_conn,
{
smartlist_t *onion_list = NULL;
if (!strcmp(question, "onions/current")) {
if (control_conn && !strcmp(question, "onions/current")) {
onion_list = control_conn->ephemeral_onion_services;
} else if (!strcmp(question, "onions/detached")) {
onion_list = detached_onion_services;
@@ -2201,10 +2201,14 @@ getinfo_helper_onions(control_connection_t *control_conn,
return 0;
}
if (!onion_list || smartlist_len(onion_list) == 0) {
*errmsg = "No onion services of the specified type.";
if (errmsg) {
*errmsg = "No onion services of the specified type.";
}
return -1;
}
*answer = smartlist_join_strings(onion_list, "\r\n", 0, NULL);
if (answer) {
*answer = smartlist_join_strings(onion_list, "\r\n", 0, NULL);
}
return 0;
}
+1 -1
View File
@@ -1417,7 +1417,7 @@ rend_data_dup(const rend_data_t *data)
static int
compute_desc_id(rend_data_t *rend_data)
{
int ret;
int ret = 0;
unsigned replica;
time_t now = time(NULL);
+2 -1
View File
@@ -152,7 +152,8 @@ ed_key_init_from_file(const char *fname, uint32_t flags,
ED25519_PUBKEY_LEN)) {
tor_log(severity, LD_OR, "Cert was for wrong key");
bad_cert = 1;
} else if (tor_cert_checksig(cert, &signing_key->pubkey, now) < 0 &&
} else if (signing_key &&
tor_cert_checksig(cert, &signing_key->pubkey, now) < 0 &&
(signing_key || cert->cert_expired)) {
tor_log(severity, LD_OR, "Can't check certificate");
bad_cert = 1;
+3 -4
View File
@@ -4319,13 +4319,12 @@ test_util_writepid(void *arg)
int n = sscanf(contents, "%lu\n%c", &pid, &c);
tt_int_op(n, OP_EQ, 1);
tt_uint_op(pid, OP_EQ,
#ifdef _WIN32
_getpid()
tt_uint_op(pid, OP_EQ, _getpid());
#else
getpid()
tt_uint_op(pid, OP_EQ, getpid());
#endif
);
done:
tor_free(contents);