summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* Better validate that both alg and enc are presentconformanceSimo Sorce2015-03-242-2/+24
| | | | | | JOSE headers must include the "alg" and "enc" options in order to be able to actually process and encrypted token. Return appropriate messages if either is missing.
* Add comments to push user to use JWS()Simo Sorce2015-03-241-1/+4
| | | | | People should not use JWSCore directly unless they know exactly what they are doing. Added doc text to that regard.
* Rename JWE.decrypt() to JWE._decrypt()Simo Sorce2015-03-241-3/+3
| | | | | Make the function private as it is not supposed to be used directly, rather deserialize() should be used.
* Fix AES blocksize handling and check keylengthsSimo Sorce2015-03-182-20/+53
| | | | | | | | | | | | AES blocksize is always 16 regardles of key length naturally. Fix the code to assume the proper blocksize and IV length. Also add tests to check proper key length and add missing A192KW and A256KW key wrapping algorythms. Add tests to try encrypting with all AES key-length combinations. Thanks to Jan Rusnacko for pointing out this flaw. Signed-off-by: Simo Sorce <simo@redhat.com>
* Fix typosSimo Sorce2015-03-181-3/+3
| | | | Signed-off-by: Simo Sorce <simo@redhat.com>
* Change the way operation keys are retrievedSimo Sorce2015-03-184-39/+38
| | | | | | | This way we have less confusion about what the function is supposed to do and less code duplication. Signed-off-by: Simo Sorce <simo@redhat.com>
* The protected header is optional in some casesSimo Sorce2015-03-182-25/+30
| | | | | | | | Allow the use of a JWE without protected headers. Thanks to Jan Rusnacko for pointing out this flaw. Signed-off-by: Simo Sorce <simo@redhat.com>
* Catch incompatible "use" and "key_ops" usageSimo Sorce2015-03-182-0/+34
| | | | | | Thanks to Jan Rusnacko for pointing out this flaw. Signed-off-by: Simo Sorce <simo@redhat.com>
* Allow unknown key parametersSimo Sorce2015-03-182-0/+17
| | | | | | Thanks to Jan Rusnacko for pointing out this flaw. Signed-off-by: Simo Sorce <simo@redhat.com>
* Add more checks, algorithms, testsSimo Sorce2015-03-093-13/+321
|
* Implement JWE JSON DeserializationSimo Sorce2015-03-091-51/+118
| | | | Also fix JWE JSON Serialization bug
* Use a constant time comparison for comparing an HMACAlex Gaynor2015-03-081-2/+2
| | | | Fixes #2
* Add JWE implementationSimo Sorce2015-03-083-26/+524
| | | | | | | Implements: draft-ietf-jose-json-web-encryption-40 plus Tests
* Add JWS implementationSimo Sorce2015-03-084-2/+729
| | | | | | | | | Implements: draft-ietf-jose-json-web-signature-41 plus Tests Signed-off-by: Simo Sorce <simo@redhat.com>
* Add JWK implementationSimo Sorce2015-03-062-0/+432
| | | | | | | | | Implements: draft-ietf-jose-json-web-key-41 plus Tests Signed-off-by: Simo Sorce <simo@redhat.com>
* Initial commitSimo Sorce2015-03-048-0/+244
Project for the implementation of the JOSE WG protocols Add some commong functions. Signed-off-by: Simo Sorce <simo@redhat.com>