-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add patch to reduce library output on command line
Signed-off-by: Luca Magrone <luca@magrone.cc>
- Loading branch information
Showing
2 changed files
with
138 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,137 @@ | ||
From 5b93eaee1df0f84110820db511b4347a1d3cb81a Mon Sep 17 00:00:00 2001 | ||
From: Luca Magrone <luca@magrone.cc> | ||
Date: Wed, 16 Oct 2024 00:07:33 +0200 | ||
Subject: [PATCH] libcie-pkcs11: reduce verbosity | ||
|
||
Because it is wildly annoying. (Might even improve performance a tad). | ||
|
||
Signed-off-by: Luca Magrone <luca@magrone.cc> | ||
--- | ||
cie-pkcs11/CSP/IAS.cpp | 2 -- | ||
cie-pkcs11/PKCS11/CIEP11Template.cpp | 2 -- | ||
cie-pkcs11/Util/CacheLib.cpp | 2 -- | ||
cie-pkcs11/Util/log.cpp | 25 ------------------------- | ||
4 files changed, 31 deletions(-) | ||
|
||
diff --git a/cie-pkcs11/CSP/IAS.cpp b/cie-pkcs11/CSP/IAS.cpp | ||
index 5ed8fa1..7ea9f92 100644 | ||
--- a/cie-pkcs11/CSP/IAS.cpp | ||
+++ b/cie-pkcs11/CSP/IAS.cpp | ||
@@ -652,11 +652,9 @@ ByteDynArray IAS::SM(ByteArray &keyEnc, ByteArray &keySig, ByteArray &apdu, Byte | ||
init_func | ||
|
||
std::string dmp; | ||
- ODS("%s\n", dumpHexData(seq, dmp).c_str()); | ||
|
||
increment(seq); | ||
|
||
- ODS("%s\n", dumpHexData(seq, dmp).c_str()); | ||
|
||
ByteDynArray smHead; | ||
smHead = apdu.left(4); | ||
diff --git a/cie-pkcs11/PKCS11/CIEP11Template.cpp b/cie-pkcs11/PKCS11/CIEP11Template.cpp | ||
index 5ed271e..d1f6258 100755 | ||
--- a/cie-pkcs11/PKCS11/CIEP11Template.cpp | ||
+++ b/cie-pkcs11/PKCS11/CIEP11Template.cpp | ||
@@ -41,7 +41,6 @@ int TokenTransmitCallback(CSlot *data, BYTE *apdu, DWORD apduSize, BYTE *resp, D | ||
} | ||
else if (code == 0xfffe) { | ||
DWORD protocol = 0; | ||
- ODS("UNPOWER CARD"); | ||
auto ris = SCardReconnect(data->hCard, SCARD_SHARE_SHARED, SCARD_PROTOCOL_Tx, SCARD_UNPOWER_CARD, &protocol); | ||
|
||
|
||
@@ -62,7 +61,6 @@ int TokenTransmitCallback(CSlot *data, BYTE *apdu, DWORD apduSize, BYTE *resp, D | ||
resp[0] = 0x90; | ||
resp[1] = 0x00; | ||
} | ||
- ODS("RESET CARD"); | ||
return ris; | ||
} | ||
} | ||
diff --git a/cie-pkcs11/Util/CacheLib.cpp b/cie-pkcs11/Util/CacheLib.cpp | ||
index c91424c..1381528 100644 | ||
--- a/cie-pkcs11/Util/CacheLib.cpp | ||
+++ b/cie-pkcs11/Util/CacheLib.cpp | ||
@@ -238,8 +238,6 @@ std::string GetCardDir() | ||
|
||
path.append("/.CIEPKI/"); | ||
|
||
- printf("Card Dir: %s\n", path.c_str()); | ||
- | ||
return path.c_str(); | ||
} | ||
|
||
diff --git a/cie-pkcs11/Util/log.cpp b/cie-pkcs11/Util/log.cpp | ||
index 78fa967..8eefa19 100644 | ||
--- a/cie-pkcs11/Util/log.cpp | ||
+++ b/cie-pkcs11/Util/log.cpp | ||
@@ -51,8 +51,6 @@ void initLog(const char *moduleName, const char *iniFile,const char *version) | ||
|
||
logGlobalVersion=version; | ||
|
||
- OutputDebugString("File INI: %s\n", iniFile); | ||
- | ||
UUCProperties settings; | ||
//settings.load(iniFile); | ||
|
||
@@ -188,13 +186,9 @@ DWORD CLog::write(const char *format,...) { | ||
|
||
if (!firstGlobal && LogMode==LM_Single) { | ||
firstGlobal =true; | ||
- write("Inizio Sessione - versione: %s",logGlobalVersion); | ||
- writeModuleInfo(); | ||
} | ||
if (!FirstLog && (LogMode==LM_Module || LogMode==LM_Module_Thread)) { | ||
FirstLog=true; | ||
- write("%s - Inizio Sessione - versione file: %s",logName.c_str(), logVersion.c_str()); | ||
- writeModuleInfo(); | ||
} | ||
|
||
//DWORD thNum; | ||
@@ -323,15 +317,9 @@ void CLog::writePure(const char *format,...) { | ||
if (Enabled && Initialized && mainEnable) { | ||
if (!firstGlobal && LogMode==LM_Single) { | ||
firstGlobal =true; | ||
- //write("Inizio Sessione - versione: %s",logGlobalVersion); | ||
- printf("Inizio Sessione - versione: %s",logGlobalVersion); | ||
- writeModuleInfo(); | ||
} | ||
if (!FirstLog && (LogMode==LM_Module || LogMode==LM_Module_Thread)) { | ||
FirstLog=true; | ||
- //write("%s - Inizio Sessione - versione file: %s",logName.c_str(), logVersion.c_str()); | ||
- printf("%s - Inizio Sessione - versione file: %s",logName.c_str(), logVersion.c_str()); | ||
- writeModuleInfo(); | ||
} | ||
|
||
// se siamo in LM_thread devo scrivere il thread nel nome del file | ||
@@ -413,13 +401,9 @@ void CLog::writeBinData(BYTE *data, size_t datalen) { | ||
if (!Enabled || !Initialized || !mainEnable) return; | ||
if (!firstGlobal && LogMode==LM_Single) { | ||
firstGlobal =true; | ||
- write("Inizio Sessione - versione: %s",logGlobalVersion); | ||
- writeModuleInfo(); | ||
} | ||
if (!FirstLog && (LogMode==LM_Module || LogMode==LM_Module_Thread)) { | ||
FirstLog=true; | ||
- write("%s - Inizio Sessione - versione file: %s",logName.c_str(), logVersion.c_str()); | ||
- writeModuleInfo(); | ||
} | ||
|
||
// char pbtDate[0x800]={NULL}; | ||
@@ -485,12 +469,3 @@ void CLog::writeBinData(BYTE *data, size_t datalen) { | ||
fclose(lf); | ||
} | ||
} | ||
- | ||
-void CLog::writeModuleInfo() { | ||
- if (!Enabled) return; | ||
- CModuleInfo module; | ||
- HANDLE mainModule = module.getApplicationModule(); | ||
- module.init(mainModule); | ||
- write("Applicazione chiamante: %s",module.szModuleName.c_str()); | ||
-} | ||
- | ||
-- | ||
2.43.5 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters