Commit graph

10 commits

Author SHA1 Message Date
Richard van der Hoff
8356fa37ad zero out plaintext buffers
Avoid leaving copies of the plaintext sitting around in the emscripten heap.
2016-12-15 13:37:34 +00:00
Richard van der Hoff
76610c0a3a Allocate memory for message blobs on the heap
Messages can be very large, so we don't really want to allocate them on the
stack. Switch to using the heap for them, and try to clean up some of the
string handling while we're at it.
2016-12-14 12:05:56 +00:00
Mark Haines
653790eacb Return the message index when decrypting group messages.
Applications can use the index to detect replays of the same message.
2016-10-20 09:58:55 +01:00
Mark Haines
d7bc00c81d Merge pull request #23 from matrix-org/markjh/remove_message_index
Remove the messsage index from olm_init_inbound_group_session
2016-09-13 17:54:14 +01:00
Mark Haines
a628ef41bd Remove the messsage index from olm_init_inbound_group_session since it is read from the session_key 2016-09-13 17:51:02 +01:00
Mark Haines
6971f54fea Add a olm_inbound_group_session_id method 2016-09-13 17:02:36 +01:00
Richard van der Hoff
c2b51207ee Fix error handling for group sessions
Fix a couple of places where we were using the wrong method to get the last
error.
2016-09-05 19:42:04 +01:00
Richard van der Hoff
1d4c13c798 Fix megolm decryption of UTF-8
Repeat the fix from b10f90d for megolm messages.

It turns out that the 'length' argument to 'Pointer_stringify' doesn't work if
the input includes characters >= 128.

Rather than try to figure out which methods can return UTF-8, and which always
return plain ascii, replace all uses of Pointer_stringify with a 'length'
argument with the version that expects a NULL-terminated input, and extend the
buffer by a byte to allow space for a null-terminator.

In the case of decrypt, we need to add the null ourself.

Fixes https://github.com/vector-im/vector-web/issues/2078.
2016-09-05 00:49:36 +01:00
Richard van der Hoff
389a181ea8 javascript/olm_inbound_group_session.js: fix length arg
message.length counts codepoints; we need bytes.
2016-05-26 13:57:09 +01:00
Richard van der Hoff
013f27f3dc Javascript bindings for group sessions 2016-05-25 17:48:01 +01:00