The Notebook Review forums were hosted by TechTarget, who shut down them down on January 31, 2022. This static read-only archive was pulled by NBR forum users between January 20 and January 31, 2022, in an effort to make sure that the valuable technical information that had been posted on the forums is preserved. For current discussions, many NBR forum users moved over to NotebookTalk.net after the shutdown.
Problems? See this thread at archive.org.

    linux Smart Card Reader install ?

    Discussion in 'Panasonic' started by Michael McBride, Apr 15, 2017.

  1. Michael McBride

    Michael McBride Notebook Enthusiast

    Reputations:
    0
    Messages:
    47
    Likes Received:
    5
    Trophy Points:
    16
    I just received my internal smart card reader for CF-30 and I am using linux. How do I check to see if the card reader is working and shows up on the hardware list?
     
  2. Shawn

    Shawn Crackpot Search Ninja and Options Whore

    Reputations:
    1,541
    Messages:
    8,306
    Likes Received:
    2,050
    Trophy Points:
    331
    Last edited by a moderator: Apr 15, 2017
  3. Michael McBride

    Michael McBride Notebook Enthusiast

    Reputations:
    0
    Messages:
    47
    Likes Received:
    5
    Trophy Points:
    16
    I tried that one for ubuntu and yes oem internal. but when I run PC/SC Device Scanner I get the Waiting for the first reader... so not sure what to do now.
     
  4. Shawn

    Shawn Crackpot Search Ninja and Options Whore

    Reputations:
    1,541
    Messages:
    8,306
    Likes Received:
    2,050
    Trophy Points:
    331
    Was that with a card inserted?
     
  5. Michael McBride

    Michael McBride Notebook Enthusiast

    Reputations:
    0
    Messages:
    47
    Likes Received:
    5
    Trophy Points:
    16
    with and with out
     
  6. Shawn

    Shawn Crackpot Search Ninja and Options Whore

    Reputations:
    1,541
    Messages:
    8,306
    Likes Received:
    2,050
    Trophy Points:
    331
    Last edited by a moderator: Apr 15, 2017
  7. Michael McBride

    Michael McBride Notebook Enthusiast

    Reputations:
    0
    Messages:
    47
    Likes Received:
    5
    Trophy Points:
    16
    ok, thanks shawn for the effort. Maybe I will figure it out later. I do notice that SCM Smart Card Reader and Writer is not reading. and I am using Cardpeek to try to read a sim card. But at least when I check the PCMCIA card slots at least it does show up as connected.
     
  8. SHEEPMAN!

    SHEEPMAN! Freelance

    Reputations:
    879
    Messages:
    2,666
    Likes Received:
    517
    Trophy Points:
    131
    lsusb #shows up as SCR35xx Smart Card Reader
    sudo lshw
    dmesg | grep scr -i
     
    Shawn likes this.
  9. Michael McBride

    Michael McBride Notebook Enthusiast

    Reputations:
    0
    Messages:
    47
    Likes Received:
    5
    Trophy Points:
    16
    lsusb:
    Bus 006 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
    Bus 008 Device 002: ID 044e:3001 Alps Electric Co., Ltd UGTZ4 Bluetooth
    Bus 008 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
    Bus 007 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
    Bus 004 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
    Bus 005 Device 003: ID 0424:2503 Standard Microsystems Corp. USB 2.0 Hub
    Bus 005 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
    Bus 003 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
    Bus 002 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
    Bus 001 Device 002: ID 0430:0501 Sun Microsystems, Inc.
    Bus 001 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub

    sudo lshw:
    sudo: lshw: command not found

    dmesg | grep scr -i :
    (Shows nothing)
     
    Shawn likes this.
  10. SHEEPMAN!

    SHEEPMAN! Freelance

    Reputations:
    879
    Messages:
    2,666
    Likes Received:
    517
    Trophy Points:
    131
    I tested this on a CF-31 MK2 while I was posting. LMDE. (Linux Mint Debian)

    What flavor of Linux was that again?
     
  11. Michael McBride

    Michael McBride Notebook Enthusiast

    Reputations:
    0
    Messages:
    47
    Likes Received:
    5
    Trophy Points:
    16
    I am using parrot os which is based from kali which is based debian. also I am getting a new error actually from PC/SC device scanner: SCardEstablishContext: Service not available. I readjusted the flat cable to the smart card reader and made sure it is enabled in bios. Wonder what to do now? Just looking up. Thank you
     
  12. SHEEPMAN!

    SHEEPMAN! Freelance

    Reputations:
    879
    Messages:
    2,666
    Likes Received:
    517
    Trophy Points:
    131
    I switched to a MK-1 CF-30.....and smartcard is on a serial port.....
    MK2/3 CF-31 are USB. As far as anything in between I'll have to check.

    Service not available means to me that systemd has raised it's ugly head.

    Let me check if I have any other smartcard readers in the collection.

    Previously interrupted by garlic sausage and gray poupon....checking..................................................................................................................................................

    From CF30CCS85BM MX-16Linux

    Jeff

    Edit:
    SERIAL SMART CARD READER DRIVERS
    Smart card reader drivers are placed in the /usr/lib/pcsc/drivers
    directory. Each driver is simply an .so file. pcscd locates the driver
    using the /etc/reader.conf.d/reader.conf file. See the reader.conf(5)
    manual page for more information.

    Some drivers are available at
    http://pcsclite.alioth.debian.org/musclecard.com/drivers.html.
     
    Last edited: Apr 16, 2017
  13. SHEEPMAN!

    SHEEPMAN! Freelance

    Reputations:
    879
    Messages:
    2,666
    Likes Received:
    517
    Trophy Points:
    131
    Swapped in a XP HDD and this reader is a Gemplus 3417.
    /windows/system32/GTwinSer.sys is the driver. (for WindowsXP) from device manager:[properties]
    Back on Linux and looking for Gemplus......................and this:

    Good luck.


    Serial readers
    Serial drivers must be configured to operate on a particular port and respond to a particular name. The reader.conf file is used for this purpose.

    It has the following syntax:

    # Configuration file for pcsc-lite
    # David Corcoran <[email protected]>

    FRIENDLYNAME Generic Reader
    DEVICENAME /dev/ttyS0
    LIBPATH /usr/lib/pcsc/drivers/libgen_ifd.so
    CHANNELID 1

    The pound sign # denotes a comment.

    FRIENDLYNAME
    The FRIENDLYNAME field is an arbitrary text used to identify the reader. This text is displayed by commands like pcsc_scan http://ludovic.rousseau.free.fr/softwares/pcsc-tools/ that prints the names of all the connected and detected readers.

    DEVICENAME
    The DEVICENAME field was not used for old drivers (using the IFD handler version 2.0 or previous). It is now (IFD handler version 3.0) used to identify the physical port on which the reader is connected. This is the device name of this port. It is dependent of the OS kernel. For example the first serial port device is called /dev/ttyS0 under Linux and /dev/cuaa0 under FreeBSD.

    If you want to use IFDHCreateChannel() instead of IFDHCreateChannelByName() then do not use any DEVICENAME line in the configuration file. IFDHCreateChannel() will then be called with the CHANNELID parameter.

    LIBPATH
    The LIBPATH field is the filename of the driver code. The driver is a dynamically loaded piece of code (generally a drivername.so* file).

    CHANNELID
    The CHANNELID is no more used for recent drivers (IFD handler 3.0) and has been superseded by DEVICENAME.

    If you have an old driver this field is used to indicate the port to use. You should read your driver documentation to know what information is needed here. It should be the serial port number for a serial reader.

    CHANNELID was the numeric version of the port in which the reader will be located. This may be done by a symbolic link where /dev/pcsc/1 is the first device which may be a symbolic link to /dev/ttyS0 or whichever location your reader resides.

    -----------------------------------EDIT--------------------------------------------------
    Code:
    $ pcsc_scan
    PC/SC device scanner
    V 1.4.27 (c) 2001-2011, Ludovic Rousseau <[email protected]>
    Compiled with PC/SC lite version: 1.8.17
    Using reader plug'n play mechanism
    Scanning present readers...
    Waiting for the first reader...^C
    #Well I got to here. Not having any cards is slowing things down a bit. These were installed with gdebi. Treating it as a serial connection all the way.
    libpcsclite1
    pcsc-tools
    libpcsc-perl #required by pcsc-tools

    I tried writing ' /etc/reader.conf/reader.conf ' as directed in one of the 'man' pages but that needs a tweak.

    Interesting.
     
    Last edited: Apr 16, 2017
  14. Shawn

    Shawn Crackpot Search Ninja and Options Whore

    Reputations:
    1,541
    Messages:
    8,306
    Likes Received:
    2,050
    Trophy Points:
    331
    Dumb question maybe..Is the smart card enabled in the BIOS?
    Does it even show up in the BIOS?
     
  15. Michael McBride

    Michael McBride Notebook Enthusiast

    Reputations:
    0
    Messages:
    47
    Likes Received:
    5
    Trophy Points:
    16
    mine shows up in bios and is enabled.

    I cant seem to find how to get the scr243 pcmcia drivers. any ideas for it also.
     
    Last edited by a moderator: Apr 16, 2017
  16. Shawn

    Shawn Crackpot Search Ninja and Options Whore

    Reputations:
    1,541
    Messages:
    8,306
    Likes Received:
    2,050
    Trophy Points:
    331
  17. Michael McBride

    Michael McBride Notebook Enthusiast

    Reputations:
    0
    Messages:
    47
    Likes Received:
    5
    Trophy Points:
    16
    I did download those but am having trouble installing them on linux. any ideas

    Sudo ./install:
    Kernel Headers located.
    Kernel module has to be recompiled
    pcsclite middleware is not installed.

    I am not sure how to recompile the drivers. Thank you
     
    Last edited by a moderator: Apr 16, 2017
  18. Shawn

    Shawn Crackpot Search Ninja and Options Whore

    Reputations:
    1,541
    Messages:
    8,306
    Likes Received:
    2,050
    Trophy Points:
    331
    I am clueless on that. Ask Sheepman
     
  19. SHEEPMAN!

    SHEEPMAN! Freelance

    Reputations:
    879
    Messages:
    2,666
    Likes Received:
    517
    Trophy Points:
    131
    Typing
    Code:
    systemctl
    should tell you if systemd has attempted to use the device.
    I see nothing in
    Code:
    lsmod
    mentioning the SCR.
     
  20. Michael McBride

    Michael McBride Notebook Enthusiast

    Reputations:
    0
    Messages:
    47
    Likes Received:
    5
    Trophy Points:
    16
    pccardctl ident:
    Socket 0:
    product info: "SCR243 PCMCIA
    ", "Smart Card Reader
    ", "", ""
    manfid: 0xffff, 0x0001
     
  21. Shawn

    Shawn Crackpot Search Ninja and Options Whore

    Reputations:
    1,541
    Messages:
    8,306
    Likes Received:
    2,050
    Trophy Points:
    331
    Download the scr Linux driver. Open the archived gz file with 7zip.
    Then open the resulting tar file with 7zip.

    Drill down through the resulting folders.
    You will find an install file.
    Run the install file in terminal.
     
  22. Michael McBride

    Michael McBride Notebook Enthusiast

    Reputations:
    0
    Messages:
    47
    Likes Received:
    5
    Trophy Points:
    16
    I get this error with install:
    Kernel Headers located.
    Kernel module has to be recompiled
    pcsclite middleware is not installed.

    pcsclite1 is installed no pcsclite in repository
     
  23. SHEEPMAN!

    SHEEPMAN! Freelance

    Reputations:
    879
    Messages:
    2,666
    Likes Received:
    517
    Trophy Points:
    131
    This is from systemctl?

    How about systemctl stop pccardctl.socket (This is per session only...permanent change would need a .conf)

    'systemctl stop gpsd.socket' worked to release systemd control of USB in a Gobi card problem I was having. I was getting permission denied errors on USB. (the cut and paste brought the bold letters with it)
     
  24. Shawn

    Shawn Crackpot Search Ninja and Options Whore

    Reputations:
    1,541
    Messages:
    8,306
    Likes Received:
    2,050
    Trophy Points:
    331
    From a Ubuntu forum https://ubuntuforums.org/showthread.php?t=1006111


    DOD CAC with a PCMCIA card reader on a laptop, Ubuntu 8.10 "Intrepid Ibex" with Linux 2.6.27-9-generic kernel.

    Background:

    I wanted to use a PCMCIA card reader as I had done with Windows. I started here:

    http://ubuntuforums.org/showthread.p...ader%20install

    Many, many thanks to psyopper and his sources for their work.

    I couldn't find any forum, site, or blog anywhere that talked about successfully doing this, so I started by trying to find a card supported by Linux drivers. The two I had already, an ActivIdentity card and a SCM SCR201 were both non-starters.

    There were two with drivers available - the Gemplus GPR-400 and the SCM SCR243. I was off to Ebay where I picked up two SCR243's for $15 including shipping! I then downloaded the drivers from the website: http://www.scmmicro.com/support/pcs_...t_drivers.html

    Save the file and extract it to your home directory. Now we need to make a change to the includes file to update it for the new kernel.

    :/$ cd ~/scr24x_v4.2.4_Release/scr24x_2.6.x_v4.2.4/src

    :/$ sudo gedit includes.h
    - remark out blockmem.h
    - change /asm/semaphore.h /linux/semaphore.h
    ....
    #include <linux/semaphore.h> // this is the first change
    #include <asm/io.h>
    #include <asm/segment.h>
    #include <asm/system.h>
    #include <asm/unistd.h>
    #include <asm/uaccess.h> // copy_to_user et al
    #include <asm/delay.h>

    //#include <pcmcia/version.h>

    #include <pcmcia/cs_types.h>
    #include <pcmcia/cs.h>
    #include <pcmcia/cistpl.h>
    #include <pcmcia/ciscode.h>
    #include <pcmcia/ds.h>
    #include <pcmcia/cisreg.h>
    #include <pcmcia/ss.h>
    //#include <pcmcia/bulkmem.h> // this is the second change
    ....

    Some prep work with other required packages:

    :/$ sudo apt-get install libusb-0.1-4 libpcsclite1 libpcsclite-dev pcscd pcsc-tools build-essential autoconf libccid

    The original post also had the xlibs-dev package listed, but that has been deprecated, this works fine without it.

    Now let's execute the install script:

    :/$ cd ..
    :/$ sudo ./install

    The driver will not create the device file. I don't know why but have a cheap workaround:

    :/$ cd /dev
    :/$ sudo mknod SCR24x0 c 251 0

    To solve issue with device file not existing for driver load at startup, added to /lib/udev/devices as well...

    :/$ cd /lib/udev/devices
    :/$ sudo mknod SCR24x0 c 251 0

    This would be a good time to seat your shiny new pcmcia card and restart the daemon:

    :/$ sudo /etc/init.d/pcscd restart

    What some commands should be showing if all is cooperating:

    :/$ lspcmcia -v
    Socket 0 Bridge: [yenta_cardbus] (bus ID: 0000:06:09.0)
    Configuration: state: on ready: unknown
    Voltage: 5.0V Vcc: 5.0V Vpp: 0.0V
    Socket 0 Device 0: [scr24x_cs] (bus ID: 0.0)
    Configuration: state: on
    Product Name: SCR243 PCMCIA Smart Card Reader
    Identification: manf_id: 0xffff card_id: 0x0001
    prod_id(1): "SCR243 PCMCIA" (0x2054e8de)
    prod_id(2): "Smart Card Reader" (0xf5a90d5d)
    prod_id(3): --- (---)
    prod_id(4): --- (---)
    :/$ lsmod |grep pcmcia
    pcmcia 43052 1 SCR24x
    pcmcia_core 43412 4 SCR24x,pcmcia,yenta_socket,rsrc_nonstatic

    Insert your CAC card and running a pcsc_scan should return something like this:

    :/$ pcsc_scan
    PC/SC device scanner
    V 1.4.14 (c) 2001-2008, Ludovic Rousseau <[email protected]>
    Compiled with PC/SC lite version: 1.4.99
    Scanning present readers
    0: SCR24x Smart Card Reader 00 00

    Mon Dec 8 23:48:47 2008
    Reader 0: SCR24x Smart Card Reader 00 00
    Card state: Card inserted, Shared Mode,
    ATR: 3B DB 96 00 80 1F 03 00 31 C0 64 77 E3 03 00 82 90 00 C1

    ATR: 3B DB 96 00 80 1F 03 00 31 C0 64 77 E3 03 00 82 90 00 C1
    + TS = 3B --> Direct Convention
    + T0 = DB, Y(1): 1101, K: 11 (historical bytes)
    TA(1) = 96 --> Fi=512, Di=32, 16 cycles/ETU (223200 bits/s at 3.57 MHz)
    TC(1) = 00 --> Extra guard time: 0
    TD(1) = 80 --> Y(i+1) = 1000, Protocol T = 0
    -----
    TD(2) = 1F --> Y(i+1) = 0001, Protocol T = 15 - Global interface bytes following
    -----
    TA(3) = 03 --> Clock stop: not supported - Class accepted by the card: (3G) A 5V B 3V
    + Historical bytes: 00 31 C0 64 77 E3 03 00 82 90 00
    Category indicator byte: 00 (compact TLV data object)
    Tag: 3, len: 1 (card service data byte)
    Card service data byte: C0
    - Application selection: by full DF name
    - Application selection: by partial DF name
    - EF.DIR and EF.ATR access services: by GET RECORD(s) command
    - Card with MF
    Tag: 6, len: 4 (pre-issuing data)
    Data: 77 E3 03 00
    Mandatory status indicator (3 last bytes)
    LCS (life card cycle): 82 (Proprietary)
    SW: 9000 (Normal processing.)
    + TCK = C1 (correct checksum)

    Possibly identified card (using /usr/share/pcsc/smartcard_list.txt):
    3B DB 96 00 80 1F 03 00 31 C0 64 77 E3 03 00 82 90 00 C1
    CAC (Common Access Card)

    Once you have success through these steps, the rest is easy:

    :/$ sudo apt-get install coolkey

    Next we need to set up Firefox to use your CAC/Reader as an authentication tool for websites. In Firefox go to:

    Edit-> Preferences -> Advanced -> Encryption --
    Click on the Security Devices button --
    Click the Load button to load a new module. Name it CAC Module and type in /usr/lib/pkcs11/libcoolkeypk11.so
    Press OK.

    Now we install certificates - go here:
    http://dodpki.c3pki.chamb.disa.mil/rootca.html

    Once there click on each of the three links, you will need to install all three certificates to get AKO/CAC working correctly. On each link, when you click it, Firefox will prompt you to install the certificate. Click Yes to each one.

    That's it! This updates the original post by psyopper, replacing the information for a USB reader with information for the SCM PCMCIA reader. Now you can check your Navy email from Linux!
    Last edited by mmoses; December 9th, 2008 at 06:25 AM.
     
  25. Michael McBride

    Michael McBride Notebook Enthusiast

    Reputations:
    0
    Messages:
    47
    Likes Received:
    5
    Trophy Points:
    16
    Failed to stop pccardctl.socket: Unit pccardctl.socket not loaded.
     
  26. SHEEPMAN!

    SHEEPMAN! Freelance

    Reputations:
    879
    Messages:
    2,666
    Likes Received:
    517
    Trophy Points:
    131
    The name is the issue then. Systemctl by itself was supposed to list all equipment that it had tampered with. See
    Code:
    man systemctl
    .

    Also see the section in this about permissions.

    https://github.com/CodeGnome/smartcard_rules
     
  27. Michael McBride

    Michael McBride Notebook Enthusiast

    Reputations:
    0
    Messages:
    47
    Likes Received:
    5
    Trophy Points:
    16
    ok got scr243 drivers to install not sure what to do now nothing is still working right going to to try to restart and see.

    ok reboot still nothing
     
    Last edited by a moderator: Apr 17, 2017
  28. SHEEPMAN!

    SHEEPMAN! Freelance

    Reputations:
    879
    Messages:
    2,666
    Likes Received:
    517
    Trophy Points:
    131
    So you have results in
    Code:
    lspci
    showing the Smartcard?
     
  29. Michael McBride

    Michael McBride Notebook Enthusiast

    Reputations:
    0
    Messages:
    47
    Likes Received:
    5
    Trophy Points:
    16
    Nope wonder why?
     
  30. SHEEPMAN!

    SHEEPMAN! Freelance

    Reputations:
    879
    Messages:
    2,666
    Likes Received:
    517
    Trophy Points:
    131
    One thing I have done is to boot with a device activated in bios, then printed the output of dmesg.
    reboot
    Disable device in bios, then dmesg again. Then do a line by line comparison.
    and/or
    udev should fire when a card is inserted.....the device being defined in /lib/udev/rules.d. See /lib/udev/rules.d/readme.
     
    Shawn likes this.
  31. Michael McBride

    Michael McBride Notebook Enthusiast

    Reputations:
    0
    Messages:
    47
    Likes Received:
    5
    Trophy Points:
    16
    Well I decided to what on getting my stupid linux to work with the smart card and will try again when I get my new hardrive and put zorin os on. Also, I will try DOD TENS-Public out and leave the results later. Thanks for help.
     
    toughasnails likes this.