linux Smart Card Reader install ?

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

  1. Shawn

    Shawn Crackpot Search Ninja

    Reputations:
    1,398
    Messages:
    6,262
    Likes Received:
    941
    Trophy Points:
    281
    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.
     
  2. Michael McBride

    Michael McBride Notebook Enthusiast

    Reputations:
    0
    Messages:
    39
    Likes Received:
    3
    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
     
  3. SHEEPMAN!

    SHEEPMAN! Freelance

    Reputations:
    790
    Messages:
    2,245
    Likes Received:
    187
    Trophy Points:
    81
    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)
     
  4. Shawn

    Shawn Crackpot Search Ninja

    Reputations:
    1,398
    Messages:
    6,262
    Likes Received:
    941
    Trophy Points:
    281
    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 <ludovic.rousseau@free.fr>
    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.
     
  5. Michael McBride

    Michael McBride Notebook Enthusiast

    Reputations:
    0
    Messages:
    39
    Likes Received:
    3
    Trophy Points:
    16
    Failed to stop pccardctl.socket: Unit pccardctl.socket not loaded.
     
  6. SHEEPMAN!

    SHEEPMAN! Freelance

    Reputations:
    790
    Messages:
    2,245
    Likes Received:
    187
    Trophy Points:
    81
    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
     
  7. Michael McBride

    Michael McBride Notebook Enthusiast

    Reputations:
    0
    Messages:
    39
    Likes Received:
    3
    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
  8. SHEEPMAN!

    SHEEPMAN! Freelance

    Reputations:
    790
    Messages:
    2,245
    Likes Received:
    187
    Trophy Points:
    81
    So you have results in
    Code:
    lspci
    showing the Smartcard?
     
  9. Michael McBride

    Michael McBride Notebook Enthusiast

    Reputations:
    0
    Messages:
    39
    Likes Received:
    3
    Trophy Points:
    16
    Nope wonder why?
     
  10. SHEEPMAN!

    SHEEPMAN! Freelance

    Reputations:
    790
    Messages:
    2,245
    Likes Received:
    187
    Trophy Points:
    81
    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.
Loading...

Share This Page