Git Product home page Git Product logo

vsmartcard's Introduction

vsmartcard's People

Contributors

bowb avatar bryant1410 avatar d0 avatar dpward avatar emaxx-google avatar eriknellessen avatar frankmorgner avatar gu1nness avatar jakuje avatar jessepeng avatar ludovicrousseau avatar michaelweghorn avatar micolous avatar mildsunrise avatar nickrussler avatar ph4r05 avatar psytester avatar robmoore-i avatar sorcerer86pt avatar suttod avatar swissbit-csteuer avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

vsmartcard's Issues

SmartCard Reader APK Crash - NVIDIA SHIELD 32 Gb and Droid RAZR M(XT907)

okay what im trying to do is this, i have an XT907(Motorola Droid RAZR M) which has NFC, and i have a tablet(NVIDIA SHIELD 32Gb LTE) and multiple PCs which id like to use the XT907 as a reader for, i tried installing the APK on my tablet and it just freezes when i try and launch it....what am i doing wrong, is this possible.ect

packet dump between vpcd and vicc.

Hi,
the following was capture by wireshark and do "follow tcp stream".

    00000000  00 01                                            ..
    00000002  04                                               .
00000000  00 0b 3b 95 13 81 01 80  73 ff 01 00 0b          ..;..... s....  <<< ATR sent by vicc.
    00000003  00 01                                            ..
    00000005  04                                               .
0000000D  00 0b 3b 95 13 81 01 80  73 ff 01 00 0b          ..;..... s....
    00000006  00 01                                            ..
    00000008  01 00 01 04                                      ....                <<<< what does this means?
0000001A  00 0b 3b 95 13 81 01 80  73 ff 01 00 0b          ..;..... s....
    0000000C  00 01                                            ..
    0000000E  04                                               .
00000027  00 0b 3b 95 13 81 01 80  73 ff 01 00 0b          ..;..... s....
    0000000F  00 01                                            ..
    00000011  00 00 01 04                                      ....  <<<<< and this one.
00000034  00 0b 3b 95 13 81 01 80  73 ff 01 00 0b          ..;..... s....
    00000015  00 01                                            ..
    00000017  04                                               .
00000041  00 0b 3b 95 13 81 01 80  73 ff 01 00 0b          ..;..... s....

default reader.conf in /etc/reader.conf

FRIENDLYNAME "Virtual PCD"
DEVICENAME /dev/null:0x8C7B
LIBPATH /usr/lib/pcsc/drivers/serial/libifdvpcd.so
CHANNELID 0x8C7B

and vicc command line
./vicc -H 192.168.0.12 -vvvv -t iso7816
As wiki mentioned
http://frankmorgner.github.io/vsmartcard/virtualsmartcard/api.html

0x0 0x01 0x04 as Get ATR from vicc.

so am not sure what happend there on vpcd to sends out " 0x01 0x00 0x01 0x04"

thanks
BL.

VPCD-CLIENT for Windows

Hello my friend Frank Morgner, I came back!
LOL
I do not know how to program as I told you, but I know a little bit about AutoIT so I did a little program, you install VPCD on windows, and VICC on ubuntu, and my program makes a call to VICC in ubuntu via ssh , Ubuntu in turn finds the VPCD of Windows and connects the connection, I made a video on Youtube especially for our community, and for the new users, the installation file that I dubbed vpcd-client this to dowload in the link below Along with the video, is now very late in Brazil 1:47 AM I need to sleep, so I'm sorry for the mistakes of English both in the video and in this writing, the program is in Portuguese, but if there is interest I translate, it is an alpha version, precise I have tried several errorlevel problems both in plink and in your vicc system, so it's just a test.

https://www.youtube.com/watch?v=D3eTqS0w6oc
link app vpcd-client for Windows 10 64 Bits
https://drive.google.com/file/d/0B8kl9PkJKPikeGlYUjdIdEVnaVE/view?usp=sharing

VpcdReader.cpp stuck in loop when connecting several times

I'm using this project to write unit tests for Java Card applet running inside jCardSim. So I have implemented a Vpicc connector to the Vpcd driver. The problem is occurring when running multiple tests and closing and reconnecting to the driver for each test. The first test often succeeds, but for the other tests more often no card is present anymore when listing the terminal and trying to connect. This behavior is not deterministic, I assume a timing condition or some inconsistent state in the driver.

I have debugged the driver and see the following behavior:

  • VpcdReader.cpp server is running and vicc_present in vpcd.c detects a card and my Vpicc connector is passing an ATR correctly.
  • VpcdReader::signalInsertion set cardPresent to true and the waitInsertIpr is triggered.
  • VpcdReader.cpp server is still running and executes vicc_present in vpcd.c detects a card and my Vpicc connector is passing an ATR correctly` every second.
  • VpcdReader::signalInsertion is called but cardPresent is already set to true, waitInsertIpr is NULL.
  • The last two points are looping forever

My assumption:

  • Reader::IoSmartCardIsPresent which was called in the beginning, is never called again, so I assume any SCardListReaders never sees a card inserted again, so the connections can never be established again.

Do you have any idea what is going wrong?

Unable to run 'make'

I get this error when running make
make[3]: Entering directory /home/achachiez/Code/Java/vsmartcard/ccid/src' CC ccid_emulator-scutil.o scutil.c: In function ‘initialize’: scutil.c:45:8: error: ‘sc_context_t’ has no member named ‘enable_default_driver’ (*ctx)->enable_default_driver = 1; ^ scutil.c: In function ‘list_readers’: scutil.c:125:9: warning: format ‘%d’ expects argument of type ‘int’, but argument 2 has type ‘size_t’ [-Wformat=] printf("%-4d %-7s %s\n", i, reader->driver->short_name, reader->name); ^ make[3]: *** [ccid_emulator-scutil.o] Error 1 make[3]: Leaving directory/home/achachiez/Code/Java/vsmartcard/ccid/src'
make[2]: *** [all] Error 2
make[2]: Leaving directory /home/achachiez/Code/Java/vsmartcard/ccid/src' make[1]: *** [all-recursive] Error 1 make[1]: Leaving directory/home/achachiez/Code/Java/vsmartcard/ccid'
make: *** [all] Error 2

Does it work with Google Pay / Google Wallet?

I am using Cyanogenmod 12 in which there is no support for Host Smartcard Emulation. Therefore, the "Tap and pay" feature in Google Wallet is not available.

So, would this app make Google Wallets Tap and Pay feature work on CM12?

Relaying communications from PC/SC to vpcd

Good afternoon,
Excuse my English, I'm trying to understand your project, do not have much knowledge about smart cards, but I have knowledge of linux and windows, if possible would like a little help step-by-step how to set up the following scenario:

Client
[Connect smartcard --- >> pc-windows] ---> Cloud / Internet -> [PC-Ubuntu emulate smart card / receive] - >> application that uses smartcard

I already managed to enter the VPCD driver in Windows but give forward not know what else to do because of the low knowledge of smartcard
Thank you for your help.

Error running make durring install


never mind, turns out Sourceforge supplied an older version that didn't compile, upon grabbing the new version direct from git it worked successfully.

this can be closed!

I followed your instruction, ran autoreconf --verbose --install, then ./configure --sysconfdir=/etc, and finally make.

When run make i get the following error:
Makefile:699: recipe for target 'vicc.1' failed
make[3]: *** [vicc.1] Error 1
make[3]: Leaving directory '/home/joe/Downloads/vsmartcard-2012-04-11/virtualsmartcard/src/vpicc'
Makefile:357: recipe for target 'all-recursive' failed
make[2]: *** [all-recursive] Error 1
make[2]: Leaving directory '/home/joe/Downloads/vsmartcard-2012-04-11/virtualsmartcard/src'
Makefile:404: recipe for target 'all-recursive' failed
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory '/home/joe/Downloads/vsmartcard-2012-04-11/virtualsmartcard'
Makefile:335: recipe for target 'all' failed
make: *** [all] Error 2

My system:
Debian Jessie amd64
Dell Laptop with physical CAC reader configured using coolkey.


here's the complete ./configure command and output:
% ./configure --sysconfdir=/etc 2 ↵
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
/home/joe/Downloads/vsmartcard-2012-04-11/virtualsmartcard/missing: Unknown --is-lightweight' option Try/home/joe/Downloads/vsmartcard-2012-04-11/virtualsmartcard/missing --help' for more information
configure: WARNING: 'missing' script is too old or missing
checking for a thread-safe mkdir -p... /bin/mkdir -p
checking for gawk... no
checking for mawk... mawk
checking whether make sets $(MAKE)... yes
checking whether make supports nested variables... yes
checking build system type... x86_64-unknown-linux-gnu
checking host system type... x86_64-unknown-linux-gnu
checking how to print strings... printf
checking for style of include used by make... GNU
checking for gcc... gcc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables...
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ISO C89... none needed
checking whether gcc understands -c and -o together... yes
checking dependency style of gcc... gcc3
checking for a sed that does not truncate output... /bin/sed
checking for grep that handles long lines and -e... /bin/grep
checking for egrep... /bin/grep -E
checking for fgrep... /bin/grep -F
checking for ld used by gcc... /usr/bin/ld
checking if the linker (/usr/bin/ld) is GNU ld... yes
checking for BSD- or MS-compatible name lister (nm)... /usr/bin/nm -B
checking the name lister (/usr/bin/nm -B) interface... BSD nm
checking whether ln -s works... yes
checking the maximum length of command line arguments... 1572864
checking whether the shell understands some XSI constructs... yes
checking whether the shell understands "+="... yes
checking how to convert x86_64-unknown-linux-gnu file names to x86_64-unknown-linux-gnu format... func_convert_file_noop
checking how to convert x86_64-unknown-linux-gnu file names to toolchain format... func_convert_file_noop
checking for /usr/bin/ld option to reload object files... -r
checking for objdump... objdump
checking how to recognize dependent libraries... pass_all
checking for dlltool... no
checking how to associate runtime and link libraries... printf %s\n
checking for ar... ar
checking for archiver @file support... @
checking for strip... strip
checking for ranlib... ranlib
checking command to parse /usr/bin/nm -B output from gcc object... ok
checking for sysroot... no
checking for mt... mt
checking if mt is a manifest tool... no
checking how to run the C preprocessor... gcc -E
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking for dlfcn.h... yes
checking for objdir... .libs
checking if gcc supports -fno-rtti -fno-exceptions... no
checking for gcc option to produce PIC... -fPIC -DPIC
checking if gcc PIC flag -fPIC -DPIC works... yes
checking if gcc static flag -static works... yes
checking if gcc supports -c -o file.o... yes
checking if gcc supports -c -o file.o... (cached) yes
checking whether the gcc linker (/usr/bin/ld -m elf_x86_64) supports shared libraries... yes
checking whether -lc should be explicitly linked in... no
checking dynamic linker characteristics... GNU/Linux ld.so
checking how to hardcode library paths into programs... immediate
checking whether stripping libraries is possible... yes
checking if libtool supports shared libraries... yes
checking whether to build shared libraries... yes
checking whether to build static libraries... yes
checking for gcc... (cached) gcc
checking whether we are using the GNU C compiler... (cached) yes
checking whether gcc accepts -g... (cached) yes
checking for gcc option to accept ISO C89... (cached) none needed
checking whether gcc understands -c and -o together... (cached) yes
checking dependency style of gcc... (cached) gcc3
checking whether ln -s works... yes
checking for a sed that does not truncate output... (cached) /bin/sed
checking for python... /usr/bin/python
checking for python version... 2.7
checking for python platform... linux2
checking for python script directory... ${prefix}/lib/python2.7/dist-packages
checking for python extension module directory... ${exec_prefix}/lib/python2.7/dist-packages
checking for pkg-config... /usr/bin/pkg-config
checking pkg-config is at least version 0.9.0... yes
checking for help2man... false // No help2man //
checking for doxygen... false // No doxygen //
checking whether make supports nested variables... (cached) yes
checking for PCSC... yes
checking ifdhandler.h usability... yes
checking ifdhandler.h presence... yes
checking for ifdhandler.h... yes
checking arpa/inet.h usability... yes
checking arpa/inet.h presence... yes
checking for arpa/inet.h... yes
checking for stdint.h... (cached) yes
checking for stdlib.h... (cached) yes
checking for string.h... (cached) yes
checking sys/socket.h usability... yes
checking sys/socket.h presence... yes
checking for sys/socket.h... yes
checking sys/time.h usability... yes
checking sys/time.h presence... yes
checking for sys/time.h... yes
checking for unistd.h... (cached) yes
checking for size_t... yes
checking for uint16_t... yes
checking for stdlib.h... (cached) yes
checking for GNU libc compatible malloc... yes
checking for memset... yes
checking for select... yes
checking for socket... yes

virtualsmartcard has been configured with following options:

Version: 0.6
User binaries: NONE/bin
PC/SC configuration: /etc/reader.conf.d
Python site-packages: NONE/lib/python2.7/dist-packages
Driver directory: /usr/lib/pcsc/drivers/serial

Host: x86_64-unknown-linux-gnu
Compiler: gcc
Preprocessor flags:
Compiler flags: -g -O2
Preprocessor flags:
Linker flags:
Libraries:
PCSC_CFLAGS: -pthread -I/usr/include/PCSC
PCSC_LIBS: -lpcsclite
BUNDLE_HOST: Linux
LIB_PREFIX: lib
DYN_LIB_EXT: so

checking that generated files are newer than configure... done
configure: creating ./config.status
config.status: creating Makefile
config.status: creating src/Makefile
config.status: creating src/vpcd/Makefile
config.status: creating src/vpicc/Makefile
config.status: creating doc/Makefile
config.status: creating doc/api/Makefile
config.status: creating config.h
config.status: config.h is unchanged
config.status: executing depfiles commands
config.status: executing libtool commands


here's the complete make command and output:
% make
make all-recursive
make[1]: Entering directory '/home/joe/Downloads/vsmartcard-2012-04-11/virtualsmartcard'
Making all in src
make[2]: Entering directory '/home/joe/Downloads/vsmartcard-2012-04-11/virtualsmartcard/src'
Making all in vpcd
make[3]: Entering directory '/home/joe/Downloads/vsmartcard-2012-04-11/virtualsmartcard/src/vpcd'
make[3]: Nothing to be done for 'all'.
make[3]: Leaving directory '/home/joe/Downloads/vsmartcard-2012-04-11/virtualsmartcard/src/vpcd'
Making all in vpicc
make[3]: Entering directory '/home/joe/Downloads/vsmartcard-2012-04-11/virtualsmartcard/src/vpicc'
/bin/sed -e 's,[@]PYTHON[@],/usr/bin/python,g' -e 's,[@]PACKAGE_VERSION[@],0.6,g' -e 's,[@]PACKAGE_BUGREPORT[@],http://sourceforge.net/projects/vsmartcard/support,g' -e 's,[@]PACKAGE_NAME[@],Virtual Smart Card,g' < ./vicc.in > ./vicc
chmod +x ./vicc
false // No help2man //
--no-discard-stderr
--output=vicc.1
./vicc
Makefile:699: recipe for target 'vicc.1' failed
make[3]: *** [vicc.1] Error 1
make[3]: Leaving directory '/home/joe/Downloads/vsmartcard-2012-04-11/virtualsmartcard/src/vpicc'
Makefile:357: recipe for target 'all-recursive' failed
make[2]: *** [all-recursive] Error 1
make[2]: Leaving directory '/home/joe/Downloads/vsmartcard-2012-04-11/virtualsmartcard/src'
Makefile:404: recipe for target 'all-recursive' failed
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory '/home/joe/Downloads/vsmartcard-2012-04-11/virtualsmartcard'
Makefile:335: recipe for target 'all' failed

make: *** [all] Error 2

Please let me know if there is any other information that you require, any suggestions would be greatly appreciated.

Thanks!

code error

syntax error

Path to the file:

$repo_root/vsmartcard/pcsc-relay/src/picc.py

Step to reproduce

python picc.py

Error messages:

File "picc.py", line 90
for (i in range[0, len(line), 2])
^
SyntaxError: invalid syntax

Remote Smart Card Reader crashes when starts

Hi. I use Samsung Galaxy SIII and I've installed Remote Smart Card Reader v1.2 to smartphone from F-Droid. But, when I try to open app, it crashes with message about app's stopping.

Could you help me solve this problem?

Python3 support

The python code is currently written for Python2 only. We should look into supporting Python3 as well.

running vicc

sudo vicc -vvv gives me a socket 111 error, connection refused.

ps -A shows pcscd running.
pcsc_scan shows Virtual PCD as Reader 0.
ufw status shows inactive.

Any suggestions? Thanks all

Running vicc on kali and sony xperia L

Hi Frank, i have problems running vicc over kali linux it installs perfectly fine and already tried out a lot of things i already readed the other issues vicc -vvv shows
25.03.2015 19:58:06 [WARNING] Using default SAM parameters. PIN=1234, Card Nr=1234567890
25.03.2015 19:58:06 [ERROR] Failed to open socket: [Errno 111] Connection refused
25.03.2015 19:58:06 [ERROR] Is pcscd running at localhost? Is vpcd loaded? Is a firewall blocking port 35963?
i already disabled the firewall, but i think it wont recognize the virtual pcd, my vpcd in reader.conf shows:
FRIENDLYNAME "Virtual PCD"
DEVICENAME /dev/null:0x8C7B
LIBPATH /usr/lib/pcsc/drivers/serial/libifdvpcd.so
CHANNELID 0x8C7B
and for the install i just downloaded virtualsmartcard-0.7.tar.gz and install libpcsclite-dev you can reproduce the problem using the newest version of kali linux in live mode and installing libpcsclite-dev and then installing virtualsmartcard-0.7.tar.gz, kali already comes with pcscd
thanks for your help :)
in the xperia (c2104 xperia L) im using remote smart card reader, btw sometimes the app dont load, it stucks in a white screen, but other times runs fine

Compiling for exe

Hello good afternoon!
I'm doing the compile for windows from vicc.py, follow the steps:

C: > pip install pyinstaller
C: > pyinstaller --onefile vicc.py

It generates this log:

671 INFO: PyInstaller: 3.2
671 INFO: Python: 2.7.12
671 INFO: Platform: Windows-10-10.0.14393
687 INFO: wrote C:\Users\suporte\Desktop\virtualsmartcard-0.7_win32\vpicc\vicc.spec
687 INFO: UPX is not available.
687 INFO: Extending PYTHONPATH with paths
['C:\Users\suporte\Desktop\virtualsmartcard-0.7_win32\vpicc',
'C:\Users\suporte\Desktop\virtualsmartcard-0.7_win32\vpicc']
687 INFO: checking Analysis
687 INFO: Building Analysis because out00-Analysis.toc is non existent
687 INFO: Initializing module dependency graph...
703 INFO: Initializing module graph hooks...
766 INFO: running Analysis out00-Analysis.toc
937 INFO: Adding Microsoft.VC90.CRT to dependent assemblies of final executable
required by c:\python27\python.exe
8265 INFO: Found C:\Windows\WinSxS\Manifests\amd64_policy.9.0.microsoft.vc90.crt_1fc8b3b9a1e18e3b_9.0.30729.1_none_3da38fdebd0e6822.manifest
8296 INFO: Found C:\Windows\WinSxS\Manifests\amd64_policy.9.0.microsoft.vc90.crt_1fc8b3b9a1e18e3b_9.0.30729.9247_none_acd10521e1dac77d.manifest
8422 INFO: Searching for assembly amd64_Microsoft.VC90.CRT_1fc8b3b9a1e18e3b_9.0.30729.9247_none ...
8422 INFO: Found manifest C:\Windows\WinSxS\Manifests\amd64_microsoft.vc90.crt_1fc8b3b9a1e18e3b_9.0.30729.9247_none_08e394a1a83e212f.manifest
8422 INFO: Searching for file msvcr90.dll
8422 INFO: Found file C:\Windows\WinSxS\amd64_microsoft.vc90.crt_1fc8b3b9a1e18e3b_9.0.30729.9247_none_08e394a1a83e212f\msvcr90.dll
8422 INFO: Searching for file msvcp90.dll
8437 INFO: Found file C:\Windows\WinSxS\amd64_microsoft.vc90.crt_1fc8b3b9a1e18e3b_9.0.30729.9247_none_08e394a1a83e212f\msvcp90.dll
8437 INFO: Searching for file msvcm90.dll
8437 INFO: Found file C:\Windows\WinSxS\amd64_microsoft.vc90.crt_1fc8b3b9a1e18e3b_9.0.30729.9247_none_08e394a1a83e212f\msvcm90.dll
8546 INFO: Found C:\Windows\WinSxS\Manifests\amd64_policy.9.0.microsoft.vc90.crt_1fc8b3b9a1e18e3b_9.0.30729.1_none_3da38fdebd0e6822.manifest
8546 INFO: Found C:\Windows\WinSxS\Manifests\amd64_policy.9.0.microsoft.vc90.crt_1fc8b3b9a1e18e3b_9.0.30729.9247_none_acd10521e1dac77d.manifest
8546 INFO: Adding redirect Microsoft.VC90.CRT version (9, 0, 21022, 8) -> (9, 0, 30729, 9247)
13891 INFO: Caching module hooks...
13906 INFO: Analyzing C:\Users\suporte\Desktop\virtualsmartcard-0.7_win32\vpicc\vicc.py
18453 INFO: Processing pre-find module path hook distutils
18765 INFO: Processing pre-safe import module hook _xmlplus
22687 INFO: Loading module hooks...
22687 INFO: Loading module hook "hook-distutils.py"...
22687 INFO: Loading module hook "hook-sysconfig.py"...
22687 INFO: Loading module hook "hook-xml.py"...
22796 INFO: Loading module hook "hook-httplib.py"...
22796 INFO: Loading module hook "hook-_tkinter.py"...
23765 INFO: checking Tree
23765 INFO: Building Tree because out00-Tree.toc is non existent
23765 INFO: Building Tree out00-Tree.toc
23983 INFO: checking Tree
23983 INFO: Building Tree because out01-Tree.toc is non existent
23983 INFO: Building Tree out01-Tree.toc
24016 INFO: Loading module hook "hook-pkg_resources.py"...
24109 INFO: Processing pre-safe import module hook win32com
24484 INFO: Loading module hook "hook-pywintypes.py"...
24765 INFO: Loading module hook "hook-encodings.py"...
25938 INFO: Loading module hook "hook-win32com.py"...
26359 INFO: Loading module hook "hook-pythoncom.py"...
29110 INFO: checking Tree
29110 INFO: Building Tree because out02-Tree.toc is non existent
29124 INFO: Building Tree out02-Tree.toc
29124 INFO: Looking for ctypes DLLs
29187 INFO: Analyzing run-time hooks ...
29187 INFO: Including run-time hook 'pyi_rth__tkinter.py'
29187 INFO: Including run-time hook 'pyi_rth_pkgres.py'
29203 INFO: Including run-time hook 'pyi_rth_win32comgenpy.py'
29219 INFO: Looking for dynamic libraries
39265 INFO: Searching for assembly amd64_Microsoft.VC90.MFC_1fc8b3b9a1e18e3b_9.0.21022.8_none ...
39281 INFO: Found manifest c:\python27\lib\site-packages\Pythonwin\Microsoft.VC90.MFC.manifest
39281 INFO: Searching for file mfc90.dll
39281 INFO: Found file c:\python27\lib\site-packages\Pythonwin\mfc90.dll
39296 INFO: Searching for file mfc90u.dll
39296 INFO: Found file c:\python27\lib\site-packages\Pythonwin\mfc90u.dll
39296 INFO: Searching for file mfcm90.dll
39296 INFO: Found file c:\python27\lib\site-packages\Pythonwin\mfcm90.dll
39296 INFO: Searching for file mfcm90u.dll
39296 INFO: Found file c:\python27\lib\site-packages\Pythonwin\mfcm90u.dll
39374 INFO: Adding redirect Microsoft.VC90.MFC version (9, 0, 21022, 8) -> (9, 0, 21022, 8)
50000 WARNING: lib not found: MSVCR120.dll dependency of C:\Users\suporte\Desktop\virtualsmartcard-0.7_win32\vpicc_eac.pyd
55265 INFO: Looking for eggs
55265 INFO: Using Python library C:\Windows\system32\python27.dll
55281 INFO: Found binding redirects:
[BindingRedirect(name=u'Microsoft.VC90.MFC', language=None, arch=u'amd64', oldVersion=(9, 0, 21022, 8), newVersion=(9, 0, 21022, 8), publicKeyToken=u'1fc8b3b9a1e18e3b'), BindingRedirect(name=u'Microsoft.VC90.CRT', language=None, arch=u'amd64', oldVersion=(9, 0, 21022, 8), newVersion=(9, 0, 30729, 9247), publicKeyToken=u'1fc8b3b9a1e18e3b')]
55296 INFO: Warnings written to C:\Users\suporte\Desktop\virtualsmartcard-0.7_win32\vpicc\build\vicc\warnvicc.txt
55578 INFO: checking PYZ
55578 INFO: Building PYZ because out00-PYZ.toc is non existent
55578 INFO: Building PYZ (ZlibArchive) C:\Users\suporte\Desktop\virtualsmartcard-0.7_win32\vpicc\build\vicc\out00-PYZ.pyz
56672 INFO: checking PKG
56672 INFO: Building PKG because out00-PKG.toc is non existent
56672 INFO: Building PKG (CArchive) out00-PKG.pkg
56906 INFO: Redirecting Microsoft.VC90.CRT version (9, 0, 21022, 8) -> (9, 0, 30729, 9247)
56922 INFO: Updating manifest in C:\Users\suporte\AppData\Roaming\pyinstaller\bincache00_py27_64bit\python27.dll
56937 INFO: Updating resource type 24 name 2 language 1033
57078 INFO: Redirecting Microsoft.VC90.CRT version (9, 0, 21022, 8) -> (9, 0, 30729, 9247)
57078 INFO: Updating manifest in C:\Users\suporte\AppData\Roaming\pyinstaller\bincache00_py27_64bit_hashlib.pyd
57078 INFO: Updating resource type 24 name 2 language 1033
57140 INFO: Redirecting Microsoft.VC90.CRT version (9, 0, 21022, 8) -> (9, 0, 30729, 9247)
57140 INFO: Updating manifest in C:\Users\suporte\AppData\Roaming\pyinstaller\bincache00_py27_64bit_ctypes.pyd
57140 INFO: Updating resource type 24 name 2 language 1033
57218 INFO: Redirecting Microsoft.VC90.CRT version (9, 0, 21022, 8) -> (9, 0, 30729, 9247)
57218 INFO: Updating manifest in C:\Users\suporte\AppData\Roaming\pyinstaller\bincache00_py27_64bit_ssl.pyd
57218 INFO: Updating resource type 24 name 2 language 1033
57297 INFO: Redirecting Microsoft.VC90.CRT version (9, 0, 21022, 8) -> (9, 0, 30729, 9247)
57297 INFO: Updating manifest in C:\Users\suporte\AppData\Roaming\pyinstaller\bincache00_py27_64bit_socket.pyd
57297 INFO: Updating resource type 24 name 2 language 1033
57343 INFO: Redirecting Microsoft.VC90.MFC version (9, 0, 21022, 8) -> (9, 0, 21022, 8)
57343 INFO: Redirecting Microsoft.VC90.CRT version (9, 0, 21022, 8) -> (9, 0, 30729, 9247)
57343 INFO: Updating manifest in C:\Users\suporte\AppData\Roaming\pyinstaller\bincache00_py27_64bit\win32ui.pyd
57343 INFO: Updating resource type 24 name 2 language 1033
57468 INFO: Redirecting Microsoft.VC90.CRT version (9, 0, 21022, 8) -> (9, 0, 30729, 9247)
57468 INFO: Updating manifest in C:\Users\suporte\AppData\Roaming\pyinstaller\bincache00_py27_64bit\bz2.pyd
57468 INFO: Updating resource type 24 name 2 language 1033
57500 INFO: Redirecting Microsoft.VC90.CRT version (9, 0, 21022, 8) -> (9, 0, 30729, 9247)
57500 INFO: Updating manifest in C:\Users\suporte\AppData\Roaming\pyinstaller\bincache00_py27_64bit\select.pyd
57500 INFO: Updating resource type 24 name 2 language 1033
57593 INFO: Redirecting Microsoft.VC90.CRT version (9, 0, 21022, 8) -> (9, 0, 30729, 9247)
57593 INFO: Updating manifest in C:\Users\suporte\AppData\Roaming\pyinstaller\bincache00_py27_64bit\pyexpat.pyd
57610 INFO: Updating resource type 24 name 2 language 1033
57688 INFO: Redirecting Microsoft.VC90.CRT version (9, 0, 21022, 8) -> (9, 0, 30729, 9247)
57703 INFO: Updating manifest in C:\Users\suporte\AppData\Roaming\pyinstaller\bincache00_py27_64bit\unicodedata.pyd
57703 INFO: Updating resource type 24 name 2 language 1033
57750 INFO: Redirecting Microsoft.VC90.CRT version (9, 0, 21022, 8) -> (9, 0, 30729, 9247)
57750 INFO: Updating manifest in C:\Users\suporte\AppData\Roaming\pyinstaller\bincache00_py27_64bit_bsddb.pyd
57750 INFO: Updating resource type 24 name 2 language 1033
57797 INFO: Redirecting Microsoft.VC90.CRT version (9, 0, 21022, 8) -> (9, 0, 30729, 9247)
57812 INFO: Updating manifest in C:\Users\suporte\AppData\Roaming\pyinstaller\bincache00_py27_64bit_testcapi.pyd
57812 INFO: Updating resource type 24 name 2 language 1033
57844 INFO: Redirecting Microsoft.VC90.CRT version (9, 0, 21022, 8) -> (9, 0, 30729, 9247)
57844 INFO: Updating manifest in C:\Users\suporte\AppData\Roaming\pyinstaller\bincache00_py27_64bit_tkinter.pyd
57860 INFO: Updating resource type 24 name 2 language 1033
57922 INFO: Updating manifest in C:\Users\suporte\AppData\Roaming\pyinstaller\bincache00_py27_64bit_eac.pyd
57922 INFO: Updating resource type 24 name 2 language 1033
58047 INFO: Updating manifest in C:\Users\suporte\AppData\Roaming\pyinstaller\bincache00_py27_64bit\mfc90.dll
58062 INFO: Updating resource type 24 name 1000 language 1033
62344 INFO: Updating manifest in C:\Users\suporte\AppData\Roaming\pyinstaller\bincache00_py27_64bit\mfc90u.dll
62344 INFO: Updating resource type 24 name 1000 language 1033
63015 INFO: Redirecting Microsoft.VC90.CRT version (9, 0, 21022, 8) -> (9, 0, 30729, 9247)
63015 INFO: Updating manifest in C:\Users\suporte\AppData\Roaming\pyinstaller\bincache00_py27_64bit\tcl85.dll
63015 INFO: Updating resource type 24 name 2 language 1033
63109 INFO: Updating manifest in C:\Users\suporte\AppData\Roaming\pyinstaller\bincache00_py27_64bit\tk85.dll
63109 INFO: Updating resource type 24 name 1 language 1033
63140 INFO: Redirecting Microsoft.VC90.CRT version (9, 0, 21022, 8) -> (9, 0, 30729, 9247)
63157 INFO: Updating manifest in C:\Users\suporte\AppData\Roaming\pyinstaller\bincache00_py27_64bit\tk85.dll
63157 INFO: Updating resource type 24 name 2 language 1033
63296 INFO: Redirecting Microsoft.VC90.CRT version (9, 0, 21022, 8) -> (9, 0, 30729, 9247)
74671 INFO: Bootloader c:\python27\lib\site-packages\PyInstaller\bootloader\Windows-64bit\run.exe
74671 INFO: checking EXE
74687 INFO: Building EXE because out00-EXE.toc is non existent
74687 INFO: Building EXE from out00-EXE.toc
74687 INFO: Appending archive to EXE C:\Users\suporte\Desktop\virtualsmartcard-0.7_win32\vpicc\dist\vicc.exe

Then I enter the folder where the exe is, when I run the following error:

C:\Users\suporte\Desktop\virtualsmartcard-0.7_win32\vpicc\dist>vicc.exe -vvvvv --type relay

Traceback (most recent call last):
File "vicc.py", line 104, in
File "c:\python27\Lib\site-packages\PyInstaller\loader\pyimod03_importers.py", line 389, in load_module
exec(bytecode, module.dict)
File "virtualsmartcard\VirtualSmartcard.py", line 24, in
File "c:\python27\Lib\site-packages\PyInstaller\loader\pyimod03_importers.py", line 389, in load_module
exec(bytecode, module.dict)
File "virtualsmartcard\CardGenerator.py", line 26, in
File "c:\python27\Lib\site-packages\PyInstaller\loader\pyimod03_importers.py", line 389, in load_module
exec(bytecode, module.dict)
File "virtualsmartcard\CryptoUtils.py", line 20, in
File "c:\python27\Lib\site-packages\PyInstaller\loader\pyimod03_importers.py", line 389, in load_module
exec(bytecode, module.dict)
File "build\bdist.win-amd64\egg\Crypto\Cipher\DES3.py", line 67, in
File "c:\python27\Lib\site-packages\PyInstaller\loader\pyimod03_importers.py", line 389, in load_module
exec(bytecode, module.dict)
File "build\bdist.win-amd64\egg\Crypto\Cipher_DES3.py", line 7, in
File "build\bdist.win-amd64\egg\Crypto\Cipher_DES3.py", line 6, in bootstrap
ImportError: DLL load failed: Could not find the specified module.
Failed to execute script vicc

Just for the right information, follow the step-by-step instructions as I promised to set up this scenario:

1-) Download Python 2.7.12 (be careful to always choose by 64bit)
    - Set the PATH option in Windows
    https://www.python.org/downloads/windows/
    [ Execute as administrator ]
    Reboot - PC

2-) [Run as Administrator]
    C: > python -m pip install --upgrade pip
    C: > pip install virtualenv

3-) Microsoft Visual C ++ Compiler for Python 2.7
    https://www.microsoft.com/en-us/download/details.aspx?id=44266
    Reboot - PC

4-) [Run as Administrator]
    C: > pip install -U setuptools
    C: > easy_install PyCrypto
    C: > pip install pyreadline

5-) Downloading Swig in http://www.swig.org/
    -> Create a folder called [swig] C: \ Python27 \ Lib \ site-packages \ swig
-> Unzip the files the
-> You have to set this variable in Windows pointed to this folder C: \ Python27 \ Lib \ site-packages \ swig
    -> In the Environment Variables section -> [PATH] -> [Edit] -> [New]
-> Windows reboot

6-) C: > pip install pyscard
     C: > pip install --egg M2CryptoWin64
     C: > python.exe vicc.py -vvvvv --type relay

Compilation Test

7-) C: > pip install pyinstaller

S.O Windows 10 64

remote-reader: read nPA withz AusweisApp gets TagLostException --- i/choreographer skipped frames

While the Open eCard can detect the nPA, the AusweisApp is doing some other smartcard communication and will get a TagLostException

As this is an indication, maybe the thread code needs to be reviewed:
I/Choreographer﹕ Skipped 62 frames! The application may be doing too much work on its main thread.

Here are some points shown why this can happen
http://stackoverflow.com/questions/11266535/meaning-of-choreographer-messages-in-logcat

Complete stack trace looks like:
09-28 21:35:37.490 9653-9762/com.vsmartcard.remotesmartcardreader.app W/System.err﹕ android.nfc.TagLostException: Tag was lost.
09-28 21:35:37.490 9653-9762/com.vsmartcard.remotesmartcardreader.app W/System.err﹕ at android.nfc.TransceiveResult.getResponseOrThrow(TransceiveResult.java:48)
09-28 21:35:37.490 9653-9762/com.vsmartcard.remotesmartcardreader.app W/System.err﹕ at android.nfc.tech.BasicTagTechnology.transceive(BasicTagTechnology.java:151)
09-28 21:35:37.490 9653-9762/com.vsmartcard.remotesmartcardreader.app W/System.err﹕ at android.nfc.tech.IsoDep.transceive(IsoDep.java:172)
09-28 21:35:37.490 9653-9762/com.vsmartcard.remotesmartcardreader.app W/System.err﹕ at com.vsmartcard.remotesmartcardreader.app.screaders.NFCReader.transmit(NFCReader.java:110)
09-28 21:35:37.495 9653-9762/com.vsmartcard.remotesmartcardreader.app W/System.err﹕ at com.vsmartcard.remotesmartcardreader.app.VPCDWorker.run(VPCDWorker.java:106)
09-28 21:35:37.495 9653-9762/com.vsmartcard.remotesmartcardreader.app W/System.err﹕ at java.lang.Thread.run(Thread.java:841)
09-28 21:35:38.545 9653-9653/com.vsmartcard.remotesmartcardreader.app I/Choreographer﹕ Skipped 62 frames! The application may be doing too much work on its main thread.

How to use the Android Smart Card Emulator app?

Can't find any documentation on how to use the app. Just a blank screen with clear and copy logs being the only options. Does this app require a smart card's contents to be sent from a connected computer?

SSL support for remote-reader

As the remote-reader application transfers personal sensitive data in raw format, please add optional SSL support for connection to Bix virtual smard card reader.
The Bix virtual smard card reader can be put here behind an Apache SSL endpoint. (no need to add SSL support to the reader itself).

can not build BixVReader with WDK 7.1 on win7 32bit

K:\vsmartcard-master\virtualsmartcard\win32\BixVReader\Win7>build
path contains nonexistant c:\winddk\7600.16385.1\tools\sdv\bin, removing
BUILD: Compile and Link for x86
BUILD: Computing Include file dependencies:
BUILD: Start time: Mon May 25 23:53:47 2015
0>errors in directory k:\vsmartcard-master\virtualsmartcard\win32\bixvreader\win
7
0>
Ignoring invalid directory prefix in SOURCES= entry: ......\src\vpcd\vpcd.c

0>errors in directory k:\vsmartcard-master\virtualsmartcard\win32\bixvreader\win
7
0>
Ignoring invalid directory prefix in SOURCES= entry: ......\src\vpcd\lock.c

BUILD: Examining k:\vsmartcard-master\virtualsmartcard\win32\bixvreader\win7 dir
ectory for files to compile.
k:\vsmartcard-master\virtualsmartcard\win32\bixvreader\win7 - 1 Pass Zero fi
les (20 lines)
BUILD: Saving c:\winddk\7600.16385.1\build.dat...
BUILD: Building generated files in k:\vsmartcard-master\virtualsmartcard\win32\b
ixvreader\win7 directory
Configuring OACR for 'root:x86chk' -
May 25 23:53:49 oacr.dll OACR version change (from build '0' to '30122')
Running MIDL on - k:\vsmartcard-master\virtualsmartcard\win32\bixvreader\virtual
screader.idl
0>errors in directory k:\vsmartcard-master\virtualsmartcard\win32\bixvreader\win
7
0>
Ignoring invalid directory prefix in SOURCES= entry: ......\src\vpcd\vpcd.c

0>errors in directory k:\vsmartcard-master\virtualsmartcard\win32\bixvreader\win
7
0>
Ignoring invalid directory prefix in SOURCES= entry: ......\src\vpcd\lock.c

BUILD: Examining k:\vsmartcard-master\virtualsmartcard\win32\bixvreader\win7 dir
ectory for files to compile. (2nd Pass)
k:\vsmartcard-master\virtualsmartcard\win32\bixvreader\win7 - 13 source file
s (2,051 lines)
BUILD: Saving c:\winddk\7600.16385.1\build.dat...
BUILD: Compiling k:\vsmartcard-master\virtualsmartcard\win32\bixvreader\win7 dir
ectory
1>errors in directory k:\vsmartcard-master\virtualsmartcard\win32\bixvreader\win
7
1>NMAKE : fatal error U1073: don't know how to make 'k:\vsmartcard-master\virtua
lsmartcard\win32\bixvreader\win7\objchk_win7_x86\i386\vpcd.obj'
1>nmake.exe /nologo BUILDMSG=Stop. -i BUILD_PASS=PASS1 NOLINK=1 NOPASS0=1 MAKEDI
R_RELATIVE_TO_BASEDIR= failed - rc = 2

BUILD: Compile errors: not linking k:\vsmartcard-master\virtualsmartcard\win32\b
ixvreader\win7 directory
BUILD: Finish time: Mon May 25 23:53:55 2015
BUILD: Done

1 file compiled - 3 Warnings - 6 Errors

K:\vsmartcard-master\virtualsmartcard\win32\BixVReader\Win7>

Not sure where the problem is. should I build it by WDK 8.1 ?

thanks
BL

"Disconnected from VPCD" after tag scanning

After the successful connection between Smart Card Reader on android and vpcd/pcscd, when trying to scan a nfc tag, "Disconnected from VPCD" appears and pcsc_scan says "Card state: Card removed".

Is there any extra configuration needed to do?


pcsc-lite version 1.8.16
vicc 0.8

Remote Smart Card Reader & vpcd connection difficulty

Hi,

I'm trying to use Samsung S4 as an NFC reader to a Javacard for GPG application.

Setup Summary:

Fedora 22 64bit running pcsc-lite-1.8.13-1.fc21.x86_64 from distribution (192.168.0.161)
with recently cloned, compiled & installed from github vsmartcard (default /etc/reader.conf.d/vpcd)

Samsung S4 running Android 5.0.1 (192.168.0.196)
Remote Smart Card Reader v1.2

On the host:

# systemctl status pcscd.service
● pcscd.service - PC/SC Smart Card Daemon
   Loaded: loaded (/usr/lib/systemd/system/pcscd.service; static)
   Active: active (running) since Thu 2015-07-09 14:12:34 CEST; 17s ago
  Main PID: 10365 (pcscd)
   CGroup: /system.slice/pcscd.service
           └─10365 /usr/sbin/pcscd --foreground --auto-exit

Jul 09 14:12:34 cephalo13 systemd[1]: Started PC/SC Smart Card Daemon.
Jul 09 14:12:34 cephalo13 pcscd[10365]: 00000000 tokenparser.l:214:bundleParse() Could not open bundle file /usr/lib64/pcsc/drivers/ifdnfc.bundle/Contents/Info.plist: No such file or directory


# opensc-tool -l
# Detected readers (pcsc)
Nr.  Card  Features  Name
0    No              Virtual PCD 00 00
1    No              Virtual PCD 00 01


# tcpdump -ni em1 port 35963
tcpdump: verbose output suppressed, use -v or -vv for full protocol decode
listening on em1, link-type EN10MB (Ethernet), capture size 262144 bytes

14:15:07.214594 IP 192.168.0.196.49496 > 192.168.0.161.35963: Flags [S], seq 2672005168, win 65535, options [mss 1460,sackOK,TS val 258667 ecr 0,nop,wscale 7], length 0

On the Android device, the Remote Reader App gives:

Error: failed to connect to /192.168.0.161 (port 35963): connect failed: EHOSTUNREACH (No route to host)
Error: failed to connect to /192.168.0.161 (port 35963): connect failed: EHOSTUNREACH (No route to host)
Using a dummy card to test the connection
Error: failed to connect to /192.168.0.161 (port 35963): connect failed: EHOSTUNREACH (No route to host)

In order to diagnose this issue, I

setenforce permissive
systemctl stop iptables
systemctl stop pcscd.service
systemctl stop pcscd.socket
systemctl start pcscd.service

and get the same result.

There is existing successful KDEConnect networking between the host and phone and so I'm puzzled by the reported error of no route to host, and despite a packet being received from the phone to the host, no return traffic is captured.

Any help gratefully received!

Check version of help2man and handle its result or remove the used option

Arghh!
The never ending story on SLES SP3. Now the installed help2man tool is too old with version 1.36
and the used option --no-discard-stderr will fail the make process.

This option was introduced with version 1.37.1, refer to its bugreport: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=138752

Please add a check that help2man is new enough
or remove the option and send the help page not on stderr.

Own hint:
Since "vicc --version" prints on stderr, I modified my /usr/bin/help2man code, where I replaced the 2>/dev/null with 2>&1

ccid/configure.ac doesn't check for OpenSC Headers

ccid.c includes OpenSC headers but configure.ac doesn't check for the presence of these header files. Therefore ./configure might succeed even though the conditions for a successful build aren't fulfilled resulting in an error during make.

[11:26] ~/workspace/vsmartcard/ccid (git:master)$ ./configure
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for a thread-safe mkdir -p... /usr/bin/mkdir -p
checking for gawk... gawk
checking whether make sets $(MAKE)... yes
checking whether make supports nested variables... yes
checking for style of include used by make... GNU
checking for gcc... gcc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables...
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ISO C89... none needed
checking whether gcc understands -c and -o together... yes
checking dependency style of gcc... gcc3
checking how to run the C preprocessor... gcc -E
checking for grep that handles long lines and -e... /usr/bin/grep
checking for egrep... /usr/bin/grep -E
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking minix/config.h usability... no
checking minix/config.h presence... no
checking for minix/config.h... no
checking whether it is safe to define EXTENSIONS... yes
checking build system type... x86_64-unknown-linux-gnu
checking host system type... x86_64-unknown-linux-gnu
checking how to print strings... printf
checking for a sed that does not truncate output... /usr/bin/sed
checking for fgrep... /usr/bin/grep -F
checking for ld used by gcc... /usr/bin/ld
checking if the linker (/usr/bin/ld) is GNU ld... yes
checking for BSD- or MS-compatible name lister (nm)... /usr/bin/nm -B
checking the name lister (/usr/bin/nm -B) interface... BSD nm
checking whether ln -s works... yes
checking the maximum length of command line arguments... 1572864
checking whether the shell understands some XSI constructs... yes
checking whether the shell understands "+="... yes
checking how to convert x86_64-unknown-linux-gnu file names to x86_64-unknown-linux-gnu format... func_convert_file_noop
checking how to convert x86_64-unknown-linux-gnu file names to toolchain format... func_convert_file_noop
checking for /usr/bin/ld option to reload object files... -r
checking for objdump... objdump
checking how to recognize dependent libraries... pass_all
checking for dlltool... no
checking how to associate runtime and link libraries... printf %s\n
checking for ar... ar
checking for archiver @file support... @
checking for strip... strip
checking for ranlib... ranlib
checking command to parse /usr/bin/nm -B output from gcc object... ok
checking for sysroot... no
checking for mt... no
checking if : is a manifest tool... no
checking for dlfcn.h... yes
checking for objdir... .libs
checking if gcc supports -fno-rtti -fno-exceptions... no
checking for gcc option to produce PIC... -fPIC -DPIC
checking if gcc PIC flag -fPIC -DPIC works... yes
checking if gcc static flag -static works... yes
checking if gcc supports -c -o file.o... yes
checking if gcc supports -c -o file.o... (cached) yes
checking whether the gcc linker (/usr/bin/ld -m elf_x86_64) supports shared libraries... yes
checking whether -lc should be explicitly linked in... no
checking dynamic linker characteristics... GNU/Linux ld.so
checking how to hardcode library paths into programs... immediate
checking whether stripping libraries is possible... yes
checking if libtool supports shared libraries... yes
checking whether to build shared libraries... yes
checking whether to build static libraries... yes
checking for g++... g++
checking whether we are using the GNU C++ compiler... yes
checking whether g++ accepts -g... yes
checking dependency style of g++... gcc3
checking how to run the C++ preprocessor... g++ -E
checking for ld used by g++... /usr/bin/ld -m elf_x86_64
checking if the linker (/usr/bin/ld -m elf_x86_64) is GNU ld... yes
checking whether the g++ linker (/usr/bin/ld -m elf_x86_64) supports shared libraries... yes
checking for g++ option to produce PIC... -fPIC -DPIC
checking if g++ PIC flag -fPIC -DPIC works... yes
checking if g++ static flag -static works... yes
checking if g++ supports -c -o file.o... yes
checking if g++ supports -c -o file.o... (cached) yes
checking whether the g++ linker (/usr/bin/ld -m elf_x86_64) supports shared libraries... yes
checking dynamic linker characteristics... (cached) GNU/Linux ld.so
checking how to hardcode library paths into programs... immediate
checking for gcc... (cached) gcc
checking whether we are using the GNU C compiler... (cached) yes
checking whether gcc accepts -g... (cached) yes
checking for gcc option to accept ISO C89... (cached) none needed
checking whether gcc understands -c and -o together... (cached) yes
checking dependency style of gcc... (cached) gcc3
checking whether ln -s works... yes
checking for a sed that does not truncate output... (cached) /usr/bin/sed
checking for pkg-config... /usr/bin/pkg-config
checking pkg-config is at least version 0.9.0... yes
checking for help2man... /usr/bin/help2man
checking for gengetopt... /usr/bin/gengetopt
checking whether make supports nested variables... (cached) yes
checking linux/usb/gadgetfs.h usability... yes
checking linux/usb/gadgetfs.h presence... yes
checking for linux/usb/gadgetfs.h... yes
checking for the pthreads library -lpthreads... no
checking whether pthreads work without any flags... no
checking whether pthreads work with -Kthread... no
checking whether pthreads work with -kthread... no
checking for the pthreads library -llthread... no
checking whether pthreads work with -pthread... yes
checking for joinable pthread attribute... PTHREAD_CREATE_JOINABLE
checking if more special flags are required for pthreads... no
checking pthread.h usability... yes
checking pthread.h presence... yes
checking for pthread.h... yes
checking for pthread_create... yes
checking for OPENSSL... yes
checking openssl/evp.h usability... yes
checking openssl/evp.h presence... yes
checking for openssl/evp.h... yes
checking for EVP_read_pw_string_min... yes
configure: WARNING: libnpa not found by pkg-config
checking npa/npa.h usability... no
checking npa/npa.h presence... no
checking for npa/npa.h... no
checking for perform_pace... configure: WARNING: libopensc >= 0.12.1 not found by pkg-config
checking for sc_bytes2apdu... yes
checking arpa/inet.h usability... yes
checking arpa/inet.h presence... yes
checking for arpa/inet.h... yes
checking fcntl.h usability... yes
checking fcntl.h presence... yes
checking for fcntl.h... yes
checking for memory.h... (cached) yes
checking for stdint.h... (cached) yes
checking for stdlib.h... (cached) yes
checking for string.h... (cached) yes
checking sys/ioctl.h usability... yes
checking sys/ioctl.h presence... yes
checking for sys/ioctl.h... yes
checking for unistd.h... (cached) yes
checking for inline... inline
checking for size_t... yes
checking for ssize_t... yes
checking for uint16_t... yes
checking for uint32_t... yes
checking for uint8_t... yes
checking for stdlib.h... (cached) yes
checking for GNU libc compatible malloc... yes
checking for stdlib.h... (cached) yes
checking for GNU libc compatible realloc... yes
checking for working strnlen... yes
checking for memmove... yes
checking for memset... yes
checking for strerror... yes
checking for strtol... yes

ccid-emulator has been configured with following options:

Version: 0.8
User binaries: NONE/bin
Libraries: NONE/lib
Configuration files: NONE/etc

Host: x86_64-unknown-linux-gnu
Compiler: gcc
Preprocessor flags:
Compiler flags: -g -O2
Preprocessor flags:
Linker flags:
Libraries:
PTHREAD_CFLAGS: -pthread
PTHREAD_LIBS:
OPENSC_LIBS: -lopensc -lssl -lcrypto
OPENSSL_CFLAGS:
OPENSSL_LIBS: -lssl -lcrypto
LIBNPA_CFLAGS:
LIBNPA_LIBS:

PACE support: no

HELP2MAN: /usr/bin/help2man
GENGETOPT: /usr/bin/gengetopt

checking that generated files are newer than configure... done
configure: creating ./config.status
config.status: creating Makefile
config.status: creating m4/Makefile
config.status: creating patches/Makefile
config.status: creating src/Makefile
config.status: creating doc/Makefile
config.status: creating config.h
config.status: config.h is unchanged
config.status: executing depfiles commands
config.status: executing libtool commands
[11:27] ~/workspace/vsmartcard/ccid (git:master)$

[11:27] ~/workspace/vsmartcard/ccid (git:master)$ make
make all-recursive
make[1]: Entering directory '/home/do/workspace/vsmartcard/ccid'
Making all in src
make[2]: Entering directory '/home/do/workspace/vsmartcard/ccid/src'
find: "../src/opensc/src": Datei oder Verzeichnis nicht gefunden
make all-am
make[3]: Entering directory '/home/do/workspace/vsmartcard/ccid/src'
find: "../src/opensc/src": Datei oder Verzeichnis nicht gefunden
CC ccid_emulator-ccid.o
ccid.c:20:27: schwerwiegender Fehler: libopensc/log.h: Datei oder Verzeichnis nicht gefunden
#include <libopensc/log.h>
^
Kompilierung beendet.
Makefile:502: recipe for target 'ccid_emulator-ccid.o' failed
make[3]: *** [ccid_emulator-ccid.o] Error 1
make[3]: Leaving directory '/home/do/workspace/vsmartcard/ccid/src'
Makefile:380: recipe for target 'all' failed
make[2]: *** [all] Error 2
make[2]: Leaving directory '/home/do/workspace/vsmartcard/ccid/src'
Makefile:406: recipe for target 'all-recursive' failed
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory '/home/do/workspace/vsmartcard/ccid'
Makefile:337: recipe for target 'all' failed
make: *** [all] Error 2
[11:28] ~/workspace/vsmartcard/ccid (git:master)$

Documentation for building ccid

The "Hints on building OpenSC" section in the ccid documentation is incorrect. The instructions tell you to use the OpenSC submodule included in the vsmartcard repository and build it using autoreconf/configure/make instructions. However, copying the instructions verbatim results in the following error:

autoreconf: `configure.ac' or `configure.in' is required

The command "autoreconf -vsi" exited with 1.

That's because the submodule doesn't include a configure.ac but a configure.ac.in. The configure.ac is probably generated by the libnpa build scripts. The documentation for CCID should be updated accordingly.

vicc Relay type doesn't work.

Remote reader driver was installed on Windows 7 x86 PC and vicc.py started at the same PC.
Below is the output of vicc.py:

D:\wrk\virtualsmartcard-0.7_win32\vpicc>python vicc.py -t relay --reader 4 -v
-v -v -v -v
02.02.2016 10:53:40  [INFO] Connected to card in 'OMNIKEY CardMan 5x21 0'
02.02.2016 10:53:40  [INFO] Connected to virtual PCD at localhost:35963
02.02.2016 10:53:41  [INFO] Reset
Traceback (most recent call last):
  File "vicc.py", line 143, in <module>
    vicc.run()
  File "D:\wrk\virtualsmartcard-0.7_win32\vpicc\virtualsmartcard\VirtualSmartcar
d.py", line 793, in run
    self.os.reset()
  File "D:\wrk\virtualsmartcard-0.7_win32\vpicc\virtualsmartcard\VirtualSmartcar
d.py", line 50, in reset
    self.mf.current = self.mf
  File "D:\wrk\virtualsmartcard-0.7_win32\vpicc\virtualsmartcard\SmartcardFilesy
stem.py", line 216, in <lambda>
    lambda self:        getattr(self, "_"+prop),
AttributeError: 'RelayOS' object has no attribute '_mf'

The card is in reader and can return ATR.
Could you please point out what I'm doing wrong?

Compiling virtualsmartcard fails due to new QR Code feature -- (not intended to be installed)

  1. Please add a note in readme about dependency to the QR Code feature.
    http://frankmorgner.github.io/vsmartcard/virtualsmartcard/README.html
    Is the source code from https://fukuchi.org/works/qrencode/ required or binary packages for related system ?
  2. Please add a flag in configure script (e.g. "--disable-QRcode") to bypass usage of the QRcode feature, as some system configuration do not want to have such additional packages or do not have internet Access and printf("https://api.qrserver.com/v1/create-qr-code/?data=%s\n", uri) will fail.

Vicc.py dynamic slot reader

Hello Frank!
Is there any way to concatenate ifdVendorID with the pcsc_scan slot reader?
Example

-> # Lsusb -v | Less
Bus 001 Device 003: ID 1059: 0017 Giesecke & Devrient GmbH

A-) I get the ID 1059: 0017
B-) And concatenate with the command:

-> # Pcsc_scan
V 1.4.22 (c) 2001-2011, Ludovic Rousseau [email protected]
Compiled with PC / SC lite version: 1.8.10
Using reader plug'n play mechanism
Scanning present readers ...
0: Giesecke & Devrient GmbH StarSign Crypto USB Token (021109280558) 00 00

C-) The reader in the case is the value 0

What I want to do is identify the usb physical port with the slot reader that was listed. Can you do that?

Comments:
A-) I know that through serial number I can but CCID readers sometimes have no serial number
B-) I know to give a link in the file
/usr/lib/pcsc/drivers/ifd-ccid.bundle/Contents/Info.plist
But I want to insert several different tokens which would be impossible to always be in a static physical slot

vpicc on windows

Expected behaviour

precompiled vpicc running with ISO 7816 card example.

Actual behaviour

Getting a bunch of ERR_FILENOTFOUND exceptions, I feel like you may have explained how to deal with the issue in this thread: #27 but I'm not sure. Lots of errors like this, but the card is detected by vpcd.

07.09.2016 20:39:58  [INFO] Parsed APDU:
C_APDU(CLA=0x00, INS=0xA4, P1=0x04, P2=0x00, Lc=0x09) with 9 (0x09) bytes of data:
0000:  a0 00 00 03 97 42 54 46 59                        .....BTFY
07.09.2016 20:39:58  [DEBUG] file (dfname='\xa0\x00\x00\x03\x97BTFY') not found in:
{MF at 0x2b6e5d0}:
  _filedescriptor 0x38
  _secondSFT      length 1:
  0000:  01                                                .
  extra_fci_data  length 0:

  _fid            0x3f00
  _content
  _lifecycle      0x5
  _data           length 0:

  _firstSFT       length 1:
  0000:  ff                                                .
07.09.2016 20:39:58  [INFO] Checking error (Wrong parameters P1-P2): File or application not found
Traceback (most recent call last):
  File "C:\virtualsmartcard-0.7_win32\vpicc\virtualsmartcard\VirtualSmartcard.py", line 337, in execute
    sw, result = self.ins2handler.get(c.ins, notImplemented)(c.p1, c.p2, c.data)
  File "C:\virtualsmartcard-0.7_win32\vpicc\virtualsmartcard\SmartcardFilesystem.py", line 683, in selectFile
    file = self._selectFile(p1, p2, data)
  File "C:\virtualsmartcard-0.7_win32\vpicc\virtualsmartcard\SmartcardFilesystem.py", line 661, in _selectFile
    REF["REFERENCE_CONTROL_SELECT"], index_current)
  File "C:\virtualsmartcard-0.7_win32\vpicc\virtualsmartcard\SmartcardFilesystem.py", line 481, in select
    raise SwError(SW["ERR_FILENOTFOUND"])

Steps to reproduce

  1. Install python 2.7, install/compile dependencies
  2. Run "python.exe vicc.py -v -v -v -v"

Thanks for your time!

Running vpicc On Windows

In my hostmachine(win7 32bit), BixVReader has been installed.
Then python2.7, pyscard-1.6.12.win32-py2.7.msi,PIL-1.1.7.win32-py2.7.exe, are installed too.When i want to make a virtualsmartcard, the result is ImportError: No module named readline

After i install pyreadline, ImportError readline disappear. But ImportError cipher is coming.
After python setup.py build , according to url
https://pypi.python.org/pypi/pycrypto/2.6.1

Then copy C:\Users\Administrator\MyProject\pycrypto-2.6.1\build\lib.win32-2.7\Crypto to C:\Python27\Lib\site-packages\Crypto, importError cipher is disappearing. But SwError is coming

D:\kp\sc\vsmartcard-master\virtualsmartcard>python.exe src/vpicc/vicc.in
Traceback (most recent call last):
File "D:\kp\sc\vsmartcard-master\virtualsmartcard\src\vpicc\virtualsmartcard\VirtualSmartcard.py", line 337, in execute
sw, result = self.ins2handler.get(c.ins, notImplemented)(c.p1, c.p2, c.data)
File "D:\kp\sc\vsmartcard-master\virtualsmartcard\src\vpicc\virtualsmartcard\SmartcardFilesystem.py", line 683, in selectFile
file = self._selectFile(p1, p2, data)
File "D:\kp\sc\vsmartcard-master\virtualsmartcard\src\vpicc\virtualsmartcard\SmartcardFilesystem.py", line 661, in _selectFile
REF["REFERENCE_CONTROL_SELECT"], index_current)
File "D:\kp\sc\vsmartcard-master\virtualsmartcard\src\vpicc\virtualsmartcard\SmartcardFilesystem.py", line 481, in select
raise SwError(SW["ERR_FILENOTFOUND"])
SwError

But through private card reader, can connect to , and send atr, the answer is 3B 95 13 81 01 80 73 FF 01 00 0B.

If use this start command, python.exe src/vpicc/vicc.in --type=cryptoflex, SwError disappear.

Any help would be appreciated. Thank you.

Relaying to ISO 7816 reader?

Is there any support to hook up a Virtual Smart Card to a "real" physical contact interface (ISO 7816)?

I'm basically trying to implement the PC/SC Relay with contact smart cards instead of contactless.

Thanks!

cc @samyk

remote-reader: build not possible due to app/build.gradle settings -- compile 'com.android.support:appcompat-v7:+'

With current settings in build.gradle I'm never able to get the code compiled on my Android 4.4.2 due to:

Error:Execution failed for task ':app:processDebugManifest'.

Manifest merger failed : uses-sdk:minSdkVersion 10 cannot be smaller than version L declared in library com.android.support:appcompat-v7:21.0.0-rc1

I change always the dependencies section from
compile 'com.android.support:appcompat-v7:+'
compile fileTree(dir: 'libs', include: ['*.jar'])

into:
compile 'com.android.support:support-v4:19.0.0'
compile 'com.android.support:appcompat-v7:19.0.0'
compile fileTree(dir: 'libs', include: ['*.jar'])

As you mentioned that Android 3.0 “Honeycomb” or newer is supported, please change the settings that not only Android version L is valid (with newest Android Studio 0.8.6)

Smart Card Reader App doesn't connect to PC

Expected behaviour

When I press the button for connecting (the yellow one), I should be able to use the smartphone as a smart card reader connected to the PC, after having installed and configurated Virtual Smart Card on the PC.

Actual behaviour

I get this error in the app (this is the log):
'Connecting to "VPCD Hostname:VPCD Port"...
ERROR: failed to connect to /
"VPCD Hostname" (port "VPCD Port"): connect
failed: ECONNREFUSED (Connection refused)'

Steps to reproduce

  1. Install and configure VPCD on a linux PC
  2. Get the Android app
  3. Try to connect

Question about pcsc-relay and the Reiner SCT cyberJack wave

I am playing with the wave, a nPA and relaying. It doesn't look like the wave wants to play.

So I was wondering if you have experience with this card reader and/or if my assumption "this should probably work" is simply wrong.

Setup:
PC1 (linux): wave via usb, pcsc-relay to PC2
PC2 (linux): default vpcd

First test I did with the Open eCard App. It recognized the card first as unknown and after some selecting and reading it switches to nPA. I tried then using the card with some services (www.kba-online.de and https://www.buergerserviceportal.de/bayern/wuerzburg/bspx_selbstauskunft). The process worked until the eID-PIN Input and crashed then. (The PIN Input came at PC2, not at as I expected on the reader.)

So after that I tried establishing PACE with CAN with the npa-tool. This time the reader showed for a brief second the Modus: Ident. screen and then crashed.

Output from pcsc-relay:

user@PC1 ~ % pcsc-relay -v -e vpcd -N 141.20.9.17
Connected to reader 2: REINER SCT cyberJack wave (5381493251) 00 00
Card's ATR: 3B 8A 80 01 80 31 B8 73 84 01 E0 82 90 00 06 
Waiting for VPCD on port 35963 for 300 seconds
C-APDU: FF 9A 04 01 
R-APDU: 30 14 A1 03 01 01 FF A2 03 01 01 FF A3 03 01 01 00 A4 03 01 01 FF 90 00 
C-APDU: FF 9A 04 02 00 00 07 30 05 A1 03 02 01 02 FF FF 
Transaction failed.

With this test I also noticed, that the ATR on PC2 was only 5 byte and not the one shown at PC1.

Output from pcsc_scan:

Mon Sep  5 15:15:55 2016
Reader 0: Virtual PCD 00 00
  Card state: Card inserted, 
  ATR: 3B 80 80 01 01

ATR: 3B 80 80 01 01
+ TS = 3B --> Direct Convention
+ T0 = 80, Y(1): 1000, K: 0 (historical bytes)
  TD(1) = 80 --> Y(i+1) = 1000, Protocol T = 0 
-----
  TD(2) = 01 --> Y(i+1) = 0000, Protocol T = 1 
-----
+ Historical bytes: 
+ TCK = 01 (correct checksum)

Possibly identified card (using /usr/share/pcsc/smartcard_list.txt):
3B 80 80 01 01
    ISO 14443 Type B without historical bytes
    Electronic Passport
    Spanish passport (2012)

SW_UNKNOWN when trying to select applets in ACardEmulator

Hi!
I am trying to use the ACardEmulator with an Android phone. I am using a second phone as Remote Smartcard Reader.

My setup is:

computer <- network -> phone#1 <- NFC -> phone#2

where phone#1 has remote smartcard reader and phone#2 has the android smartcard emulator.

I can communicate from the computer to the phone#1. And the phone#1 (remote reader) recognizes a NFC compatible Java Card that I own (i.e. computer <- network -> phone#1 <- NFC -> NFC java card works).
However, it will always return the 0x6F00 (No precise diagnosis) status word when trying to select an (arbitrary) smartcard applet on phone#2. It seems like the remote smartcard reader (phone#1) returns this and is using the "dummy card to test the connection". The remote smartcard reader does not seem to recognize the emulated smartcard via NFC.

I suspect that this is some sort of misconfiguration or misuse on my side. Is there any additional step needed to install the applets in the emulated smartcard environment after pressing the "run app" button in android studio? Or to set up the NFC connection?
Also, the log screen of the android smartcard emulator keeps staying empty. Should there be any log entry?
In case you need to see any logs or have a suggestion on how to debug this, please let me know. Thank you for your time.

pcsc-relay can't be build

pcsc-relay includes a symlink to vpcd.c. This now includes lock.h. Since there is no symlink to lock.h (or lock.c) in the pcsc-relay folder, building pcsc-relay fails with the following error:

vpcd.c:20:18: fatal error: lock.h: No such file or directory

compilation terminated.

make[3]: *** [pcsc_relay-vpcd.o] Error 1

virtualsmartcard reset feature.

Hi,
I am not sure if this is a bug or not.
vicc in relay mode. like bellow.

./vicc -t relay -P 12019 -R -vvv

when I made a tcp connection with port 12019 and just sent 3 bytes. { 0x00,0x01,0x02}

vicc has the following errors.

[root@dell52 vpicc]# ./vicc -t relay -P 12019 -R -vvv
21.05.2015 16:11:34 [INFO] Connected to card in 'Realtek Smart Card Reader Interface 00 00'
21.05.2015 16:11:34 [INFO] Waiting for vpcd on port 12019
21.05.2015 16:12:09 [INFO] Connected to virtual PCD at 172.27.103.30:12019
21.05.2015 16:12:19 [INFO] Reset
Traceback (most recent call last):
File "./vicc", line 161, in
vicc.run()
File "/root/tmp/vsmartcard/virtualsmartcard/src/vpicc/virtualsmartcard/VirtualSmartcard.py", line 804, in run
self.os.reset()
File "/root/tmp/vsmartcard/virtualsmartcard/src/vpicc/virtualsmartcard/VirtualSmartcard.py", line 50, in reset
self.mf.current = self.mf
File "/root/tmp/vsmartcard/virtualsmartcard/src/vpicc/virtualsmartcard/SmartcardFilesystem.py", line 216, in
lambda self: getattr(self, "_"+prop),
AttributeError: 'RelayOS' object has no attribute '_mf'

Thanks
--BL

Make problem

Hello, having this output in Kubuntu 14.10

Makefile:699: recipe for target 'vicc.1' failed
make[3]: *** [vicc.1] Error 1
make[3]: Leaving directory '/home/rayce/vsmartcard-2012-04-11/virtualsmartcard/src/vpicc'
Makefile:357: recipe for target 'all-recursive' failed
make[2]: *** [all-recursive] Error 1
make[2]: Leaving directory '/home/rayce/vsmartcard-2012-04-11/virtualsmartcard/src'
Makefile:404: recipe for target 'all-recursive' failed
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory '/home/rayce/vsmartcard-2012-04-11/virtualsmartcard'
Makefile:335: recipe for target 'all' failed
make: *** [all] Error 2

Wondering if I'm missing something or doing something wrong. I've read the INSTALL and README. Thanks for any help!!!

PyCrypto not installed: CryptoUtils.py gets DeprecationWarning for sha module in Python 2.6

PyCrypto was not installed, that's why I go the except path in CryptoUtils.py to use "import sha as SHA1"

But in Python 2.6 it leads to the "DeprecationWarning: the sha module is deprecated; use the hashlib module instead" while in Python 2.7 the Deprecation Warnings are switched off.

I know I can bypass the warning in 2.6 by calling python with "-W ignore::DeprecationWarning", but please move to usage of hashlib module to be more compatible.

Provided python-crypto 2.0.1 package by SLES 11 SP3 is .... too old and fails as well, but with pycrypto 2.6.1 is works again

This issue is just for the except path where sha module is used. Please change it to hashlib or remove its usage and throw a hint message about mandatory of pycrypto.

Python coding style

AFAICT the python code currently doesn't use a unified coding style. We should move to PEP8 compliant formatting.

Running VPCD on OSX El Capitan

I'm trying to set up VPCD to use the Remote Reader on my Mac (10.11.5). I would like to connect via "Smart Card Remote" on my OnePlus One.

At first I struggled with building due to System Integrity Protection. I got over it and vpcd-config prints an IP and a Port. But starting vicc manually it Prints

MacBook: John$ vicc Traceback (most recent call last): File "/opt/bin/vicc", line 112, in <module> from virtualsmartcard.VirtualSmartcard import VirtualICC ImportError: No module named virtualsmartcard.VirtualSmartcard

Any suggestions how to fix it? Where should "virtualsmartcard.VirtualSmartcard" be situated?

Thanks for your support!

Support for another type of card

Thanks for sharing the incredible work.

Is it possible to add support for another type of Card like the ISO-14443types a and b? Am confused since Generic ISO-7816 smart card uses the same transmission protocol as 14443 type a and b.

running vicc

Failed to load symbol for: SCardCancelTransaction, /lib/x86_64-linux-gnu/libpcsclite.so.1: undefined symbol: SCardCancelTransaction!
26.01.2015 23:05:18 [WARNING] Using default SAM parameters. PIN=1234, Card Nr=1234567890
26.01.2015 23:05:18 [ERROR] Failed to open socket: [Errno 111] Connection refused
26.01.2015 23:05:18 [ERROR] Is pcscd running at localhost? Is vpcd loaded? Is a firewall blocking port 35963?

This is my output. Thanks for any enlightenment

Support Needed

Expected behaviour

What should happen?
Should see APDU responses.

Actual behaviour

Error message: ***** Buffer Over Flow *****

Setup

  • Machine A has physical smart card reader(PC/SC supported) and UICC (T-mobile USIM) connected.
  • Machine A is a Ubuntu 14.04.5 LTS running on a Lenovo T430
  • B machine is a Ubuntu VM running on windows 7 platform.
  • A(192.168.1.160) and B(192.168.1.3) are in the same local network

Steps to reproduce

  1. A machine runs "pcsc-relay --connector pcsc --emulator vpcd"
  2. B machine runs "pcsc-relay --connector vicc --emulator vpcd"

Logs

leander@ubuntu:~/Wing/WingSIM/vsmartcard/pcsc-relay$ sudo pcsc-relay -n 192.168.1.160-p 35963 --connector vicc --emulator vpcd
*** buffer overflow detected ***: pcsc-relay terminated

======= Backtrace: =========
/lib/x86_64-linux-gnu/libc.so.6(+0x7329f)[0x7f2c9baa029f]
/lib/x86_64-linux-gnu/libc.so.6(__fortify_fail+0x5c)[0x7f2c9bb37bbc]
/lib/x86_64-linux-gnu/libc.so.6(+0x109a90)[0x7f2c9bb36a90]
/lib/x86_64-linux-gnu/libc.so.6(+0x10ab07)[0x7f2c9bb37b07]
pcsc-relay[0x402c80]
pcsc-relay[0x40319b]
pcsc-relay[0x4031fa]
...

remote-reader: to keep NFC active, please build in keep screen active function

On Android, the NFC will be switched off, in case the screen goes off/into standby.
That's within the overall communication and I have to touch the display permanently to keep it active.

To avoid that, the simplest way is to declare in remote-reader/app/src/main/res/layout/activity_main.xml section the attribute
android:keepScreenOn="true"
But as this will drop off the battery, please build in some (configurable) timer (e.g. one minute), after which the screen goes off again.

Android remote-reader gets "Error: Call connect() first!" if nPA is put on NFC

The stacktrace looks like:
09-19 22:38:09.223 16403-16455/com.vsmartcard.remotesmartcardreader.app W/System.err﹕ java.lang.IllegalStateException: Call connect() first!
09-19 22:38:09.228 16403-16455/com.vsmartcard.remotesmartcardreader.app W/System.err﹕ at android.nfc.tech.BasicTagTechnology.checkConnected(BasicTagTechnology.java:52)
09-19 22:38:09.228 16403-16455/com.vsmartcard.remotesmartcardreader.app W/System.err﹕ at android.nfc.tech.BasicTagTechnology.transceive(BasicTagTechnology.java:143)
09-19 22:38:09.228 16403-16455/com.vsmartcard.remotesmartcardreader.app W/System.err﹕ at android.nfc.tech.IsoDep.transceive(IsoDep.java:172)
09-19 22:38:09.228 16403-16455/com.vsmartcard.remotesmartcardreader.app W/System.err﹕ at com.vsmartcard.remotesmartcardreader.app.screaders.NFCReader.reset(NFCReader.java:71)
09-19 22:38:09.228 16403-16455/com.vsmartcard.remotesmartcardreader.app W/System.err﹕ at com.vsmartcard.remotesmartcardreader.app.VPCDWorker.run(VPCDWorker.java:100)
09-19 22:38:09.233 16403-16455/com.vsmartcard.remotesmartcardreader.app W/System.err﹕ at java.lang.Thread.run(Thread.java:841)

In detail:
The VPCDWorker.java is going to case VPCD_CTRL_RESET and will call reader.reset()

But in screaders\NFCReader.java the reset method will fail at card.transceive(SELECT_MF);

As dirty hack I added a card close() and connect() before card.transceive() and Open eCard got visible the nPA :-) but the AusweisApp 1.13 says "unbekannte Karten" :-(

public void reset() throws IOException {
    card.close();
    card.connect();
    card.setTimeout(TIMEOUT);
    byte[] response = card.transceive(SELECT_MF);
    if (response.length == 2 && response[0] == 0x90 && response[1] == 0x00) {
        Log.d(this.getClass().getName(), "Resetting the card by selecting the MF results in " + Hex.getHexString(response));
    }
}

Later on if I remove the nPA a TagLostException occurs while send APDU, please catch that possible user interaction:
09-19 22:54:04.118 17860-18681/com.vsmartcard.remotesmartcardreader.app W/System.err﹕ android.nfc.TagLostException: Tag was lost.
09-19 22:54:04.118 17860-18681/com.vsmartcard.remotesmartcardreader.app W/System.err﹕ at android.nfc.TransceiveResult.getResponseOrThrow(TransceiveResult.java:48)
09-19 22:54:04.123 17860-18681/com.vsmartcard.remotesmartcardreader.app W/System.err﹕ at android.nfc.tech.BasicTagTechnology.transceive(BasicTagTechnology.java:151)
09-19 22:54:04.123 17860-18681/com.vsmartcard.remotesmartcardreader.app W/System.err﹕ at android.nfc.tech.IsoDep.transceive(IsoDep.java:172)
09-19 22:54:04.128 17860-18681/com.vsmartcard.remotesmartcardreader.app W/System.err﹕ at com.vsmartcard.remotesmartcardreader.app.screaders.NFCReader.transmit(NFCReader.java:105)
09-19 22:54:04.128 17860-18681/com.vsmartcard.remotesmartcardreader.app W/System.err﹕ at com.vsmartcard.remotesmartcardreader.app.VPCDWorker.run(VPCDWorker.java:109)
09-19 22:54:04.133 17860-18681/com.vsmartcard.remotesmartcardreader.app W/System.err﹕ at java.lang.Thread.run(Thread.java:841)

Read Information smartcard

Hello Frank

I would like to know if you have how to read the certificate in linux by command line, for example data like:

  • Name
  • certified issuer

README.txt - Improve hints on building and installing vpcd on Windows for 64 bit systems

It's about: http://frankmorgner.github.io/vsmartcard/virtualsmartcard/README.html

some points to make life easier.

  1. an issue:
    If this is an issue, please mention in you guide which version of Visual Studio 2013 is required to get it compiled. Is Express enough or Professional required? If it's does not matter, mention it as well. ;-)
  2. an issue:
    That UMDF Driver for a Virtual Smart Card Reader is written as Win 32 bit code.
    The Win7 source can be compiled as Win7 64 Bit, but C/C++ builder option needs to be changed!
    For that, option "/WX" needs to be removed, otherwise some warnings gets escalated to errors and build will fail.
    Open properties of "BixVReader" (not for "BixVReader-package"), go to C/C++ and change "/WX" into "/WX-".
  3. just a hint:
    In configuration manager ensure, that both projects are set to platform = x64, no mix with Win32 !!!
    Another indication that correct x64 setting was used, is the file size of WudfUpdate_01009.dll in final binary output directory
    32 Bit WudfUpdate_01009.dll ~ 1795 KB
    64 Bit WudfUpdate_01009.dll ~ 2102 KB

Any mix will result into device manager error code 31 for that driver and this is NOT related to wrong or missing code signing!

  1. just a hint:
    The Win7 64 Bit build does not need to be signed, during installation Windows will prompt a warning, just allow its installation.

In case WDK test signing should be used, simply use VS build in Driver Signing settings. Context menu for "BixVReader-package" -> properties -> Driver Signing -> Sign Mode = "Test Sign".
Import the WDKTestCert into your windows keystore. Just read Microsoft "Kernel-Mode Code Signing Walkthrough". It is a very good document for understanding.

Cannot Get vpcd to work on windows

Windows version: 8.1 x64
Ive managed to install the corresponding driver and the driver shows up as "Working" in the device manager as well but when I open resource monitor the corresponding port doesn't show up at all and therefore I can not run vpicc( of course windows refuses connections to closed ports)., What kind of log should I provide? Is this situation fixable?
Thanks.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.