summaryrefslogtreecommitdiff
blob: 1db749ca654e42d78ee9089890e52737027cacc6 (plain)
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
From 1f1de5ae9a43e845431dc43af96ec61e910ad789 Mon Sep 17 00:00:00 2001
From: Alon Bar-Lev <alon.barlev@gmail.com>
Date: Wed, 16 May 2018 21:30:15 +0300
Subject: [PATCH] build: fix --disable-sm

---
 src/libopensc/card-sc-hsm.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/src/libopensc/card-sc-hsm.c b/src/libopensc/card-sc-hsm.c
index e2af52b9..a609f612 100644
--- a/src/libopensc/card-sc-hsm.c
+++ b/src/libopensc/card-sc-hsm.c
@@ -451,6 +451,7 @@ static int sc_hsm_soc_biomatch(sc_card_t *card, struct sc_pin_cmd_data *data,
 
 
 
+#ifdef ENABLE_SM
 #ifdef ENABLE_OPENPACE
 #include "sm/sm-eac.h"
 #include <eac/cv_cert.h>
@@ -573,6 +574,7 @@ static int sc_hsm_perform_chip_authentication(sc_card_t *card)
 	return SC_ERROR_NOT_SUPPORTED;
 }
 #endif
+#endif
 
 
 
-- 
2.16.1

From a6b4605b863d45978ebd681c4bbaa3aaf0ab90e7 Mon Sep 17 00:00:00 2001
From: Gianfranco Costamagna <costamagnagianfranco@yahoo.it>
Date: Tue, 10 Jul 2018 14:49:42 +0200
Subject: [PATCH] card-piv.c: initialize variable to fix a ppc64el build
 failure
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

This fixes a build failure with optimized ppc64el and new gcc builds
card-piv.c: In function ‘piv_validate_general_authentication.isra.3’:
card-piv.c:2390:9: error: ‘rbuflen’ may be used uninitialized in this function [-Werror=maybe-uninitialized]
    body = sc_asn1_find_tag(card->ctx, rbuf, rbuflen, 0x7c, &bodylen);
    ~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
---
 src/libopensc/card-piv.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/libopensc/card-piv.c b/src/libopensc/card-piv.c
index e85dfc45..13b0cc21 100644
--- a/src/libopensc/card-piv.c
+++ b/src/libopensc/card-piv.c
@@ -2334,7 +2334,7 @@ static int piv_validate_general_authentication(sc_card_t *card,
 
 	u8 sbuf[4096]; /* needs work. for 3072 keys, needs 384+10 or so */
 	u8 *rbuf = NULL;
-	size_t rbuflen;
+	size_t rbuflen = 0;
 
 	SC_FUNC_CALLED(card->ctx, SC_LOG_DEBUG_VERBOSE);
 
-- 
2.16.4

From 0f7af8a647a8fca6b1f1ee2327c3d26bed38c8f6 Mon Sep 17 00:00:00 2001
From: Alon Bar-Lev <alon.barlev@gmail.com>
Date: Sat, 8 Sep 2018 00:16:57 +0300
Subject: [PATCH] reader-ctapi: ctapi_connect: remove unused variable

from day 1 return value of _sc_parse_atr was ignored.
---
 src/libopensc/reader-ctapi.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/src/libopensc/reader-ctapi.c b/src/libopensc/reader-ctapi.c
index 8d4c1c24..4b94337f 100644
--- a/src/libopensc/reader-ctapi.c
+++ b/src/libopensc/reader-ctapi.c
@@ -239,7 +239,6 @@ static int ctapi_connect(sc_reader_t *reader)
 	char rv;
 	u8 cmd[9], rbuf[256], sad, dad;
 	unsigned short lr;
-	int r;
 
 	if (reader->ctx->flags & SC_CTX_FLAG_TERMINATE)
 		return SC_ERROR_NOT_ALLOWED;
@@ -265,7 +264,7 @@ static int ctapi_connect(sc_reader_t *reader)
 		return SC_ERROR_INTERNAL;
 	reader->atr.len = lr;
 	memcpy(reader->atr.value, rbuf, lr);
-	r = _sc_parse_atr(reader);
+	_sc_parse_atr(reader);
 
 	return 0;
 }
-- 
2.16.4