[...]

> > 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

So In your opinion when should invalidated DNIe report error, and which error 
code?
Actually card code returns SC_ERROR_INTERNAL.

(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

------------------------ src/libopensc/dnie/base_card.c ------------------------
index 5e84cd3..c2430bb 100644
@@ -48,7 +48,16 @@ static struct sc_atr_table card_atrs[] = {
     SC_CARD_TYPE_DNIE,
     0,
     NULL
-  }
+  },
+  { // card invalidated
+    "3B:7F:00:00:00:00:6A:44:4E:49:65:00:00:00:00:00:00:0F:65:81",
+    "FF:FF:00:FF:FF:FF:FF:FF:FF:FF:FF:00:00:00:00:00:00:FF:FF:FF",
+    CARD_CHIP_NAME, 
+    SC_CARD_TYPE_DNIE,
+    0,
+    NULL
+  },
+  { NULL, NULL, NULL, 0, 0, NULL }
 };
 
 static struct sc_card_operations card_ops;

Attachment: damaged_dnie.log
Description: Binary data

_______________________________________________
opensc-devel mailing list
opensc-devel@lists.opensc-project.org
http://www.opensc-project.org/mailman/listinfo/opensc-devel

Reply via email to