Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
matrix-org
Olm
Commits
7538a1ec
Commit
7538a1ec
authored
Jun 20, 2019
by
poljar
Browse files
olm: Rename the errors function argument in the decryption functions.
parent
fec41f95
Changes
3
Hide whitespace changes
Inline
Side-by-side
python/olm/group_session.py
View file @
7538a1ec
...
...
@@ -176,7 +176,7 @@ class InboundGroupSession(object):
raise
OlmGroupSessionError
(
last_error
)
def
decrypt
(
self
,
ciphertext
,
errors
=
"replace"
):
def
decrypt
(
self
,
ciphertext
,
unicode_
errors
=
"replace"
):
# type: (AnyStr, str) -> Tuple[str, int]
"""Decrypt a message
...
...
@@ -232,7 +232,7 @@ class InboundGroupSession(object):
plaintext
=
to_unicode_str
(
ffi
.
unpack
(
plaintext_buffer
,
plaintext_length
),
errors
=
errors
errors
=
unicode_
errors
)
# clear out copies of the plaintext
...
...
python/olm/pk.py
View file @
7538a1ec
...
...
@@ -313,7 +313,7 @@ class PkDecryption(object):
return
obj
def
decrypt
(
self
,
message
,
errors
=
"replace"
):
def
decrypt
(
self
,
message
,
unicode_
errors
=
"replace"
):
# type (PkMessage, str) -> str
"""Decrypt a previously encrypted Pk message.
...
...
@@ -361,7 +361,7 @@ class PkDecryption(object):
# clear out copies of the plaintext
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
):
...
...
python/olm/session.py
View file @
7538a1ec
...
...
@@ -273,7 +273,7 @@ class Session(object):
else
:
# pragma: no cover
raise
ValueError
(
"Unknown message type"
)
def
decrypt
(
self
,
message
,
errors
=
"replace"
):
def
decrypt
(
self
,
message
,
unicode_
errors
=
"replace"
):
# type: (_OlmMessage, str) -> str
"""Decrypts a message using the session. Returns the plaintext string
on success. Raises OlmSessionError on failure. If the base64 couldn't
...
...
@@ -320,7 +320,7 @@ class Session(object):
self
.
_check_error
(
plaintext_length
)
plaintext
=
to_unicode_str
(
ffi
.
unpack
(
plaintext_buffer
,
plaintext_length
),
errors
=
errors
errors
=
unicode_
errors
)
# clear out copies of the plaintext
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment