[stem/master] Tutorial section mislabeled

commit 797d70780548abc44f8021489d5a12352310c598 Author: Damian Johnson <atagar@torproject.org> Date: Mon May 15 10:30:25 2017 -0700 Tutorial section mislabeled On the top of the descriptor tutorials we listed "Can I create descriptors?" twice. Fixing it so the second says "Validating the descriptor's content" instead. --- docs/tutorials/mirror_mirror_on_the_wall.rst | 4 ++-- stem/descriptor/__init__.py | 2 ++ 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/docs/tutorials/mirror_mirror_on_the_wall.rst b/docs/tutorials/mirror_mirror_on_the_wall.rst index d9ba6e0..5148c50 100644 --- a/docs/tutorials/mirror_mirror_on_the_wall.rst +++ b/docs/tutorials/mirror_mirror_on_the_wall.rst @@ -163,8 +163,6 @@ through Tor's control socket... .. literalinclude:: /_static/example/descriptor_from_tor_data_directory.py :language: python -.. _validating-the-descriptors-content: - .. _can-i-create-descriptors: Can I create descriptors? @@ -204,6 +202,8 @@ descriptor... Until it does try using `leekspin <https://pypi.python.org/pypi/leekspin>`_ instead. +.. _validating-the-descriptors-content: + Validating the descriptor's content ----------------------------------- diff --git a/stem/descriptor/__init__.py b/stem/descriptor/__init__.py index b9c31af..a73093c 100644 --- a/stem/descriptor/__init__.py +++ b/stem/descriptor/__init__.py @@ -681,9 +681,11 @@ class Descriptor(object): from cryptography.hazmat.backends import default_backend from cryptography.hazmat.primitives.serialization import load_der_public_key from cryptography.utils import int_to_bytes, int_from_bytes + key = load_der_public_key(_bytes_for_block(signing_key), default_backend()) modulus = key.public_numbers().n public_exponent = key.public_numbers().e + sig_as_bytes = _bytes_for_block(signature) sig_as_long = int_from_bytes(sig_as_bytes, byteorder='big') # convert signature to an int blocksize = len(sig_as_bytes) # 256B for NetworkStatusDocuments, 128B for others
participants (1)
-
atagar@torproject.org