diff options
author | Damir Jelić <poljar@termina.org.uk> | 2019-01-23 17:49:42 +0100 |
---|---|---|
committer | Hubert Chathi <hubert@uhoreg.ca> | 2019-01-23 17:10:44 -0500 |
commit | 45091c158d956ebb6c23acfe4dcb1f147df55d4a (patch) | |
tree | 8478b84053773e2a27dafb92cefa34c67559e3a6 /python/olm | |
parent | 94f664e7256215f33639dbbad6aaf87ada082a9f (diff) |
python: Turn the signature buffer into a bytearray.
This is a workaround for a bug where signature verification would
overwrite the variable holding the signature.
This only happens on python2.
Signed-off-by: Damir Jelić <poljar@termina.org.uk>
Diffstat (limited to 'python/olm')
-rw-r--r-- | python/olm/utility.py | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/python/olm/utility.py b/python/olm/utility.py index 0a64128..121ff63 100644 --- a/python/olm/utility.py +++ b/python/olm/utility.py @@ -81,14 +81,15 @@ class _Utility(object): byte_key = to_bytes(key) byte_message = to_bytearray(message) - byte_signature = to_bytes(signature) + byte_signature = to_bytearray(signature) try: cls._check_error( lib.olm_ed25519_verify(cls._utility, byte_key, len(byte_key), ffi.from_buffer(byte_message), len(byte_message), - byte_signature, len(byte_signature))) + ffi.from_buffer(byte_signature), + len(byte_signature))) finally: # clear out copies of the message, which may be a plaintext if byte_message is not message: |