aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/common/crypto.c4
-rw-r--r--src/or/main.c3
2 files changed, 6 insertions, 1 deletions
diff --git a/src/common/crypto.c b/src/common/crypto.c
index 851f11bf3..235bd88ff 100644
--- a/src/common/crypto.c
+++ b/src/common/crypto.c
@@ -1663,6 +1663,10 @@ crypto_digest_get_digest(crypto_digest_env_t *digest,
SHA256_Final(r, &tmpenv.d.sha2);
break;
default:
+ log_warn(LD_BUG, "Called with unknown algorithm %d", digest->algorithm);
+ /* If fragile_assert is not enabled, then we should at least not
+ * leak anything. */
+ memset(r, 0xff, sizeof(r));
tor_fragile_assert();
break;
}
diff --git a/src/or/main.c b/src/or/main.c
index 95acea4f5..b1159746a 100644
--- a/src/or/main.c
+++ b/src/or/main.c
@@ -1378,7 +1378,8 @@ ip_address_changed(int at_interface)
if (at_interface) {
if (! server) {
/* Okay, change our keys. */
- init_keys();
+ if (init_keys()<0)
+ log_warn(LD_GENERAL, "Unable to rotate keys after IP change!");
}
} else {
if (server) {