Blame SOURCES/esc-1.1.2-fix8.patch

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