diff options
author | Richard van der Hoff <github@rvanderhoff.org.uk> | 2016-09-05 10:36:43 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-09-05 10:36:43 +0100 |
commit | 9d16d820890e7b301baa8b69694aaea19f9bfc7f (patch) | |
tree | 659be65eb1b131073bf9580292214b3fc24aa982 /src/olm.cpp | |
parent | 0c3f527dfd46d3056d5b3690836c102f0e0adfb4 (diff) | |
parent | 39212987bdef8e16794e756e3c78b531be25b70a (diff) |
Merge pull request #13 from matrix-org/rav/split_out_key_lengths
Create new constants for key lengths, etc
Diffstat (limited to 'src/olm.cpp')
-rw-r--r-- | src/olm.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/olm.cpp b/src/olm.cpp index 682a84c..10e00fa 100644 --- a/src/olm.cpp +++ b/src/olm.cpp @@ -436,8 +436,8 @@ size_t olm_create_outbound_session( std::size_t id_key_length = their_identity_key_length; std::size_t ot_key_length = their_one_time_key_length; - if (olm::decode_base64_length(id_key_length) != olm::KEY_LENGTH - || olm::decode_base64_length(ot_key_length) != olm::KEY_LENGTH + if (olm::decode_base64_length(id_key_length) != CURVE25519_KEY_LENGTH + || olm::decode_base64_length(ot_key_length) != CURVE25519_KEY_LENGTH ) { from_c(session)->last_error = OlmErrorCode::OLM_INVALID_BASE64; return std::size_t(-1); @@ -483,7 +483,7 @@ size_t olm_create_inbound_session_from( std::uint8_t const * id_key = from_c(their_identity_key); std::size_t id_key_length = their_identity_key_length; - if (olm::decode_base64_length(id_key_length) != olm::KEY_LENGTH) { + if (olm::decode_base64_length(id_key_length) != CURVE25519_KEY_LENGTH) { from_c(session)->last_error = OlmErrorCode::OLM_INVALID_BASE64; return std::size_t(-1); } @@ -554,7 +554,7 @@ size_t olm_matches_inbound_session_from( std::uint8_t const * id_key = from_c(their_identity_key); std::size_t id_key_length = their_identity_key_length; - if (olm::decode_base64_length(id_key_length) != olm::KEY_LENGTH) { + if (olm::decode_base64_length(id_key_length) != CURVE25519_KEY_LENGTH) { from_c(session)->last_error = OlmErrorCode::OLM_INVALID_BASE64; return std::size_t(-1); } @@ -710,7 +710,7 @@ size_t olm_ed25519_verify( void const * message, size_t message_length, void * signature, size_t signature_length ) { - if (olm::decode_base64_length(key_length) != olm::KEY_LENGTH) { + if (olm::decode_base64_length(key_length) != CURVE25519_KEY_LENGTH) { from_c(utility)->last_error = OlmErrorCode::OLM_INVALID_BASE64; return std::size_t(-1); } |