Set a known buffer size if possible on BinaryWriter()s

This commit is contained in:
Lonami Exo
2017-08-29 20:25:49 +02:00
parent 7ad2ece168
commit b4811261e9
4 changed files with 15 additions and 9 deletions

View File

@@ -19,7 +19,7 @@ def do_authentication(connection):
# Step 1 sending: PQ Request
nonce = os.urandom(16)
with BinaryWriter() as writer:
with BinaryWriter(known_length=20) as writer:
writer.write_int(0x60469778, signed=False) # Constructor number
writer.write(nonce)
sender.send(writer.get_bytes())