Commit 2f35e0bc authored by Denis Kasak's avatar Denis Kasak
Browse files

olm_sas_set_their_key: Fail early on invalid base64.

parent e82f2601
......@@ -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;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment