frankmorgner / vsmartcard

umbrella project for emulation of smart card readers or smart cards
http://frankmorgner.github.io/vsmartcard/
684 stars 197 forks source link

TypeError while creating nPA #247

Closed oldner closed 1 year ago

oldner commented 1 year ago

Expected behaviour

What should happen?

Actual behaviour

What happens instead?

Steps to reproduce

  1. Change parser.add_option(..., default="nPA", ...) in CardGenerator.py default card to nPA from iso7816.
  2. run python CardGenerator.py OR vicc -t nPA on Ubuntu VM.

If I do something wrong, please let me know if there is another way to creating nPA card.

Logs

Please use Gist (https://gist.github.com/) or a similar code paster for longer logs.

Traceback (most recent call last):
  File "/home/user/programming/vsmartcard/virtualsmartcard/src/vpicc/virtualsmartcard/CardGenerator.py", line 722, in <module>
    generator.generateCard()
  File "/home/user/programming/vsmartcard/virtualsmartcard/src/vpicc/virtualsmartcard/CardGenerator.py", line 680, in generateCard
    self.__generate_nPA()
  File "/home/user/programming/vsmartcard/virtualsmartcard/src/vpicc/virtualsmartcard/CardGenerator.py", line 470, in __generate_nPA
    dg18 = pack([(0x72, 0, [(0x04, 0, bytes(CommunityID_Binary, "ascii"))])], True)
TypeError: encoding without a string argument
frankmorgner commented 1 year ago

fixed, thanks