Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Cyberjack card reader [solved]
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Unsupported Software
View previous topic :: View next topic  
Author Message
Moldmaker
Tux's lil' helper
Tux's lil' helper


Joined: 13 Jul 2010
Posts: 120

PostPosted: Sat May 23, 2020 12:52 pm    Post subject: Cyberjack card reader [solved] Reply with quote

Hi everybody,

I have a USB card reader "Reiner SCT cyberjack pinpad" that I use in combination with a proprietary software called "moneyplex". Been using this combination since 2005 under Linux and never had trouble. Now I have installed a new Linux, a Funtoo (which is a Gentoo with different repositories, but basically it is Gentoo).
However, first I did what is being written on this site: Install pcsc-lite, install the cyberjack driver, add the service pcscd to the default runlevel, first start it in debug mode
Code:
pcscd -a -d -f
and see if my chipcard is being detected:
Code:
# pcscd -a -d -f
00000000 [140200313560512] /var/tmp/portage/sys-apps/pcsc-lite-1.8.26/work/pcsc-lite-1.8.26/src/pcscdaemon.c:347:main() pcscd set to foreground with debug send to stdout
00000133 [140200313560512] configfile.l:369:DBGetReaderList() Parsing conf file: /etc/reader.conf.d
00000020 [140200313560512] /var/tmp/portage/sys-apps/pcsc-lite-1.8.26/work/pcsc-lite-1.8.26/src/pcscdaemon.c:663:main() pcsc-lite 1.8.26 daemon ready.
00003089 [140200313560512] /var/tmp/portage/sys-apps/pcsc-lite-1.8.26/work/pcsc-lite-1.8.26/src/hotplug_libudev.c:299:get_driver() Looking for a driver for VID: 0x1D6B, PID: 0x0001, path: /dev/bus/usb/003/001
00000112 [140200313560512] /var/tmp/portage/sys-apps/pcsc-lite-1.8.26/work/pcsc-lite-1.8.26/src/hotplug_libudev.c:299:get_driver() Looking for a driver for VID: 0x1D6B, PID: 0x0001, path: /dev/bus/usb/003/001
00000110 [140200313560512] /var/tmp/portage/sys-apps/pcsc-lite-1.8.26/work/pcsc-lite-1.8.26/src/hotplug_libudev.c:299:get_driver() Looking for a driver for VID: 0x046D, PID: 0x08DA, path: /dev/bus/usb/003/002
00000107 [140200313560512] /var/tmp/portage/sys-apps/pcsc-lite-1.8.26/work/pcsc-lite-1.8.26/src/hotplug_libudev.c:299:get_driver() Looking for a driver for VID: 0x046D, PID: 0x08DA, path: /dev/bus/usb/003/002
00000108 [140200313560512] /var/tmp/portage/sys-apps/pcsc-lite-1.8.26/work/pcsc-lite-1.8.26/src/hotplug_libudev.c:299:get_driver() Looking for a driver for VID: 0x046D, PID: 0x08DA, path: /dev/bus/usb/003/002
00000142 [140200313560512] /var/tmp/portage/sys-apps/pcsc-lite-1.8.26/work/pcsc-lite-1.8.26/src/hotplug_libudev.c:299:get_driver() Looking for a driver for VID: 0x1D6B, PID: 0x0001, path: /dev/bus/usb/004/001
00000139 [140200313560512] /var/tmp/portage/sys-apps/pcsc-lite-1.8.26/work/pcsc-lite-1.8.26/src/hotplug_libudev.c:299:get_driver() Looking for a driver for VID: 0x1D6B, PID: 0x0001, path: /dev/bus/usb/005/001
00000104 [140200313560512] /var/tmp/portage/sys-apps/pcsc-lite-1.8.26/work/pcsc-lite-1.8.26/src/hotplug_libudev.c:299:get_driver() Looking for a driver for VID: 0x1D6B, PID: 0x0001, path: /dev/bus/usb/005/001
00000109 [140200313560512] /var/tmp/portage/sys-apps/pcsc-lite-1.8.26/work/pcsc-lite-1.8.26/src/hotplug_libudev.c:299:get_driver() Looking for a driver for VID: 0x0C4B, PID: 0x0300, path: /dev/bus/usb/005/003
00000015 [140200313560512] /var/tmp/portage/sys-apps/pcsc-lite-1.8.26/work/pcsc-lite-1.8.26/src/hotplug_libudev.c:440:HPAddDevice() Adding USB device: REINER SCT cyberJack pp_a
00000065 [140200313560512] /var/tmp/portage/sys-apps/pcsc-lite-1.8.26/work/pcsc-lite-1.8.26/src/readerfactory.c:1074:RFInitializeReader() Attempting startup of REINER SCT cyberJack pp_a (2542540122) 00 00 using /usr/lib64/readers/usb/libifd-cyberjack.bundle/Contents/Linux/libifd-cyberjack.so
CYBERJACK: Started
00002926 [140200313560512] /var/tmp/portage/sys-apps/pcsc-lite-1.8.26/work/pcsc-lite-1.8.26/src/readerfactory.c:950:RFBindFunctions() Loading IFD Handler 3.0
00032441 [140200313560512] /var/tmp/portage/sys-apps/pcsc-lite-1.8.26/work/pcsc-lite-1.8.26/src/readerfactory.c:391:RFAddReader() Using the pcscd polling thread
00001642 [140200313560512] /var/tmp/portage/sys-apps/pcsc-lite-1.8.26/work/pcsc-lite-1.8.26/src/hotplug_libudev.c:299:get_driver() Looking for a driver for VID: 0x1D6B, PID: 0x0002, path: /dev/bus/usb/001/001
00000083 [140200313560512] /var/tmp/portage/sys-apps/pcsc-lite-1.8.26/work/pcsc-lite-1.8.26/src/hotplug_libudev.c:299:get_driver() Looking for a driver for VID: 0x1D6B, PID: 0x0002, path: /dev/bus/usb/001/001
00000084 [140200313560512] /var/tmp/portage/sys-apps/pcsc-lite-1.8.26/work/pcsc-lite-1.8.26/src/hotplug_libudev.c:299:get_driver() Looking for a driver for VID: 0x0955, PID: 0x0007, path: /dev/bus/usb/001/003
00000106 [140200313560512] /var/tmp/portage/sys-apps/pcsc-lite-1.8.26/work/pcsc-lite-1.8.26/src/hotplug_libudev.c:299:get_driver() Looking for a driver for VID: 0x1D6B, PID: 0x0001, path: /dev/bus/usb/006/001
00000080 [140200313560512] /var/tmp/portage/sys-apps/pcsc-lite-1.8.26/work/pcsc-lite-1.8.26/src/hotplug_libudev.c:299:get_driver() Looking for a driver for VID: 0x1D6B, PID: 0x0001, path: /dev/bus/usb/006/001
00000081 [140200313560512] /var/tmp/portage/sys-apps/pcsc-lite-1.8.26/work/pcsc-lite-1.8.26/src/hotplug_libudev.c:299:get_driver() Looking for a driver for VID: 0x046D, PID: 0xC626, path: /dev/bus/usb/006/002
00000105 [140200313560512] /var/tmp/portage/sys-apps/pcsc-lite-1.8.26/work/pcsc-lite-1.8.26/src/hotplug_libudev.c:299:get_driver() Looking for a driver for VID: 0x1D6B, PID: 0x0001, path: /dev/bus/usb/007/001
00000105 [140200313560512] /var/tmp/portage/sys-apps/pcsc-lite-1.8.26/work/pcsc-lite-1.8.26/src/hotplug_libudev.c:299:get_driver() Looking for a driver for VID: 0x1D6B, PID: 0x0001, path: /dev/bus/usb/008/001
00000077 [140200313560512] /var/tmp/portage/sys-apps/pcsc-lite-1.8.26/work/pcsc-lite-1.8.26/src/hotplug_libudev.c:299:get_driver() Looking for a driver for VID: 0x1D6B, PID: 0x0001, path: /dev/bus/usb/008/001
00000085 [140200313560512] /var/tmp/portage/sys-apps/pcsc-lite-1.8.26/work/pcsc-lite-1.8.26/src/hotplug_libudev.c:299:get_driver() Looking for a driver for VID: 0x046D, PID: 0xC21C, path: /dev/bus/usb/008/002
00000112 [140200313560512] /var/tmp/portage/sys-apps/pcsc-lite-1.8.26/work/pcsc-lite-1.8.26/src/hotplug_libudev.c:299:get_driver() Looking for a driver for VID: 0x1D6B, PID: 0x0002, path: /dev/bus/usb/002/001
00000078 [140200313560512] /var/tmp/portage/sys-apps/pcsc-lite-1.8.26/work/pcsc-lite-1.8.26/src/hotplug_libudev.c:299:get_driver() Looking for a driver for VID: 0x1D6B, PID: 0x0002, path: /dev/bus/usb/002/001
00000080 [140200313560512] /var/tmp/portage/sys-apps/pcsc-lite-1.8.26/work/pcsc-lite-1.8.26/src/hotplug_libudev.c:299:get_driver() Looking for a driver for VID: 0x1A40, PID: 0x0101, path: /dev/bus/usb/002/003
00000077 [140200313560512] /var/tmp/portage/sys-apps/pcsc-lite-1.8.26/work/pcsc-lite-1.8.26/src/hotplug_libudev.c:299:get_driver() Looking for a driver for VID: 0x1D6B, PID: 0x0002, path: /dev/bus/usb/002/001
00000081 [140200313560512] /var/tmp/portage/sys-apps/pcsc-lite-1.8.26/work/pcsc-lite-1.8.26/src/hotplug_libudev.c:299:get_driver() Looking for a driver for VID: 0x04A9, PID: 0x10D3, path: /dev/bus/usb/002/004
00000304 [140200313560512] /var/tmp/portage/sys-apps/pcsc-lite-1.8.26/work/pcsc-lite-1.8.26/src/readerfactory.c:1409:RFWaitForReaderInit() Waiting init for reader: REINER SCT cyberJack pp_a (2542540122) 00 00
06485325 [140200292820736] /var/tmp/portage/sys-apps/pcsc-lite-1.8.26/work/pcsc-lite-1.8.26/src/eventhandler.c:406:EHStatusHandlerThread() powerState: POWER_STATE_POWERED
00000023 [140200292820736] /var/tmp/portage/sys-apps/pcsc-lite-1.8.26/work/pcsc-lite-1.8.26/src/eventhandler.c:423:EHStatusHandlerThread() Card inserted into REINER SCT cyberJack pp_a (2542540122) 00 00
00000013 [140200292820736] Card ATR: 3B B7 94 00 81 31 FE 65 53 50 4B 32 33 90 00 D1
00404951 [140200292820736] /var/tmp/portage/sys-apps/pcsc-lite-1.8.26/work/pcsc-lite-1.8.26/src/eventhandler.c:482:EHStatusHandlerThread() powerState: POWER_STATE_UNPOWERED
Obviously, the card is being detected (important is the line with Card ATR: blabla). When I remove the card I get the output
Code:
59243043 [140200292820736] /var/tmp/portage/sys-apps/pcsc-lite-1.8.26/work/pcsc-lite-1.8.26/src/eventhandler.c:358:EHStatusHandlerThread() Card Removed From REINER SCT cyberJack pp_a (2542540122) 00 00
Looking good so far, isn't it?
Then I downloaded the moneyplex software and asked for a key for testing purposes; you get it via email. monexplex is installed in your user's home directory, from here you can start it. It starts, asks for the key, it updates itself, it tests your internet, and then it wants to test the card reader. The pcscd daemon is running (not in debug mode, only started during booting). When I insert my chipcard, the green LED turns on (good sign for me) and then you have a button "Test" and when I hit it, moneyplex tells me that there is no card inserted. I tried this many times cleaning the contacs on the card, but moneyplex does not recognize it, whereas the system sees it. So I did some research and installed the pcsc-tools. They give you a nice little tool called pcsc_scan which gives the following output when being started and you insert and remove a chipcard:
Code:
# pcsc_scan
Using reader plug'n play mechanism
Scanning present readers...
0: REINER SCT cyberJack pp_a (2542540122) 00 00
 
Sat May 23 14:35:52 2020
 Reader 0: REINER SCT cyberJack pp_a (2542540122) 00 00
  Event number: 0
  Card state: Card removed,
   
Sat May 23 14:36:01 2020
 Reader 0: REINER SCT cyberJack pp_a (2542540122) 00 00
  Event number: 1
  Card state: Card inserted,
  ATR: 3B B7 94 00 81 31 FE 65 53 50 4B 32 33 90 00 D1

ATR: 3B B7 94 00 81 31 FE 65 53 50 4B 32 33 90 00 D1
+ TS = 3B --> Direct Convention
+ T0 = B7, Y(1): 1011, K: 7 (historical bytes)
  TA(1) = 94 --> Fi=512, Di=8, 64 cycles/ETU
    62500 bits/s at 4 MHz, fMax for Fi = 5 MHz => 78125 bits/s
  TB(1) = 00 --> VPP is not electrically connected
  TD(1) = 81 --> Y(i+1) = 1000, Protocol T = 1
-----
  TD(2) = 31 --> Y(i+1) = 0011, Protocol T = 1
-----
  TA(3) = FE --> IFSC: 254
  TB(3) = 65 --> Block Waiting Integer: 6 - Character Waiting Integer: 5
+ Historical bytes: 53 50 4B 32 33 90 00
  Category indicator byte: 53 (proprietary format)
+ TCK = D1 (correct checksum)

Possibly identified card (using /usr/share/pcsc/smartcard_list.txt):
3B B7 94 00 81 31 FE 65 53 50 4B 32 33 90 00 D1
   Giesecke & Devrient Starcos 2.3
   Deutsche Bank WebSign (RSA-Card)
   G&D StarSign Token
   Osakidetza ONA (eID)
   http://www.osakidetza.euskadi.eus/r85-ckserv01/es/contenidos/nota_prensa/ruedasanidad35/es_rs/ruedasanidad35_c.html
   
Sat May 23 14:36:05 2020
 Reader 0: REINER SCT cyberJack pp_a (2542540122) 00 00
  Event number: 2
  Card state: Card removed,
I think this chipcard is being recognized perfectly, and I also think that I did the installation of the drivers right (newest version from ReinerSCT website being pulled by the ebuild).
Has anyone a idea why moneyplex does not see the card? I am not asking for support for moneyplex, for this I started an email conversation with their support (and they seem to be helpless), what I would like to know is: Did I do something not right in installing the drivers and the related software? Did I forget something? Do I have to edit configuration files? My user is member of the group pcscd (I found a hint to this in the cyberjack udev rule).
At last here the list of software that I have installed for the card reader.
Code:
*  dev-libs/cyberjack
      Latest version available: 3.99.5_p13
      Latest version installed: 3.99.5_p13
      Size of files: 1.580 KiB
      Homepage:      https://www.reiner-sct.de/
      Description:   REINER SCT cyberJack USB chipcard reader user space driver
      License:       GPL-2+ LGPL-2.1+

*  acct-group/pcscd
      Latest version available: 0
      Latest version installed: 0
      Size of files: 0 KiB
      Homepage:      https://www.gentoo.org/
      Description:   System group: pcscd
      License:       

*  acct-user/pcscd
      Latest version available: 0
      Latest version installed: 0
      Size of files: 0 KiB
      Homepage:      https://www.gentoo.org/
      Description:   A user for pcsc-lite
      License:       

*  dev-perl/pcsc-perl
      Latest version available: 1.4.14
      Latest version installed: 1.4.14
      Size of files: 36 KiB
      Homepage:      http://ludovic.rousseau.free.fr/softwares/pcsc-perl/
      Description:   A Perl Module for PC/SC SmartCard access
      License:       GPL-2

*  sys-apps/pcsc-lite
      Latest version available: 1.8.26
      Latest version installed: 1.8.26
      Size of files: 738 KiB
      Homepage:      https://pcsclite.apdu.fr https://github.com/LudovicRousseau/PCSC
      Description:   PC/SC Architecture smartcard middleware library
      License:       BSD ISC MIT GPL-3+ GPL-2

*  sys-apps/pcsc-tools
      Latest version available: 1.5.6
      Latest version installed: 1.5.6
      Size of files: 283 KiB
      Homepage:      http://ludovic.rousseau.free.fr/softwares/pcsc-tools/
      Description:   PC/SC Architecture smartcard tools
      License:       GPL-2

*  sys-libs/libchipcard
      Latest version available: 5.1.5_rc2
      Latest version installed: 5.1.5_rc2
      Size of files: 858 KiB
      Homepage:      https://www.aquamaniac.de/rdm/projects/libchipcard
      Description:   Library for accessing chip cards via chip card readers (terminals)
      License:       LGPL-2.1

*  app-crypt/ccid
      Latest version available: 1.4.30
      Latest version installed: 1.4.30
      Size of files: 628 KiB
      Homepage:      https://ccid.apdu.fr/
      Description:   CCID free software driver
      License:       GPL-2
I am not sure if I need the pcsc-perl package, I don't think so. For the ccid package I found a hint on the moneyplex website. Whether or not I need libchipcard I am also unsure.
For my understanding the problem is located on the moneyplex end. What do you think? Any help is appreciated.
_________________
Mm.


Last edited by Moldmaker on Tue May 26, 2020 7:55 pm; edited 1 time in total
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 54331
Location: 56N 3W

PostPosted: Sat May 23, 2020 1:32 pm    Post subject: Reply with quote

Moldmaker,

What user does moneyplex run as.
What user can see the card?

I suspect a permissions problem somewhere.
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
Moldmaker
Tux's lil' helper
Tux's lil' helper


Joined: 13 Jul 2010
Posts: 120

PostPosted: Sat May 23, 2020 1:59 pm    Post subject: Reply with quote

Thank you for your quick response.
NeddySeagoon wrote:
What user does moneyplex run as.
Normal user, no root permissions. I also started it being root, no difference.
Quote:
What user can see the card?
When I type as a normal user
Code:
$ pcsc_scan
Using reader plug'n play mechanism
Scanning present readers...
0: REINER SCT cyberJack pp_a (2542540122) 00 00
 
Sat May 23 15:46:01 2020
 Reader 0: REINER SCT cyberJack pp_a (2542540122) 00 00
  Event number: 2
  Card state: Card removed,
   
Sat May 23 15:46:06 2020
 Reader 0: REINER SCT cyberJack pp_a (2542540122) 00 00
  Event number: 3
  Card state: Card inserted,
  ATR: 3B B7 94 00 81 31 FE 65 53 50 4B 32 33 90 00 D1

Can't locate Chipcard/PCSC/Card.pm in @INC (you may need to install the Chipcard::PCSC::Card module) (@INC contains: /etc/perl /usr/local/lib64/perl5/5.28.2/x86_64-linux /usr/local/lib64/perl5/5.28.2 /usr/lib64/perl5/vendor_perl/5.28.2/x86_64-linux /usr/lib64/perl5/vendor_perl/5.28.2 /usr/local/lib64/perl5 /usr/lib64/perl5/vendor_perl/5.28.0/x86_64-linux /usr/lib64/perl5/vendor_perl/5.28.0 /usr/lib64/perl5/vendor_perl /usr/lib64/perl5/5.28.2/x86_64-linux /usr/lib64/perl5/5.28.2) at /usr/bin/ATR_analysis line 45.
BEGIN failed--compilation aborted at /usr/bin/ATR_analysis line 45.
ATR_analysis '3B B7 94 00 81 31 FE 65 53 50 4B 32 33 90 00 D1': Success
   
Sat May 23 15:46:08 2020
 Reader 0: REINER SCT cyberJack pp_a (2542540122) 00 00
  Event number: 4
  Card state: Card removed,
then I can watch the card being inserted and removed. Also, when I insert the card in the reader, the device's green LED flashes (there's a green one and a yellow one). Maybe that's not good enough for moneyplex.
Quote:
I suspect a permissions problem somewhere.
I've been thinking in that direction too. There is a udev rule called 99-cyberjack.rules and it contains the following:
Code:
# If not adding the device, go away
ACTION!="add", GOTO="cyberjack_rules_end"
SUBSYSTEM!="usb", GOTO="cyberjack_rules_end"
ENV{DEVTYPE}!="usb_device", GOTO="cyberjack_rules_end"

ATTR{idVendor}=="0c4b", ATTR{idProduct}=="0100", MODE="660", GROUP="pcscd"
ATTR{idVendor}=="0c4b", ATTR{idProduct}=="0300", MODE="660", GROUP="pcscd"
ATTR{idVendor}=="0c4b", ATTR{idProduct}=="0400", MODE="660", GROUP="pcscd"
ATTR{idVendor}=="0c4b", ATTR{idProduct}=="0401", MODE="660", GROUP="pcscd"
ATTR{idVendor}=="0c4b", ATTR{idProduct}=="0412", MODE="660", GROUP="pcscd"
ATTR{idVendor}=="0c4b", ATTR{idProduct}=="0485", MODE="660", GROUP="pcscd"
ATTR{idVendor}=="0c4b", ATTR{idProduct}=="0500", MODE="660", GROUP="pcscd"
ATTR{idVendor}=="0c4b", ATTR{idProduct}=="0501", MODE="660", GROUP="pcscd"
ATTR{idVendor}=="0c4b", ATTR{idProduct}=="0502", MODE="660", GROUP="pcscd"
ATTR{idVendor}=="0c4b", ATTR{idProduct}=="0503", MODE="660", GROUP="pcscd"
ATTR{idVendor}=="0c4b", ATTR{idProduct}=="0504", MODE="660", GROUP="pcscd"
ATTR{idVendor}=="0c4b", ATTR{idProduct}=="0505", MODE="660", GROUP="pcscd"
ATTR{idVendor}=="0c4b", ATTR{idProduct}=="0506", MODE="660", GROUP="pcscd"
ATTR{idVendor}=="0c4b", ATTR{idProduct}=="0507", MODE="660", GROUP="pcscd"
ATTR{idVendor}=="0c4b", ATTR{idProduct}=="0525", MODE="660", GROUP="pcscd"
ATTR{idVendor}=="0c4b", ATTR{idProduct}=="0580", MODE="660", GROUP="pcscd"
ATTR{idVendor}=="0c4b", ATTR{idProduct}=="2000", MODE="660", GROUP="pcscd"
ATTR{idVendor}=="0c4b", ATTR{idProduct}=="0551", MODE="660", GROUP="pcscd"
ATTR{idVendor}=="0c4b", ATTR{idProduct}=="2002", MODE="660", GROUP="pcscd"

# All done
LABEL="cyberjack_rules_end"
My card reader is listed in the second line, product ID 300. Here is also mentioned the group "pcscd" to which I added my user, hoping it might help.
_________________
Mm.
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 54331
Location: 56N 3W

PostPosted: Sat May 23, 2020 2:32 pm    Post subject: Reply with quote

Moldmaker,

Code:
MODE="660", GROUP="pcscd"


Is your normal user in the pcscd group?
The MODE="660" means only the owner and pcscd group members can read and write to the card.
I suspect that the owner will be root.

You will need to log out and back in again to pick up new group memberships.

What does groups tell you?
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
Moldmaker
Tux's lil' helper
Tux's lil' helper


Joined: 13 Jul 2010
Posts: 120

PostPosted: Sat May 23, 2020 3:07 pm    Post subject: Reply with quote

NeddySeagoon wrote:
Is your normal user in the pcscd group?
Yes.
Quote:
What does groups tell you?
It says (as normal user)
Code:
thomas@funtoo ~ $ groups
lp wheel audio video usb portage pcscd scanner plugdev thomas power
thomas@funtoo ~ $
I already rebooted since adding me to the group. (Oh and Thomas, that's me.)
_________________
Mm.
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 54331
Location: 56N 3W

PostPosted: Sat May 23, 2020 6:22 pm    Post subject: Reply with quote

Moldmaker,

I suppose udev is doing its thing ?

Does the /dev/bus/... entry exist as described by the udev rule?
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
Moldmaker
Tux's lil' helper
Tux's lil' helper


Joined: 13 Jul 2010
Posts: 120

PostPosted: Sun May 24, 2020 8:38 am    Post subject: Reply with quote

NeddySeagoon wrote:
I suppose udev is doing its thing ?

Does the /dev/bus/... entry exist as described by the udev rule?
This is what happens when I unplug and plug again the card reader:
Code:
[ 1171.994290] usb 5-2: USB disconnect, device number 2
[ 1179.622181] usb 5-2: new full-speed USB device number 3 using uhci_hcd
[ 1179.807262] usb 5-2: New USB device found, idVendor=0c4b, idProduct=0300, bcdDevice= 1.00
[ 1179.807265] usb 5-2: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[ 1179.807267] usb 5-2: Product: cyberJack pinpad(a)
[ 1179.807269] usb 5-2: Manufacturer: Reiner-SCT
[ 1179.807270] usb 5-2: SerialNumber: 2542540122
I did another test and inserted some other chipcards into the reader, watching what happens. It perfectly idetifies my health insurance card
Code:
German public health insurance card (Elektronische Gesundheitskarte eGK), 2nd generation (G2) (HealthCare)
and also my debit card
Code:
Debit card (Germany): ec-cash, GeldKarte(EUR), Maestro, Cirrus, ...
and of course the card that I use together with my old moneyplex
Code:
Giesecke & Devrient Starcos 2.3
   Deutsche Bank WebSign (RSA-Card)
   G&D StarSign Token
   Osakidetza ONA (eID)
Neither of these cards will be detected by the recent moneyplex. It always says there is no card inserted.
Maybe the problem is really simple. moneyplex is designed for Linuxes like opensuse, Ubuntu, Fedora. What if it searches for libraries that are here on my computer simply not in the paths moneyplex expects them to be? How can I find out?
_________________
Mm.
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 54331
Location: 56N 3W

PostPosted: Sun May 24, 2020 9:03 am    Post subject: Reply with quote

Moldmaker,

If it were a missing library, the program would not start.
You would get an unable to load ... error.

Is there anything in dmesg?

If you run moneyplex from a console window, are there any errors in the console?

All the card detection and set up is done by root so the setup and use are different things.
The setup is required for the card to be used but not sufficient.

Find the dev entry is /dev/usb/... somewhere. Check that its correct.
The permissions should be 660.
Change the permissions to 666, so world has read/write access. Does that help?
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
Moldmaker
Tux's lil' helper
Tux's lil' helper


Joined: 13 Jul 2010
Posts: 120

PostPosted: Sun May 24, 2020 10:05 am    Post subject: Reply with quote

NeddySeagoon wrote:
Is there anything in dmesg?

No. it keeps silent.
Quote:
If you run moneyplex from a console window, are there any errors in the terminal?

There are actually two binaries. The one that is normally used for starting moneyplex is called prestart. If I launch it from a terminal, I get the following:
Code:
thomas@funtoo ~/moneyplex $ ./prestart
Starting ... /home/thomas/moneyplex/moneyplex
... ExecuteProcess result code = -1 Version 2018-12-02
thomas@funtoo ~/moneyplex $ TGtk2MemoStrings.QueueSelectLength 23
TGtk2MemoStrings.QueueSelectLength 92
TGtk2MemoStrings.QueueSelectLength 119
TGtk2MemoStrings.QueueSelectLength 128
WARNING: obsolete call to RecreateWnd for TEmbedFondsContainer
Warning: TWinControl.DestroyHandle :TEmbedFondsContainer Handle not Allocated
WARNING: obsolete call to RecreateWnd for TEmbedContainer
Warning: TWinControl.DestroyHandle :TEmbedContainer Handle not Allocated
WARNING: obsolete call to RecreateWnd for TEmbedContainer
Warning: TWinControl.DestroyHandle :TEmbedContainer Handle not Allocated
TGtk2MemoStrings.QueueSelectLength 325
(TGtk2MemoStrings) UpdateMemoSelLengthCB
(TGtk2MemoStrings) UpdateMemoSelLengthCB
(TGtk2MemoStrings) UpdateMemoSelLengthCB
(TGtk2MemoStrings) UpdateMemoSelLengthCB
(TGtk2MemoStrings) UpdateMemoSelLengthCB
Then it launches the main binary and exits. When I quit moneyplex, the following appears:
Code:

GTKKillFocusCBAfter: abc: MediumBlzEdit:TEdit
TAnchorSide.CheckSidePosition Circle, MandantLB:TLabel akTop
TAnchorSide.CheckSidePosition Circle, MandantLB:TLabel akTop
TAnchorSide.CheckSidePosition Circle, MandantLB:TLabel akTop
TAnchorSide.CheckSidePosition Circle, MandantLB:TLabel akTop
GTKKillFocusCBAfter: abc: MandantEdit:TEdit
When I start the main binary directly, without prestart, then I can see:
Code:
thomas@funtoo ~/moneyplex $ ./moneyplex
TGtk2MemoStrings.QueueSelectLength 20
TGtk2MemoStrings.QueueSelectLength 87
TGtk2MemoStrings.QueueSelectLength 112
TGtk2MemoStrings.QueueSelectLength 119
WARNING: obsolete call to RecreateWnd for TEmbedFondsContainer
Warning: TWinControl.DestroyHandle :TEmbedFondsContainer Handle not Allocated
WARNING: obsolete call to RecreateWnd for TEmbedContainer
Warning: TWinControl.DestroyHandle :TEmbedContainer Handle not Allocated
WARNING: obsolete call to RecreateWnd for TEmbedContainer
Warning: TWinControl.DestroyHandle :TEmbedContainer Handle not Allocated
TGtk2MemoStrings.QueueSelectLength 224
(TGtk2MemoStrings) UpdateMemoSelLengthCB
(TGtk2MemoStrings) UpdateMemoSelLengthCB
(TGtk2MemoStrings) UpdateMemoSelLengthCB
(TGtk2MemoStrings) UpdateMemoSelLengthCB
(TGtk2MemoStrings) UpdateMemoSelLengthCB
The application seems to start exactly as with the prestart binary. Then it asks for two things, what type of "Medium" I want to use (the chipcard) and what name the "Mandant" shall have. You can see it it the output:
Code:
GTKKillFocusCBAfter: abc: MediumBlzEdit:TEdit
TAnchorSide.CheckSidePosition Circle, MandantLB:TLabel akTop
TAnchorSide.CheckSidePosition Circle, MandantLB:TLabel akTop
TAnchorSide.CheckSidePosition Circle, MandantLB:TLabel akTop
TAnchorSide.CheckSidePosition Circle, MandantLB:TLabel akTop
GTKKillFocusCBAfter: abc: MandantEdit:TEdit
Then I hit the "Test" button, the failure message appears ("no card inserted" while it is inserted), but there is no output in the terminal nor in dmesg. When I close the moneyplex window, the terminal says
Code:
(moneyplex:8932): Gtk-CRITICAL **: 11:39:00.011: IA__gtk_window_set_keep_above: assertion 'GTK_IS_WINDOW (window)' failed

(moneyplex:8932): Gtk-CRITICAL **: 11:39:00.012: IA__gtk_window_get_gravity: assertion 'GTK_IS_WINDOW (window)' failed

(moneyplex:8932): Gtk-CRITICAL **: 11:39:00.012: IA__gtk_window_set_geometry_hints: assertion 'GTK_IS_WINDOW (window)' failed

(moneyplex:8932): GLib-CRITICAL **: 11:39:00.061: g_source_remove: assertion 'tag > 0' failed

(moneyplex:8932): GLib-CRITICAL **: 11:39:00.100: g_source_remove: assertion 'tag > 0' failed

(moneyplex:8932): GLib-CRITICAL **: 11:39:00.101: g_source_remove: assertion 'tag > 0' failed

(moneyplex:8932): GLib-CRITICAL **: 11:39:00.106: g_source_remove: assertion 'tag > 0' failed

(moneyplex:8932): GLib-CRITICAL **: 11:39:00.127: g_source_remove: assertion 'tag > 0' failed
Not very enlightening to me, everything seems to be related to Gtk.

Quote:
All the card detection and set up is done by root so the setup and use are different things.

The card detection I described before can be done in a terminal by my normal user. The service pcscd must run, but I don't have to be root for that.
Quote:
The setup is required for the card to be used but not sufficient.

Find the dev entry is /dev/usb/... somewhere. Check that its correct.
The permissions should be 660.
Change the permissions to 666, so world has read/write access. Does that help?
The correct one is /dev/bus/usb/005/002.
Code:
funtoo /dev/bus/usb/005 # ls -la
insgesamt 0
drwxr-xr-x  2 root root       80 24. Mai 11:12 .
drwxr-xr-x 10 root root      200 24. Mai 11:12 ..
crw-rw----  1 root usb  189, 512 24. Mai 11:12 001
crw-rw----  1 root usb  189, 513 24. Mai 11:58 002
funtoo /dev/bus/usb/005 # chmod 666 002
funtoo /dev/bus/usb/005 # ls -la
insgesamt 0
drwxr-xr-x  2 root root       80 24. Mai 11:12 .
drwxr-xr-x 10 root root      200 24. Mai 11:12 ..
crw-rw----  1 root usb  189, 512 24. Mai 11:12 001
crw-rw-rw-  1 root usb  189, 513 24. Mai 11:59 002
funtoo /dev/bus/usb/005 #
After that I restarted the pcscd service and fired up moneyplex, but there is no difference. Card is not detected.
_________________
Mm.
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 54331
Location: 56N 3W

PostPosted: Sun May 24, 2020 10:18 am    Post subject: Reply with quote

Moldmaker,

The udev rule appeals to fail.
Code:
funtoo /dev/bus/usb/005 # ls -la
insgesamt 0
drwxr-xr-x  2 root root       80 24. Mai 11:12 .
drwxr-xr-x 10 root root      200 24. Mai 11:12 ..
crw-rw----  1 root usb  189, 512 24. Mai 11:12 001
crw-rw----  1 root usb  189, 513 24. Mai 11:58 002

The group should be pcscd, not usb but thats not the issue because
Code:
$ groups
lp wheel audio video usb portage pcscd scanner plugdev thomas power
you are in the usb group and it still fails with 666 permissions.

If this udev rule is failing what others are failing too?
Is udev actually running?

Its very noticeable when udev fails to start as lots of things in /dev have the wrong permissions so its all over the kernel messages during boot.
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
Moldmaker
Tux's lil' helper
Tux's lil' helper


Joined: 13 Jul 2010
Posts: 120

PostPosted: Sun May 24, 2020 2:04 pm    Post subject: Reply with quote

NeddySeagoon wrote:
The udev rule appeals to fail. (...) If this udev rule is failing what others are failing too? Is udev actually running?

Yes. it is running. And I doublechecked that
Code:
/dev/bus/usb/005/002
is the correct one. When I unplug the reader and plug in in again it appears as 003.
Code:
funtoo /dev/bus/usb/008 # cd /dev/bus/usb/005
funtoo /dev/bus/usb/005 # ls -la
insgesamt 0
drwxr-xr-x  2 root root       80 24. Mai 15:26 .
drwxr-xr-x 10 root root      200 24. Mai 15:26 ..
crw-rw----  1 root usb  189, 512 24. Mai 15:26 001
crw-rw----  1 root usb  189, 513 24. Mai 15:31 002
funtoo /dev/bus/usb/005 # ls -la
insgesamt 0
drwxr-xr-x  2 root root       60 24. Mai 15:31 .
drwxr-xr-x 10 root root      200 24. Mai 15:26 ..
crw-rw----  1 root usb  189, 512 24. Mai 15:26 001
funtoo /dev/bus/usb/005 # ls -la
insgesamt 0
drwxr-xr-x  2 root root       80 24. Mai 15:32 .
drwxr-xr-x 10 root root      200 24. Mai 15:26 ..
crw-rw----  1 root usb  189, 512 24. Mai 15:26 001
crw-rw----  1 root usb  189, 514 24. Mai 15:32 003
funtoo /dev/bus/usb/005 # lsusb
.
.
Bus 005 Device 003: ID 0c4b:0300 Reiner SCT Kartensysteme GmbH cyberJack pinpad(a)
.
.
funtoo /dev/bus/usb/005 # ls -la
insgesamt 0
drwxr-xr-x  2 root root       80 24. Mai 15:32 .
drwxr-xr-x 10 root root      200 24. Mai 15:26 ..
crw-rw----  1 root usb  189, 512 24. Mai 15:26 001
crw-rw----  1 root usb  189, 514 24. Mai 15:33 003
funtoo /dev/bus/usb/005 #
I agree that according to the cyberjack udev rule one can expect pcscd as group and not usb.
Quote:
Its very noticeable when udev fails to start as lots of things in /dev have the wrong permissions so its all over the kernel messages during boot.
But I have no error messages during startup. Starting up smoothly.However, when poking around in
Code:
/lib/udev/rules.d
I found this udev rule I didn't notice before:
Code:
99-pcscd-hotplug.rules
It contains only this text:
Code:
# Copyright 1999-2019 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2

# We add this here so that it runs after ccid's and ifd-gempc's rules;
# if we just added a pcscd-owned device, we hotplug the pcscd service.
ACTION=="add", ENV{PCSCD}=="1", GROUP="pcscd", TAG+="systemd", ENV{SYSTEMD_WANTS}+="pcscd.service", RUN+="pcscd.sh"
I don't entirely understand what it does, but there is this
Code:
TAG+="systemd"
that irritates me because i do not use systemd, I use OpenRC. Plus, there is this hint to "ccid". I also found on the moneyplex website instructions to install something like "pcsc-ccid" for opensuse and "libccid" for ubuntu. In the Funtoo/Gentoo repos all I find is this here so I installed it.
Code:
*  app-crypt/ccid
      Latest version available: 1.4.32
      Latest version installed: 1.4.32
      Size of files: 642 KiB
      Homepage:      https://ccid.apdu.fr https://github.com/LudovicRousseau/CCID
      Description:   CCID free software driver
      License:       GPL-2
To be honest I have no clue how to solve this. In my conversation with the moneyplex support I asked if it was possible to discuss this whole thing with the developer(s). Also I am trying to lay my hands on another cardreader I might be able to get in a few days, a more modern one. There was also the advice to update the reader's firmware (only possible under Windows) which I also tried, but it failed with an error. Luckily I did not brick the device, it's still working fine under the old Linux system. Another suspicion I have is that the chipcard itself might be incompatible to the new moneyplex because it is from 12/2004. Got to ask that their support, but then I would expect some message like "card is too old" or something like that and not "no card inserted".
This whole thing is harder than I thought.
_________________
Mm.
Back to top
View user's profile Send private message
Moldmaker
Tux's lil' helper
Tux's lil' helper


Joined: 13 Jul 2010
Posts: 120

PostPosted: Tue May 26, 2020 7:52 pm    Post subject: Reply with quote

Today I had the chance to test another, more modern card reader from ReinerSCT, called RFID standard. I plugged it in, fired up moneyplex, inserted the chip card - and BAM, test was successful. It seems that if you didn't update the firmware of your old reader back in time (using MS Windows) you just fail to put it into operation today (under Linux).
Anyway, thank you for your support and patience. I really appreciate it.
_________________
Mm.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Unsupported Software All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum