Commit graph

14 commits

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
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
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
Lukas Lihotzki
be0c31894a fix memory leaks in tests 2020-10-01 15:39:48 +02: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
Hubert Chathi
157c0fa67e remove some debugging output from tests 2019-04-22 10:11:43 -04:00
Hubert Chathi
d5c0eb9d20 update unit test to match function name change 2019-03-28 13:38:08 -04:00
David Baker
8df2ab7c07 Add signing class to the pk module 2019-01-29 20:47:41 +00:00
David Baker
0346145a81 Work with PkDecryption keys by their private keys
Change interface to allow the app to get the private part of the
key and instantiate a decryption object from just the private part
of the key.

Changes the function generating a key from random bytes to be
initialising a key with a private key (because it's exactly the
same thing). Exports & imports private key parts as ArrayBuffer at
JS level rather than base64 assuming we are moving that way in
general.
2018-10-02 12:02:56 +01:00
David Baker
2835110cee Remove trailing letter 'K's from the test pubkeys
base64 encoded newlines somehow?
2018-10-01 20:01:47 +01:00
Hubert Chathi
f709b062bb add functions for pickling/unpickling a decryption object 2018-06-28 17:10:36 -04:00
Hubert Chathi
b91c77721d improve public key encryption unit test 2018-06-28 15:11:53 -04:00
Hubert Chathi
128d45cc83 add initial implementation of basic private key encryption functionality 2018-06-27 16:38:45 -04:00