Commit Graph

310 Commits

Author SHA1 Message Date
Rob
d40b203774 Fix cast of APDU res to byte array (aka string) 2018-10-26 13:00:32 +02:00
Frank Morgner
5082ab09d4 vicc: temporarily drop python3 compatibility for relay
fixes https://github.com/frankmorgner/vsmartcard/issues/129
2018-10-20 04:05:44 +02:00
Frank Morgner
04642a3bfc fixed more Python 3 issues
also fixes the debug output
2018-05-03 22:55:10 +02:00
Frank Morgner
3b7c04c535 added more Python 3 compatibility
fixes https://github.com/frankmorgner/vsmartcard/issues/71
2018-05-03 16:30:08 +02:00
Frank Morgner
ae0d04f8b7 added some Python 3 compatibility 2018-05-02 16:21:44 +02:00
Dániel SÜTTŐ
a9482d9f99 Use at least two bytes for filesize in FCP template (#116)
* Fix length of filesize parameter in FCP template

'Number of data bytes in the file' parameters should be represented on
two bytes in FCP.

* Extendable length of filesize parameter in FCP

Increase length of filesize parameter in FCP template if can't be
represented on two bytes.
2018-01-10 23:07:08 +01:00
Dániel SÜTTŐ
b0783bd373 Fix selection by DF name (#118)
DF names shall be globally uniqe within a given card. Selecting by DF
name should be made on card level instead of current DF level.

A new list has been inroduced as a static attribute of MF in order to
track each named DF.

* Prevent prettyprint from infinite recursion

By adding a possible self-pointer to MF prettyprint_anything function
got into an infinite loop. Printing of named DFs has been cut off.
2018-01-10 23:01:56 +01:00
Daniel SUTTO
0f4e79db17 Fix SFID parameter in FCP template
In FCP SFID tag bits 8 to 4 encode the short EF identifier.
2018-01-08 13:03:32 +01:00
Daniel SUTTO
666294b313 Fix missing raise statement before SwError 2018-01-08 12:29:44 +01:00
Frank Morgner
377774fd65 vicc: catch ctrl-c via KeyboardInterrupt
... and ignore EINT in recv as it may be triggered for various other reasons

fixes https://github.com/frankmorgner/vsmartcard/issues/95
2017-04-05 12:20:20 +02:00
Frank Morgner
eb4c8a8103 fixed distcheck 2016-10-10 10:33:09 +02:00
Frank Morgner
fd8ae7c7c8 Merge pull request #78 from d0/no_serialization
Remove serialization support
2016-05-15 17:32:03 +02:00
Frank Morgner
0d1977fc1a print QR code in case of reversed mode 2016-04-15 11:11:15 -04:00
Dominik
41bd7ab105 Remove serialization support 2016-04-10 19:31:24 +02:00
Dominik
de683869b4 Refactored the python files in the cards directory according to PEP8 2016-03-19 10:04:16 +01:00
Dominik
33dc00e175 Fix broken function SmartcardSAM.set_asym_cipher 2016-03-19 07:35:15 +01:00
Dominik
c0bea2cd25 Refactor code according to PEP8 2016-03-13 15:30:15 +01:00
Dominik
08f91685fc Updated regression tests and simplified code a bit 2016-03-05 13:46:22 +01:00
Dominik
c8f27768a4 Added a regression test for strings generated by the old crypt() implementation 2016-03-03 22:06:08 +01:00
Dominik
82e924811e Added a regression test for strings generated by the old protect_string() implementation 2016-03-03 21:33:07 +01:00
Dominik
36970a26d7 Replace PBKDF2 class by python stdlib implementation
hashlib.pbkdf2_hmac has been backported to Python 2.7 (see PEP 466). In
order to avoid reinventing the wheel and to include less third party
code we switch to the stdlib implementation.
2016-03-02 23:02:59 +01:00
Frank Morgner
29dfed5de9 Updated mail address 2015-12-15 16:58:28 +01:00
Erik Nellessen
e8076f0f38 Added missing import. 2015-09-28 15:49:45 +02:00
Frank Morgner
799894c83a don't print raw binary data 2015-08-13 09:21:38 +02:00
Frank Morgner
a7c0f04ec2 removed code duplication
regression of cde9393
2015-06-21 00:16:25 +02:00
Frank Morgner
470552da48 fixed missing import of sys
closes #55 #56 #57 #58
2015-06-20 00:36:50 +02:00
Frank Morgner
d471598380 Let SmartcardOS have only stubs
mf and SAM are implementations pecific to Iso7816OS
2015-05-21 22:04:44 +02:00
Frank Morgner
cbc8ab7ab9 implement reset() for relay card
fixes #48
2015-05-21 21:56:08 +02:00
Frank Morgner
ca7dbab716 moved HandlerTestOS to cards/HandlerTest.py 2015-05-20 02:17:55 +02:00
Frank Morgner
dbc8054813 moved NPAOS to nPA.py 2015-05-20 02:17:55 +02:00
Frank Morgner
cde9393e89 moved CryptoflexOS to cryptoflex.py 2015-05-20 02:17:55 +02:00
Frank Morgner
3277da7824 moved RelayOS into separate file 2015-05-20 02:17:55 +02:00
Frank Morgner
3f74291dc2 fixed pycrypto import
fixes regression from bca53f92f1
2015-05-18 08:43:37 +02:00
Frank Morgner
bca53f92f1 import Crypto only when needed 2015-05-18 07:55:18 +02:00
Frank Morgner
a76a859a92 fixed loading file image
partially fixes #41
2015-02-08 20:41:07 +01:00
Frank Morgner
676bc3707a save reference date/community id in the local object, not the class
- mapps a truncated brith date YYYYMM to YYYYMM31
- uses python magic to shorten the code
- closes #38
2015-01-30 22:58:55 +01:00
psytester
702e248a48 Verify implemented for Age, DocumentValidity and PlaceVerification checks
In case of AgeVerification , DocumentValidity and PlaceVerification checks, the return code is not longer hard coded.
Based on given reference values a check is does against given DG3, DG8 and DG18 values

Still ToDo is incomplete DG8 BirthDate in Format YYYY-XX where the day is missing
2015-01-30 22:58:55 +01:00
psytester
c4790e02b3 provide CommunityID as hex string
CommunityID is taken now from default value or dataset file in readable digit-string Format.
Benefits:
- internal "NotOnChip" function is now working for DG18
- The value is readable ;-)
2015-01-30 22:58:31 +01:00
Dominik
4f6c4749f9 Merge remote-tracking branch 'upstream/master' 2015-01-18 19:29:34 +01:00
Dominik
0b52e4a184 Use a relative path instead of a symlink so that the unit test works on windows 2015-01-18 19:03:13 +01:00
Frank Morgner
d89385c3e1 added support for QES with German ID card
libnpa: requires an ID card that is initialized for QES. Today, this
means you need to register at sign-me.

virtualsmartcard: We don't actually create a real signature, because
PyCrypto can't handle ECDSA, let alone brainpoolP256r1. We only return a
64 byte buffer.
2015-01-18 02:24:18 +01:00
Frank Morgner
ff71e301db fixed handling of missing le in sm apdu 2015-01-18 01:04:16 +01:00
Dominik
482df53e4c Extend CardGenerator unittests
There are now tests for most currently implemented card types. Tests for
new card types can easily be added by inheriting from the basic test
class. The ePass card type is currently missing from the tests because
the CardGenerator for this class currently only works with user
interaction.
2015-01-10 12:19:45 +01:00
Frank Morgner
a35f0295c6 Merge pull request #35 from d0/master
Minor improvements to CardGenerator and the corresponding unit test
2015-01-08 12:12:02 +01:00
Dominik
d90914edb0 Fix incorrect indention of close statement
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().
2014-12-23 12:10:07 +01:00
Dominik
8ea1c74e2f Fix indention 2014-12-23 11:36:29 +01:00
Dominik
5cb1c6ad58 Restore readDatagroups function accidently deleted in 1e7492a806 2014-12-23 11:16:58 +01:00
Dominik
991ba148d9 Minor improvements to CardGenerator and the corresponding unit test
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.
2014-12-22 14:58:11 +01:00
Frank Morgner
3822b00c8a Merge pull request #34 from d0/master
Add CardGenerator unit test
2014-12-22 11:49:46 +01:00
Dominik
1e7492a806 Remove superfluous whitespaces 2014-12-21 16:06:32 +01:00