Commits on Source (64)
-
Christian Heimes authored
setup.cfg adds a flag for universal builds and two aliases to build and upload packages. A PyPY release becomes as simple as python setup.py release Signed-off-by: Christian Heimes <cheimes@redhat.com> Reviewed-by: Simo Sorce <simo@redhat.com> Closes #52
a3499b7e -
Simo Sorce authored
Resolves #53 Signed-off-by: Simo Sorce <simo@redhat.com> Reviewed-by: Hanno Schlichting <hanno@hannosch.eu> Closes #54
af69ffda -
Simo Sorce authored
Where it makes sense, allow to pass in a dictionary for the various headers and auto-encode them as needed. Resolves #53 Signed-off-by: Simo Sorce <simo@redhat.com> Reviewed-by: Hanno Schlichting <hanno@hannosch.eu> Closes #55
7c452b96 -
Simo Sorce authored
Resolves #53 Signed-off-by: Simo Sorce <simo@redhat.com> Reviewed-by: Hanno Schlichting <hanno@hannosch.eu> Closes #56
e0b3d9d2 -
Simo Sorce authored
Create a new jwa module that hosts the actual JWA crypto defined in RFC 7518: JSON Web Algorithms (JWA) Also slightly changes the "none" algorithm to always raise an InvalidSignature error on verify(), as the None signature can never be verified after all. Signed-off-by: Simo Sorce <simo@redhat.com> Reviewed-by: Christian Heimes <cheimes@redhat.com>
bf54a6c3 -
Simo Sorce authored
This keeps all JWA defined algorithms in the same module and make all algorithms use a common way of instantiating and handling crypto Signed-off-by: Simo Sorce <simo@redhat.com> Reviewed-by: Christian Heimes <cheimes@redhat.com> Closes #57 Closes #58
4df4a7b3 -
Simo Sorce authored
If an 'alg' argument is apssed in at key generation, then it can be used to determine the key size appropriate for the desired algorithm. An explicit 'size' argument always takes precendence. An 'alg' parameter is accpeted for 'oct' and 'RSA' keys only. Resolves #50 Signed-off-by: Simo Sorce <simo@redhat.com> Reviewed-by: Christian Heimes <cheimes@redhat.com> Closes #59
06da1cd5 -
Simo Sorce authored
Always use bits to mesure key material sizes through the code. Resolves #49 Signed-off-by: Simo Sorce <simo@redhat.com> Reviewed-by: Christian Heimes <cheimes@redhat.com> Closes #60
f7edc391 -
Simo Sorce authored
Streamline some of the code by using better python conventions/style/syntax/constricts Resolves #61 Resolves #62 Resolves #63 Signed-off-by: Simo Sorce <simo@redhat.com> Reviewed-by: Christian Heimes <cheimes@redhat.com> Closes #64
ccee4027 -
Simo Sorce authored
Keys can be load from PEM files, and Public Keys even from PEM files that have X509 certificates in it. Keys can be exported (either Private or Public) to PEM files. Signed-off-by: Simo Sorce <simo@redhat.com> Closes: #25
9baa1bfa -
Simo Sorce authored
New test properties are: - is_symmetric True if key is symmetric (kty=oct) otherwise False - has_private True if the key is not symmetric and the key has values marked 'Private' according to the JWKValuesRegistry - has_public True if the key is not symmetric and the key has values marked 'Public' according to the JWKValuesRegistry New export helpers are: - export_private() Succeeds only if the key 'has_private' - export_symmetric() Succeeds only if the key 'is_symmetric' Un-deprecates export_public() but adds checks to make it fail if 'has_public' returns False Adds tests. Signed-off-by: Simo Sorce <simo@redhat.com> Closes #45
9282e1e9 -
Simo Sorce authored
RFC 3218 describes an oracle attack called Million Messages Attack against RSA with PKCS1 v1.5 padding. Depending on how JWEs are used a server may become an Oracle, and the mitigation presecribed in RFC 3218 2.3.2 need to be implemented. Many thanks to Dennis Detering for his responsible disclosure and help verifying the mitigation approach. Resolves #65 Signed-off-by: Simo Sorce <simo@redhat.com> Closes #66
eb5be5bd -
Simo Sorce authored
This test is not very reliable and takes a long time so it is provided but diasabled by default. It is only useful to verify if any regression regarding MMA occurs, so it can be just run occasionally. Signed-off-by: Simo Sorce <simo@redhat.com>
19490b84 -
Christian Heimes authored
ECDH-ES is an actual JWA algorithm and not a base class. Therefore it must be a subclass of JWAAlgorithm. New tests will catch these errors in the future. Signed-off-by: Christian Heimes <cheimes@redhat.com> Reviewed-by: Simo Sorce <simo@redhat.com> Closes #67
2869305d -
Simo Sorce authored
Signed-off-by: Simo Sorce <simo@redhat.com>
1ac6f479 -
Ash Berlin authored
This is so that you can add just jwcrypto to the requirements of a downstream project and have it install everything needed -- previously you would also have to add cryptography yourself. Since this was the only thing in requirements.txt I have removed the file Reviewed-by: Simo Sorce <simo@redhat.com> Fixes #69 Closes #70
09d05131 -
Carlos Jenkins authored
Reviewed-by: Simo Sorce <simo@redhat.com> Fixes #71 Closes #72
53cc2720 -
Christian Heimes authored
Signed-off-by: Christian Heimes <cheimes@redhat.com>
c85a52be -
Christian Heimes authored
Signed-off-by: Christian Heimes <cheimes@redhat.com>
b9949a79 -
Simo Sorce authored
Signed-off-by: Simo Sorce <simo@redhat.com> Close #81
bb42eca5 -
Yann Cézard authored19c4d97a
-
James Gardiner authoredf38ff2c3
-
Simo Sorce authored
Use sign() and verify() directly instead. Signed-off-by: Simo Sorce <simo@redhat.com>
ffa4ddae -
Christian Heimes authored
Signed-off-by: Christian Heimes <cheimes@redhat.com>
9203242c -
Christian Heimes authored
Signed-off-by: Christian Heimes <cheimes@redhat.com>
dfd400d8 -
Christian Heimes authored
Signed-off-by: Christian Heimes <cheimes@redhat.com>
a55d16c7 -
Christian Heimes authored
In Python 3, '' != b''. With bytes warning enabled, comparison of bytes and str raise an exception, too. Signed-off-by: Christian Heimes <cheimes@redhat.com>
323327b6 -
Christian Heimes authored
json_decode() returns str instances for str values anyway. In case the JSON payload contains invalid types, base64 codec will fail with an appropriate error message. 'some.string'.split('.') returns a list of str. Signed-off-by: Christian Heimes <cheimes@redhat.com>
68bac873 -
Christian Heimes authored
Signed-off-by: Christian Heimes <cheimes@redhat.com>
8b41d34e -
Christian Heimes authored
Signed-off-by: Christian Heimes <cheimes@redhat.com>
c4637c14 -
Christian Heimes authored
Signed-off-by: Christian Heimes <cheimes@redhat.com>
5ecfa17d -
Michael Boulton authoredadeaa746
-
Michael Boulton authored
If the claim passed was not one of sub, aud, iat, etc. then passing a string as a value to check_claims would raise an error if it was not an integer Add a working test as well
0dab54b0 -
Simo Sorce authored
Fixes #93 Signed-off-by: Simo Sorce <simo@redhat.com>
3db0271a -
Simo Sorce authorede21a20ab
-
Michael Boulton authoredfd425f38
-
Simo Sorce authoreda03a0360
-
Simo Sorce authored
Signed-off-by: Simo Sorce <simo@redhat.com>
8e438cbe -
Simo Sorce authored
This makes it simpler to get a JWK that contains excluively a pulic key from an existing JWK. It fails if no public key is available in the source JWK. Only known public elements are returned. "Unknown" attributes are not copied over. Signed-off-by: Simo Sorce <simo@redhat.com> Resolves #99
31079736 -
Simo Sorce authored
Fixes #92 Signed-off-by: Simo Sorce <simo@redhat.com>
9721a314 -
Simo Sorce authored
Change one test to also test using strings instead of dicts as headers. This is supported in the code but was not tested. Signed-off-by: Simo Sorce <simo@redhat.com> Closes #96
3bc514d4 -
Simo Sorce authored
Modify test to check the header is emitted correctly Signed-off-by: Simo Sorce <simo@redhat.com> Fixes #105
4d92702e -
Simo Sorce authored
Signed-off-by: Simo Sorce <simo@redhat.com>
75ff511b -
Simo Sorce authored
Signed-off-by: Simo Sorce <simo@redhat.com>
69c845c7 -
Michael Boulton authoredbc3708a4
-
Eamonn Nugent authored
There was a typo in the "_EcdhEsAes256Kw" class. I have changed "A128KW" in the description for the class to become "A256KW" in accordance with the algorithm.
39e4ff51 -
Simo Sorce authored
Signed-off-by: Simo Sorce <simo@redhat.com>
34e7919e -
Simo Sorce authored
Signed-off-by: Simo Sorce <simo@redhat.com>
c527234e -
Simo Sorce authored
JWK.from_json(<json_string>) will import a previously exported key. Signed-off-by: Simo Sorce <simo@redhat.com> Fixes: #116
4f3ae07c -
Simo Sorce authored
It has no value to return the 'keys' attribute itself, instead we now we return the inner 'keys' object iterator when the JWKSet is iterated over. This way iterating over the JWKSet object returns its JWK objects. Signed-off-by: Simo Sorce <simo@redhat.com> Fixes #117
0ff425e4 -
Simo Sorce authored
Fixes #120 Signed-off-by: Simo Sorce <simo@redhat.com>
b367cfb0 -
Simo Sorce authored
Signed-off-by: Simo Sorce <simo@redhat.com>
e4b08846 -
Christian Heimes authored
Signed-off-by: Christian Heimes <cheimes@redhat.com>
0115c859 -
Christian Heimes authored
Signed-off-by: Christian Heimes <cheimes@redhat.com>
76e358d0 -
Christian Heimes authored
Signed-off-by: Christian Heimes <cheimes@redhat.com>
02161189 -
mbaldwin authored9f441be9
-
Li lin authoredd0c3ee27
-
Simo Sorce authored
Stop using our own, pyca has has AES Key wrap support for long enough now. Resolves #137 Signed-off-by: Simo Sorce <simo@redhat.com>
e319b0c0 -
Simo Sorce authored
When using ECDH-ES+A[128|192|256]WK key agreement and A128CBC-HS256 encryption the Content Encrypition Key (CEK) has a bigger size than the Key Encryption Key (KEK). Thess tests makes sure we properly handle this case. Signed-off-by: Simo Sorce <simo@redhat.com>
5f9d86ae -
Simo Sorce authored
The code was incorrectly assigning key size for derivation and wrapping when they differ in size. Fixes #136 Signed-off-by: Simo Sorce <simo@redhat.com>
13421b48 -
Simo Sorce authored
Together with non encoded payloads this commit also adds sull support for dealing with detached payloads on deserlization and serialization. The payload must still be provided for any computation, but can be removed before serialization and add after deserialization of a JWS with detached payload. Signed-off-by: Simo Sorce <simo@redhat.com> Fixes #4
2220d100 -
Jonathan Huot authored3c9000fb
-
Jonathan Huot authored
import_keyset no longer returns self.
ea21d349 -
Christian Heimes authored
Signed-off-by: Christian Heimes <cheimes@redhat.com>
jwcrypto/jwa.py
0 → 100644
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
requirements.txt
deleted
100644 → 0
cryptography >= 0.7.2 |
setup.cfg
0 → 100644