aboutsummaryrefslogtreecommitdiff
path: root/src/pk.cpp
diff options
context:
space:
mode:
authorDavid Baker <dbkr@users.noreply.github.com>2018-09-20 11:30:27 +0100
committerGitHub <noreply@github.com>2018-09-20 11:30:27 +0100
commitd6cd18df403e4323ee583b1029989eff26b33459 (patch)
treee351a066d3a6c03f603a2d2870a2b12053a297df /src/pk.cpp
parented02c217e6f7e95e495c241c8ff27ef6b5dd8417 (diff)
parent65d4ac19c82478f7719a47879b1c0ffa99dc19d8 (diff)
Merge pull request #55 from matrix-org/dbkr/pk_key_length
Fix output buffer length check
Diffstat (limited to 'src/pk.cpp')
-rw-r--r--src/pk.cpp2
1 files changed, 1 insertions, 1 deletions
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);