On 9/14/2010 8:27 AM, Andre Zepezauer wrote:
> On Tue, 2010-09-14 at 14:38 +0200, jons...@terra.es wrote:
>> [...]
>>
>>>> Not sure on other cards, but DNIe mark this situation by mean of
>>>> change on ATR status code from 03 90 00 to
>>>> 0F 65 81 (Memory error). Not sure what to do if detected this
>>>> situation:
>>
>>> 1. When data structures of your card are still readable, then match
>> on
>>> both ATRs. And fail gracefully on pin verification and privileged
>>> operations.
>>
>>> 2. When your card doesn't provide any data, then not recognising it
>>> should be fine. Or handle it like a card in manufacturing state.
>>
>> Adding invalidated DNIe's ATR to ATR List, some commands still are
>> available:
>> card_select_file() seems to work... but card fails on stablishing SM.
>> at card_get_serialnr()
>>
>> Attached comes ATR patch and resulting log to "pkcs15-tool -c" command
>
> Are your logs complete? I can't see the APDU messages for the select
> commands.


In older versions of many of the tools, like pkcs15-tool, the
opensc.conf debug level is reset to the verbose:

pkcs15-tool.c:  "Verbose operation. Use several times to enable debug output.",
pkcs15-tool.c:          ctx->debug = verbose-1;

So add 8 -v options.

In the SVN this restriction was removed form pkcs15-tool.c, but
westcos-tool.c, opensc-tool.c, piv-tool.c, pkcs15-crypt.c pkcs15-init.c
and rutoken-tool.c still reset the debug level.

I would rather see these do something like:
        if (verbose > ctx->debug)
               ctx->debug = verbose;

>
>> So In your opinion when should invalidated DNIe report error, and
>> which error code?
>> Actually card code returns SC_ERROR_INTERNAL.
>
> Supposed that the attached log file is complete, then the card fails on
> receiving the first APDU. In this case the card provides only it's ATR
> and nothing more. This makes it less useful and thus I would prefer to
> ignore such a card.
>
>> (NOTE: Remember that this is not an official nor officially supported
>> work: Still waiting for Spanish autorities
>> to get support and permission to integrate DNIe into mainstream and
>> resolve LGPL/GPL conflict on published code )
>>
>> Juan Antonio
>> _______________________________________________
>> opensc-devel mailing list
>> opensc-devel@lists.opensc-project.org
>> http://www.opensc-project.org/mailman/listinfo/opensc-devel
>
> _______________________________________________
> opensc-devel mailing list
> opensc-devel@lists.opensc-project.org
> http://www.opensc-project.org/mailman/listinfo/opensc-devel
>
>

-- 

  Douglas E. Engert  <deeng...@anl.gov>
  Argonne National Laboratory
  9700 South Cass Avenue
  Argonne, Illinois  60439
  (630) 252-5444
_______________________________________________
opensc-devel mailing list
opensc-devel@lists.opensc-project.org
http://www.opensc-project.org/mailman/listinfo/opensc-devel

Reply via email to