mirror of https://github.com/azlux/pymumble
Compare commits
2 Commits
36486601a2
...
bd6032aa24
Author | SHA1 | Date |
---|---|---|
Nicola C | bd6032aa24 | |
Nicola | 14ceab8466 |
|
@ -142,7 +142,7 @@ class CryptStateOCB2:
|
|||
head = bytes((eiv[0], *tag[:3]))
|
||||
return head + dst
|
||||
|
||||
def decrypt(self, source: bytes, len_plain: int | None = None) -> bytes:
|
||||
def decrypt(self, source: bytes) -> bytes:
|
||||
"""
|
||||
Decrypt a message
|
||||
|
||||
|
@ -162,8 +162,7 @@ class CryptStateOCB2:
|
|||
if len(source) < 4:
|
||||
raise DecryptFailedException('Source <4 bytes long!')
|
||||
|
||||
if not len_plain:
|
||||
len_plain = len(source) - 4 # The entire packet length, minus the header
|
||||
len_plain = len(source) - 4 # The entire packet length, minus the header
|
||||
|
||||
div = self.decrypt_iv.copy()
|
||||
ivbyte = source[0]
|
||||
|
|
|
@ -333,7 +333,7 @@ class Mumble(threading.Thread):
|
|||
except socket.error:
|
||||
pass
|
||||
|
||||
receive_buffer = self.ocb.decrypt(encrypted_buffer, len(encrypted_buffer))
|
||||
receive_buffer = self.ocb.decrypt(encrypted_buffer)
|
||||
|
||||
while len(receive_buffer) >= 6: # header is present (type + length)
|
||||
self.Log.debug("read control connection")
|
||||
|
|
Loading…
Reference in New Issue