[tor-commits] [bridgedb/master] Fix error for initializeGnuPG() return value when signing fails.

isis at torproject.org isis at torproject.org
Wed Mar 25 19:03:46 UTC 2015


commit 105de16be5962ecdc6979936da17bb587aece69b
Author: Isis Lovecruft <isis at torproject.org>
Date:   Sat Mar 21 03:36:48 2015 +0000

    Fix error for initializeGnuPG() return value when signing fails.
    
    When the test signing in bridgedb.crypto.initializeGnuPG() fails, the
    return value would be `None`, rather than the gpg interface and the
    signing function, `(gpg, gpgSignMessage)`, or `(None, None)` as it does
    with the other failure modes.  This would cause the EmailServerContext
    to raise a TypeError because `None` is not iterable, and cannot be
    assigned to two variables.
    
    We now return `(None, None)` when the test signing fails.
    
    This is a bugfix on #10385. [0]
    
    [0]: https://bugs.torproject.org/10385
---
 lib/bridgedb/crypto.py |    2 ++
 1 file changed, 2 insertions(+)

diff --git a/lib/bridgedb/crypto.py b/lib/bridgedb/crypto.py
index c17957b..d6dbbad 100644
--- a/lib/bridgedb/crypto.py
+++ b/lib/bridgedb/crypto.py
@@ -355,6 +355,8 @@ def initializeGnuPG(config):
         logging.info("Test signature with GnuPG key %s okay:\n%s" % (primary, sig))
         return (gpg, gpgSignMessage)
 
+    return ret
+
 
 class SSLVerifyingContextFactory(ssl.CertificateOptions):
     """``OpenSSL.SSL.Context`` factory which does full certificate-chain and





More information about the tor-commits mailing list