c679b5
diff -up ./esc/src/app/esc.js.fix13 ./esc/src/app/esc.js
c679b5
--- ./esc/src/app/esc.js.fix13	2022-06-29 16:03:45.002292355 -0700
c679b5
+++ ./esc/src/app/esc.js	2022-06-29 16:04:40.594027223 -0700
c679b5
@@ -581,7 +581,6 @@ class ESC {
c679b5
          this._configFile =  new GLib.KeyFile();
c679b5
 
c679b5
          this._configPath = GLib.get_user_config_dir() + "/esc";
c679b5
-
c679b5
          let configDir = Gio.File.new_for_path(this._configPath);
c679b5
 
c679b5
          try {
c679b5
@@ -606,6 +605,9 @@ class ESC {
c679b5
              this._configFile.save_to_file(this._configFileName); 
c679b5
          } 
c679b5
      }
c679b5
+     _initConfigTokenManuIDs() {
c679b5
+        this._setConfigValue("esc.token.manu_id.0","Volkswagen AG");
c679b5
+     }
c679b5
 
c679b5
     _buildUI() {
c679b5
         // Create the application window
c679b5
@@ -637,6 +639,7 @@ class ESC {
c679b5
 
c679b5
 
c679b5
             this._initConfig();
c679b5
+            this._initConfigTokenManuIDs();
c679b5
             this._initProperties();
c679b5
 
c679b5
             this._statusMessages = null; 
c679b5
diff -up ./esc/src/lib/coolkey/CoolKeyHandler.cpp.fix13 ./esc/src/lib/coolkey/CoolKeyHandler.cpp
c679b5
--- ./esc/src/lib/coolkey/CoolKeyHandler.cpp.fix13	2022-06-29 16:04:10.082172742 -0700
c679b5
+++ ./esc/src/lib/coolkey/CoolKeyHandler.cpp	2022-06-29 16:04:40.595027219 -0700
c679b5
@@ -63,6 +63,7 @@ static const char *piv_manu_id_1=  "piv_
c679b5
 static PRLogModuleInfo *coolKeyLogHN = PR_NewLogModule("coolKeyHandler");
c679b5
 
c679b5
 void NotifyEndResult(CoolKeyHandler* context, int operation, int result, int description);
c679b5
+bool isTokenTypeOtherKnownType(CK_TOKEN_INFO *tokenInfo);
c679b5
 
c679b5
 struct AutoCKYBuffer : public CKYBuffer
c679b5
 {
c679b5
@@ -2246,6 +2247,7 @@ CKHGetCoolKeyInfo(PK11SlotInfo *aSlot,Co
c679b5
     int isACOOLKey = 0;
c679b5
     int isACAC = 0;
c679b5
     int isAPIV = 0;
c679b5
+    bool isOtherKey = false;
c679b5
 
c679b5
     int hasApplet = 0;
c679b5
     int isPersonalized = 0;
c679b5
@@ -2306,6 +2308,12 @@ CKHGetCoolKeyInfo(PK11SlotInfo *aSlot,Co
c679b5
 	isAPIV = 1;
c679b5
     } else {
c679b5
         isACOOLKey = 1;
c679b5
+        isOtherKey = isTokenTypeOtherKnownType(&tokenInfo);
c679b5
+        if(isOtherKey == true && hasApplet == 0 && isPersonalized == 0) {
c679b5
+            isACOOLKey = 0;
c679b5
+        } else {
c679b5
+            isOtherKey = false;
c679b5
+        }
c679b5
     }
c679b5
 
c679b5
     // OK, we have everything we need, now build the COOLKEYInfo structure.
c679b5
@@ -2336,7 +2344,7 @@ CKHGetCoolKeyInfo(PK11SlotInfo *aSlot,Co
c679b5
         tokenInfo.firmwareVersion.major = 1;    
c679b5
     }
c679b5
 
c679b5
-    if(isPersonalized == 1 || isACAC == 1 || isAPIV == 1) {
c679b5
+    if(isPersonalized == 1 || isACAC == 1 || isAPIV == 1 || isOtherKey == true) {
c679b5
         tokenInfo.flags |= CKF_TOKEN_INITIALIZED;
c679b5
     }
c679b5
 
c679b5
@@ -2407,3 +2415,33 @@ failed:
c679b5
     
c679b5
     return NULL;
c679b5
 }
c679b5
+
c679b5
+bool isTokenTypeOtherKnownType(CK_TOKEN_INFO *tokenInfo)
c679b5
+{
c679b5
+    char tBuff[56];
c679b5
+    bool res = false;
c679b5
+
c679b5
+    if(tokenInfo == NULL) {
c679b5
+        return res;
c679b5
+    }
c679b5
+    string curManuCfg;
c679b5
+    string num;
c679b5
+    for(int i = 0;;i++) {
c679b5
+        num = to_string(i);
c679b5
+        curManuCfg = "esc.token.manu_id." + num;
c679b5
+        const char *curManu = CoolKeyGetConfig(curManuCfg.c_str());
c679b5
+
c679b5
+        if(curManu == NULL) {
c679b5
+            break;
c679b5
+        }
c679b5
+
c679b5
+        int match = memcmp(tokenInfo->manufacturerID, curManu, strlen(curManu));
c679b5
+        CoolKeyFreeConfig(curManu);
c679b5
+        if(match == 0) {
c679b5
+            res = true;
c679b5
+            break;
c679b5
+        }
c679b5
+    }
c679b5
+    PR_LOG( coolKeyLogHN, PR_LOG_DEBUG, ("%s CoolKeyHandler::isTokenTypeOtherKnownType:  result: %d .\n",GetTStamp(tBuff,56), res));
c679b5
+    return res;
c679b5
+}