Fix output buffer length check

...when generating a key in PkDecryption.

The pubkey is base64ed on the output, so will be longer.
This commit is contained in:
David Baker 2018-09-19 14:10:12 +01:00
parent ed02c217e6
commit 65d4ac19c8

View file

@ -189,7 +189,7 @@ size_t olm_pk_generate_key(
void * pubkey, size_t pubkey_length, void * pubkey, size_t pubkey_length,
void * random, size_t random_length void * random, size_t random_length
) { ) {
if (pubkey_length < CURVE25519_KEY_LENGTH) { if (pubkey_length < olm_pk_key_length()) {
decryption->last_error = decryption->last_error =
OlmErrorCode::OLM_OUTPUT_BUFFER_TOO_SMALL; OlmErrorCode::OLM_OUTPUT_BUFFER_TOO_SMALL;
return std::size_t(-1); return std::size_t(-1);