Siemens CardOS v4.3b - reading files

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Siemens CardOS v4.3b - reading files

Nilesh Bhogate

Hi,

 

I am working on OpenSC (v0.14.0) to interact with Charismathics card having ‘Siemens CardOS v4.3b’.

 

OpenSC fails to get the MF from this card; while a Software tool provided by manufacturer is able to read the data objects present on this card.

 

My question is: whether it is valid for the Smartcards to have different location address for MF for different card OS? (May be a dumb question, but I found MF location is hardcoded to “3F002F00” inside ‘libopensc\dir.c’)

If it is valid, is there any way to get information about file structure (and location addresses) for a particular card? Appreciate any help / guidance in this regard.

 

=======================================================================================

Log snippet:

matched driver 'Siemens CardOS'

card info name:'CardOS M4', type:1004, flags:0x0, max_send/recv_size:0/0

[opensc-pkcs11] libopensc\card.c:250:sc_connect_card: returning with: 0 (Success)

SCM Microsystems Inc. SCR33x USB Smart Card Reader 0: Connected SC card 013FC618

[opensc-pkcs11] libopensc\dir.c:140:sc_enum_apps: called

called; type=2, path=3f002f00

[opensc-pkcs11] libopensc\card-cardos.c:449:cardos_select_file: called

[opensc-pkcs11] libopensc\apdu.c:559:sc_transmit_apdu: called

[opensc-pkcs11] libopensc\card.c:325:sc_lock: called

[opensc-pkcs11] libopensc\reader-pcsc.c:517:pcsc_lock: called

[opensc-pkcs11] libopensc\apdu.c:526:sc_transmit: called

[opensc-pkcs11] libopensc\apdu.c:380:sc_single_transmit: called

CLA:0, INS:A4, P1:8, P2:0, data(2) 00C4E7BA

reader 'SCM Microsystems Inc. SCR33x USB Smart Card Reader 0'

Outgoing APDU data [    8 bytes] =====================================

00 A4 08 00 02 2F 00 00 ...../..

======================================================================

[opensc-pkcs11] libopensc\reader-pcsc.c:182:pcsc_internal_transmit: called

Incoming APDU data [    2 bytes] =====================================

6A 82 j.

======================================================================

[opensc-pkcs11] libopensc\apdu.c:395:sc_single_transmit: returning with: 0 (Success)

[opensc-pkcs11] libopensc\apdu.c:548:sc_transmit: returning with: 0 (Success)

[opensc-pkcs11] libopensc\card.c:361:sc_unlock: called

[opensc-pkcs11] libopensc\reader-pcsc.c:554:pcsc_unlock: called

file not found

[opensc-pkcs11] libopensc\iso7816.c:507:iso7816_select_file: returning with: -1201 (File not found)

[opensc-pkcs11] libopensc\card-cardos.c:453:cardos_select_file: returning with: -1201 (File not found)

[opensc-pkcs11] libopensc\card.c:640:sc_select_file: 'SELECT' error: -1201 (File not found)

[opensc-pkcs11] libopensc\dir.c:151:sc_enum_apps: Cannot select EF.DIR file: -1201 (File not found)

=======================================================================================

 

Thanks and Best regards,

Nilesh


------------------------------------------------------------------------------

_______________________________________________
Opensc-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/opensc-devel
Reply | Threaded
Open this post in threaded view
|

Re: Siemens CardOS v4.3b - reading files

Frank Morgner
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA512

No, that should not happen. First of all, you should use a more recent
version of OpenSC. Second, you could log the APDUs coming from the
vendor and compare that to OpenSC.

If the problem persists, please open a github issue with all the
information.

Greets, Frank.


On Friday, April 08 at 05:33PM, Nilesh Bhogate wrote:

> Hi,
>
>  
>
> I am working on OpenSC (v0.14.0) to interact with Charismathics card having
> 'Siemens CardOS v4.3b'.
>
>  
>
> OpenSC fails to get the MF from this card; while a Software tool provided by
> manufacturer is able to read the data objects present on this card.
>
>  
>
> My question is: whether it is valid for the Smartcards to have different
> location address for MF for different card OS? (May be a dumb question, but
> I found MF location is hardcoded to "3F002F00" inside 'libopensc\dir.c')
>
> If it is valid, is there any way to get information about file structure
> (and location addresses) for a particular card? Appreciate any help /
> guidance in this regard.
>
>  
>
> ============================================================================
> ===========
>
> Log snippet:
>
> matched driver 'Siemens CardOS'
>
> card info name:'CardOS M4', type:1004, flags:0x0, max_send/recv_size:0/0
>
> [opensc-pkcs11] libopensc\card.c:250:sc_connect_card: returning with: 0
> (Success)
>
> SCM Microsystems Inc. SCR33x USB Smart Card Reader 0: Connected SC card
> 013FC618
>
> [opensc-pkcs11] libopensc\dir.c:140:sc_enum_apps: called
>
> called; type=2, path=3f002f00
>
> [opensc-pkcs11] libopensc\card-cardos.c:449:cardos_select_file: called
>
> [opensc-pkcs11] libopensc\apdu.c:559:sc_transmit_apdu: called
>
> [opensc-pkcs11] libopensc\card.c:325:sc_lock: called
>
> [opensc-pkcs11] libopensc\reader-pcsc.c:517:pcsc_lock: called
>
> [opensc-pkcs11] libopensc\apdu.c:526:sc_transmit: called
>
> [opensc-pkcs11] libopensc\apdu.c:380:sc_single_transmit: called
>
> CLA:0, INS:A4, P1:8, P2:0, data(2) 00C4E7BA
>
> reader 'SCM Microsystems Inc. SCR33x USB Smart Card Reader 0'
>
> Outgoing APDU data [    8 bytes] =====================================
>
> 00 A4 08 00 02 2F 00 00 ...../..
>
> ======================================================================
>
> [opensc-pkcs11] libopensc\reader-pcsc.c:182:pcsc_internal_transmit: called
>
> Incoming APDU data [    2 bytes] =====================================
>
> 6A 82 j.
>
> ======================================================================
>
> [opensc-pkcs11] libopensc\apdu.c:395:sc_single_transmit: returning with: 0
> (Success)
>
> [opensc-pkcs11] libopensc\apdu.c:548:sc_transmit: returning with: 0
> (Success)
>
> [opensc-pkcs11] libopensc\card.c:361:sc_unlock: called
>
> [opensc-pkcs11] libopensc\reader-pcsc.c:554:pcsc_unlock: called
>
> file not found
>
> [opensc-pkcs11] libopensc\iso7816.c:507:iso7816_select_file: returning with:
> -1201 (File not found)
>
> [opensc-pkcs11] libopensc\card-cardos.c:453:cardos_select_file: returning
> with: -1201 (File not found)
>
> [opensc-pkcs11] libopensc\card.c:640:sc_select_file: 'SELECT' error: -1201
> (File not found)
>
> [opensc-pkcs11] libopensc\dir.c:151:sc_enum_apps: Cannot select EF.DIR file:
> -1201 (File not found)
>
> ============================================================================
> ===========
>
>  
>
> Thanks and Best regards,
>
> Nilesh
>

> ------------------------------------------------------------------------------

> _______________________________________________
> Opensc-devel mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/opensc-devel


- --
Frank Morgner

Virtual Smart Card Architecture http://vsmartcard.sourceforge.net
OpenPACE                        http://openpace.sourceforge.net
IFD Handler for libnfc Devices  http://sourceforge.net/projects/ifdnfc
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.22 (GNU/Linux)

iQJ8BAEBCgBmBQJXDP6ZXxSAAAAAAC4AKGlzc3Vlci1mcHJAbm90YXRpb25zLm9w
ZW5wZ3AuZmlmdGhob3JzZW1hbi5uZXQ1QUQ1RjJCMjQ4M0IwQjUwMjQxOTFGMDI4
NTEyRTI3RUJGOUJDMTYyAAoJEIUS4n6/m8Fim2AQAK0ViSyZtxzB9cxNPrpVntys
PZMQKVmSiSoWIwWsl3NX2PvPxHjCplyZJ/GVlwUavzwkn0y84hao4CAog7MdtNX5
DKgz9LDcvUW95dWmR6LTH89traRa2FCQzh8dCCExmcppMWYHn7frzwPN12Zj9irY
wGQYLIINxqs464q4c+zwdnr0NkHIIxV9DWFNs9QlHOHTrtcrovBBRXLS/AwqpTAv
QCOGYwtBL3USBxh/8kWVaPHxyEAZeHLh21QHHLSganopxn2/a/872hejGOBJphNe
3Ib2hgGJQjRwqX+lSUTcJpJTfbH+enVPqY3NphDtjUaNrfR1F6WnlxuUxSWwEwbh
VB/yZGioN8iCWQ6vULFWWxNSCdDxgcg7GhDuFW4P1c7eWe+tHh0ASwtUKLz0sOky
uL56U0/1VPRVTothgUVPo2LFz/bJZGGOGfqyddgVatJRFDrZCZYzaQt7N5GNDuYi
lvvM5kBT4jMjOpnCPXBECFaG5qv+ITwRfMwY2cUXjXqTOvm1/Hs8aEkZaaZN5Ic+
AGI3bz/z02Uojo9418e4wi+gMdHFLSubuT98lJrhXd3An2D8enBKMEjBWBh43W4Q
a4u945/ghNTgUq8DPD1T6XQX/mwwo6BmiQ/XYdfFEMRvxCnm9iRixj3LMWZScZ5T
Fu3+Xg63hx99aauojvDp
=tI4I
-----END PGP SIGNATURE-----

------------------------------------------------------------------------------
Find and fix application performance issues faster with Applications Manager
Applications Manager provides deep performance insights into multiple tiers of
your business applications. It resolves application problems quickly and
reduces your MTTR. Get your free trial!
https://ad.doubleclick.net/ddm/clk/302982198;130105516;z
_______________________________________________
Opensc-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/opensc-devel
Reply | Threaded
Open this post in threaded view
|

Re: Siemens CardOS v4.3b - reading files

Nilesh Bhogate
Thanks Frank, for your inputs.

The project, I am working on, is an year-old one and v0.14.0 was the latest
at that time. It worked fine with various smartcards, until a card with
CardOS 4.3b was used recently. However, I verified with the latest stable
release of OpenSC (v0.15.0) and the result is the same.

While searching for CardOS 4.3b, I came across following (older) posts -
> http://comments.gmane.org/gmane.comp.encryption.opensc.user/4244
> http://comments.gmane.org/gmane.comp.encryption.opensc.devel/13592

As I understand from these posts, cards with CardOS 4.3b/4.4 could have
different/proprietary file structures and one would need to format the card
to install a file system, which is  legible to the OpenSC library. APDUs for
formatting such cards are secured under NDA.

I have been looking for more details about this on OpenSC site as well as on
Atos (formerly Siemens) site, yet could not find any. I would very much
appreciate, if anyone can share any information or any pointers related to
this. Also, could there be any other card, which is supported by OpenSC, yet
need some additional steps as in the case of CardOS?  Thanks in advance.

Best regards,
Nilesh

-----Original Message-----
From: Frank Morgner [mailto:[hidden email]]
Sent: 12 April 2016 07:27 PM
To: [hidden email]
Subject: Re: [Opensc-devel] Siemens CardOS v4.3b - reading files

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA512

No, that should not happen. First of all, you should use a more recent
version of OpenSC. Second, you could log the APDUs coming from the vendor
and compare that to OpenSC.

If the problem persists, please open a github issue with all the
information.

Greets, Frank.


On Friday, April 08 at 05:33PM, Nilesh Bhogate wrote:

> Hi,
>
>  
>
> I am working on OpenSC (v0.14.0) to interact with Charismathics card
> having 'Siemens CardOS v4.3b'.
>
>  
>
> OpenSC fails to get the MF from this card; while a Software tool
> provided by manufacturer is able to read the data objects present on this
card.

>
>  
>
> My question is: whether it is valid for the Smartcards to have
> different location address for MF for different card OS? (May be a
> dumb question, but I found MF location is hardcoded to "3F002F00"
> inside 'libopensc\dir.c')
>
> If it is valid, is there any way to get information about file
> structure (and location addresses) for a particular card? Appreciate
> any help / guidance in this regard.
>
>  
>
> ======================================================================
> ======
> ===========
>
> Log snippet:
>
> matched driver 'Siemens CardOS'
>
> card info name:'CardOS M4', type:1004, flags:0x0,
> max_send/recv_size:0/0
>
> [opensc-pkcs11] libopensc\card.c:250:sc_connect_card: returning with:
> 0
> (Success)
>
> SCM Microsystems Inc. SCR33x USB Smart Card Reader 0: Connected SC
> card
> 013FC618
>
> [opensc-pkcs11] libopensc\dir.c:140:sc_enum_apps: called
>
> called; type=2, path=3f002f00
>
> [opensc-pkcs11] libopensc\card-cardos.c:449:cardos_select_file: called
>
> [opensc-pkcs11] libopensc\apdu.c:559:sc_transmit_apdu: called
>
> [opensc-pkcs11] libopensc\card.c:325:sc_lock: called
>
> [opensc-pkcs11] libopensc\reader-pcsc.c:517:pcsc_lock: called
>
> [opensc-pkcs11] libopensc\apdu.c:526:sc_transmit: called
>
> [opensc-pkcs11] libopensc\apdu.c:380:sc_single_transmit: called
>
> CLA:0, INS:A4, P1:8, P2:0, data(2) 00C4E7BA
>
> reader 'SCM Microsystems Inc. SCR33x USB Smart Card Reader 0'
>
> Outgoing APDU data [    8 bytes] =====================================
>
> 00 A4 08 00 02 2F 00 00 ...../..
>
> ======================================================================
>
> [opensc-pkcs11] libopensc\reader-pcsc.c:182:pcsc_internal_transmit:
> called
>
> Incoming APDU data [    2 bytes] =====================================
>
> 6A 82 j.
>
> ======================================================================
>
> [opensc-pkcs11] libopensc\apdu.c:395:sc_single_transmit: returning
> with: 0
> (Success)
>
> [opensc-pkcs11] libopensc\apdu.c:548:sc_transmit: returning with: 0
> (Success)
>
> [opensc-pkcs11] libopensc\card.c:361:sc_unlock: called
>
> [opensc-pkcs11] libopensc\reader-pcsc.c:554:pcsc_unlock: called
>
> file not found
>
> [opensc-pkcs11] libopensc\iso7816.c:507:iso7816_select_file: returning
with:

> -1201 (File not found)
>
> [opensc-pkcs11] libopensc\card-cardos.c:453:cardos_select_file:
> returning
> with: -1201 (File not found)
>
> [opensc-pkcs11] libopensc\card.c:640:sc_select_file: 'SELECT' error:
> -1201 (File not found)
>
> [opensc-pkcs11] libopensc\dir.c:151:sc_enum_apps: Cannot select EF.DIR
file:

> -1201 (File not found)
>
> ======================================================================
> ======
> ===========
>
>  
>
> Thanks and Best regards,
>
> Nilesh
>

> ----------------------------------------------------------------------
> --------

> _______________________________________________
> Opensc-devel mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/opensc-devel


- --
Frank Morgner

Virtual Smart Card Architecture http://vsmartcard.sourceforge.net
OpenPACE                        http://openpace.sourceforge.net
IFD Handler for libnfc Devices  http://sourceforge.net/projects/ifdnfc
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.22 (GNU/Linux)

iQJ8BAEBCgBmBQJXDP6ZXxSAAAAAAC4AKGlzc3Vlci1mcHJAbm90YXRpb25zLm9w
ZW5wZ3AuZmlmdGhob3JzZW1hbi5uZXQ1QUQ1RjJCMjQ4M0IwQjUwMjQxOTFGMDI4
NTEyRTI3RUJGOUJDMTYyAAoJEIUS4n6/m8Fim2AQAK0ViSyZtxzB9cxNPrpVntys
PZMQKVmSiSoWIwWsl3NX2PvPxHjCplyZJ/GVlwUavzwkn0y84hao4CAog7MdtNX5
DKgz9LDcvUW95dWmR6LTH89traRa2FCQzh8dCCExmcppMWYHn7frzwPN12Zj9irY
wGQYLIINxqs464q4c+zwdnr0NkHIIxV9DWFNs9QlHOHTrtcrovBBRXLS/AwqpTAv
QCOGYwtBL3USBxh/8kWVaPHxyEAZeHLh21QHHLSganopxn2/a/872hejGOBJphNe
3Ib2hgGJQjRwqX+lSUTcJpJTfbH+enVPqY3NphDtjUaNrfR1F6WnlxuUxSWwEwbh
VB/yZGioN8iCWQ6vULFWWxNSCdDxgcg7GhDuFW4P1c7eWe+tHh0ASwtUKLz0sOky
uL56U0/1VPRVTothgUVPo2LFz/bJZGGOGfqyddgVatJRFDrZCZYzaQt7N5GNDuYi
lvvM5kBT4jMjOpnCPXBECFaG5qv+ITwRfMwY2cUXjXqTOvm1/Hs8aEkZaaZN5Ic+
AGI3bz/z02Uojo9418e4wi+gMdHFLSubuT98lJrhXd3An2D8enBKMEjBWBh43W4Q
a4u945/ghNTgUq8DPD1T6XQX/mwwo6BmiQ/XYdfFEMRvxCnm9iRixj3LMWZScZ5T
Fu3+Xg63hx99aauojvDp
=tI4I
-----END PGP SIGNATURE-----

----------------------------------------------------------------------------
--
Find and fix application performance issues faster with Applications Manager
Applications Manager provides deep performance insights into multiple tiers
of your business applications. It resolves application problems quickly and
reduces your MTTR. Get your free trial!
https://ad.doubleclick.net/ddm/clk/302982198;130105516;z
_______________________________________________
Opensc-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/opensc-devel


------------------------------------------------------------------------------
Find and fix application performance issues faster with Applications Manager
Applications Manager provides deep performance insights into multiple tiers of
your business applications. It resolves application problems quickly and
reduces your MTTR. Get your free trial!
https://ad.doubleclick.net/ddm/clk/302982198;130105516;z
_______________________________________________
Opensc-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/opensc-devel