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
Denis Kasak
bdd73c5c32
Fix unpickling error handling.
2021-07-31 01:27:43 +00:00
Hubert Chathi
37c8e14e53
make functions const where possible
2021-06-16 23:22:25 -04:00
Hubert Chathi
7263c4221b
add functions to get the error codes rather than error strings
2021-06-16 22:40:14 -04:00
Denis Kasak
ccc0d122ee
olm_pk_decrypt: Ensure inputs are of correct length.
2021-05-24 15:50:14 +02:00
Hubert Chathi
969c8b45e5
add more consts and comments
2019-05-14 22:02:50 -04:00
Hubert Chathi
0348f06a56
rename functions to be more consistent
2019-03-13 22:39:21 -04:00
Hubert Chathi
48dda7922d
call the right function and remove unnecessary include
2019-02-01 11:39:06 -05:00
David Baker
8df2ab7c07
Add signing class to the pk module
2019-01-29 20:47:41 +00:00
Hubert Chathi
8c1169f0f5
use the correct error code
2018-10-15 10:11:47 -04:00
David Baker
fac1d52dfe
Add aliases for deprecated functions
2018-10-11 18:16:39 +01:00
Hubert Chathi
f6e3f7f44a
Merge branch 'master' into dbkr/pk_private_export_import
2018-10-05 14:52:01 -04:00
Hubert Chathi
8520168e0b
fix some code style issues and typos
2018-10-05 10:35:09 -04: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
65d4ac19c8
Fix output buffer length check
...
...when generating a key in PkDecryption.
The pubkey is base64ed on the output, so will be longer.
2018-09-19 14:10:12 +01:00
Hubert Chathi
dac2c1064e
use void in type signatures for functions with no arguments
2018-06-28 17:13:52 -04:00
Hubert Chathi
f709b062bb
add functions for pickling/unpickling a decryption object
2018-06-28 17:10:36 -04:00
Hubert Chathi
128d45cc83
add initial implementation of basic private key encryption functionality
2018-06-27 16:38:45 -04:00