diff options
author | Richard van der Hoff <github@rvanderhoff.org.uk> | 2016-09-06 15:53:06 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-09-06 15:53:06 +0100 |
commit | 79485b223014923636d8f95bac9b4baf265e958e (patch) | |
tree | 9b89ee865fc3b71f07d645dcd5c499672bca83eb /include/olm | |
parent | 50cd2b2a430b379bf6cee1259867faa08daea1b7 (diff) | |
parent | 2fc83aa9aca1ce84b3c425a670cdf6a3a8886b34 (diff) |
Merge pull request #19 from matrix-org/rav/megolm_signing
Sign megolm messages
Diffstat (limited to 'include/olm')
-rw-r--r-- | include/olm/error.h | 5 | ||||
-rw-r--r-- | include/olm/inbound_group_session.h | 2 | ||||
-rw-r--r-- | include/olm/message.h | 8 |
3 files changed, 11 insertions, 4 deletions
diff --git a/include/olm/error.h b/include/olm/error.h index 1c44de8..9d44a94 100644 --- a/include/olm/error.h +++ b/include/olm/error.h @@ -46,6 +46,11 @@ enum OlmErrorCode { */ OLM_BAD_LEGACY_ACCOUNT_PICKLE = 13, + /** + * Received message had a bad signature + */ + OLM_BAD_SIGNATURE = 14, + /* remember to update the list of string constants in error.c when updating * this list. */ }; diff --git a/include/olm/inbound_group_session.h b/include/olm/inbound_group_session.h index e24f377..49992b2 100644 --- a/include/olm/inbound_group_session.h +++ b/include/olm/inbound_group_session.h @@ -97,7 +97,7 @@ size_t olm_init_inbound_group_session( OlmInboundGroupSession *session, uint32_t message_index, - /* base64-encoded key */ + /* base64-encoded keys */ uint8_t const * session_key, size_t session_key_length ); diff --git a/include/olm/message.h b/include/olm/message.h index 5eb504d..61012c9 100644 --- a/include/olm/message.h +++ b/include/olm/message.h @@ -37,7 +37,8 @@ extern "C" { size_t _olm_encode_group_message_length( uint32_t chain_index, size_t ciphertext_length, - size_t mac_length + size_t mac_length, + size_t signature_length ); /** @@ -49,7 +50,8 @@ size_t _olm_encode_group_message_length( * output: where to write the output. Should be at least * olm_encode_group_message_length() bytes long. * ciphertext_ptr: returns the address that the ciphertext - * should be written to, followed by the MAC. + * should be written to, followed by the MAC and the + * signature. * * Returns the size of the message, up to the MAC. */ @@ -76,7 +78,7 @@ struct _OlmDecodeGroupMessageResults { */ void _olm_decode_group_message( const uint8_t *input, size_t input_length, - size_t mac_length, + size_t mac_length, size_t signature_length, /* output structure: updated with results */ struct _OlmDecodeGroupMessageResults *results |