Received: by mail.netbsd.org (Postfix, from userid 605) id E905984D72; Thu, 26 Mar 2020 21:50:45 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by mail.netbsd.org (Postfix) with ESMTP id 705C484D5B for ; Thu, 26 Mar 2020 21:50:45 +0000 (UTC) X-Virus-Scanned: amavisd-new at netbsd.org Received: from mail.netbsd.org ([IPv6:::1]) by localhost (mail.netbsd.org [IPv6:::1]) (amavisd-new, port 10025) with ESMTP id toTJjWeK-6PZ for ; Thu, 26 Mar 2020 21:50:44 +0000 (UTC) Received: from cvs.NetBSD.org (ivanova.NetBSD.org [IPv6:2001:470:a085:999:28c:faff:fe03:5984]) by mail.netbsd.org (Postfix) with ESMTP id 77FC784D2C for ; Thu, 26 Mar 2020 21:50:44 +0000 (UTC) Received: by cvs.NetBSD.org (Postfix, from userid 500) id 75DC5FB27; Thu, 26 Mar 2020 21:50:44 +0000 (UTC) Content-Transfer-Encoding: 7bit Content-Type: multipart/mixed; boundary="_----------=_1585259444246330" MIME-Version: 1.0 Date: Thu, 26 Mar 2020 21:50:44 +0000 From: "Joerg Sonnenberger" Subject: CVS commit: pkgsrc/security/CoolKey To: pkgsrc-changes@NetBSD.org Reply-To: joerg@netbsd.org X-Mailer: log_accum Message-Id: <20200326215044.75DC5FB27@cvs.NetBSD.org> Sender: pkgsrc-changes-owner@NetBSD.org List-Id: pkgsrc-changes.NetBSD.org Precedence: bulk List-Unsubscribe: This is a multi-part message in MIME format. --_----------=_1585259444246330 Content-Disposition: inline Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset="US-ASCII" Module Name: pkgsrc Committed By: joerg Date: Thu Mar 26 21:50:44 UTC 2020 Modified Files: pkgsrc/security/CoolKey: distinfo pkgsrc/security/CoolKey/patches: patch-ac Log Message: Rename log to not conflict with math.h. To generate a diff of this commit: cvs rdiff -u -r1.5 -r1.6 pkgsrc/security/CoolKey/distinfo cvs rdiff -u -r1.1.1.1 -r1.2 pkgsrc/security/CoolKey/patches/patch-ac Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. --_----------=_1585259444246330 Content-Disposition: inline Content-Length: 13339 Content-Transfer-Encoding: binary Content-Type: text/x-diff; charset=us-ascii Modified files: Index: pkgsrc/security/CoolKey/distinfo diff -u pkgsrc/security/CoolKey/distinfo:1.5 pkgsrc/security/CoolKey/distinfo:1.6 --- pkgsrc/security/CoolKey/distinfo:1.5 Wed Nov 4 01:17:40 2015 +++ pkgsrc/security/CoolKey/distinfo Thu Mar 26 21:50:44 2020 @@ -1,4 +1,4 @@ -$NetBSD: distinfo,v 1.5 2015/11/04 01:17:40 agc Exp $ +$NetBSD: distinfo,v 1.6 2020/03/26 21:50:44 joerg Exp $ SHA1 (coolkey-1.1.0.tar.gz) = 54136decf9dfd091c8b231cb77dac97db95e1866 RMD160 (coolkey-1.1.0.tar.gz) = 1873e85aecb30c5311444c76fd85ba79633dce23 @@ -6,7 +6,7 @@ SHA512 (coolkey-1.1.0.tar.gz) = 4b61de9b Size (coolkey-1.1.0.tar.gz) = 432808 bytes SHA1 (patch-aa) = f91d804c54540f45e7791b3ca9a1fb987bde0a72 SHA1 (patch-ab) = 6aed241ec856b7b826e7c9953e286088d8960feb -SHA1 (patch-ac) = 8b7604ea677471a7ee5c1d7c9f4f6f4c03468350 +SHA1 (patch-ac) = dcb0a43f895da69addc6c745645c488dd5985116 SHA1 (patch-src_coolkey_log.cpp) = 2e9fe538236496a924eb3a12a43a4336e814aabb SHA1 (patch-src_coolkey_object.cpp) = a28c9a56e4a184bcdf73be9d64ef133b691ccf0e SHA1 (patch-src_coolkey_params.h) = 21b7ae6a872a7d79d884d7a380f131839d867aff Index: pkgsrc/security/CoolKey/patches/patch-ac diff -u pkgsrc/security/CoolKey/patches/patch-ac:1.1.1.1 pkgsrc/security/CoolKey/patches/patch-ac:1.2 --- pkgsrc/security/CoolKey/patches/patch-ac:1.1.1.1 Tue Mar 4 11:33:02 2008 +++ pkgsrc/security/CoolKey/patches/patch-ac Thu Mar 26 21:50:44 2020 @@ -1,8 +1,10 @@ -$NetBSD: patch-ac,v 1.1.1.1 2008/03/04 11:33:02 shannonjr Exp $ +$NetBSD: patch-ac,v 1.2 2020/03/26 21:50:44 joerg Exp $ ---- ./src/coolkey/coolkey.cpp.orig 2007-02-14 12:54:01.000000000 -0700 -+++ ./src/coolkey/coolkey.cpp -@@ -34,7 +34,9 @@ +Avoid name conflict with math.h's log. + +--- src/coolkey/coolkey.cpp.orig 2007-02-14 19:54:01.000000000 +0000 ++++ src/coolkey/coolkey.cpp +@@ -34,11 +34,13 @@ #include "cky_base.h" #include "params.h" @@ -12,3 +14,329 @@ $NetBSD: patch-ac,v 1.1.1.1 2008/03/04 1 /* static module data -------------------------------- */ +-static Log *log = NULL; ++static Log *mylog = NULL; + + static SlotList *slotList = NULL; + +@@ -86,11 +88,11 @@ dumpTemplates(CK_ATTRIBUTE_PTR pTemplate + for (i = 0; i < ulCount; ++i) { + CK_ATTRIBUTE_PTR pT = pTemplate + i; + if (pT->pValue && pT->ulValueLen == 4) { +- log->log( ++ mylog->log( + "template [%02lu] type: %04lx, pValue: %08lx, ulValueLen: %08lx, value: %lu\n", + i, pT->type, pT->pValue, pT->ulValueLen, *(CK_ULONG_PTR)pT->pValue); + } else +- log->log("template [%02lu] type: %04lx, pValue: %08lx, ulValueLen: %08lx\n", ++ mylog->log("template [%02lu] type: %04lx, pValue: %08lx, ulValueLen: %08lx\n", + i, pT->type, pT->pValue, pT->ulValueLen); + } + } +@@ -101,7 +103,7 @@ dumpTemplates(CK_ATTRIBUTE_PTR pTemplate + #define NOTSUPPORTED(name, args) \ + CK_RV name args \ + { \ +- log->log(#name " called (notSupported)\n"); \ ++ mylog->log(#name " called (notSupported)\n"); \ + return CKR_FUNCTION_NOT_SUPPORTED; \ + } + +@@ -112,11 +114,11 @@ CK_RV name dec_args \ + return CKR_CRYPTOKI_NOT_INITIALIZED; \ + } \ + try { \ +- log->log(#name " called\n"); \ ++ mylog->log(#name " called\n"); \ + slotList->name2 use_args ; \ + return CKR_OK; \ + } catch(PKCS11Exception& e) { \ +- e.log(log); \ ++ e.log(mylog); \ + return e.getCRV(); \ + } \ + } +@@ -227,21 +229,21 @@ C_Initialize(CK_VOID_PTR pInitArgs) + char * logFileName = getenv("COOL_KEY_LOG_FILE"); + if (logFileName) { + if (strcmp(logFileName,"SYSLOG") == 0) { +- log = new SysLog(); ++ mylog = new SysLog(); + } else { +- log = new FileLog(logFileName); ++ mylog = new FileLog(logFileName); + } + } else { +- log = new DummyLog(); ++ mylog = new DummyLog(); + } +- log->log("Initialize called, hello %d\n", 5); ++ mylog->log("Initialize called, hello %d\n", 5); + CKY_SetName("coolkey"); +- slotList = new SlotList(log); ++ slotList = new SlotList(mylog); + initialized = TRUE; + return CKR_OK; + } catch(PKCS11Exception &e) { +- if( log ) +- e.log(log); ++ if( mylog ) ++ e.log(mylog); + return e.getReturnValue(); + } + } +@@ -254,7 +256,7 @@ C_Finalize(CK_VOID_PTR pReserved) + } + // XXX cleanup all data structures !!! + //delete sessionManager; +- log->log("Finalizing...\n"); ++ mylog->log("Finalizing...\n"); + // don't race the setting of finalizing. If C_WaitEvent gets passed + // the finalizing call first, we know it will set waitEvent before + // we can get the lock, so we only need to protect setting finalizing +@@ -272,7 +274,7 @@ C_Finalize(CK_VOID_PTR pReserved) + } + } + delete slotList; +- delete log; ++ delete mylog; + finalizeLock.getLock(); + finalizing = FALSE; + initialized = FALSE; +@@ -287,7 +289,7 @@ C_GetInfo(CK_INFO_PTR p) + if( ! initialized ) { + return CKR_CRYPTOKI_NOT_INITIALIZED; + } +- log->log("C_GetInfo called\n"); ++ mylog->log("C_GetInfo called\n"); + ckInfo.manufacturerID[31] = ' '; + ckInfo.libraryDescription[31] = ' '; + *p = ckInfo; +@@ -302,12 +304,12 @@ C_GetSlotInfo(CK_SLOT_ID slotID, CK_SLOT + return CKR_CRYPTOKI_NOT_INITIALIZED; + } + try { +- log->log("Called C_GetSlotInfo\n"); ++ mylog->log("Called C_GetSlotInfo\n"); + slotList->validateSlotID(slotID); + return slotList->getSlot( + slotIDToIndex(slotID))->getSlotInfo(pSlotInfo); + } catch( PKCS11Exception &excep ) { +- excep.log(log); ++ excep.log(mylog); + return excep.getCRV(); + } + } +@@ -319,12 +321,12 @@ C_GetTokenInfo(CK_SLOT_ID slotID, CK_TOK + return CKR_CRYPTOKI_NOT_INITIALIZED; + } + try { +- log->log("C_GetTokenInfo called\n"); ++ mylog->log("C_GetTokenInfo called\n"); + slotList->validateSlotID(slotID); + return slotList->getSlot( + slotIDToIndex(slotID))->getTokenInfo(pTokenInfo); + } catch( PKCS11Exception &excep ) { +- excep.log(log); ++ excep.log(mylog); + return excep.getCRV(); + } + } +@@ -339,7 +341,7 @@ C_GetMechanismList(CK_SLOT_ID slotID, CK + try { + CK_RV rv = CKR_OK; + +- log->log("C_GetMechanismList called\n"); ++ mylog->log("C_GetMechanismList called\n"); + if( pulCount == NULL ) { + throw PKCS11Exception(CKR_ARGUMENTS_BAD); + } +@@ -362,11 +364,11 @@ C_GetMechanismList(CK_SLOT_ID slotID, CK + + *pulCount = numMechanisms; + +- log->log("C_GetMechanismList returning %d\n", rv); ++ mylog->log("C_GetMechanismList returning %d\n", rv); + return rv; + + } catch(PKCS11Exception &excep ) { +- excep.log(log); ++ excep.log(mylog); + return excep.getCRV(); + } + +@@ -380,7 +382,7 @@ C_GetMechanismInfo(CK_SLOT_ID slotID, CK + return CKR_CRYPTOKI_NOT_INITIALIZED; + } + try { +- log->log("C_GetMechanismInfo called\n"); ++ mylog->log("C_GetMechanismInfo called\n"); + if( pInfo == NULL ) { + throw PKCS11Exception(CKR_ARGUMENTS_BAD); + } +@@ -392,14 +394,14 @@ C_GetMechanismInfo(CK_SLOT_ID slotID, CK + for(unsigned int i=0; i < numMechanisms; ++i ) { + if( mechanismList[i].mech == type ) { + *pInfo = mechanismList[i].info; +- log->log("C_GetMechanismInfo got info about %d\n", type); ++ mylog->log("C_GetMechanismInfo got info about %d\n", type); + return CKR_OK; + } + } +- log->log("C_GetMechanismInfo failed to find info about %d\n", type); ++ mylog->log("C_GetMechanismInfo failed to find info about %d\n", type); + return CKR_MECHANISM_INVALID; // mechanism not in the list + } catch(PKCS11Exception &e) { +- e.log(log); ++ e.log(mylog); + return e.getCRV(); + } + } +@@ -412,7 +414,7 @@ C_OpenSession(CK_SLOT_ID slotID, CK_FLAG + return CKR_CRYPTOKI_NOT_INITIALIZED; + } + try { +- log->log("C_OpenSession called\n"); ++ mylog->log("C_OpenSession called\n"); + slotList->validateSlotID(slotID); + #ifdef LATER // the CSP isn't setting this bit right now. + if( ! (flags & CKF_SERIAL_SESSION) ) { +@@ -430,7 +432,7 @@ C_OpenSession(CK_SLOT_ID slotID, CK_FLAG + return CKR_OK; + + } catch(PKCS11Exception &e) { +- e.log(log); ++ e.log(mylog); + return e.getCRV(); + } + } +@@ -442,13 +444,13 @@ C_CloseSession(CK_SESSION_HANDLE hSessio + return CKR_CRYPTOKI_NOT_INITIALIZED; + } + try { +- log->log("C_CloseSession(0x%x) called\n", hSession); ++ mylog->log("C_CloseSession(0x%x) called\n", hSession); + // !!!XXX Hack + // If nothing else, we need to logout the token when all + // its sessions are closed. + return CKR_OK; + } catch(PKCS11Exception &e) { +- e.log(log); ++ e.log(mylog); + return e.getCRV(); + } + } +@@ -460,14 +462,14 @@ C_CloseAllSessions(CK_SLOT_ID slotID) + return CKR_CRYPTOKI_NOT_INITIALIZED; + } + try { +- log->log("C_CloseAllSessions(0x%x) called\n", slotID); ++ mylog->log("C_CloseAllSessions(0x%x) called\n", slotID); + slotList->validateSlotID(slotID); + // !!!XXX Hack + // If nothing else, we need to logout the token when all + // its sessions are closed. + return CKR_OK; + } catch(PKCS11Exception &e) { +- e.log(log); ++ e.log(mylog); + return e.getCRV(); + } + } +@@ -481,7 +483,7 @@ C_FindObjectsInit(CK_SESSION_HANDLE hSes + return CKR_CRYPTOKI_NOT_INITIALIZED; + } + try { +- log->log("C_FindObjectsInit called, %lu templates\n", ulCount); ++ mylog->log("C_FindObjectsInit called, %lu templates\n", ulCount); + dumpTemplates(pTemplate, ulCount); + + if( pTemplate == NULL && ulCount != 0 ) { +@@ -490,7 +492,7 @@ C_FindObjectsInit(CK_SESSION_HANDLE hSes + slotList->findObjectsInit(hSession, pTemplate, ulCount); + return CKR_OK; + } catch(PKCS11Exception &e) { +- e.log(log); ++ e.log(mylog); + return e.getCRV(); + } + } +@@ -504,22 +506,22 @@ C_FindObjects(CK_SESSION_HANDLE hSession + return CKR_CRYPTOKI_NOT_INITIALIZED; + } + try { +- log->log("C_FindObjects called, max objects = %lu\n", ulMaxObjectCount ); ++ mylog->log("C_FindObjects called, max objects = %lu\n", ulMaxObjectCount ); + if( phObject == NULL && ulMaxObjectCount != 0 ) { + throw PKCS11Exception(CKR_ARGUMENTS_BAD); + } + slotList->findObjects(hSession, phObject, ulMaxObjectCount, + pulObjectCount); + count = *pulObjectCount; +- log->log("returned %lu objects:", count ); ++ mylog->log("returned %lu objects:", count ); + CK_ULONG i; + for (i = 0; i < count; ++i) { +- log->log(" 0x%08lx", phObject[i]); ++ mylog->log(" 0x%08lx", phObject[i]); + } +- log->log("\n" ); ++ mylog->log("\n" ); + return CKR_OK; + } catch(PKCS11Exception &e) { +- e.log(log); ++ e.log(mylog); + return e.getCRV(); + } + } +@@ -542,7 +544,7 @@ C_Login(CK_SESSION_HANDLE hSession, CK_U + return CKR_CRYPTOKI_NOT_INITIALIZED; + } + try { +- log->log("C_Login called\n"); ++ mylog->log("C_Login called\n"); + if( userType != CKU_USER ) { + throw PKCS11Exception(CKR_USER_TYPE_INVALID); + } +@@ -552,7 +554,7 @@ C_Login(CK_SESSION_HANDLE hSession, CK_U + slotList->login(hSession, pPin, ulPinLen); + return CKR_OK; + } catch(PKCS11Exception &e) { +- e.log(log); ++ e.log(mylog); + return e.getCRV(); + } + } +@@ -566,7 +568,7 @@ C_GetAttributeValue(CK_SESSION_HANDLE hS + return CKR_CRYPTOKI_NOT_INITIALIZED; + } + try { +- log->log("C_GetAttributeValue called, %lu templates for object 0x%08lx\n", ulCount, hObject); ++ mylog->log("C_GetAttributeValue called, %lu templates for object 0x%08lx\n", ulCount, hObject); + dumpTemplates(pTemplate, ulCount); + if( pTemplate == NULL && ulCount != 0 ) { + throw PKCS11Exception(CKR_ARGUMENTS_BAD); +@@ -576,7 +578,7 @@ C_GetAttributeValue(CK_SESSION_HANDLE hS + return CKR_OK; + } catch(PKCS11Exception& e) { + CK_RV rv = e.getCRV(); +- e.log(log); ++ e.log(mylog); + if (rv == CKR_ATTRIBUTE_TYPE_INVALID || + rv == CKR_BUFFER_TOO_SMALL) { + dumpTemplates(pTemplate, ulCount); +@@ -607,12 +609,12 @@ C_WaitForSlotEvent(CK_FLAGS flags, CK_SL + waitEvent = TRUE; + finalizeLock.releaseLock(); + try { +- log->log("C_WaitForSlotEvent called\n"); ++ mylog->log("C_WaitForSlotEvent called\n"); + slotList->waitForSlotEvent(flags, pSlot, pReserved); + waitEvent = FALSE; + return CKR_OK; + } catch(PKCS11Exception& e) { +- e.log(log); ++ e.log(mylog); + waitEvent = FALSE; + return e.getCRV(); + } --_----------=_1585259444246330--