[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

[tor-commits] [tor/maint-0.3.0] Repair the unit test behavior of my fix for 22508.



commit 68c3df69dec4b2b9b5276f7cc9f86ef4167fc705
Author: Nick Mathewson <nickm@xxxxxxxxxxxxxx>
Date:   Tue Jun 6 11:32:01 2017 -0400

    Repair the unit test behavior of my fix for 22508.
    
    Apparently, the unit tests relied on being able to make ed->x509
    link certs even when they hadn't set any server flags in the
    options.  So instead of making "client" mean "never generate an
    ed->x509 cert", we'll have it mean "it's okay not to generate an
    ed->x509 cert".
    
    (Going with a minimal fix here, since this is supposed to be a
    stable version.)
---
 src/or/routerkeys.c | 9 ++++-----
 1 file changed, 4 insertions(+), 5 deletions(-)

diff --git a/src/or/routerkeys.c b/src/or/routerkeys.c
index f69c0f1..aa7aee4 100644
--- a/src/or/routerkeys.c
+++ b/src/or/routerkeys.c
@@ -997,12 +997,11 @@ generate_ed_link_cert(const or_options_t *options, time_t now,
   const tor_x509_cert_t *link_ = NULL, *id = NULL;
   tor_cert_t *link_cert = NULL;
 
-  if (!server_mode(options)) {
-    /* No need to make an Ed25519->Link cert: we are a client */
-    return 0;
-  }
-
   if (tor_tls_get_my_certs(1, &link_, &id) < 0 || link_ == NULL) {
+    if (!server_mode(options)) {
+        /* No need to make an Ed25519->Link cert: we are a client */
+      return 0;
+    }
     log_warn(LD_OR, "Can't get my x509 link cert.");
     return -1;
   }

_______________________________________________
tor-commits mailing list
tor-commits@xxxxxxxxxxxxxxxxxxxx
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits