Commit Graph

21 Commits (master)

Author SHA1 Message Date
Hubert Chathi 8475061136 switch to doctest for unit testing
thanks to Nico Werner, who did most of the porting work
2021-12-22 13:45:33 -05:00
Denis Kasak 5e5e32fe83 fix typo 2021-11-23 22:35:10 +00:00
Hubert Chathi 631f050554 add a test for fallback keys, and clear memory when we forget the old fallback 2021-11-23 22:35:10 +00:00
Hubert Chathi b989db0117 track if fallback keys were published 2021-11-23 22:35:10 +00:00
Hubert Chathi 609e7e8d40 make sure we have enough space for the encrypted and encoded version of the junk 2021-11-17 14:18:03 -05:00
Hubert Chathi 6c552dd7eb use the right size in the tests 2021-08-09 16:21:13 -04:00
Denis Kasak b70e0b06df Differentiate between malformed pickle objects and trailing junk data.
Adds the OLM_PICKLE_EXTRA_DATA error code. We fail with this code when
the pickle object looks right except for some unexpected trailing bytes
which we didn't process.
2021-07-31 01:27:43 +00:00
Denis Kasak d704f4bd3c Fail when an unpickle succeeds but has extra junk data at the end.
Also adds tests to ensure this is working.
2021-07-31 01:27:43 +00:00
Hubert Chathi ea13edcae0 don't use variable length or zero-length arrays in test files
as some compilers don't handle that
2019-04-22 10:12:42 -04:00
Mark Haines 7e9f3bebb8 Document the return values for olm_matches_inbound_session 2016-10-25 14:42:10 +01:00
Richard van der Hoff a7310c5821 Return the base64-encoded length of pickles
make olm_pickle_* return the lengths of the base64-encoded pickles, rather than
the raw pickle. (From the application's POV, the format of the pickle is
opaque: it doesn't even know that it is base64-encoded. So returning the length
of the raw pickle is particularly unhelpful.)
2016-10-24 10:06:06 +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
Richard van der Hoff 4f1bb49d20 Rename olm.hh to olm.h 2016-05-23 18:55:05 +01:00
Mark Haines 3468886e27 Add method getting a session id. Update the python and javascript bindings 2015-07-16 11:45:20 +01:00
Mark Haines a59fbdfe7f Add a test for pickling and unpickling sessions, fix off by one error when unpickling sessions 2015-07-14 11:32:11 +01:00
Mark Haines b6e248c9a5 Output simpler JSON for the account keys, don't sign the JSON but instead provide a olm_account_sign method so that the user of the library can sign the JSON themselves 2015-07-10 11:57:53 +01:00
Mark Haines 373acefde7 Add c bindings for the methods for managing one time keys 2015-07-09 18:35:54 +01:00
Mark Haines 532dc0d4e7 Change the JSON format for one time keys to include what algorithm they are for 2015-07-08 15:30:34 +01:00
Mark Haines 5291ec78b5 Send the public part of the one time key rather than passing an identifier 2015-07-08 14:53:25 +01:00
Mark Haines 3a382aec59 Encode the account keys as a signed JSON object 2015-07-07 16:42:03 +01:00
Matthew Hodgson 09d4125ff1 Rename axolotlpp as olm to avoid confusion with Axolotl-the-spec and Axolotl-the-OWS-libraries at moxie's request 2015-06-27 01:15:23 +02:00