<div dir="ltr">Hello,<br><div><div class="gmail_extra"><br><div class="gmail_quote">2017-02-06 11:19 GMT+01:00 James <span dir="ltr"><<a href="mailto:pcsclite@madingley.org" target="_blank">pcsclite@madingley.org</a>></span>:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">This is a usb/bluetooth card reader, easily available from ebay &c.<br>
<br>
<a href="https://www.hidglobal.com/products/readers/omnikey/2061" rel="noreferrer" target="_blank">https://www.hidglobal.com/<wbr>products/readers/omnikey/2061</a><br>
<br>
It has a single bluetooth SPP<br>
<br>
Service Name: SPP<br>
Service RecHandle: 0x10000<br>
Service Class ID List:<br>
  "Serial Port" (0x1101)<br>
Protocol Descriptor List:<br>
  "L2CAP" (0x0100)<br>
  "RFCOMM" (0x0003)<br>
    Channel: 1<br>
Language Base Attr List:<br>
  code_ISO639: 0x656e<br>
  encoding:    0x6a<br>
  base_offset: 0x100<br>
<br>
<br>
The protocol (for which i was unable to find any documentation)<br>
is quite simple, after the connexion is set up, CCID packets are sent<br>
with<br>
<br>
0xA5 <ccid packet> CHK<br>
<br>
CHK is the XOR of all the bytes in the ccid picket, replies are sent<br>
similarly.<br>
<br>
With this driver I'm able to use a J3A081 running isoapplet, but<br>
attempts to use cardcontact's smartcard-hsm failed (I think due<br>
to the lack of extended APDUs)<br>
<br>
Snooping the communication with the windows software there are a few<br>
reader escapes the purpose of which I've not discovered.<br>
<br>
a5 6b 02 00 00 00 00 77 00 00 00 02 00 1c<br>
a5 6b 02 00 00 00 00 78 00 00 00 0c 23 3e<br>
a5 6b 02 00 00 00 00 7b 00 00 00 0c 26 38<br>
a5 6b 06 00 00 00 00 86 00 00 00 2d 00 00 00 00 00 c6<br>
a5 6b 0c 00 00 00 00 87 00 00 00 1a 00 40 07 80 58 00 00 00 00 00 9f fa<br>
a5 6b 06 00 00 00 00 88 00 00 00 2d 01 fe fe 80 00 49<br>
a5 6b 06 00 00 00 00 98 00 00 00 2d 00 00 00 00 00 d8<br>
a5 6b 0c 00 00 00 00 99 00 00 00 1a 00 40 07 80 58 00 00 00 00 00 9f e4<br></blockquote><div><br></div><div>6b is PC_to_RDR_Escape<br></div><div>It is used to send a proprietary command to the reader. So without a documentation is will be difficult to know what the commands are doing.<br>But that is the goal of reverse engineering :-)<br></div><div><br> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<br>
&c.<br>
<br>
The patch renames the twin driver file and symbols to include twin in the name.<br>
<br>
Ideally I think the rfcomm functionality needs to be in the driver<br>
and it needs to be able to handle bluetooth connect/disconnect without<br>
the need to restart pcscd.<br>
<br>
PINs are encrypted only by the bluetooth transport layer, more modern<br>
bluetooth card readers wrap the communication in another layer of AES.<br>
<br>
I'm intending to write patches to support one of more popular models of those<br>
as well.<br></blockquote><div><br></div><div>Good luck<br><br></div><div>Bye<br clear="all"></div></div><br>-- <br><div class="gmail_signature"> Dr. Ludovic Rousseau</div>
</div></div></div>