Blame SOURCES/esc-1.1.2-fix8.patch

72313d
diff -up ./esc/src/app/opensc.esc.conf.fix8 ./esc/src/app/opensc.esc.conf
72313d
--- ./esc/src/app/opensc.esc.conf.fix8	2020-08-07 16:17:37.464650003 -0700
72313d
+++ ./esc/src/app/opensc.esc.conf	2020-08-07 16:20:21.861957011 -0700
72313d
@@ -89,12 +89,12 @@ app default {
72313d
     }
72313d
     reader_driver openct {
72313d
     };
72313d
-    card_drivers = coolkey, cac,cac1, piv, default;
72313d
+    card_drivers = coolkey, cac,cac1, PIV-II, default;
72313d
     secure_messaging local_authentic  {
72313d
         module_path = /usr/lib64;
72313d
     }
72313d
     framework pkcs15 {
72313d
-        builtin_emulators = coolkey, cac, cac1, piv;
72313d
+        builtin_emulators = coolkey, cac, cac1, PIV-II;
72313d
     }
72313d
 }
72313d
 app opensc-pkcs11 {
72313d
diff -up ./esc/src/lib/coolkey/CoolKey.cpp.fix8 ./esc/src/lib/coolkey/CoolKey.cpp
72313d
--- ./esc/src/lib/coolkey/CoolKey.cpp.fix8	2020-08-07 12:05:35.982966019 -0700
72313d
+++ ./esc/src/lib/coolkey/CoolKey.cpp	2020-08-07 16:08:16.747602873 -0700
72313d
@@ -593,6 +593,7 @@ char *CoolKeyGetFullReaderName(const cha
72313d
 	} else {
72313d
             fullReaderName = strdup(thisReader);
72313d
             PR_LOG( coolKeyLog, PR_LOG_DEBUG, ("%s CoolKeyGetFullReaderName correct full name:  %s \n",fullReaderName,GetTStamp(tBuff,56)));
72313d
+	    break;
72313d
         }
72313d
     }
72313d
 
72313d
diff -up ./esc/src/lib/coolkey/CoolKeyHandler.cpp.fix8 ./esc/src/lib/coolkey/CoolKeyHandler.cpp
72313d
--- ./esc/src/lib/coolkey/CoolKeyHandler.cpp.fix8	2020-08-07 12:05:44.394982245 -0700
72313d
+++ ./esc/src/lib/coolkey/CoolKeyHandler.cpp	2020-08-07 16:10:35.504862004 -0700
72313d
@@ -2225,8 +2225,17 @@ CKHGetCoolKeyInfo(PK11SlotInfo *aSlot,Co
72313d
     HRESULT hres,atrRes,cycleRes,cuidRes;
72313d
 
72313d
     char *readerName =  PK11_GetSlotName(aSlot);
72313d
+    int readerNameLen = strlen(readerName);
72313d
 
72313d
-    char *actualReaderName = CoolKeyGetFullReaderName(readerName);
72313d
+    //Since there is no local support to get a reader name by slot,
72313d
+    //Will simply do a partial substring compare, using less characters
72313d
+    //to avoid any hard coded trailing chars.
72313d
+    
72313d
+    char partialReaderName[60];
72313d
+    memset(partialReaderName, 0, 60);
72313d
+
72313d
+    strncpy(partialReaderName,readerName, 59);
72313d
+    char *actualReaderName =   CoolKeyGetFullReaderName(partialReaderName);
72313d
 
72313d
     memset((void *) &tokenInfo,0,sizeof(tokenInfo));
72313d
     ATR.data = NULL; // initialize for error processing
72313d
@@ -2348,7 +2357,7 @@ CKHGetCoolKeyInfo(PK11SlotInfo *aSlot,Co
72313d
      if(isACOOLKey && cuidRes == E_FAIL) {
72313d
         //Let's try to get the cuid directly from the token.
72313d
 
72313d
-        cuidRes = CoolKeyGetCUIDDirectly(cuidChar, 100, readerName);
72313d
+        cuidRes = CoolKeyGetCUIDDirectly(cuidChar, 100, actualReaderName);
72313d
 
72313d
         if(cuidRes != S_OK) {
72313d
            strcpy(info->mCUID, "unknown");