summaryrefslogtreecommitdiffstats
path: root/custodia/message/kem.py
Commit message (Collapse)AuthorAgeFilesLines
* Add support in the client for the kem message typeSimo Sorce2015-11-061-5/+9
| | | | | | | This allows to easily use end-to-end encrypted requests and replies to fetch secrets. Signed-off-by: Simo Sorce <simo@redhat.com>
* Fix KEM messages handling when storing data.Simo Sorce2015-11-061-3/+11
| | | | | | | | The payload was not being set with the provided value when a PUT operation token was parsed. This resulted in attempting to store an empty value instead of the provided secret. Signed-off-by: Simo Sorce <simo@redhat.com>
* Use Python's logging framework for loggingChristian Heimes2015-10-201-2/+3
| | | | | | | | | | The custom logging and traceback functions as well as the audit logger are replaced with Python's logging framework. For now the loggers are hard-coded to use a StreamHandler(sys.stderr) as root handler and a FileHandler for the audit log. Signed-off-by: Christian Heimes <cheimes@redhat.com> Reviewed-by: Simo Sorce <simo@redhat.com>
* Make tox pep8 happySimo Sorce2015-10-191-25/+25
| | | | | Signed-off-by: Simo Sorce <simo@redhat.com> Reviewed-by: Christian Heimes <cheimes@redhat.com>
* Fix pep8 issuesSimo Sorce2015-10-191-1/+1
| | | | | Signed-off-by: Simo Sorce <simo@redhat.com> Reviewed-by: Christian Heimes <cheimes@redhat.com>
* Make KEMClient actually check the replySimo Sorce2015-07-091-18/+24
| | | | | | | | | Uses the same method as the server, the request and response are quite symmetrical here. also fix a bug with the subject name missing in the replies. Adapt tests. Signed-off-by: Simo Sorce <simo@redhat.com>
* Fix typos in tests and add cleanupChristian Heimes2015-07-081-1/+1
| | | | | | | | | The patch fixes to typos in the tear down function of two test suites. The tests now cleanup and remove temporary files like Unix socket and test databases. Reviewed-by: Simo Sorce <simo@redhat.com> Closes: #3
* Fix Python 3 portablility issuesSimo Sorce2015-06-071-2/+2
| | | | Signed-off-by: Simo Sorce <simo@redhat.com>
* Use reasonable algorithms based on key typeSimo Sorce2015-06-051-8/+11
| | | | | | | If 'signing_algorithms' is not explicitly set in the configuration file use a reasonable default based on the server key type. Signed-off-by: Simo Sorce <simo@redhat.com>
* Fix name checking for kem backendSimo Sorce2015-06-051-2/+3
| | | | Signed-off-by: Simo Sorce <simo@redhat.com>
* Change KEMClient to be able to encrypt requestsSimo Sorce2015-06-051-30/+50
| | | | | | | Also fix errors in handling encrypted requests, as well errors in the test suite. Signed-off-by: Simo Sorce <simo@redhat.com>
* Add basic debugging capabilitiesSimo Sorce2015-06-051-1/+4
| | | | | | | If debug is set to True, then custodia's own Exception handlers will print a stack trace to standard output to aid debugging. Signed-off-by: Simo Sorce <simo@redhat.com>
* Assume keys are JWK objectsSimo Sorce2015-06-041-5/+7
| | | | | | | | This way clients that already have JWK key objects do not have to export/import them. Other clients can simply call JWK upfront like in the modified test. Signed-off-by: Simo Sorce <simo@redhat.com>
* Add client class to build and parse kem tokensSimo Sorce2015-06-041-5/+32
| | | | | | This makes it easier to build clients. Signed-off-by: Simo Sorce <simo@redhat.com>
* Change KEM Parsing to actually check claimsSimo Sorce2015-06-041-8/+18
| | | | | | | The name ('sub') and the time ('exp') must be checked before letting the reuqest proceed. Signed-off-by: Simo Sorce <simo@redhat.com>
* Do not use the same key for encryption and signingSimo Sorce2015-06-031-37/+94
| | | | | | | | | | using the same key for signing and encryption is generally a frown upon approach in the scirty community as it may lead to some attacks. Change the code to use key pairs, where the first key is the signing key and the second one is the encryption key. Signed-off-by: Simo Sorce <simo@redhat.com>
* Use str to give back more human readable messagesSimo Sorce2015-05-281-2/+2
| | | | | | | These messages are returned as is by the HTTP server as the status code reason, str() returns a more human readable format. Signed-off-by: Simo Sorce <simo@redhat.com>
* Remove pylint star-args exceptionsSimo Sorce2015-05-261-5/+5
| | | | | | | | | | | Newer pylint version completely removed the star-args warning, including recognizing the exception in the source code. Remove it from all source code to avoid annoyinf pylint errors about unrecognized exceptions, and add a general exception in the pylint makefile invocation, as apparently it is ok there. This will avoid warnings if older versions of pylint are used. Signed-off-by: Simo Sorce <simo@redhat.com>
* Add support for signed/encrypted messagesSimo Sorce2015-04-271-0/+275
The new 'kem' type allows the backend to authorize access to keys based on a signed request where the key mus be whitelisted in advance in a kemkeys database. The reply is encrypted with the client public key. Signed-off-by: Simo Sorce <simo@redhat.com>