]> git.ipfire.org Git - thirdparty/tor.git/commitdiff
Report wrong key sizes correctly
authorNick Mathewson <nickm@torproject.org>
Wed, 1 Jun 2011 15:07:08 +0000 (11:07 -0400)
committerNick Mathewson <nickm@torproject.org>
Wed, 1 Jun 2011 15:07:17 +0000 (11:07 -0400)
When we introduced NEED_KEY_1024 in routerparse.c back in
0.2.0.1-alpha, I forgot to add a *8 when logging the length of a
bad-length key.

Bugfix for 3318 on 0.2.0.1-alpha.

changes/bug3318 [new file with mode: 0644]
src/or/routerparse.c

diff --git a/changes/bug3318 b/changes/bug3318
new file mode 100644 (file)
index 0000000..38991c4
--- /dev/null
@@ -0,0 +1,3 @@
+  o Minor bugfixes:
+    - Fix a log message that said "bits" while displaying a value in
+      bytes. Fixes bug 3318; bugfix on 0.2.0.1-alpha.
index 1dcbc6a18488d36091e320942e4c8a3e6d3057cd..3728e9932b073346575d32ba7d52d63c4940ad2d 100644 (file)
@@ -3767,7 +3767,7 @@ token_check_object(memarea_t *area, const char *kwd,
     case NEED_SKEY_1024: /* There must be a 1024-bit private key. */
       if (tok->key && crypto_pk_keysize(tok->key) != PK_BYTES) {
         tor_snprintf(ebuf, sizeof(ebuf), "Wrong size on key for %s: %d bits",
-                     kwd, (int)crypto_pk_keysize(tok->key));
+                     kwd, (int)crypto_pk_keysize(tok->key)*8);
         RET_ERR(ebuf);
       }
       /* fall through */