olm: Rename the errors function argument in the decryption functions.
This commit is contained in:
parent
fec41f9540
commit
7538a1eccf
3 changed files with 6 additions and 6 deletions
|
@ -176,7 +176,7 @@ class InboundGroupSession(object):
|
||||||
|
|
||||||
raise OlmGroupSessionError(last_error)
|
raise OlmGroupSessionError(last_error)
|
||||||
|
|
||||||
def decrypt(self, ciphertext, errors="replace"):
|
def decrypt(self, ciphertext, unicode_errors="replace"):
|
||||||
# type: (AnyStr, str) -> Tuple[str, int]
|
# type: (AnyStr, str) -> Tuple[str, int]
|
||||||
"""Decrypt a message
|
"""Decrypt a message
|
||||||
|
|
||||||
|
@ -232,7 +232,7 @@ class InboundGroupSession(object):
|
||||||
|
|
||||||
plaintext = to_unicode_str(
|
plaintext = to_unicode_str(
|
||||||
ffi.unpack(plaintext_buffer, plaintext_length),
|
ffi.unpack(plaintext_buffer, plaintext_length),
|
||||||
errors=errors
|
errors=unicode_errors
|
||||||
)
|
)
|
||||||
|
|
||||||
# clear out copies of the plaintext
|
# clear out copies of the plaintext
|
||||||
|
|
|
@ -313,7 +313,7 @@ class PkDecryption(object):
|
||||||
|
|
||||||
return obj
|
return obj
|
||||||
|
|
||||||
def decrypt(self, message, errors="replace"):
|
def decrypt(self, message, unicode_errors="replace"):
|
||||||
# type (PkMessage, str) -> str
|
# type (PkMessage, str) -> str
|
||||||
"""Decrypt a previously encrypted Pk message.
|
"""Decrypt a previously encrypted Pk message.
|
||||||
|
|
||||||
|
@ -361,7 +361,7 @@ class PkDecryption(object):
|
||||||
# clear out copies of the plaintext
|
# clear out copies of the plaintext
|
||||||
lib.memset(plaintext_buffer, 0, max_plaintext_length)
|
lib.memset(plaintext_buffer, 0, max_plaintext_length)
|
||||||
|
|
||||||
return to_unicode_str(plaintext, errors=errors)
|
return to_unicode_str(plaintext, errors=unicode_errors)
|
||||||
|
|
||||||
|
|
||||||
def _clear_pk_signing(pk_struct):
|
def _clear_pk_signing(pk_struct):
|
||||||
|
|
|
@ -273,7 +273,7 @@ class Session(object):
|
||||||
else: # pragma: no cover
|
else: # pragma: no cover
|
||||||
raise ValueError("Unknown message type")
|
raise ValueError("Unknown message type")
|
||||||
|
|
||||||
def decrypt(self, message, errors="replace"):
|
def decrypt(self, message, unicode_errors="replace"):
|
||||||
# type: (_OlmMessage, str) -> str
|
# type: (_OlmMessage, str) -> str
|
||||||
"""Decrypts a message using the session. Returns the plaintext string
|
"""Decrypts a message using the session. Returns the plaintext string
|
||||||
on success. Raises OlmSessionError on failure. If the base64 couldn't
|
on success. Raises OlmSessionError on failure. If the base64 couldn't
|
||||||
|
@ -320,7 +320,7 @@ class Session(object):
|
||||||
self._check_error(plaintext_length)
|
self._check_error(plaintext_length)
|
||||||
plaintext = to_unicode_str(
|
plaintext = to_unicode_str(
|
||||||
ffi.unpack(plaintext_buffer, plaintext_length),
|
ffi.unpack(plaintext_buffer, plaintext_length),
|
||||||
errors=errors
|
errors=unicode_errors
|
||||||
)
|
)
|
||||||
|
|
||||||
# clear out copies of the plaintext
|
# clear out copies of the plaintext
|
||||||
|
|
Loading…
Reference in a new issue