[PATCH GnuPG 1/2] scd:p15: Add support for CardOS 5.4

Mario Haustein mario.haustein at hrz.tu-chemnitz.de
Tue Nov 28 23:09:21 CET 2023


* scd/app-p15.c (CARD_TYPE_CARDOS_54): New.
---
 scd/app-p15.c | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

diff --git a/scd/app-p15.c b/scd/app-p15.c
index 4338a623e..dab1f4901 100644
--- a/scd/app-p15.c
+++ b/scd/app-p15.c
@@ -74,6 +74,7 @@ typedef enum
     CARD_TYPE_MICARDO,
     CARD_TYPE_CARDOS_50,
     CARD_TYPE_CARDOS_53,
+    CARD_TYPE_CARDOS_54,
     CARD_TYPE_AET,     /* A.E.T. Europe JCOP card.  */
     CARD_TYPE_BELPIC   /* Belgian eID card specs. */
   }
@@ -123,6 +124,8 @@ static struct
     CARD_TYPE_CARDOS_50 }, /* CardOS 5.0 */
   { 11, X("\x3b\xd2\x18\x00\x81\x31\xfe\x58\xc9\x03\x16"),
     CARD_TYPE_CARDOS_53 }, /* CardOS 5.3 */
+  { 11, X("\x3b\xd2\x18\x00\x81\x31\xfe\x58\xc9\x04\x11"),
+    CARD_TYPE_CARDOS_54 }, /* CardOS 5.4 */
   { 24, X("\x3b\xfe\x18\x00\x00\x80\x31\xfe\x45\x53\x43\x45"
           "\x36\x30\x2d\x43\x44\x30\x38\x31\x2d\x6e\x46\xa9"),
     CARD_TYPE_AET },
@@ -131,9 +134,10 @@ static struct
 #undef X
 
 
-/* Macro to test for CardOS 5.0 and 5.3.  */
+/* Macro to test for CardOS 5.0, 5.3 and 5.4.  */
 #define IS_CARDOS_5(a) ((a)->app_local->card_type == CARD_TYPE_CARDOS_50 \
-                        || (a)->app_local->card_type == CARD_TYPE_CARDOS_53)
+                        || (a)->app_local->card_type == CARD_TYPE_CARDOS_53 \
+                        || (a)->app_local->card_type == CARD_TYPE_CARDOS_54)
 
 /* The default PKCS-15 home DF */
 #define DEFAULT_HOME_DF 0x5015
@@ -536,6 +540,7 @@ cardtype2str (card_type_t cardtype)
     case CARD_TYPE_MICARDO:   return "Micardo";
     case CARD_TYPE_CARDOS_50: return "CardOS 5.0";
     case CARD_TYPE_CARDOS_53: return "CardOS 5.3";
+    case CARD_TYPE_CARDOS_54: return "CardOS 5.4";
     case CARD_TYPE_BELPIC:    return "Belgian eID";
     case CARD_TYPE_AET:       return "AET";
     }
@@ -6284,6 +6289,7 @@ app_select_p15 (app_t app)
         {
         case CARD_TYPE_CARDOS_50:
         case CARD_TYPE_CARDOS_53:
+        case CARD_TYPE_CARDOS_54:
           direct = 1;
           break;
         case CARD_TYPE_AET:
-- 
2.41.0

-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 5734 bytes
Desc: not available
URL: <https://lists.gnupg.org/pipermail/gnupg-devel/attachments/20231128/daeb8a0f/attachment.bin>


More information about the Gnupg-devel mailing list