Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: vicc vs vpicc vs vpcd #273

Open
HannesGitH opened this issue Apr 17, 2024 · 3 comments
Open

docs: vicc vs vpicc vs vpcd #273

HannesGitH opened this issue Apr 17, 2024 · 3 comments

Comments

@HannesGitH
Copy link

running freshly compiled vicc results in

[CRITICAL] Failed to open socket: [Errno 111] Connection refused
[CRITICAL] Is pcscd running at localhost? Is vpcd loaded? Is a                               firewall blocking port 35963?

pcscd is enabled and its socket listening:

pcscd.service - PC/SC Smart Card Daemon
     Loaded: loaded (/etc/systemd/system/pcscd.service; linked; preset: enabled)
    Drop-In: /nix/store/jzbsd5h5xwpyl8zkl6hq3zpm077gzp1g-system-units/pcscd.service.d
             └─overrides.conf
     Active: inactive (dead) since Wed 2024-04-17 12:48:04 CEST; 3min 27s ago
   Duration: 1min 1.017s
TriggeredBy: ● pcscd.socket
       Docs: man:pcscd(8)
    Process: 128360 ExecStart=/nix/store/bizgyqkmhkypkall5s69wsv6hwy49mqh-pcsclite-with-polkit-2.0.3/bin/pcscd -f >
   Main PID: 128360 (code=exited, status=0/SUCCESS)
         IP: 0B in, 0B out
         IO: 0B read, 0B written
        CPU: 12ms

Apr 17 12:47:03 hannes systemd[1]: Started PC/SC Smart Card Daemon.
Apr 17 12:48:04 hannes systemd[1]: pcscd.service: Deactivated successfully.

also i think vpcd is loaded (as provided by pcscd log:

00000002 [140523999942976] configfile.l:272:tok_error() tok_error: invalid value line 54 in /etc/passwd: don
00000004 [140523999942976] configfile.l:329:DBGetReaderListDir() Skipping non regular file: locale.conf
00000011 [140523999942976] readerfactory.c:1094:RFInitializeReader() Attempting startup of Virtual PCD 00 00 using /var/lib/pcsc/drivers/serial/libifdvpcd.so
00000053 [140523999942976] readerfactory.c:968:RFBindFunctions() Loading IFD Handler 3.0
00000008 [140523999942976] ifd-vpcd.c:126:IFDHCreateChannel() Waiting for virtual ICC on port 35963
00000018 [140523999942976] ifd-vpcd.c:340:IFDHGetCapabilities() unknown tag 4019
00000002 [140523999942976] readerfactory.c:389:RFAddReader() Using the pcscd polling thread
00000026 [140523999942976] readerfactory.c:520:RFAddReader() Driver is slot thread safe
00000003 [140523999942976] readerfactory.c:1094:RFInitializeReader() Attempting startup of Virtual PCD 00 01 using /var/lib/pcsc/drivers/serial/libifdvpcd.so
00000002 [140523999942976] readerfactory.c:878:RFLoadReader() Reusing already loaded driver for /var/lib/pcsc/drivers/serial/libifdvpcd.so
00000002 [140523999942976] readerfactory.c:968:RFBindFunctions() Loading IFD Handler 3.0
00000005 [140523999942976] ifd-vpcd.c:126:IFDHCreateChannel() Waiting for virtual ICC on port 35964
00000008 [140523999942976] ifd-vpcd.c:340:IFDHGetCapabilities() unknown tag 4019
00000002 [140523999942976] readerfactory.c:554:RFAddReader() Using the pcscd polling thread
00000024 [140523999942976] pcscdaemon.c:809:at_exit() cleaning /run/pcscd
00000006 [140523999942976] pcscdaemon.c:839:clean_temp_files() Cannot remove /run/pcscd/pcscd.comm: No such file or directory
00000004 [140523999942976] pcscdaemon.c:845:clean_temp_files() Cannot remove /run/pcscd/pcscd.pid: No such file or directory

But i don't know how to debug as I cannot understand what vpcd exactly is from the docs..

Steps to reproduce

I used the nix package manager two make it reproducible, therefor it suffices to have a fresh install of pcscd running and then running

  1. nix run github:hannesgith/vsmartcard
@TubaxCrypter
Copy link

If your smart card has a chip, it likely has an embedded OS, which allows only one client to connect at a time. There's a tunnel that continuously listens for the handshake protocol. Even various smart card distributors don't support multiple connections because of this

@frankmorgner
Copy link
Owner

if i understand correctly, no physical smart card is involved and you startet the programs in the following order on one and the same machine:

  1. pcscd with vpcd loaded
  2. vicc

vpcd is the virutal driver and litens on port 35963 for an incoming connection (seems to work). vicc should now connect to that port (does not work).

@frankmorgner
Copy link
Owner

I do not have a lot of advices other than what you already seem to know. the command vicc cannot connect to the local socket 35963, which could be blocked by some firewall rule. There are a number of linux command to check for open ports, also a number of tools to actually connect to one of them. try those and check if you run into any problems.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants