Browse Source

add comment about how to improve this...

tags/v0.1.0
John-Mark Gurney 5 years ago
parent
commit
f002ce41d1
1 changed files with 5 additions and 0 deletions
  1. +5
    -0
      ntunnel.py

+ 5
- 0
ntunnel.py View File

@@ -155,6 +155,11 @@ async def NoiseForwarder(mode, rdrwrr, ptpair, priv_key, pub_key=None):
raise RuntimeError('failed to finish handshake')

# generate the keys for lengths
# XXX - get_handshake_hash is probably not the best option, but
# this is only to obscure lengths, it is not required to be secure
# as the underlying NoiseProtocol securely validates everything.
# It is marginally useful as writing patterns likely expose the
# true length. Adding padding could marginally help w/ this.
if mode == 'resp':
_, declenfun = _genciphfun(proto.get_handshake_hash(), b'toresp')
enclenfun, _ = _genciphfun(proto.get_handshake_hash(), b'toinit')


Loading…
Cancel
Save