Arthur de Jong

Open Source / Free Software developer

summaryrefslogtreecommitdiffstats
path: root/tests
Commit message (Collapse)AuthorAgeFilesLines
...
* Allow global specification of IVArthur de Jong2016-04-232-0/+49
| | | | | | In older versions of the PSKC standard it was allowed to have a global initialization vector for CBC based encryption algorithms. It is probably not a good idea to re-use an IV in general.
* Add encryption error testsArthur de Jong2016-03-261-0/+74
|
* Add tests for writing encrypted PSKC filesArthur de Jong2016-03-261-0/+175
|
* Allow configuring PBKDF2 key derivationArthur de Jong2016-03-261-0/+58
| | | | | This factors out the PBKDF2 key derivation to a separate function and introduces a function to configure KeyDerivation instances with PBKDF2.
* Allow configuring a MAC keyArthur de Jong2016-03-261-0/+27
| | | | | This method will set up a MAC key and algorithm as specified or use reasonable defauts.
* Write encryption key informationArthur de Jong2016-03-261-0/+4
| | | | | | This writes information about a pre-shared key or PBKDF2 key derivation in the PSKC file. This also means that writing a decrypted version of a previously encrypted file requires actively removing the encryption.
* 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-233-10/+26
|
* Support writing to text streams in Python 3Arthur de Jong2016-03-191-3/+1
| | | | | This supports writing the XML output to binary streams as well as text streams in Python 3.
* Improve tests and test coverageArthur de Jong2016-03-1912-54/+162
| | | | | | | | | | 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-192-0/+75
| | | | | | 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-192-0/+122
| | | | | This checks for unknown policy elements in the PSKC file and will cause the key usage policy check to fail.
* Add a few tests for vendor filesArthur de Jong2016-03-194-0/+434
| | | | | Some vendor-specific files were lifted from the LinOTP test suite and another Feitian file was found in the oath-toolkit repository.
* Support various integer representationsArthur de Jong2016-03-192-1/+56
| | | | | | | | | | | | | | | | | | | 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-3034-32/+32
| | | | | 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-242-2/+17
| | | | | | 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.
* Fix a problem when writing previously encrypted fileArthur de Jong2016-01-241-0/+21
| | | | | This fixes a problem with writing a PSKC file that is based on a read file that was encrypted.
* Fix doctest: IGNORE_EXCEPTION_DETALMathias Laurin2015-11-301-5/+5
|
* Support Python 3Arthur de Jong2015-10-068-99/+131
| | | | | | | | 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-062-1/+114
| | | | | | | | | | | | 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.
* Move encryption functions in pskc.crypto packageArthur de Jong2014-10-092-2/+2
| | | | | | This moves the encryption functions under the pskc.crypto package to more clearly separate it from the other code. Ideally this should be replaced by third-party library code.
* Add test for writing PSKC filesArthur de Jong2014-06-281-0/+143
| | | | | This makes a simple doctest that checks the writing of the XML representation of the PSKC data.
* 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.
* Add tests for missing or invalid MACArthur de Jong2014-06-144-0/+172
| | | | This tests for incomplete, unknown or invalid MACs in PSKC files.
* Add MAC tests to all CBC encrypted keysArthur de Jong2014-06-145-0/+52
| | | | | This adds hmac-sha224, hmac-sha256, hmac-sha384 and hmac-sha512 tests for values that are encrypted using CBC block cypher modes.
* Support kw-tripledes decryptionArthur de Jong2014-05-312-0/+41
| | | | | This adds support for key unwrapping using the RFC 3217 Triple DES key wrap algorithm if the PSKC file uses this.
* Implement RFC 3217 Triple DES key wrappingArthur de Jong2014-05-311-0/+85
|
* Merge test_minimal into test_miscArthur de Jong2014-05-312-51/+30
|
* Add an ActivIdentity-3DES testArthur de Jong2014-05-312-0/+79
| | | | | The test is taken from draft-hoyer-keyprov-pskc-algorithm-profiles-01 modified to fit the schema as described in RFC 6030.
* Add an SecurID-AES-Counter testArthur de Jong2014-05-312-0/+69
| | | | | The test is taken from draft-hoyer-keyprov-pskc-algorithm-profiles-01 modified to be valid XML and to fit the schema as described in RFC 6030.
* Add an TOTP testArthur de Jong2014-05-312-0/+72
| | | | | The test is taken from draft-hoyer-keyprov-pskc-algorithm-profiles-01 modified to fit the schema as described in RFC 6030.
* Add an OCRA testArthur de Jong2014-05-312-0/+92
| | | | | The test is taken from draft-hoyer-keyprov-pskc-algorithm-profiles-01 modified to fit the schema as described in RFC 6030.
* Add a test for an odd namespaceArthur de Jong2014-05-312-0/+59
|
* Support kw-aes128, kw-aes192 and kw-aes256Arthur de Jong2014-05-304-0/+117
| | | | | This adds support for key unwrapping using the RFC 3394 or RFC 5649 algorithm if the PSKC file uses this.
* Implement padding as specified in RFC 5649Arthur de Jong2014-05-301-1/+79
| | | | This adds a pad argument with which padding can be forced or disabled.
* Allow speciying an initial value for key wrappingArthur de Jong2014-05-301-0/+17
|
* Provide an RFC 3394 AES key wrapping algorithmArthur de Jong2014-05-301-0/+101
| | | | This also introduces an EncryptionError exception.
* Always put a space between RFC and numberArthur de Jong2014-05-298-26/+27
|
* Support Tripple DES decryptionArthur de Jong2014-05-292-0/+40
|
* 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-292-1/+24
| | | | | This also introduces a toplevel PSKCError exception that all exceptions have as parent.
* Add test for all AES-CBC encryption schemesArthur de Jong2014-05-294-0/+131
|
* Add test for missing secret valueArthur de Jong2014-05-291-0/+2
|
* Add a function for adding a new keyArthur de Jong2014-05-251-1/+10
|
* Support creating an empty PSKC instanceArthur de Jong2014-05-251-0/+5
|
* Raise an exception if decryption failsArthur de Jong2014-05-253-2/+50
|
* Add tests for invalid PSKC filesArthur de Jong2014-05-234-0/+65
|
* Use pskcxml as file name extensionArthur de Jong2014-05-238-7/+7
| | | | This is the extension that is suggested in RFC6030.