In order to thank you for all members' support of our website, we are holding new events - Getting Free Samples by Paying Freight only.
Want to get free samples? Please check this post for more details.

CCID Device Chrome Extension v1.0

Other Tools
User avatar
JavaCardOS
Posts: 260
Joined: Thu Apr 30, 2015 12:00 pm
Points :2279
Contact:

CCID Device Chrome Extension v1.0

Post by JavaCardOS » Mon Jan 16, 2017 1:44 am

Overview
CCID Device Chrome Extension is an chrome extension, which provides apis for pages to communicate with CCID Devices.
If you have any question, please post your question here or contact javacardos@gmail.com.

Usage
Your device shall be recognized by chrome first.
● Download Zadig.
● Replace your device driver with driver WinUSB.



Web page communicates with the CCID device

Load extension
> Go to Chrome extension page
◇ Visit chrome extension page by entering chrome://extensions/
or
◇ Use chrome menu: "Customise and control Google Chrome" -> "More tools" -> "Extensions"
> Enable "Developer mode"
> "Load unpacked extension ..."
> The extension is loaded.



Communicate with CCID device
● Open the demo web page


● Get Devices
Enumerates connected USB devices.

● Open Device
Opens a USB device returned by getDevices.

● Close Device
Closes a connection handle. Invoking operations on a handle after it has been closed is a safe operation but causes no action to be taken.

● List Interfaces
Lists all interfaces on a USB device.

● Claim Interface
Claims an interface on a USB device. Before data can be transfered to an interface or associated endpoints the interface must be claimed. Only one connection handle can claim an interface at any given time. If the interface is already claimed, this call will fail.

● Release Interface
Releases a claimed interface.

● Init Transmit
Initialize a transmission, this function sends "PC_to_RDR_IccPowerOff", "PC_to_RDR_IccPowerOn" and "PC_to_RDR_SetParameters" message to the CCID device.

● Send Receive TPDU
Send "PC_to_RDR_XfrBlock" message contains TPDU data to the CCID device;

● End Transmit
Close a transmission, this function sends "PC_to_RDR_IccPowerOff" message to the CCID device.

Reference

This demo extension is modified on u2f-chrome-extension.

TODO
1. Select device from the web page
2. Select interface from the web page
3. Implement T0/T1 protocol
You do not have the required permissions to view the files attached to this post. Please login first.

tieuhaoluong
Posts: 14
Joined: Mon Sep 19, 2016 12:28 am
Points :312
Contact:

Re: CCID Device Chrome Extension v1.0

Post by tieuhaoluong » Mon Jan 16, 2017 9:57 pm

Thank you so much, but I can't use the demo web page. At https://crxjs-dot-u2fdemo.appspot.com/ it's using this extension ID, and at function "handleWebPageRequest" in "webrequest.js" have "switch (request.type)".
This type is sign request, get api version and then register request (it is not in case).

Another question about Zadig. If I change driver from WUDFRd to WinUSB, will an error occur? And how I can restore this driver?
Thank you!

User avatar
JavaCardOS
Posts: 260
Joined: Thu Apr 30, 2015 12:00 pm
Points :2279
Contact:

Re: CCID Device Chrome Extension v1.0

Post by JavaCardOS » Mon Jan 16, 2017 11:04 pm

tieuhaoluong wrote:Thank you so much, but I can't use the demo web page. At https://crxjs-dot-u2fdemo.appspot.com/ it's using this extension ID, and at function "handleWebPageRequest" in "webrequest.js" have "switch (request.type)".
This type is sign request, get api version and then register request (it is not in case).


Would you please let us know your implementation method, 1 or 2?

You do not have the required permissions to view the files attached to this post. Please login first.

User avatar
JavaCardOS
Posts: 260
Joined: Thu Apr 30, 2015 12:00 pm
Points :2279
Contact:

Re: CCID Device Chrome Extension v1.0

Post by JavaCardOS » Mon Jan 16, 2017 11:14 pm

tieuhaoluong wrote:Another question about Zadig. If I change driver from WUDFRd to WinUSB, will an error occur? And how I can restore this driver?
Thank you!


Usually, there will be no problem. If there is, just delete and reinstall the driver.

You do not have the required permissions to view the files attached to this post. Please login first.

tieuhaoluong
Posts: 14
Joined: Mon Sep 19, 2016 12:28 am
Points :312
Contact:

Re: CCID Device Chrome Extension v1.0

Post by tieuhaoluong » Tue Jan 17, 2017 3:22 am

JavaCardOS wrote:
tieuhaoluong wrote:Thank you so much, but I can't use the demo web page. At https://crxjs-dot-u2fdemo.appspot.com/ it's using this extension ID, and at function "handleWebPageRequest" in "webrequest.js" have "switch (request.type)".
This type is sign request, get api version and then register request (it is not in case).


Would you please let us know your implementation method, 1 or 2?

Image


I'm using method 2, but I use NativeMessage, communication with C# app by stdio via chrome.runtime.connectNative() & chrome.runtime.postMessage()

User avatar
JavaCardOS
Posts: 260
Joined: Thu Apr 30, 2015 12:00 pm
Points :2279
Contact:

Re: CCID Device Chrome Extension v1.0

Post by JavaCardOS » Tue Jan 17, 2017 5:54 am

tieuhaoluong wrote:I'm using method 2, but I use NativeMessage, communication with C# app by stdio via chrome.runtime.connectNative() & chrome.runtime.postMessage()


Ok. How is your code going? Is there any problem?

tieuhaoluong
Posts: 14
Joined: Mon Sep 19, 2016 12:28 am
Points :312
Contact:

Re: CCID Device Chrome Extension v1.0

Post by tieuhaoluong » Tue Jan 17, 2017 9:23 pm

JavaCardOS wrote:Ok. How is your code going? Is there any problem?

Ok. I work normally. But I think it is not a secure protocol, is there?

User avatar
UNKNwYSHSA
Posts: 630
Joined: Thu May 21, 2015 4:05 am
Points :3021
Contact:

Re: CCID Device Chrome Extension v1.0

Post by UNKNwYSHSA » Tue Jan 17, 2017 10:22 pm

About security. I think tay00000 have more expirence can share with us. @tay00000
sense and simplicity

User avatar
UNKNwYSHSA
Posts: 630
Joined: Thu May 21, 2015 4:05 am
Points :3021
Contact:

Re: CCID Device Chrome Extension v1.0

Post by UNKNwYSHSA » Thu Jan 19, 2017 4:46 am

tieuhaoluong wrote:
JavaCardOS wrote:Ok. How is your code going? Is there any problem?

Ok. I work normally. But I think it is not a secure protocol, is there?


Maybe tay00000 is busy.

I think, the secure level of these two methods is same as u2f implementation. The implementation is based on challenge and public key, it data can't be resend or hacked easily. Don't worry about the security, just like no one is worry about the security of u2f.
sense and simplicity

tay00000
Posts: 112
Joined: Tue Sep 27, 2016 10:58 am
Points :1486
Contact:

Re: CCID Device Chrome Extension v1.0

Post by tay00000 » Tue Jan 24, 2017 6:37 am

Maybe a little explanation on what I am being asked to review and where is the source code ? I am abit lost reading the thread.

Also, note that the Browser/PC to U2F card/device does not use any sort of Secure Channel Protocol of any sort. They are done over plain APDU channels which I have tried to raise attention to the FIDO Alliance but nobody bothers anyway.

Post Reply Previous topicNext topic

Who is online

Users browsing this forum: No registered users and 1 guest

JavaCard OS : Disclaimer