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

Failed to open device OMNIKEY AG CardMan 3121 on Linux #44

Closed
mefernandez opened this issue Oct 26, 2016 · 6 comments
Closed

Failed to open device OMNIKEY AG CardMan 3121 on Linux #44

mefernandez opened this issue Oct 26, 2016 · 6 comments

Comments

@mefernandez
Copy link

Hi,

I was trying to use the Smart Card Connector App in Ubuntu 16.04, with a OmniKey CarMand 3021 plugged in. The smart card reader is working with Firefox.

This error show up upon adding permissions to the reader.

image

Here are the logs:

 [  0.038s] [<background page>.GoogleSmartCard.ConnectorApp.BackgroundMain] [INFO] The Smart Card Connector app (id "khpfeaanjngmcnplbdlpegiifgpfgdco", version 1.2.3.0) background script started
 [  0.059s] [<background page>.GoogleSmartCard.ConnectorApp.BackgroundMain] [INFO] Created a new PC/SC-Lite client handler (id 0) for handling requests from own app
 [  0.065s] [<background page>.GoogleSmartCard.NaclModule<"nacl_module.nmf">] [INFO] Loading NaCl module...
 [  0.102s] [<background page>.GoogleSmartCard.Libusb.ChromeUsbBackend] [INFO] 1 USB device(s) available: [{device: 0x00, manufacturerName: "OMNIKEY AG", productId: 0x00003021, productName: "Smart Card Reader USB", serialNumber: "", vendorId: 0x0000076B, version: 0x00000302}]
 [  0.194s] [<background page>.GoogleSmartCard.PcscLiteServerClientsManagement.ClientHandler<id=0, client=own app>] [INFO] Delaying the received requests until the PC/SC-Lite server gets ready. Currently delayed requests: SCardEstablishContext(<stripped value>, <stripped value>, <stripped value>)
 [  0.562s] [</window.html>.GoogleSmartCard.ConnectorApp.MainWindow] [INFO] The main window is created
 [  0.569s] [</window.html>.GoogleSmartCard.ConnectorApp.MainWindow] [INFO] Displaying 0 card reader(s): []
 [  1.344s] [</window.html>.GoogleSmartCard.ConnectorApp.MainWindow] [INFO] Displaying the warning regarding non-Chrome OS system (the current OS is "linux")
 [  1.347s] [<background page>.GoogleSmartCard.PcscLiteServerClientsManagement.PermissionsChecking.ManagedRegistry] [INFO] Loaded managed storage data with the allowed client App ids: Set{}
 [  1.349s] [<background page>.GoogleSmartCard.PcscLiteServerClientsManagement.PermissionsChecking.UserPromptingChecker] [INFO] Loaded local storage data with the stored user selections: no data
 [  6.280s] [<background page>.GoogleSmartCard.NaclModule<"nacl_module.nmf">] [INFO] Successfully loaded NaCl module
 [  6.299s] [<background page>.GoogleSmartCard.NaclModule<"nacl_module.nmf">.ReaderTracker] [INFO] A new reader "OMNIKEY AG CardMan 3121" (port 2097152, device "usb:076b/3021:libusb-1.0:42:0:0") is being initialized...
 [  6.302s] [</window.html>.GoogleSmartCard.ConnectorApp.MainWindow] [INFO] Displaying 1 card reader(s): [{name: "OMNIKEY AG CardMan 3121", status: "init", error: undefined, isCardPresent: false}]
 [  6.305s] [<background page>.GoogleSmartCard.NaclModule<"nacl_module.nmf">.NaCl] [INFO] [syslog] 00000000 ../../src/src/ifdhandler.c:1953:init_driver() Driver version: 1.4.24
 [  6.306s] [<background page>.GoogleSmartCard.NaclModule<"nacl_module.nmf">.NaCl] [INFO] [syslog] 00000930 ../../src/src/ifdhandler.c:1970:init_driver() LogLevel: 0x0003
 [  6.307s] [<background page>.GoogleSmartCard.NaclModule<"nacl_module.nmf">.NaCl] [INFO] [syslog] 00000100 ../../src/src/ifdhandler.c:1981:init_driver() DriverOptions: 0x0004
 [  6.307s] [<background page>.GoogleSmartCard.NaclModule<"nacl_module.nmf">.NaCl] [INFO] [syslog] 00000300 ../../src/src/ifdhandler.c:110:CreateChannelByNameOrChannel() Lun: 0, device: usb:076b/3021:libusb-1.0:42:0:0
 [  6.308s] [<background page>.GoogleSmartCard.NaclModule<"nacl_module.nmf">.NaCl] [INFO] [syslog] 00000070 ../../src/src/ccid_usb.c:287:OpenUSBByName() Using: /crx/pcsc/drivers/ifd-ccid.bundle/Contents/Info.plist
 [  6.309s] [<background page>.GoogleSmartCard.NaclModule<"nacl_module.nmf">.NaCl] [INFO] [syslog] 00000830 ../../src/src/ccid_usb.c:305:OpenUSBByName() ifdManufacturerString: Ludovic Rousseau ([email protected])
 [  6.310s] [<background page>.GoogleSmartCard.NaclModule<"nacl_module.nmf">.NaCl] [INFO] [syslog] 00000090 ../../src/src/ccid_usb.c:306:OpenUSBByName() ifdProductString: Generic CCID driver
 [  6.312s] [<background page>.GoogleSmartCard.NaclModule<"nacl_module.nmf">.NaCl] [INFO] [syslog] 00000050 ../../src/src/ccid_usb.c:307:OpenUSBByName() Copyright: This driver is protected by terms of the GNU Lesser General Public License version 2.1, or (at your option) any later version.
 [  6.321s] [<background page>.GoogleSmartCard.Libusb.ChromeUsbRequestHandler] [WARNING] API error occurred while calling chrome.usb.openDevice(<stripped value>): Failed to open device.
 [  6.325s] [<background page>.GoogleSmartCard.NaclModule<"nacl_module.nmf">.NaCl] [WARNING] LibusbOverChromeUsb::LibusbOpen request failed: Error: Failed to open device.
 [  6.326s] [<background page>.GoogleSmartCard.NaclModule<"nacl_module.nmf">.NaCl] [WARNING] [syslog] 00022720 ../../src/src/ccid_usb.c:525:OpenUSBByName() Can't libusb_open(42/0): LIBUSB_ERROR_OTHER
 [  6.327s] [<background page>.GoogleSmartCard.NaclModule<"nacl_module.nmf">.NaCl] [INFO] [syslog] 00000360 ../../src/src/ccid_usb.c:189:close_libusb_if_needed() libusb_exit
 [  6.328s] [<background page>.GoogleSmartCard.NaclModule<"nacl_module.nmf">.NaCl] [INFO] [syslog] 00000140 ../../src/src/ccid_usb.c:749:OpenUSBByName() Device not found?
 [  6.329s] [<background page>.GoogleSmartCard.NaclModule<"nacl_module.nmf">.NaCl] [WARNING] [syslog] 00000130 ../../src/src/ifdhandler.c:144:CreateChannelByNameOrChannel() failed
 [  6.330s] [<background page>.GoogleSmartCard.NaclModule<"nacl_module.nmf">.NaCl] [INFO] [syslog] ../../../../../third_party/pcsc-lite/src/src/readerfactory.c:1110:RFInitializeReader() Open Port 0x200000 Failed (usb:076b/3021:libusb-1.0:42:0:0)
 [  6.331s] [<background page>.GoogleSmartCard.NaclModule<"nacl_module.nmf">.NaCl] [INFO] [syslog] ../../../../../third_party/pcsc-lite/src/src/readerfactory.c:375:RFAddReaderOriginal() OMNIKEY AG CardMan 3121 init failed.
 [  6.332s] [<background page>.GoogleSmartCard.NaclModule<"nacl_module.nmf">.ReaderTracker] [WARNING] Failure while initializing the reader "OMNIKEY AG CardMan 3121" (port 2097152, device "usb:076b/3021:libusb-1.0:42:0:0"): error code 0x80100009
 [  6.333s] [</window.html>.GoogleSmartCard.ConnectorApp.MainWindow] [INFO] Displaying 1 card reader(s): [{name: "OMNIKEY AG CardMan 3121", status: "failure", error: "0x80100009", isCardPresent: false}]
 [  6.334s] [<background page>.GoogleSmartCard.PcscLiteServerClientsManagement.ClientHandler<id=0, client=own app>] [INFO] The server is ready, processing the delayed requests...
 [  6.338s] [<background page>.GoogleSmartCard.NaclModule<"nacl_module.nmf">.NaCl] [INFO] [PC/SC-Lite client 0 handler] SCardEstablishContext(dwScope=SCARD_SCOPE_SYSTEM, pvReserved1=null, pvReserved2=null): called...
 [  6.339s] [<background page>.GoogleSmartCard.NaclModule<"nacl_module.nmf">.NaCl] [INFO] [PC/SC-Lite client 0 handler] SCardEstablishContext: returning 0x00000000 ["Command successful."], hContext=0x5851F42D
 [  6.344s] [<background page>.GoogleSmartCard.NaclModule<"nacl_module.nmf">.NaCl] [INFO] [PC/SC-Lite client 0 handler] SCardListReaders(hContext=0x5851F42D, mszGroups=null): called...
 [  6.345s] [<background page>.GoogleSmartCard.NaclModule<"nacl_module.nmf">.NaCl] [INFO] [PC/SC-Lite client 0 handler] SCardListReaders: returning 0x8010002E ["Cannot find a smart card reader."]
 [  6.351s] [<background page>.GoogleSmartCard.NaclModule<"nacl_module.nmf">.NaCl] [INFO] [PC/SC-Lite client 0 handler] SCardGetStatusChange(hContext=0x5851F42D, dwTimeout=0, rgReaderStates=NULL): called...
 [  6.351s] [<background page>.GoogleSmartCard.NaclModule<"nacl_module.nmf">.NaCl] [INFO] [PC/SC-Lite client 0 handler] SCardGetStatusChange: returning 0x00000000 ["Command successful."], rgReaderStates=NULL
 [  6.354s] [<background page>.GoogleSmartCard.NaclModule<"nacl_module.nmf">.NaCl] [INFO] [PC/SC-Lite client 0 handler] SCardGetStatusChange(hContext=0x5851F42D, dwTimeout=60000, rgReaderStates=0xFEB13A80([SCARD_READERSTATE(szReader="\\?PnP?\Notification", pvUserData=NULL, dwCurrentState=SCARD_STATE_UNAWARE)])): called...

@ivansandrk
Copy link
Contributor

Hi Mariano, error 0x80100009 means that the reader is not recognized. So my first guess would be that the particular reader isn't supported unfortunately.

What driver are you using for the reader? If you're not using the open source ccid driver, give it a shot. Here's a thread where someone had a problem because of wrong driver https://ubuntuforums.org/showthread.php?t=1613601

@mefernandez
Copy link
Author

That's a quick response.
I'm using the drivers listed at Omnikey's web page, ifdokccid_linux_x86_64-v4.0.5.5.
It works fine with Firefox.

Are you recommending to install https://pcsclite.alioth.debian.org/ccid.html?
Should I uninstall Omnikey's drivers?

Some more debugging:

$ sudo pcscd -v

pcsc-lite version 1.8.14.
Copyright (C) 1999-2002 by David Corcoran <[email protected]>.
Copyright (C) 2001-2011 by Ludovic Rousseau <[email protected]>.
Copyright (C) 2003-2004 by Damien Sauveron <[email protected]>.
Report bugs to <[email protected]>.
Enabled features: Linux x86_64-pc-linux-gnu serial usb libudev usbdropdir=/usr/lib/pcsc/drivers ipcdir=/var/run/pcscd configdir=/etc/reader.conf.d


$ opensc-tool -l
# Detected readers (pcsc)
Nr.  Card  Features  Name
0    Yes             OMNIKEY CardMan (076B:3021) 3021 00 00

@mefernandez
Copy link
Author

I see I already have libccid installed.
How to make this work?

@emaxx-google
Copy link
Collaborator

emaxx-google commented Oct 26, 2016

Hi Mariano,
You would have to stop the system pcscd daemon whilebefore using the Connector app. Two processes (pcscd and Chrome) cannot access the same device simultaneously.
Firefox is probably handling this differently, but the Connector app is working this way because it's primarily oriented to Chrome OS.

Hope this helps.

@emaxx-google
Copy link
Collaborator

Also note that there are some problems with support of this reader by the Free CCID driver that is used by the Connector app:
LudovicRousseau/PCSC#11

@emaxx-google
Copy link
Collaborator

Closing this issue for inactivity. In case you would have more questions, please feel free to submit a new issue.

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