Commit 8ea1c74e2f moved the f.close()
statement to the wrong indention level, thereby closing the file
prematurely when reading Datagroups from a file. Since files are closed
automatically due to the with statement, we just remove the explicit
call to close().
Make sure that the file gets closed when writing a card to/reading a
card from disk. Also add a unit test for the error condition when trying
to import a card from a nonexistent file.
Added a first unit test for the CardGenerator class. It currently only contains
one test case for generating a virtual nPA.
In order to use this test some changes to the TravisCI configuration are
required. Especially the OpenPACE python bindings need to be build before
vsmartcard is being tested since the vsmartcard nPA functions use these
bindings.
- changes DG13 into BirthName, DG19 into eAT ResidencePermit1 and DG20
into eAT ResidencePermit2
- better reading of datasetfile (empty lines are allowed, new line
character is trimmed from value
- Closes#30#33#31
different ATR (Answer To Reset) values depending on used Chip version
It's just a playground, because in past eID client 'Open eCard App' did not recognize the card correctly with newest ATR values.
This patch fixes the remaining Security Environment test cases so that
they will at least run. This has already turned up some
strange/inconsistent behaviour in the Security_Environment class and at
least one bug (incorrect usage of the bertlv_pack function in the
generate_public_key_pair method).
We currently include the PBKDF2 implementation from the PyCrypto author.
This patch removes some of the stuff we do not use and need. In the
future we should move to the PBKDF2 implementation that is nowadays included
in PyCrypto to clean up the code even more.
That new option -d <dataset file> or --datasetfile <dataset file> will read an optional dataset file to be able to start vicc->CardGenerator.py with various content