Arthur de Jong

Open Source / Free Software developer

summaryrefslogtreecommitdiffstats
path: root/tests/test_invalid.doctest
Commit message (Collapse)AuthorAgeFilesLines
* Refactor MAC lookupsArthur de Jong2017-06-091-1/+11
| | | | | | | | This switches to using the hashlib.new() function to be able to use all hashes that are available in Python (specifically RIPEMD160). This also adds a number of tests for HMACs using test vectors from RFC 2202, RFC 4231 and RFC 2857.
* Allow MAC over plaintext or ciphertextArthur de Jong2016-12-201-25/+16
| | | | | | | | | | | | | | | | | | RFC 6030 implies that the MAC should be performed over the ciphertext but some earlier drafts implied that the MAC should be performed on the plaintext. This change accpets the MAC if either the plaintext or ciphertext match. Note that this change allows for a padding oracle attack when CBC encryption modes are used because decryption (and unpadding) needs to be done before MAC checking. However, this module is not expected to be available to users to process arbitrary PSKC files repeatedly. This removes the tests for a missing MAC key (and replaces it for tests of missing EncryptionMethod) because falling back to using the encryption key (implemented in a444f78) in combination with this change means that decryption is performed before MAC checking and is no longer possible to trigger a missing MAC key error.
* Some minor improvements to the testsArthur de Jong2016-09-141-1/+9
|
* Improve branch coverageArthur de Jong2016-09-141-0/+26
| | | | This enables branch coverage testing and adds tests to improve coverage.
* Fall back to encryption key for MACArthur de Jong2016-04-231-0/+12
| | | | | | This uses the encryption key also as MAC key if no MAC key has been specified in the PSKC file. Earlier versions of the PSKC draft specified this behaviour.
* Improve tests and test coverageArthur de Jong2016-03-191-16/+46
| | | | | | | | | | This adds tests to ensure that incorrect attribute and value types in the PSKC file raise a ValueError exception and extends the tests for invalid encryption options. This removes some code or adds no cover directives to a few places that have unreachable code or are Python version specific and places doctest directives inside the doctests where needed.
* Re-organise test filesArthur de Jong2016-01-301-10/+10
| | | | | This puts the test PSKC files in subdirectories so they can be organised more cleanly.
* Fix doctest: IGNORE_EXCEPTION_DETALMathias Laurin2015-11-301-5/+5
|
* Support Python 3Arthur de Jong2015-10-061-5/+6
| | | | | | | | This enables support for Python 3 together with Python 2 support with a single codebase. On Python 3 key data is passed around as bytestrings which makes the doctests a little harder to maintain across Python versions.
* Add tests for missing or invalid MACArthur de Jong2014-06-141-0/+40
| | | | This tests for incomplete, unknown or invalid MACs in PSKC files.
* Add tests for key derivation problemsArthur de Jong2014-05-291-0/+39
| | | | | This tests for unknown or missing algorithms and unknown derivation parameters.
* Add test for missing key encryption algorithmArthur de Jong2014-05-291-0/+7
| | | | | This also introduces a toplevel PSKCError exception that all exceptions have as parent.
* Raise an exception if decryption failsArthur de Jong2014-05-251-0/+15
|
* Add tests for invalid PSKC filesArthur de Jong2014-05-231-0/+42