aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorRoger Dingledine <arma@torproject.org>2011-12-08 04:45:59 -0500
committerRoger Dingledine <arma@torproject.org>2011-12-08 04:45:59 -0500
commit97bd03661c5c0b99e5a95da292954b25f885597b (patch)
treecaa43b29ebb9dcb301bbd384f5b0476a212bd519 /src
parentae07af564e66adb7d6158fb0cfaed92e44d37ee0 (diff)
parent0f8026ec2359a754550190947138b9168671949e (diff)
downloadtor-97bd03661c5c0b99e5a95da292954b25f885597b.tar
tor-97bd03661c5c0b99e5a95da292954b25f885597b.tar.gz
Merge remote-tracking branch 'sebastian/bug4672'
Diffstat (limited to 'src')
-rw-r--r--src/common/compat_libevent.c5
-rw-r--r--src/common/tortls.c14
-rw-r--r--src/common/util.c4
3 files changed, 12 insertions, 11 deletions
diff --git a/src/common/compat_libevent.c b/src/common/compat_libevent.c
index 7a28c9bc9..0cedef8d5 100644
--- a/src/common/compat_libevent.c
+++ b/src/common/compat_libevent.c
@@ -243,8 +243,8 @@ tor_libevent_initialize(tor_libevent_cfg *torcfg)
* again. */
#if defined(MS_WINDOWS) && defined(USE_BUFFEREVENTS)
if (torcfg->disable_iocp == 0) {
- log_warn(LD_GENERAL, "Unable to initialize Libevent. Trying again with "
- "IOCP disabled.");
+ log_warn(LD_GENERAL, "Unable to initialize Libevent. Trying again "
+ "with IOCP disabled.");
} else
#endif
{
@@ -254,7 +254,6 @@ tor_libevent_initialize(tor_libevent_cfg *torcfg)
torcfg->disable_iocp = 1;
goto retry;
}
-
}
#else
the_event_base = event_init();
diff --git a/src/common/tortls.c b/src/common/tortls.c
index e4992efc6..231be8272 100644
--- a/src/common/tortls.c
+++ b/src/common/tortls.c
@@ -580,6 +580,8 @@ tor_tls_create_certificate(crypto_pk_env_t *rsa,
const char *cname_sign,
unsigned int cert_lifetime)
{
+ /* OpenSSL generates self-signed certificates with random 64-bit serial
+ * numbers, so let's do that too. */
#define SERIAL_NUMBER_SIZE 8
time_t start_time, end_time;
@@ -607,12 +609,12 @@ tor_tls_create_certificate(crypto_pk_env_t *rsa,
goto error;
{ /* our serial number is 8 random bytes. */
- if (crypto_rand((char *)serial_tmp, sizeof(serial_tmp)) < 0)
- goto error;
- if (!(serial_number = BN_bin2bn(serial_tmp, sizeof(serial_tmp), NULL)))
- goto error;
- if (!(BN_to_ASN1_INTEGER(serial_number, X509_get_serialNumber(x509))))
- goto error;
+ if (crypto_rand((char *)serial_tmp, sizeof(serial_tmp)) < 0)
+ goto error;
+ if (!(serial_number = BN_bin2bn(serial_tmp, sizeof(serial_tmp), NULL)))
+ goto error;
+ if (!(BN_to_ASN1_INTEGER(serial_number, X509_get_serialNumber(x509))))
+ goto error;
}
if (!(name = tor_x509_name_new(cname)))
diff --git a/src/common/util.c b/src/common/util.c
index a59cab0bb..6d488d996 100644
--- a/src/common/util.c
+++ b/src/common/util.c
@@ -3661,8 +3661,8 @@ tor_get_exit_code(const process_handle_t *process_handle,
/* Process has not exited */
return PROCESS_EXIT_RUNNING;
} else if (retval != process_handle->pid) {
- log_warn(LD_GENERAL, "waitpid() failed for PID %d: %s", process_handle->pid,
- strerror(errno));
+ log_warn(LD_GENERAL, "waitpid() failed for PID %d: %s",
+ process_handle->pid, strerror(errno));
return PROCESS_EXIT_ERROR;
}