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

[tor-commits] [stem/master] Skip verification when no signing cert is present



commit 97dcda0457535a8e31089eccf1e40d13953bb0b0
Author: Damian Johnson <atagar@xxxxxxxxxxxxxx>
Date:   Sat Oct 12 13:37:46 2019 -0700

    Skip verification when no signing cert is present
    
    ======================================================================
    ERROR: test_invalid_revision_counter
    ----------------------------------------------------------------------
    Traceback (most recent call last):
      File "/home/atagar/Desktop/stem/test/unit/descriptor/hidden_service_v3.py", line 209, in test_invalid_revision_counter
        expect_invalid_attr(self, {'revision-counter': test_value}, 'revision_counter')
      File "/home/atagar/Desktop/stem/test/unit/descriptor/__init__.py", line 41, in base_expect_invalid_attr
        return base_expect_invalid_attr_for_text(cls, default_attr, default_value, test, cls.content(desc_attrs), attr, expected_value)
      File "/home/atagar/Desktop/stem/test/unit/descriptor/__init__.py", line 52, in base_expect_invalid_attr_for_text
        desc = cls(desc_text, validate = False)
      File "/home/atagar/Desktop/stem/stem/descriptor/hidden_service.py", line 1080, in __init__
        descriptor_signing_key = self.signing_cert.certified_ed25519_key()
    AttributeError: 'NoneType' object has no attribute 'certified_ed25519_key'
---
 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 7ab8cf38..dc382ac0 100644
--- a/stem/descriptor/hidden_service.py
+++ b/stem/descriptor/hidden_service.py
@@ -1074,7 +1074,7 @@ class HiddenServiceDescriptorV3(BaseHiddenServiceDescriptor):
 
     from cryptography.hazmat.backends.openssl.backend import backend
 
-    if backend.x25519_supported():
+    if backend.x25519_supported() and self.signing_cert:
       # Verify the signature!
       # First compute the body that was signed
       descriptor_signing_key = self.signing_cert.certified_ed25519_key()



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