Skip to content
GitLab
Menu
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
2f35e0bc
Commit
2f35e0bc
authored
May 17, 2021
by
Denis Kasak
Browse files
olm_sas_set_their_key: Fail early on invalid base64.
parent
e82f2601
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/sas.c
View file @
2f35e0bc
...
...
@@ -95,7 +95,13 @@ size_t olm_sas_set_their_key(
sas
->
last_error
=
OLM_INPUT_BUFFER_TOO_SMALL
;
return
(
size_t
)
-
1
;
}
_olm_decode_base64
(
their_key
,
their_key_length
,
their_key
);
size_t
ret
=
_olm_decode_base64
(
their_key
,
their_key_length
,
their_key
);
if
(
ret
==
(
size_t
)
-
1
)
{
sas
->
last_error
=
OLM_INVALID_BASE64
;
return
(
size_t
)
-
1
;
}
_olm_crypto_curve25519_shared_secret
(
&
sas
->
curve25519_key
,
their_key
,
sas
->
secret
);
sas
->
their_key_set
=
1
;
return
0
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a 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