-
Notifications
You must be signed in to change notification settings - Fork 143
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use new Secure Message API in PyThemis (#401)
* Use new Secure Message API in PyThemis Straightforward changes to use new C API of Secure Message. We just need to call different functions and that's it. Keep Python method naming the same, we'll update it later separately. * Improve key kind verification and tests Previous implementation allowed to (ab)use SecureMessage class in sign/verify mode by not specifying one of the keys. It is not possible now since we're using the new C API. Now we require both public and private key to be specified at Secure Message construction. Update the tests to verify the new requirement and add more error checking to constructor to ensure that both keys are provided and that they have correct kinds. * Early key kind checks for sign/verify mode Check key kinds in sign/verify mode as well and produce user-friendly error messages. Update the tests to expect ThemisError now if the key is None. Previously this failed on len() method call, now we check the type correctly.
- Loading branch information
Showing
2 changed files
with
78 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters