From bernhard.walle at posteo.eu  Wed Nov  6 06:07:06 2024
From: bernhard.walle at posteo.eu (Bernhard Walle)
Date: Wed, 06 Nov 2024 14:07:06 +0000
Subject: [Pcsclite-muscle] ccid: Change order of card readers
Message-ID: <f8167c6af5dd7d17016dab1a92c4cfff@posteo.de>

Hello,

is is possible to change the order of card readers detected by pcscd 
when using ccid drivers in some configuration file?

I mean, we have two identical readers:

$ pcsc_scan -r
Using reader plug'n play mechanism
Scanning present readers...
0: HID Global OMNIKEY 3x21 Smart Card Reader [OMNIKEY 3x21 Smart Card 
Reader] 00 00
1: HID Global OMNIKEY 3x21 Smart Card Reader [OMNIKEY 3x21 Smart Card 
Reader] 01 00


So is it possible to revert the order?


Regards,
Bernhard





From ludovic.rousseau at gmail.com  Wed Nov  6 10:41:59 2024
From: ludovic.rousseau at gmail.com (Ludovic Rousseau)
Date: Wed, 6 Nov 2024 19:41:59 +0100
Subject: [Pcsclite-muscle] ccid: Change order of card readers
In-Reply-To: <f8167c6af5dd7d17016dab1a92c4cfff@posteo.de>
References: <f8167c6af5dd7d17016dab1a92c4cfff@posteo.de>
Message-ID: <CAGstE8CRk5b4Fmr1Bj7CXhKb8EWAd3xb3rX9Hp2LJM+nV_dQqQ@mail.gmail.com>

Le mer. 6 nov. 2024 ? 15:14, Bernhard Walle <bernhard.walle at posteo.eu> a ?crit :
>
> Hello,

Hello Bernhard,

> is is possible to change the order of card readers detected by pcscd
> when using ccid drivers in some configuration file?
>
> I mean, we have two identical readers:
>
> $ pcsc_scan -r
> Using reader plug'n play mechanism
> Scanning present readers...
> 0: HID Global OMNIKEY 3x21 Smart Card Reader [OMNIKEY 3x21 Smart Card
> Reader] 00 00
> 1: HID Global OMNIKEY 3x21 Smart Card Reader [OMNIKEY 3x21 Smart Card
> Reader] 01 00
>
>
> So is it possible to revert the order?

No, it is not.
The order listed by PC/SC is the order the readers are connected.
So connect first the reader you want to have listed first.

It would be easier if your USB devices had a serial number.
See "What is in a PC/SC reader name?"
https://blog.apdu.fr/posts/2010/05/what-is-in-pcsc-reader-name/

Bye

-- 
 Dr. Ludovic Rousseau


From deengert at gmail.com  Wed Nov  6 17:52:10 2024
From: deengert at gmail.com (Douglas E Engert)
Date: Wed, 6 Nov 2024 19:52:10 -0600
Subject: [Pcsclite-muscle] ccid: Change order of card readers
In-Reply-To: <f8167c6af5dd7d17016dab1a92c4cfff@posteo.de>
References: <f8167c6af5dd7d17016dab1a92c4cfff@posteo.de>
Message-ID: <8d63f9ad-e5d5-40f4-8cf8-92538c553291@gmail.com>

If you have more then one reader,? you should be looking for the card in the reader.
What code is calling PCSC?
What OS?

On 11/6/2024 8:07 AM, Bernhard Walle wrote:
> Hello,
>
> is is possible to change the order of card readers detected by pcscd when using ccid drivers in some configuration file?
>
> I mean, we have two identical readers:
>
> $ pcsc_scan -r
> Using reader plug'n play mechanism
> Scanning present readers...
> 0: HID Global OMNIKEY 3x21 Smart Card Reader [OMNIKEY 3x21 Smart Card Reader] 00 00
> 1: HID Global OMNIKEY 3x21 Smart Card Reader [OMNIKEY 3x21 Smart Card Reader] 01 00
>
>
> So is it possible to revert the order?
>
>
> Regards,
> Bernhard
>
>
>
>
> _______________________________________________
> pcsclite-muscle mailing list
> pcsclite-muscle at lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/pcsclite-muscle

-- 

  Douglas E. Engert  <DEEngert at gmail.com>
  



From bernhard.walle at posteo.eu  Thu Nov  7 01:07:23 2024
From: bernhard.walle at posteo.eu (Bernhard Walle)
Date: Thu, 07 Nov 2024 09:07:23 +0000
Subject: [Pcsclite-muscle] ccid: Change order of card readers
In-Reply-To: <8d63f9ad-e5d5-40f4-8cf8-92538c553291@gmail.com>
References: <f8167c6af5dd7d17016dab1a92c4cfff@posteo.de>
 <8d63f9ad-e5d5-40f4-8cf8-92538c553291@gmail.com>
Message-ID: <d6b0570827754856306a22dfc5c61f23@posteo.de>

Hello,

I'm using Linux.

Problem is that we don't use pcsc directly but via a PKCS#11 middleware 
(Telesec), so we're not dealing with reader names in PC/SC but with slot 
numbers in the PKCS#11.


Regards,
Bernhard


Am 07.11.2024 02:52 schrieb Douglas E Engert:
> If you have more then one reader,? you should be looking for the card
> in the reader.
> What code is calling PCSC?
> What OS?
> 
> On 11/6/2024 8:07 AM, Bernhard Walle wrote:
>> Hello,
>> 
>> is is possible to change the order of card readers detected by pcscd 
>> when using ccid drivers in some configuration file?
>> 
>> I mean, we have two identical readers:
>> 
>> $ pcsc_scan -r
>> Using reader plug'n play mechanism
>> Scanning present readers...
>> 0: HID Global OMNIKEY 3x21 Smart Card Reader [OMNIKEY 3x21 Smart Card 
>> Reader] 00 00
>> 1: HID Global OMNIKEY 3x21 Smart Card Reader [OMNIKEY 3x21 Smart Card 
>> Reader] 01 00
>> 
>> 
>> So is it possible to revert the order?
>> 
>> 
>> Regards,
>> Bernhard
>> 
>> 
>> 
>> 
>> _______________________________________________
>> pcsclite-muscle mailing list
>> pcsclite-muscle at lists.infradead.org
>> http://lists.infradead.org/mailman/listinfo/pcsclite-muscle


From deengert at gmail.com  Thu Nov  7 03:23:10 2024
From: deengert at gmail.com (Douglas E Engert)
Date: Thu, 7 Nov 2024 05:23:10 -0600
Subject: [Pcsclite-muscle] ccid: Change order of card readers
In-Reply-To: <d6b0570827754856306a22dfc5c61f23@posteo.de>
References: <f8167c6af5dd7d17016dab1a92c4cfff@posteo.de>
 <8d63f9ad-e5d5-40f4-8cf8-92538c553291@gmail.com>
 <d6b0570827754856306a22dfc5c61f23@posteo.de>
Message-ID: <93a0d2ca-0801-4237-9186-c75495a14d45@gmail.com>

What you should be dealing with is not the slot numbers, but the tokens in the slot.

Have a look at https://www.rfc-editor.org/rfc/rfc7512.html which tries address many of the following issues

PKCS11 does not really care about readers but the card in the readers

"CK_SLOT_ID is a Cryptoki-assigned value that identifies a slot." Each application gets a
list of known slots when it calls C_GetSlotList, Note the flags CKF_TOKEN_PRESENT and CKF_REMOVABLE_DEVICE
The list of slots will not change for that application until C_GetSlotList is called again. The
CKF_TOKEN_PRESENT may change if a card is removed or inserted.

If multiple applications call C_GetSlotList the slot numbers may be different if readers are are added or removed.
So you can not depend on the slot number. CKF_REMOVABLE_DEVICE distinguishes the difference.

The CK_SLOT_INFO slotDescription and manufacturerID? are set by the PKCS11? module (in your case Telesec)
which may or may not include the reader name.

C_GetTokenInfo is more of what you should look at, which serialNumber.

You may also find the OpenSC pkcs11-tool which can use any PKCS11 module to look at what the
Telesec pkcs11 module? does.

After all of this if your problem is something like trying to have one card for an ADMIN trying
to initialize a new card in another reader, you still need to tell the person which reader to insert
the new card.? One way to to have two different types of readers.
Personally I have found Identiv SCR3500 Smartfold Smart Card Reader to be good. Amazon?? $17.95


On 11/7/2024 3:07 AM, Bernhard Walle wrote:
> Hello,
>
> I'm using Linux.
>
> Problem is that we don't use pcsc directly but via a PKCS#11 middleware (Telesec), so we're not dealing with reader names in PC/SC but with slot numbers in the PKCS#11.
>
>
> Regards,
> Bernhard
>
>
> Am 07.11.2024 02:52 schrieb Douglas E Engert:
>> If you have more then one reader,? you should be looking for the card
>> in the reader.
>> What code is calling PCSC?
>> What OS?
>>
>> On 11/6/2024 8:07 AM, Bernhard Walle wrote:
>>> Hello,
>>>
>>> is is possible to change the order of card readers detected by pcscd when using ccid drivers in some configuration file?
>>>
>>> I mean, we have two identical readers:
>>>
>>> $ pcsc_scan -r
>>> Using reader plug'n play mechanism
>>> Scanning present readers...
>>> 0: HID Global OMNIKEY 3x21 Smart Card Reader [OMNIKEY 3x21 Smart Card Reader] 00 00
>>> 1: HID Global OMNIKEY 3x21 Smart Card Reader [OMNIKEY 3x21 Smart Card Reader] 01 00
>>>
>>>
>>> So is it possible to revert the order?
>>>
>>>
>>> Regards,
>>> Bernhard
>>>
>>>
>>>
>>>
>>> _______________________________________________
>>> pcsclite-muscle mailing list
>>> pcsclite-muscle at lists.infradead.org
>>> http://lists.infradead.org/mailman/listinfo/pcsclite-muscle

-- 

  Douglas E. Engert  <DEEngert at gmail.com>
  



From bernhard.walle at posteo.eu  Thu Nov  7 06:07:30 2024
From: bernhard.walle at posteo.eu (Bernhard Walle)
Date: Thu, 07 Nov 2024 14:07:30 +0000
Subject: [Pcsclite-muscle] ccid: Change order of card readers
In-Reply-To: <93a0d2ca-0801-4237-9186-c75495a14d45@gmail.com>
References: <f8167c6af5dd7d17016dab1a92c4cfff@posteo.de>
 <8d63f9ad-e5d5-40f4-8cf8-92538c553291@gmail.com>
 <d6b0570827754856306a22dfc5c61f23@posteo.de>
 <93a0d2ca-0801-4237-9186-c75495a14d45@gmail.com>
Message-ID: <2cae55bce942a6ccf42aba9f313368aa@posteo.de>

Hi, Douglas,

Thanks a lot.

Regards,
Bernhard

Am 07.11.2024 12:23 schrieb Douglas E Engert:
> What you should be dealing with is not the slot numbers, but the
> tokens in the slot.
> 
> Have a look at https://www.rfc-editor.org/rfc/rfc7512.html which tries
> address many of the following issues
> 
> PKCS11 does not really care about readers but the card in the readers
> 
> "CK_SLOT_ID is a Cryptoki-assigned value that identifies a slot." Each
> application gets a
> list of known slots when it calls C_GetSlotList, Note the flags
> CKF_TOKEN_PRESENT and CKF_REMOVABLE_DEVICE
> The list of slots will not change for that application until
> C_GetSlotList is called again. The
> CKF_TOKEN_PRESENT may change if a card is removed or inserted.
> 
> If multiple applications call C_GetSlotList the slot numbers may be
> different if readers are are added or removed.
> So you can not depend on the slot number. CKF_REMOVABLE_DEVICE
> distinguishes the difference.
> 
> The CK_SLOT_INFO slotDescription and manufacturerID? are set by the
> PKCS11? module (in your case Telesec)
> which may or may not include the reader name.
> 
> C_GetTokenInfo is more of what you should look at, which serialNumber.
> 
> You may also find the OpenSC pkcs11-tool which can use any PKCS11
> module to look at what the
> Telesec pkcs11 module? does.
> 
> After all of this if your problem is something like trying to have one
> card for an ADMIN trying
> to initialize a new card in another reader, you still need to tell the
> person which reader to insert
> the new card.? One way to to have two different types of readers.
> Personally I have found Identiv SCR3500 Smartfold Smart Card Reader to
> be good. Amazon?? $17.95
> 
> 
> On 11/7/2024 3:07 AM, Bernhard Walle wrote:
>> Hello,
>> 
>> I'm using Linux.
>> 
>> Problem is that we don't use pcsc directly but via a PKCS#11 
>> middleware (Telesec), so we're not dealing with reader names in PC/SC 
>> but with slot numbers in the PKCS#11.
>> 
>> 
>> Regards,
>> Bernhard
>> 
>> 
>> Am 07.11.2024 02:52 schrieb Douglas E Engert:
>>> If you have more then one reader,? you should be looking for the card
>>> in the reader.
>>> What code is calling PCSC?
>>> What OS?
>>> 
>>> On 11/6/2024 8:07 AM, Bernhard Walle wrote:
>>>> Hello,
>>>> 
>>>> is is possible to change the order of card readers detected by pcscd 
>>>> when using ccid drivers in some configuration file?
>>>> 
>>>> I mean, we have two identical readers:
>>>> 
>>>> $ pcsc_scan -r
>>>> Using reader plug'n play mechanism
>>>> Scanning present readers...
>>>> 0: HID Global OMNIKEY 3x21 Smart Card Reader [OMNIKEY 3x21 Smart 
>>>> Card Reader] 00 00
>>>> 1: HID Global OMNIKEY 3x21 Smart Card Reader [OMNIKEY 3x21 Smart 
>>>> Card Reader] 01 00
>>>> 
>>>> 
>>>> So is it possible to revert the order?
>>>> 
>>>> 
>>>> Regards,
>>>> Bernhard
>>>> 
>>>> 
>>>> 
>>>> 
>>>> _______________________________________________
>>>> pcsclite-muscle mailing list
>>>> pcsclite-muscle at lists.infradead.org
>>>> http://lists.infradead.org/mailman/listinfo/pcsclite-muscle


From linuxmasterjedi at free.fr  Thu Nov  7 13:21:38 2024
From: linuxmasterjedi at free.fr (L.M.J)
Date: Thu, 7 Nov 2024 22:21:38 +0100 (CET)
Subject: [Pcsclite-muscle] Need Help Reading Atmel AT88SC0204C Smart Card
Message-ID: <84437601.26184947.1731014498168.JavaMail.root@zimbra32-e6.priv.proxad.net>

Hi everyone,

I?m new to smart card reader technologies and would appreciate any guidance or resources (tutorials, websites, etc.) for reading or dumping the memory of an Atmel AT88SC0204C smart card (credit card format) on Linux. I am using an Cardman 5422 reader.

I?ve been running into issues with `pcsc_scan`, which keeps looping without end (`- / \ -`). Here is a snapshot of the output:

        $ pcsc_scan
        Using reader plug'n play mechanism
        Scanning present readers...
        0: HID Global OMNIKEY 5422 Smartcard Reader [OMNIKEY 5422CL Smartcard Reader] (KJ0J0F017R11102027) 00 00
        1: HID Global OMNIKEY 5422 Smartcard Reader [OMNIKEY 5422 Smartcard Reader] (KJ0J0F017R11102027) 01 00
        
        Wed Nov  6 21:06:42 2024
         Reader 0: HID Global OMNIKEY 5422CL Smartcard Reader (KJ0J0F017R11102027) 00 00
          Card state: Card removed
         Reader 1: HID Global OMNIKEY 5422 Smartcard Reader (KJ0J0F017R11102027) 01 00
          Card state: Card inserted
          ATR: 3B B2 11 00 10 80 00 02

        ATR Analysis:
          Possibly identified card:
          Atmel memory card AT88SC0204C (source: /usr/share/pcsc/smartcard_list.txt)
          Documentation: http://www.atmel.com/dyn/resources/prod_documents/doc5211.pdf

Any advice on setting up commands to read this card?s memory or understanding the APDU commands for the AT88SC0204C would be greatly appreciated!

Thanks in advance for your help!


From s.brunner at stephan-brunner.net  Thu Nov  7 22:12:45 2024
From: s.brunner at stephan-brunner.net (Stephan Brunner)
Date: Fri, 08 Nov 2024 07:12:45 +0100
Subject: [Pcsclite-muscle] Need Help Reading Atmel AT88SC0204C Smart Card
In-Reply-To: <84437601.26184947.1731014498168.JavaMail.root@zimbra32-e6.priv.proxad.net>
References: <84437601.26184947.1731014498168.JavaMail.root@zimbra32-e6.priv.proxad.net>
Message-ID: <61c59e6e45edc8fe92bf0cc7ef790b7f6f950122.camel@stephan-brunner.net>

> Hi everyone,
Hi,

> I?ve been running into issues with `pcsc_scan`, which keeps looping without end (`- / \ -`). Here is a snapshot of the output:
pcsc_scan is supposed to do that. It waits for a card to be inserted, prints its infos, and keeps looking for another one.

> ??????? $ pcsc_scan
> [...]
> ???????? Reader 1: HID Global OMNIKEY 5422 Smartcard Reader (KJ0J0F017R11102027) 01 00
> ????????? Card state: Card inserted
> ????????? ATR: 3B B2 11 00 10 80 00 02
It seems that PCSC found it. Good.

> Any advice on setting up commands to read this card?s memory or understanding the APDU commands for the AT88SC0204C would be greatly appreciated!
You want to look at the manufacturer's page for documentation.
Normally, anything crypto or smartcard is hidden behind a ton of NDAs, but it seems for this one, its simply there:

-> https://www.microchip.com/en-us/product/at88sc0204c#document-table
-> CryptoMemory Full Specification Datasheet

-- 
Stephan


From linuxmasterjedi at free.fr  Wed Nov 13 12:15:28 2024
From: linuxmasterjedi at free.fr (L.M.J)
Date: Wed, 13 Nov 2024 21:15:28 +0100 (CET)
Subject: [Pcsclite-muscle] Need Help Reading Atmel AT88SC0204C Smart Card
In-Reply-To: <CALF_nURhSEcFatQaz_aHkX+iT_S9d4Hk+rGX3Mk-t0_CbBwVBQ@mail.gmail.com>
Message-ID: <1308697749.68008405.1731528928939.JavaMail.root@zimbra32-e6.priv.proxad.net>


----- Mail original -----
> De: "Bruno Jesus" <00cpxxx at gmail.com>
> ?: "L.M.J" <linuxmasterjedi at free.fr>
> Cc: pcsclite-muscle at lists.infradead.org
> Envoy?: Jeudi 7 Novembre 2024 23:05:38
> Objet: Re: [Pcsclite-muscle] Need Help Reading Atmel AT88SC0204C Smart Card
> 
> 
> 
> On Thu, Nov 7, 2024 at 6:23 PM L.M.J < linuxmasterjedi at free.fr >
> wrote:
> 
> 
> Hi everyone,
> 
> I?m new to smart card reader technologies and would appreciate any
> guidance or resources (tutorials, websites, etc.) for reading or
> dumping the memory of an Atmel AT88SC0204C smart card (credit card
> format) on Linux. I am using an Cardman 5422 reader.
> 
> I?ve been running into issues with `pcsc_scan`, which keeps looping
> without end (`- / \ -`). Here is a snapshot of the output:
> 
> $ pcsc_scan
> Using reader plug'n play mechanism
> Scanning present readers...
> 0: HID Global OMNIKEY 5422 Smartcard Reader [OMNIKEY 5422CL Smartcard
> Reader] (KJ0J0F017R11102027) 00 00
> 1: HID Global OMNIKEY 5422 Smartcard Reader [OMNIKEY 5422 Smartcard
> Reader] (KJ0J0F017R11102027) 01 00
> 
> Wed Nov 6 21:06:42 2024
> Reader 0: HID Global OMNIKEY 5422CL Smartcard Reader
> (KJ0J0F017R11102027) 00 00
> Card state: Card removed
> Reader 1: HID Global OMNIKEY 5422 Smartcard Reader
> (KJ0J0F017R11102027) 01 00
> Card state: Card inserted
> ATR: 3B B2 11 00 10 80 00 02
> 
> ATR Analysis:
> Possibly identified card:
> Atmel memory card AT88SC0204C (source:
> /usr/share/pcsc/smartcard_list.txt)
> Documentation:
> http://www.atmel.com/dyn/resources/prod_documents/doc5211.pdf
> 
> Any advice on setting up commands to read this card?s memory or
> understanding the APDU commands for the AT88SC0204C would be greatly
> appreciated!
> 
> 
> 
> 
> Similar document replacements from 2015 are publicly available here:
> https://www.microchip.com/en-us/product/AT88SC0204C
> 
> 
> You have to read the manual to understand the zone divisions and what
> can be done, a quick start from
> Atmel-5211-CryptoMem-Full-Specification-Datasheet.pdf are chapters
> 4.1, 4.3 and 9.4. I no longer remember how they work (this card is
> from 2001 as far as I remember) but a general rule is to never
> change keys or enable authentication mechanisms before understanding
> the complete process and having at least some cards to burn on
> errors. Start by selecting a user zone and reading from it. A blank
> card will reply without authentication.
> 

Hi,

 Thank you Stephan & Bruno for sharing informations.
 So far, I manage to do this :

$ opensc-tool -s '00 B6 00 00 10'
Received (SW1=0x90, SW2=0x00):
3B B2 11 00 10 80 00 02 20 20 FF FF 53 02 FF FF ;.......  ..S...

$ opensc-tool -s '00 B6 00 10 10'
Received (SW1=0x90, SW2=0x00):
24 20 F3 95 56 66 20 20 FF 00 00 00 23 47 03 07 $ ..Vf  ....#G..

$ opensc-tool -s '00 B6 00 20 10'
Received (SW1=0x90, SW2=0x00):
EF 3F EF 3F EF 3F EF 3F FF FF FF FF FF FF FF FF .?.?.?.?........

$ opensc-tool -s '00 B6 00 30 10'
Received (SW1=0x90, SW2=0x00):
FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF ................

$ opensc-tool -s '00 B6 00 40 10'
Received (SW1=0x90, SW2=0x00):
00 00 02 00 00 00 00 00 00 00 00 00 00 00 00 00 ................

$ opensc-tool -s '00 B6 00 50 10'
Received (SW1=0x69, SW2=0x00):
FF B6 75 CD 27 9C B2 4E 10 10 10 10 10 10 10 10 ..u.'..N........

$ opensc-tool -s '00 B6 00 60 10'
Received (SW1=0x69, SW2=0x00):
FF FF FF FF FF FF FF FF 10 10 10 10 10 10 10 10 ................

$ opensc-tool -s '00 B6 00 70 10'
Received (SW1=0x69, SW2=0x00):
FF FF FF FF FF FF FF FF 10 10 10 10 10 10 10 10 ................


Am I on a good read why to read the whole memory of the card ?
Do you have any ressources to share (website and/or youtube) video to teach how this technology works, what tools to use and how ?

Thanks you




From neel148 at yahoo.co.in  Tue Nov 19 22:05:09 2024
From: neel148 at yahoo.co.in (Neel Shah)
Date: Wed, 20 Nov 2024 11:35:09 +0530
Subject: [Pcsclite-muscle] Pcsclite implementation on Android
References: <666787E9-EBEA-4167-84EF-7C87A86FE4FB.ref@yahoo.co.in>
Message-ID: <666787E9-EBEA-4167-84EF-7C87A86FE4FB@yahoo.co.in>

Dear team,

I am looking for pcsclite implementation on Android.

Any guidance on where I can find it would be helpful.

I am trying to connect a smart card reader over USB OTG to an Android phone (non rooted)

Regards 

Neel

