Skip to content
Snippets Groups Projects
Commit 2f35e0bc authored by Denis Kasak's avatar Denis Kasak
Browse files

olm_sas_set_their_key: Fail early on invalid base64.

parent e82f2601
Branches
Tags
1 merge request!27Decoding fixes for invalid base64 payloads
......@@ -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;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment