Commit 541a2bf6 authored by Tobias Furuholm's avatar Tobias Furuholm Committed by Hubert Chathi
Browse files

Fix length calculation of fallback key json

parent b9771dae
...@@ -316,7 +316,7 @@ std::size_t olm::Account::generate_fallback_key( ...@@ -316,7 +316,7 @@ std::size_t olm::Account::generate_fallback_key(
std::size_t olm::Account::get_fallback_key_json_length( std::size_t olm::Account::get_fallback_key_json_length(
) { ) {
std::size_t length = 4 + sizeof(KEY_JSON_CURVE25519); /* {"curve25519":{}} */ std::size_t length = 4 + sizeof(KEY_JSON_CURVE25519) - 1; /* {"curve25519":{}} */
OneTimeKey & key = current_fallback_key; OneTimeKey & key = current_fallback_key;
if (key.published) { if (key.published) {
length += 1; /* " */ length += 1; /* " */
......
Supports Markdown
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