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

[tor-commits] [stem/master] Fix x25519_supported AttributeError



commit 95531abf2b88f97f881b73f61c037a21390388cd
Author: Damian Johnson <atagar@xxxxxxxxxxxxxx>
Date:   Sun Nov 17 16:00:34 2019 -0800

    Fix x25519_supported AttributeError
    
    Oops, turns out the cryptography module doesn't always supply this method...
    
      Traceback (most recent call last):
        File "./run_tests.py", line 36, in <module>
          import test.runner
        File "/srv/jenkins-workspace/workspace/stem-tor-ci/test/runner.py", line 44, in <module>
          import stem.connection
        File "/srv/jenkins-workspace/workspace/stem-tor-ci/stem/connection.py", line 136, in <module>
          import stem.control
        File "/srv/jenkins-workspace/workspace/stem-tor-ci/stem/control.py", line 271, in <module>
          import stem.descriptor.microdescriptor
        File "/srv/jenkins-workspace/workspace/stem-tor-ci/stem/descriptor/__init__.py", line 1544, in <module>
          import stem.descriptor.hidden_service
        File "/srv/jenkins-workspace/workspace/stem-tor-ci/stem/descriptor/hidden_service.py", line 81, in <module>
          X25519_AVAILABLE = backend.x25519_supported()
      AttributeError: 'Backend' object has no attribute 'x25519_supported'
---
 stem/descriptor/hidden_service.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/stem/descriptor/hidden_service.py b/stem/descriptor/hidden_service.py
index 3ad2f031..0e710e7a 100644
--- a/stem/descriptor/hidden_service.py
+++ b/stem/descriptor/hidden_service.py
@@ -78,7 +78,7 @@ else:
 
 try:
   from cryptography.hazmat.backends.openssl.backend import backend
-  X25519_AVAILABLE = backend.x25519_supported()
+  X25519_AVAILABLE = hasattr(backend, 'x25519_supported') and backend.x25519_supported()
 except ImportError:
   X25519_AVAILABLE = False
 

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