-
Notifications
You must be signed in to change notification settings - Fork 0
/
cie-middleware-reduce-verbosity.patch
137 lines (117 loc) · 4.5 KB
/
cie-middleware-reduce-verbosity.patch
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
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