From 65d4ac19c82478f7719a47879b1c0ffa99dc19d8 Mon Sep 17 00:00:00 2001 From: David Baker Date: Wed, 19 Sep 2018 14:10:12 +0100 Subject: [PATCH 1/2] Fix output buffer length check ...when generating a key in PkDecryption. The pubkey is base64ed on the output, so will be longer. --- src/pk.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/pk.cpp b/src/pk.cpp index b8fe95b..e646dc4 100644 --- a/src/pk.cpp +++ b/src/pk.cpp @@ -189,7 +189,7 @@ size_t olm_pk_generate_key( void * pubkey, size_t pubkey_length, void * random, size_t random_length ) { - if (pubkey_length < CURVE25519_KEY_LENGTH) { + if (pubkey_length < olm_pk_key_length()) { decryption->last_error = OlmErrorCode::OLM_OUTPUT_BUFFER_TOO_SMALL; return std::size_t(-1); From 8f6e0557eeb3afe1088ce1abfc7351eb697eea24 Mon Sep 17 00:00:00 2001 From: Matthew Hodgson Date: Thu, 27 Sep 2018 18:45:00 +0100 Subject: [PATCH 2/2] oops, fix typo - thanks to @dest4 --- docs/olm.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/olm.rst b/docs/olm.rst index 9f82c8e..9c13478 100644 --- a/docs/olm.rst +++ b/docs/olm.rst @@ -72,7 +72,7 @@ info. Advancing the chain key ~~~~~~~~~~~~~~~~~~~~~~~ -Advancing a chain key takes the previous chain key, :math:`C_{i,j-i}`. The next +Advancing a chain key takes the previous chain key, :math:`C_{i,j-1}`. The next chain key, :math:`C_{i,j}`, is the HMAC-SHA-256_ of ``"\x02"`` using the previous chain key as the key.