瀏覽代碼

Merge remote-tracking branch 'origin/maint-0.2.2'

Nick Mathewson 12 年之前
父節點
當前提交
beb9097bed
共有 4 個文件被更改,包括 15 次插入1 次删除
  1. 5 0
      changes/cov479
  2. 4 0
      changes/cov484
  3. 4 0
      src/common/crypto.c
  4. 2 1
      src/or/main.c

+ 5 - 0
changes/cov479

@@ -0,0 +1,5 @@
+  o Minor bugfixes:
+    - Fix internal bug-checking logic that was supposed to catch
+      failures in digest generation so that it will fail more robustly
+      if we ask for a nonexistent algorithm. Found by Coverity Scan.
+      Bugfix on 0.2.2.1-alpha; fixes Coverity CID 479.

+ 4 - 0
changes/cov484

@@ -0,0 +1,4 @@
+  o Minor bugfixes:
+    - Report any failure in init_keys() calls done because our IP address
+      has changed. Spotted by Coverity Scan. Bugfix on 0.1.1.4-alpha;
+      fixes CID 484.

+ 4 - 0
src/common/crypto.c

@@ -1690,6 +1690,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;
   }

+ 2 - 1
src/or/main.c

@@ -1689,7 +1689,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) {