Arthur de Jong

Open Source / Free Software developer

summaryrefslogtreecommitdiffstats
path: root/tests/test_write.doctest
Commit message (Collapse)AuthorAgeFilesLines
* Support bytearray for key valuesArthur de Jong2022-01-301-1/+57
| | | | Related to https://github.com/arthurdejong/python-pskc/issues/5
* Increase default PBKDF2 iterations to 100000Arthur de Jong2018-03-111-2/+2
|
* Correctly write a PSKC file without a MAC keyArthur de Jong2018-02-091-0/+92
| | | | | | | | In some cases a PSKC file can be written with a MAC algorithm but without a MAC key. This is possible when the MAC key is not supplied (allowed in older PSKC versions) and a fallback to the encryption key is done. If we have not yet decrypted the file the MAC key is not yet available and so can't be included in the written file.
* Correctly write a PSKC file with a global IVArthur de Jong2018-02-091-1/+39
| | | | | | | This ensures that the encryption IV, which should be per encrypted value is written out per encrypted value instead of globally. This is mostly useful for when reading an old format PSKC file and writing out a RFC 6030 compliant one.
* Implement removing encryptionArthur de Jong2018-02-081-4/+1
| | | | | This adds a function to decrypt all values and remove the encryption of an encrypted PSKC file.
* Not all XML serialisers write namespaces in same orderArthur de Jong2017-12-291-6/+6
| | | | | | This ignores the namespace declarations in the generated XML files because not all implementations on all environments write these in the same order.
* Fix typo in pin_max_failed_attempts attributeArthur de Jong2017-12-181-1/+1
| | | | | This makes the old name (pin_max_failed_attemtps) available as a deprecated property.
* Refactor internal storate of encrypted valuesArthur de Jong2017-12-151-2/+2
| | | | | | | | | | | This changes the way encrypted values are stored internally before being decrypted. For example, the internal _secret property can now be a decrypted plain value or an EncryptedValue instance instead of always being a DataType, simplifying some things (e.g. all XML encoding/decoding is now done in the corresponding module). This should not change the public API but does have consequences for those who use custom serialisers or parsers.
* Replace use of pycrypto utility functionsArthur de Jong2017-10-011-2/+2
| | | | | | This uses os.urandom() as a source for random data and replaces other utility functions. This also removes one import for getting the lengths of Tripple DES keys.
* Implement our own XML formattingArthur de Jong2017-09-251-8/+8
| | | | | | This avoids a using xml.dom.minidom to indent the XML tree and keep the attributes ordered alphabetically. This also allows for customisations to the XML formatting.
* Fix bug in saving PBKDF2 salt on Python3Arthur de Jong2017-09-241-2/+20
| | | | | | | The PBKDF2 salt was saved in the wrong way (b'base64encodeddata' instead of base64encodeddata) when using Python 3. This fixes that problem and tests that saving and loading of a file that uses PBKDF2 key derivation works.
* Close read files in testsArthur de Jong2016-12-191-2/+4
| | | | | This ensures that the files that are read in the test suite are properly closed to avoid leaking open file descriptors.
* Support separate device from keyArthur de Jong2016-09-171-0/+37
| | | | | | | | 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-2/+97
| | | | This enables branch coverage testing and adds tests to improve coverage.
* Add encryption error testsArthur de Jong2016-03-261-0/+74
|
* Add tests for writing encrypted PSKC filesArthur de Jong2016-03-261-0/+175
|
* 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.
* Also check key expiry in may_use()Arthur de Jong2016-03-231-5/+4
|
* 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-191-3/+3
| | | | | | | | | | 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-1/+1
| | | | | This puts the test PSKC files in subdirectories so they can be organised more cleanly.
* 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.
* Support Python 3Arthur de Jong2015-10-061-5/+7
| | | | | | | | 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 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.