Arthur de Jong

Open Source / Free Software developer

summaryrefslogtreecommitdiffstats
path: root/pskc/parser.py
Commit message (Collapse)AuthorAgeFilesLines
* Add and cleanup docstringsArthur de Jong2018-02-151-16/+16
| | | | | | | | This adds docstrings to public methods and cleans up a few other docstrings to pass most flake8 docstring related tests. This also adds noqa statements in a few places so we can remove most entries from the global flake8 ignore list.
* Also use EncryptedValue for MAC keyArthur de Jong2018-02-091-2/+2
| | | | | | | | This ensures that an encrypted MAC key is hanled in the same way as normal encrypted data values. This also ensures consistent fallback to the globally configured encryption algorithm if no value has been set in the EncryptedValue.
* Implement signature checkingArthur de Jong2017-12-271-1/+4
| | | | | | | | | | | | | | | This adds support for creating and verifying embedded XML signatures in PSKC files. This uses the third-party signxml library for actual signing and verification. The signxml library has a dependency on lxml and defusedxml (and a few others) but all parts of python-pskc still work correctly with our without lxml and/or defusedxml and signxml is only required when working with embedded signatures. This modifies the tox configuration to skip the signature checks if singxml is not installed and to only require 100% code coverage if the signature tests are done.
* Implement basic parsing of signature propertiesArthur de Jong2017-12-271-0/+30
|
* 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.
* Add limited support for very old draft PSKC versionsArthur de Jong2017-12-151-13/+43
| | | | | | | | | | | | This adds basic support for parsing the PSKC files as specified in draft-hoyer-keyprov-portable-symmetric-key-container-00 and draft-hoyer-keyprov-portable-symmetric-key-container-01. It should be able to extract secrets, counters, etc. but not all properties from the PSKC file are supported. It is speculated that this format resembles the "Verisign PSKC format" that some applications produce.
* Refactor internal storate of encrypted valuesArthur de Jong2017-12-151-22/+60
| | | | | | | | | | | 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.
* Run flake8 from toxArthur de Jong2017-09-201-2/+4
| | | | | This also makes a few small code formatting changes to ensure that the flake8 tests pass.
* Various minor code style improvementsArthur de Jong2017-06-101-1/+4
|
* Normalise key derivation algorithmsArthur de Jong2017-06-101-3/+1
| | | | | This makes KeyDerivation.algorithm and KeyDerivation.pbkdf2_prf properties automatically normalise assigned values.
* Support legacy ActivIdentity filesArthur de Jong2017-01-151-12/+33
| | | | | | This adds support for parsing ActivIdentity files that conform to a very old version of an Internet Draft. The implementation and test were based on a file provided by Jaap Ruijgrok.
* Use original examples from old profiles Internet DraftArthur de Jong2017-01-111-4/+18
| | | | | | | | | | | | | This updates the tests to use the original examples from draft-hoyer-keyprov-pskc-algorithm-profiles-01 instead of modifying them to fit the RFC 6030 schema (but does include some minor changes to make them valid XML). This adds a few additions to the parser to handle legacy challenge and resposne encoding and a few key policy properties. This also includes a fix for 0b757ec in the handling of the <ChallengeFormat> element under a <Usage> element.
* Add support for older Internet Draft versionArthur de Jong2016-12-211-23/+38
| | | | | | | | | | | | | | This adds support for parsing most examples from draft-ietf-keyprov-pskc-02. That file uses a few other names for elements and attributes of the PSKC file and a few other minor differences. The XML parsing has been changed to allow specifying multiple matches and the find*() functions now return the first found match. While all examples from draft-ietf-keyprov-pskc-02 are tested support for verifying digital signatures and asymmetric keys have not yet been implemented.
* Support missing or lowercase version attributeArthur de Jong2016-12-181-2/+2
|
* Also move outer writing and parsing to modulesArthur de Jong2016-09-241-1/+11
|
* Support separate device from keyArthur de Jong2016-09-171-28/+33
| | | | | | | | 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.
* Move document parsing to own moduleArthur de Jong2016-09-171-0/+226
This moves all the parse() functions to a single class in a dedicated module that can be used for parsing PSKC files. This should make it easier to subclass the parser.