Skip to content

Commit

Permalink
Merge pull request #144 from david415/fix-ephemeral-key-size-constrai…
Browse files Browse the repository at this point in the history
…nt.0

Fix EphemeralHiddenService key blob size constraint
  • Loading branch information
meejah committed Nov 16, 2015
2 parents 9c914a7 + 61dfea2 commit 722fb64
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions txtorcon/torconfig.py
Expand Up @@ -846,8 +846,8 @@ def __init__(self, ports, key_blob_or_type='NEW:BEST', auth=[], ver=2):
# FIXME nicer than assert, plz
assert ' ' not in self._key_blob
assert type(ports) is types.ListType
if not key_blob_or_type.startswith('NEW:') and len(key_blob_or_type) != (812 + 8):
raise RuntimeError('Wrong size key-blob')
if not key_blob_or_type.startswith('NEW:') and (len(key_blob_or_type) > (825) or len(key_blob_or_type) < (820)):
raise RuntimeError('Wrong key-blob size too big')

@defer.inlineCallbacks
def add_to_tor(self, protocol):
Expand Down

0 comments on commit 722fb64

Please sign in to comment.