Commit graph

304 commits

Author SHA1 Message Date
Richard van der Hoff
214e932806 Merge branch 'rav/ed25519_fix' 2016-09-01 14:06:57 +01:00
Richard van der Hoff
f7c428d62c update changelog
pre-1.0.0 was broken too
2016-09-01 14:00:26 +01:00
Richard van der Hoff
0c462cff11 Fix Ed25519 keypair generation
Ed25519 private keys, it turns out, have 64 bytes, not 32.

We were previously generating only 32 bytes (which is all that is required to
generate the public key), and then using the public key as the upper 32 bytes
when generating the per-message session key. This meant that everything
appeared to work, but the security of the private key was severely compromised.

By way of fixes:

 * Use the correct algorithm for generating the Ed25519 private key, and store
   all 512 bits of it.

 * Update the account pickle format and refuse to load the old format (since we
   should consider it compromised).

 * Bump the library version, and add a function to retrieve the library
   version, so that applications can verify that they are linked against a
   fixed version of the library.

 * Remove the curve25519_{sign, verify} functions which were unused and of
   dubious quality.
2016-09-01 13:35:23 +01:00
Matthew Hodgson
f2906ac0e7 refer to Double Ratchet in readme 2016-07-16 20:56:29 +01:00
Richard van der Hoff
f03febb772 Document the release process 2016-07-11 14:51:04 +01:00
Richard van der Hoff
d30db7b5c0 Makefile rules to build the rst into html 2016-07-11 14:50:49 +01:00
Richard van der Hoff
f3b9c3bbbb Prepare 1.0.0 release 2016-07-11 12:50:11 +01:00
Richard van der Hoff
f2151c0287 Merge branch 'rav/fix_decrypt_utf8' 2016-07-06 22:33:14 +01:00
Richard van der Hoff
939aa747dd JS: make sure returned strings are null-terminated
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/1719.
2016-07-06 22:32:51 +01:00
Emmanuel Gil Peyrot
c8d00665b3 Add an install and an install-debug targets
This makes the user able to use the familiar `make install` syntax, and
allows overriding of the default directories using the DESTDIR and
PREFIX variables, for example:
 make DESTDIR=packaging PREFIX=/usr install
2016-07-05 23:21:28 +01:00
Emmanuel Gil Peyrot
06cdb3f75e Specify the soname in the library and its name
This provides users of this library the guarantee that the ABI will
stay stable when MAJOR will reach 1, and will stay backwards compatible
for the entire duration of the 1.x.y branch.

It does require the maintainers to always update the version in the
Makefile at every ABI change.
2016-07-05 23:21:22 +01:00
Richard van der Hoff
97c110f24b Include chain_index in session pickle
Write a different version of the session pickle for the logging_enabled branch
which includes the chain_index.
2016-06-30 14:14:35 +01:00
Richard van der Hoff
a8d0ac436e Merge branch 'master' into logging_enabled 2016-06-30 14:10:55 +01:00
Richard van der Hoff
d8b24acb77 PR feedback
* write V1 pickles on the master branch
* the logging branch is going to write v0x80000001
2016-06-30 14:01:02 +01:00
Richard van der Hoff
8b19ad3c8e Merge from master
Merges the latest changes from master, having backed out the changes which
removed chain_index tracking, since they are still useful on this branch.
2016-06-30 13:39:40 +01:00
Richard van der Hoff
95327e1f93 Reintroduce chain_index tracking
This is a partial revert of commit 757c422578,
prior to merging into the logging_enabled branch. It re-introduces the
chain_index tracking, without (yet) putting it back into the session pickle.
2016-06-30 11:58:18 +01:00
Richard van der Hoff
8dd3c182ee Make space in the session pickle for chain index
Keeping track of the chain index is a useful thing to do, but is only required
if we've enabled diagnostics. Extend the session pickle format to make a space
for it, so that pickles can be transferred between the logging_enabled branch
and the master branch without loss of information.

Also add some tests for session pickling which explicitly check that we can
unpickle both formats of pickle.
2016-06-30 11:38:01 +01:00
Richard van der Hoff
757c422578 Remove unused 'chain_index' from Ratchet
This was introduced when I was experimenting with support for logging progress
in Olm. That is now relegated to the logging_enabled branch, so this should
probably be removed.

This also fixes the incompatibility of session pickles from the current master
branch with those from olm 0.1.0.
2016-06-30 11:31:36 +01:00
Richard van der Hoff
af45901f76 Merge commit '8036729' into logging_enabled 2016-06-28 14:33:34 +01:00
Richard van der Hoff
61072c640c Merge commit '27b57c8' into logging_enabled 2016-06-28 14:33:19 +01:00
Richard van der Hoff
c7a2359639 Merge commit '54d4301' into logging_enabled 2016-06-28 14:33:09 +01:00
Richard van der Hoff
02bc4ccad9 Merge commit '024685f' into logging_enabled 2016-06-28 14:32:55 +01:00
Richard van der Hoff
cd942f32c1 Merge commit '2e7800c' into logging_enabled 2016-06-28 14:32:32 +01:00
Richard van der Hoff
2f8d7ba80e Merge commit 'b1c5732' into logging_enabled 2016-06-28 14:29:17 +01:00
Richard van der Hoff
070390e180 Merge commit 'ea130ca' into logging_enabled 2016-06-28 14:28:50 +01:00
Richard van der Hoff
ef05676dcb Merge commit 'ff4d210' into logging_enabled 2016-06-28 14:27:56 +01:00
Richard van der Hoff
0d041f08fe Revert "Remove functions which return strings"
We need these functions for the logging_enabled branch.

This reverts commit acae4e8438.
2016-06-28 14:27:08 +01:00
Richard van der Hoff
4a74fd9297 Revert "Remove vestiges of logging"
Re-enable the logging stuff on the logging_enabled branch.

This reverts commit 2a09ccbd63.
2016-06-28 14:26:07 +01:00
Richard van der Hoff
eb3bad7718 Merge commit 'acae4e8' into logging_enabled 2016-06-28 14:16:56 +01:00
Richard van der Hoff
2b7c7eef8c Merge commit 'd37edae' into logging_enabled 2016-06-28 14:16:28 +01:00
Richard van der Hoff
803672931a Put a signature on sent group messages
It's important that group messages be signed by the sender, rather than by a
secret derived from the shared secret.
2016-05-26 18:01:02 +01:00
Richard van der Hoff
7c5ab63fd8 js group demo: use a remoteOps object
To make sure that we don't sneakily use methods which we wouldn't be able to
for remote users, expose an interface object which contains the remote
interface.
2016-05-26 17:14:33 +01:00
Richard van der Hoff
952a3e15cf Merge branch 'rav/group_chat_js_bindings' 2016-05-26 13:58:14 +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
Mark Haines
09b8c3d7bc Merge remote-tracking branch 'matrix/master' 2016-05-26 13:27:23 +01:00
Mark Haines
bfeb554e86 Add a fuzzer for olm_group_decrypt 2016-05-26 13:25:34 +01:00
Richard van der Hoff
315fbfc921 Add a demo for group messaging via the JS bindings 2016-05-25 17:48:01 +01:00
Richard van der Hoff
013f27f3dc Javascript bindings for group sessions 2016-05-25 17:48:01 +01:00
Richard van der Hoff
708fddd747 Remove session_id from group messages
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-25 17:42:32 +01:00
Richard van der Hoff
ee8172d882 Compile some of the crypto libs directly
sha256.c and aes.c contain conflicting declarations, so we need to compile them
as separate units. This requires a bit more Makefile-shuffling; the build
directory now includes 'src' or 'lib' as appropriate, and we just mkdir -p
before each compilation.
2016-05-25 17:08:44 +01:00
Richard van der Hoff
27b57c8d88 Merge branch 'rav/more_group_chat/1' 2016-05-25 15:46:50 +01:00
Richard van der Hoff
fae8dacab5 Add a comment explaining Mark's latest fix 2016-05-25 15:44:39 +01:00
Richard van der Hoff
54d43010c8 Merge branch 'rav/jenkins_build' 2016-05-25 15:33:33 +01:00
Mark Haines
19a7fb5df5 Fix an integer wrap around bug and add a couple more tests 2016-05-25 15:00:05 +01:00
Mark Haines
024685f3db Merge branch 'markjh/fuzzingII' 2016-05-25 14:32:03 +01:00
Richard van der Hoff
01ea3d4b9a Fix handling of integer wraparound in megolm.c 2016-05-24 17:52:35 +01:00
Richard van der Hoff
1f31427139 megolm_advance_to: Remove excessive optimisation
There was some slightly overcomplex logic designed to save a couple of hash
operations when R(0) and R(1) were advanced, but the extra code was hard to
understand and didn't save much.
2016-05-24 17:38:43 +01:00
Richard van der Hoff
ef8d24f483 megolm.c: rewrite counter update
We no longer need to keep track of intermediate values of the counter, which
means we can update it much more easily.
2016-05-24 17:33:41 +01:00
Richard van der Hoff
f3c0dd76d7 megolm.c: Remove spurious arguments to rehash_part
These were left over from when rehash_part did a bunch of logging.
2016-05-24 17:03:42 +01:00
Richard van der Hoff
8d55954ce1 Avoid use of jq in test_olm
I want to use test_olm.sh on jenkins, which lacks jq. Hence, add support to
olm.main to get id and one-time keys individually.
2016-05-24 16:50:26 +01:00