-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcie-middleware-FirmaConCIE-make-progress-more-uniform.patch
58 lines (48 loc) · 2.08 KB
/
cie-middleware-FirmaConCIE-make-progress-more-uniform.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
From f49a29963144307fa72f3f3f2e4cf05c98e0b429 Mon Sep 17 00:00:00 2001
From: Luca Magrone <luca@magrone.cc>
Date: Sat, 26 Oct 2024 19:16:20 +0200
Subject: [PATCH] CSP: firmaConCIE: make progress more uniform
Divide the progress of the progress bar into 4 chunks. Each one
corresponding to 25% of the total progress.
Signed-off-by: Luca Magrone <luca@magrone.cc>
---
cie-pkcs11/CSP/FirmaConCIE.cpp | 11 +++++++----
1 file changed, 7 insertions(+), 4 deletions(-)
diff --git a/cie-pkcs11/CSP/FirmaConCIE.cpp b/cie-pkcs11/CSP/FirmaConCIE.cpp
index 9e3b961..15b5257 100644
--- a/cie-pkcs11/CSP/FirmaConCIE.cpp
+++ b/cie-pkcs11/CSP/FirmaConCIE.cpp
@@ -71,6 +71,9 @@ CK_RV CK_ENTRY firmaConCIE(const char* inFilePath, const char* type, const char*
char *curreader = readers;
bool foundCIE = false;
+
+ progressCallBack(25, "Looking for CIE...");
+
for (; curreader[0] != 0; curreader += strnlen(curreader, len) + 1)
{
safeConnection conn(hSC, curreader, SCARD_SHARE_SHARED);
@@ -93,8 +96,6 @@ CK_RV CK_ENTRY firmaConCIE(const char* inFilePath, const char* type, const char*
ByteArray atrBa((BYTE*)ATR, atrLen);
- progressCallBack(20, "Getting certificate from CIE...");
-
IAS* ias = new IAS((CToken::TokenTransmitCallback)TokenTransmitCallback, atrBa);
ias->SetCardContext(&conn);
@@ -134,14 +135,16 @@ CK_RV CK_ENTRY firmaConCIE(const char* inFilePath, const char* type, const char*
delete ias;
continue;
}
-
+
+ progressCallBack(50, "Getting certificate from CIE...");
+
ByteDynArray FullPIN;
ByteArray LastPIN = ByteArray((uint8_t*)pin, strlen(pin));
ias->GetFirstPIN(FullPIN);
FullPIN.append(LastPIN);
ias->token.Reset();
- progressCallBack(40, "Starting signature...");
+ progressCallBack(75, "Starting signature...");
char fullPinCStr[9];
memcpy(fullPinCStr, FullPIN.data(), 8);
--
2.43.5