Commit graph

98 commits

Author SHA1 Message Date
Damir Jelić
701f9c765d python: Expose the method to forget the old fallback key 2021-11-24 20:06:24 +01:00
Damir Jelić
85a2f47088 python: Use the unpublished fallback key lenght when outputing fallback keys 2021-11-24 20:06:24 +01:00
Damir Jelić
8c62046392 python: Add support to generate fallback keys 2021-11-24 20:06:24 +01:00
Damir Jelić
845e7cb43b python: Remove Python 2 from the makefile 2021-11-24 20:06:24 +01:00
Hubert Chathi
8656f1463c release 3.2.6 2021-09-16 17:16:56 -04:00
Hubert Chathi
c81dfd0718 fix Python build 2021-09-16 17:06:45 -04:00
Hubert Chathi
904e80b75f release 3.2.5 2021-09-15 19:15:58 -04:00
Hubert Chathi
2aad86ea84 fix Python build 2021-06-17 11:56:08 -04:00
Hubert Chathi
64afab9364 prepare for release 2021-06-01 13:44:45 -04:00
Hubert Chathi
22bc1155ed prepare for release 2021-05-24 10:29:24 -04:00
Arun Babu Neelicattu
0684eb4564 ci: add initial build pipeline 2021-05-10 20:40:42 +00:00
Arun Babu Neelicattu
b0a05976ea python: remove tox basepython configuration 2021-05-10 20:40:42 +00:00
Hubert Chathi
3745ea57bb bump version number and add changelog 2021-02-22 17:06:13 -05:00
Hubert Chathi
c4d737c86c bump version numbers and update changelog 2020-10-06 17:39:48 -04:00
Hubert Chathi
4d17aa4f05 bump version numbers and update changelog 2020-10-06 15:08:10 -04:00
Hubert Chathi
0e6ec3062d remove other_key checks from Python binding since it's done in C now 2020-09-24 18:56:19 +00:00
Hubert Chathi
8a958beb48 bump version info for release 2020-06-11 11:47:50 -04:00
Hubert Chathi
efd17631b1 move -o option before source files, for better compatibility with LLVM 2020-05-19 15:10:24 -04:00
Hubert Chathi
6753595300 release 3.1.4 2019-10-09 12:33:47 -04:00
Hubert Chathi
c463d8b55b Merge branch 'python/drop-hypothesis' into 'master'
tests: Drop hypothesis from the python tests.

See merge request matrix-org/olm!5
2019-07-03 19:27:30 +00:00
Hubert Chathi
ebd3ba6cc1 release 3.1.3 2019-06-24 17:09:41 -04:00
Matthew Hodgson
ae38f2c5a0 Merge branch 'python/unicode_decode_errors' into 'master'
Python unicode decode errors when decrypting.

See merge request matrix-org/olm!4
2019-06-22 17:06:02 +00:00
Damir Jelić
61175c969b tests: Simplify the input parameter for the Unicode decoding tests. 2019-06-20 14:08:21 +02:00
Damir Jelić
28350d612e tests: Use Unicode literals in the Unicode decoding tests.
This is needed because the function returns Unicode strings and the
comparison will fail under python2 unless Unicode literals are used.
2019-06-20 14:07:14 +02:00
Damir Jelić
5d7070d2f3 tests: Simplify the sha256 tests for python.
Hypothesis isn't used anymore and the strings are now constants, meaning
that the hashes should never match.
2019-06-20 13:55:03 +02:00
Damir Jelić
125c62098c tests: Drop hypothesis from the tests.
Hypothesis recently had some problems with the typing module breaking
the tox tests.

Since Hypothesis isn't really used much in the test this patch removes
it from them as well as from the test-requirements.
2019-06-20 13:45:33 +02:00
Damir Jelić
c4d703ac3d _compat: Make the encoding argument explicit in to_unicode_str(). 2019-06-20 12:24:08 +02:00
Damir Jelić
7538a1eccf olm: Rename the errors function argument in the decryption functions. 2019-06-20 12:16:37 +02:00
Damir Jelić
fec41f9540 _compat: Remove the now unused native_str. 2019-06-19 15:07:14 +02:00
Damir Jelić
5e24c605d2 _compat: Change the to_native_str into a to_unicode_str function.
The to_native_str function was supposed to produce Unicode decoded
native strings for python2 and python3.

Upon further consideration this doesn't make much sense since under
python2 it would need to decode the bytes into a Unicode string and turn
it back into a python2 str.

The ability to use the replacement character requires us to use a
Unicode string under python2 as well.
2019-06-19 15:03:57 +02:00
Damir Jelić
ba65551d5f _compat: Remove unused import. 2019-06-19 14:42:58 +02:00
Damir Jelić
9faa100c6a Makefile: Add an isort target. 2019-06-18 13:52:02 +02:00
Damir Jelić
2f5590bf38 olm: Allow decryption functions to define how to handle unicode decode errors.
This patch changes the decryption functions not to fail if there was an
unicode decode error while converting the decrypted bytes plaintext into
a native python string.

Characters that cannot be decoded as unicode are now replaced with the
unicode replacement character (U+FFFD).

The old behaviour of raising an UnicodeDecodeError can be achieved by
passing the "strict" error handling scheme to the decrypt function.
2019-06-18 13:50:46 +02:00
Damir Jelić
e1a4e6ebf1 compat: Add a method to convert bytes to a string that handles unicode errors. 2019-06-18 13:44:22 +02:00
Hubert Chathi
769d013ef7 release 3.1.2 2019-04-30 18:25:21 -04:00
Hubert Chathi
6aafd69f8f bump version number for 3.1.1 2019-04-29 15:01:09 -04:00
Hubert Chathi
bac8ca7802 prepare for 3.1.0 release 2019-04-17 17:31:01 -04:00
Hubert Chathi
0d0169c839
Merge pull request #86 from matrix-org/add_python_pk_signing
add python bindings for PK signing
2019-04-12 19:21:17 -04:00
Hubert Chathi
ab6e8d5086 more isort 2019-04-12 19:17:06 -04:00
Hubert Chathi
107adba241 isort python/olm/pk.py 2019-04-12 13:02:57 -04:00
Damir Jelić
54cb52e05e python: Add the SAS header to the manifest.
The SAS header is required to build the package therefore it needs to be
shipped with the source distribution of the package.

Adding it to the manifest achieves this.
2019-04-09 11:41:44 +02:00
Damir Jelić
32b99b7935 python: Add support for the long KDF MAC calculation. 2019-04-09 10:57:36 +02:00
Damir Jelić
659eb34fa4 python: Remove an unneeded and old copyright header. 2019-04-09 10:47:26 +02:00
Hubert Chathi
74e9300daf add python bindings for PK signing 2019-04-08 17:19:47 -04:00
Hubert Chathi
2a6400716c
Merge branch 'master' into poljar/python-sas 2019-04-08 15:08:17 -04:00
Damir Jelić
709687a7b5 python: Build the build headers with setup.py.
This allows downstream users to install this python module with pip as
well as allowing people to declare it as a dependency in their setup.py.

Signed-off-by: Damir Jelić <poljar@termina.org.uk>
2019-04-08 15:04:32 -04:00
Damir Jelić
f1d45c2cd3 python: Fix the MANIFEST file.
This patch adds the Olm header files to the manifest, this results in
the header files being added to source distributions of the python-olm
module.

The headers are required to build the module. Including them in the
source distribution is the easiest way to make sure that builds from the
source distribution will succeed provided that the Olm C library is
already installed.

Signed-off-by: Damir Jelić <poljar@termina.org.uk>
2019-04-08 15:04:32 -04:00
Damir Jelić
f160d693b6 python: Add PK bindings.
This patch adds bindings to the PK part of the Olm library contained in
the pk.h header file.

Encryption, decryption as well as pickling/unpickling of the decryption
object is supported.

Signed-off-by: Damir Jelić <poljar@termina.org.uk>
2019-04-08 15:04:32 -04:00
Damir Jelić
0883a922ff python: Make the typing module a requirement only for old python versions.
Typing is part of standard library from python 3.5 and from python 3.7
onwards trying to install it results in an error.

This patch disables typing installation on python versions that are
newer than 3.5.

Signed-off-by: Damir Jelić <poljar@termina.org.uk>
2019-04-08 15:04:32 -04:00
Damir Jelić
fcfa5f12a4 python: Expose the sha256() function in the utilities.
Signed-off-by: Damir Jelić <poljar@termina.org.uk>
2019-04-02 12:56:59 +02:00