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

[tor-commits] [bridgedb/master] Obtain the fingerprint and add it to the documents/descriptors



commit 33dcd5bed7aad5dd6f37d53cca9afc7baf371b75
Author: Matthew Finkel <Matthew.Finkel@xxxxxxxxx>
Date:   Sat Nov 9 17:23:07 2013 +0000

    Obtain the fingerprint and add it to the documents/descriptors
    
    (cherry picked from commit b4357fe77284d9858a1c71be649cd6cc157002fd)
    Signed-off-by: Isis Lovecruft <isis@xxxxxxxxxxxxxx>
    
    Conflicts:
    	scripts/gen_bridge_descriptors
    
    Again, I had to change a few things due to Matt and I both trying to fix
    something, and both simultaneously catching problems that the other person
    missed. :)
---
 scripts/gen_bridge_descriptors |    8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/scripts/gen_bridge_descriptors b/scripts/gen_bridge_descriptors
index da25e59..66f07ab 100644
--- a/scripts/gen_bridge_descriptors
+++ b/scripts/gen_bridge_descriptors
@@ -745,8 +745,6 @@ def generateDescriptors():
     idkey_private = getPEMPrivateKey(SIDSKey)
     idkey_digest = hashlib.sha1(idkey_private).digest()
 
-    fpr = convertToSpaceyFingerprint(fingerprint)
-
     idkey_public = OpenSSL.crypto.dump_privatekey(ASN1,
                                                   SIDPCert.get_pubkey())
     idkey_public = re.sub(OPENSSL_BEGIN_KEY, '', idkey_public)
@@ -754,11 +752,13 @@ def generateDescriptors():
     idkey_public = idkey_public.strip()
  
     ident_digest = hashlib.sha1(idkey_public).digest()
+    fingerprint = hashlib.sha1(idkey_public).hexdigest().upper()
+    fpr = convertToSpaceyFingerprint(ident_digest)
 
     identity = binascii.b2a_base64(
         hashlib.sha1(idkey_public).digest()).strip().strip('=======')
 
-    extrainfo_document = generateExtraInfo(fpr, timestamp, ipv4, port)
+    extrainfo_document = generateExtraInfo(fingerprint, timestamp, ipv4, port)
     extrainfo_digest = hashlib.sha1(extrainfo_document).digest()
     extrainfo_hexdigest = hashlib.sha1(extrainfo_document).hexdigest().upper()
     extrainfo_sig = signDescriptorDigest(idkey, extrainfo_digest)
@@ -782,7 +782,7 @@ def generateDescriptors():
     server_desc = '\n'.join(server)
 
     server_desc_digest = hashlib.sha1(server_desc).digest()
-    netstatus_desc = generateNetstatus(idkey_digest, server_desc_digest,
+    netstatus_desc = generateNetstatus(ident_digest, server_desc_digest,
                                        timestamp, ipv4, port, ipv6=ipv6,
                                        bandwidth_line=bandwidth)
     server_desc += signDescriptorDigest(idkey, server_desc_digest)



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