Arthur de Jong

Open Source / Free Software developer

summaryrefslogtreecommitdiffstats
path: root/tests/test_misc.doctest
Commit message (Collapse)AuthorAgeFilesLines
* Support separate device from keyArthur de Jong2016-09-171-3/+30
| | | | | | | | This allows having multiple keys per device while also maintaining the previous API. Note that having multiple keys per device is not allowed by the RFC 6030 schema but is allowed by some older internet drafts.
* Improve branch coverageArthur de Jong2016-09-141-0/+8
| | | | This enables branch coverage testing and adds tests to improve coverage.
* Add algorithm_key_lengths propertyArthur de Jong2016-03-261-0/+11
| | | | | This property on the Encryption object provides a list of key sizes (in bytes) that the configured encryption algorithm supports.
* Also check key expiry in may_use()Arthur de Jong2016-03-231-3/+18
|
* Improve tests and test coverageArthur de Jong2016-03-191-2/+6
| | | | | | | | | | 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.
* Support both CheckDigit and CheckDigitsArthur de Jong2016-03-191-0/+21
| | | | | | RFC 6030 is not clear about whether the attribute of ChallengeFormat and ResponseFormat should be the singular CheckDigit or the plural CheckDigits. This ensures that both forms are accepted.
* Implement policy checkingArthur de Jong2016-03-191-0/+41
| | | | | This checks for unknown policy elements in the PSKC file and will cause the key usage policy check to fail.
* Support various integer representationsArthur de Jong2016-03-191-1/+9
| | | | | | | | | | | | | | | | | | | This extends support for handling various encoding methods for integer values in PSKC files. For encrypted files the decrypted value is first tried to be evaluated as an ASCII representation of the number and after that big-endian decoded. For plaintext values first ASCII decoding is tried after which base64 decoding is tried which tries the same encodings as for decrypted values. There should be no possibility for any base64 encoded value (either of an ASCII value or a big-endian value) to be interpreted as an ASCII value for any 32-bit integer. There is a possibility that a big-endian encoded integer could be incorrectly interpreted as an ASCII value but this is only the case for 110 numbers when only considering 6-digit numbers.
* Re-organise test filesArthur de Jong2016-01-301-2/+2
| | | | | This puts the test PSKC files in subdirectories so they can be organised more cleanly.
* Add test for incorrect key derivationArthur de Jong2016-01-301-0/+10
| | | | | If no key derivation algorithm has been specified in the PSKC file an exception should be raised when attempting to perform key derivation.
* Normalise algorithm namesArthur de Jong2016-01-241-1/+1
| | | | | This transforms the algorithm URIs that are set to known values when parsing or setting the algorithm.
* Add encryption algorithm propertyArthur de Jong2016-01-241-1/+12
| | | | | | Either determine the encryption algorithm from the PSKC file or from the explicitly set value. This also adds support for setting the encryption key name.
* Support Python 3Arthur de Jong2015-10-061-4/+14
| | | | | | | | 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.
* Fix issue with namespaced PBKDF2 parametersArthur de Jong2015-10-061-1/+14
| | | | | | | | | | | | The find() utility functions now allow specifying multiple paths to be searched where the first match is returned. This allows handling PSKC files where the PBKDF2 salt, iteration count, key length and PRF elements are prefixed with the xenc11 namespace. A test including such a PSKC file has been included. Thanks to Eric Plet for reporting this.
* Add support for setting secretArthur de Jong2014-06-151-0/+12
| | | | | | This supports setters for the secret, counter, time_offset, time_interval and time_drift properties. Setting these values stores the values unencrypted internally.
* Merge test_minimal into test_miscArthur de Jong2014-05-311-0/+30
|
* Add a test for an odd namespaceArthur de Jong2014-05-311-0/+37