aboutsummaryrefslogtreecommitdiff
path: root/src/inbound_group_session.c
AgeCommit message (Collapse)Author
2016-09-13Remove the messsage index from olm_init_inbound_group_session since it is ↵Mark Haines
read from the session_key
2016-09-13Comment on the encoding of the message counter.Mark Haines
2016-09-13Use the ed22519 public key as the group session id.Mark Haines
Some clients expect the session id to be globally unique, so allowing the end devices to pick the session id will cause problems. Include the current ratchet index with the initial keys, this decreases the risk that the client will supply the wrong index causing problems. Sign the initial keys with the ratchet ed25519 key, this reduces the risk of a client claiming a session that they didn't create.
2016-09-06Sign megolm messagesRichard van der Hoff
Add ed25519 keys to the inbound and outbound sessions, and use them to sign and verify megolm messages. We just stuff the ed25519 public key in alongside the megolm session key (and add a version byte), to save adding more boilerplate to the JS/python/etc layers.
2016-05-25Remove session_id from group messagesRichard van der Hoff
Putting the session_id inside the packed message body makes it hard to extract so that we can decide which session to use. We don't think there is any advantage to having thes sesion_id protected by the HMACs, so we're going to move it to the JSON framing.
2016-05-24Separate base64ing from the rest of msg encodingRichard van der Hoff
Factor the actual message encoding/decoding and encrypting/decrypting out to separate functions from the top-level functions which do the base64-wrangling. This is particularly helpful in the 'outbound' code-path where the offsets required to allow room to base64-encode make the flow hard to see when it's all inline.
2016-05-24Update megolm_cipher as a global structRichard van der Hoff
Initialise megolm_cipher via the preprocessor macro, instead of with a function.
2016-05-24Use _olm_unset instead of memsetRichard van der Hoff
memset is at risk of being optimised away, so use _olm_unset instead.
2016-05-24Avoid relying on uint -> int casting behaviourRichard van der Hoff
The behaviour when casting from a uint32_t which has overflowed (so has the top bit set) to int32_t is implementation-defined, so let's avoid relying on it.
2016-05-24Fix up some names, and protobuf tagsRichard van der Hoff
Make names (of session_key and message_index) more consistent. Use our own protobuf tags rather than trying to piggyback on the one-to-one structure.
2016-05-24Support for pickling inbound group sessionsRichard van der Hoff
2016-05-24Implement decrypting inbound group messagesRichard van der Hoff
Includes creation of inbound sessions, etc