1 |
commit: 8f51b98ef781174c33af1e0d92ec8def54ec0be2 |
2 |
Author: Alon Bar-Lev <alonbl <AT> gentoo <DOT> org> |
3 |
AuthorDate: Wed Jul 19 13:46:05 2017 +0000 |
4 |
Commit: Alon Bar-Lev <alonbl <AT> gentoo <DOT> org> |
5 |
CommitDate: Wed Jul 19 13:52:26 2017 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=8f51b98e |
7 |
|
8 |
dev-libs/opensc: version bump |
9 |
|
10 |
Package-Manager: Portage-2.3.6, Repoman-2.3.1 |
11 |
|
12 |
dev-libs/opensc/Manifest | 1 + |
13 |
dev-libs/opensc/files/opensc-0.17.0-build.patch | 100 ++++++++++++++++++++++++ |
14 |
dev-libs/opensc/opensc-0.17.0.ebuild | 60 ++++++++++++++ |
15 |
3 files changed, 161 insertions(+) |
16 |
|
17 |
diff --git a/dev-libs/opensc/Manifest b/dev-libs/opensc/Manifest |
18 |
index c55f52e15fd..f8e3c0ca396 100644 |
19 |
--- a/dev-libs/opensc/Manifest |
20 |
+++ b/dev-libs/opensc/Manifest |
21 |
@@ -1 +1,2 @@ |
22 |
DIST opensc-0.16.0.tar.gz 1760418 SHA256 3ac8c29542bb48179e7086d35a1b8907a4e86aca3de3323c2f48bd74eaaf5729 SHA512 15f7d62388dde6dad226acab3cd54f8e2f2f53684dc0cb976c6fc6fbdb4487be931ca69bf965ab07c51efd16be64d5411f10bacea11a07fc823c92dd7bb25139 WHIRLPOOL 8207606e4994d7744fc93cc6aef1b0cde8a2073e791aebf71e82669013d261f82abc6e41ddf971fb136d4580c21ea475bb2e36bbdec600b354f5e1decec4b02a |
23 |
+DIST opensc-0.17.0.tar.gz 1900483 SHA256 4cd8928c5c5787dd8beee6c77be25032996dedaa4df8bfdd369bcbcde9980bd1 SHA512 64c4f44be64e315fba96974c23331b06805b258ea6296bcc741b8f50b35bba4ab5aace8137f2642e114210465e6312a38e83d3261952b56ab7c06a43d475a7f7 WHIRLPOOL d48e591ec47589945dd8b4b358ce5c51c980ec75f7ab0724884fa2fe28cedeeacbc575a5ae4b0a354afcc5ffc608e0502c28244c8f3ebd3867dd7e5b7f270259 |
24 |
|
25 |
diff --git a/dev-libs/opensc/files/opensc-0.17.0-build.patch b/dev-libs/opensc/files/opensc-0.17.0-build.patch |
26 |
new file mode 100644 |
27 |
index 00000000000..8a51d7ac445 |
28 |
--- /dev/null |
29 |
+++ b/dev-libs/opensc/files/opensc-0.17.0-build.patch |
30 |
@@ -0,0 +1,100 @@ |
31 |
+From 65b302e33b710833d4d14bf8eaf00acdaa436c39 Mon Sep 17 00:00:00 2001 |
32 |
+From: Frank Morgner <frankmorgner@×××××.com> |
33 |
+Date: Wed, 19 Jul 2017 00:09:36 +0200 |
34 |
+Subject: [PATCH] sc-hsm: fixed building with --disable-sm |
35 |
+ |
36 |
+Closes https://github.com/OpenSC/OpenSC/pull/1103 |
37 |
+--- |
38 |
+ src/libopensc/card-sc-hsm.c | 21 ++++++++++++++++++++- |
39 |
+ 1 file changed, 20 insertions(+), 1 deletion(-) |
40 |
+ |
41 |
+diff --git a/src/libopensc/card-sc-hsm.c b/src/libopensc/card-sc-hsm.c |
42 |
+index cfa084a06..1f61e0138 100644 |
43 |
+--- a/src/libopensc/card-sc-hsm.c |
44 |
++++ b/src/libopensc/card-sc-hsm.c |
45 |
+@@ -284,7 +284,9 @@ static int sc_hsm_soc_select_minbioclient(sc_card_t *card) |
46 |
+ }; |
47 |
+ |
48 |
+ /* Select MinBioClient */ |
49 |
++#ifdef ENABLE_SM |
50 |
+ sc_sm_stop(card); |
51 |
++#endif |
52 |
+ sc_format_apdu(card, &apdu, SC_APDU_CASE_3_SHORT, 0xA4, 0x04, 0x0C); |
53 |
+ apdu.data = minBioClient_aid.value; |
54 |
+ apdu.datalen = minBioClient_aid.len; |
55 |
+@@ -533,7 +535,9 @@ static int sc_hsm_pin_cmd(sc_card_t *card, struct sc_pin_cmd_data *data, |
56 |
+ sc_hsm_private_data_t *priv = (sc_hsm_private_data_t *) card->drv_data; |
57 |
+ sc_apdu_t apdu; |
58 |
+ u8 cmdbuff[16]; |
59 |
++#ifdef ENABLE_SM |
60 |
+ u8 rbuf[SC_MAX_APDU_BUFFER_SIZE]; |
61 |
++#endif |
62 |
+ int r; |
63 |
+ int cmd = data->cmd; |
64 |
+ size_t pin2_len = data->pin2.len; |
65 |
+@@ -563,7 +567,10 @@ static int sc_hsm_pin_cmd(sc_card_t *card, struct sc_pin_cmd_data *data, |
66 |
+ if ((card->type == SC_CARD_TYPE_SC_HSM_SOC || card->reader->uid.len |
67 |
+ || cmd == SC_PIN_CMD_GET_SESSION_PIN) |
68 |
+ && (data->cmd != SC_PIN_CMD_GET_INFO) |
69 |
+- && card->sm_ctx.sm_mode != SM_MODE_TRANSMIT) { |
70 |
++#ifdef ENABLE_SM |
71 |
++ && card->sm_ctx.sm_mode != SM_MODE_TRANSMIT |
72 |
++#endif |
73 |
++ ) { |
74 |
+ LOG_TEST_RET(card->ctx, |
75 |
+ sc_hsm_perform_chip_authentication(card), |
76 |
+ "Could not perform chip authentication"); |
77 |
+@@ -604,6 +611,7 @@ static int sc_hsm_pin_cmd(sc_card_t *card, struct sc_pin_cmd_data *data, |
78 |
+ data->apdu = &apdu; |
79 |
+ } |
80 |
+ |
81 |
++#ifdef ENABLE_SM |
82 |
+ if ((data->cmd == SC_PIN_CMD_GET_INFO) |
83 |
+ && (card->sm_ctx.sm_mode == SM_MODE_TRANSMIT)) { |
84 |
+ /* JCOP's SM accelerator is incapable of using case 1 APDU in SM */ |
85 |
+@@ -612,6 +620,7 @@ static int sc_hsm_pin_cmd(sc_card_t *card, struct sc_pin_cmd_data *data, |
86 |
+ apdu.resplen = sizeof rbuf; |
87 |
+ data->apdu = &apdu; |
88 |
+ } |
89 |
++#endif |
90 |
+ |
91 |
+ data->pin1.offset = 5; |
92 |
+ data->pin1.length_offset = 4; |
93 |
+@@ -627,11 +636,17 @@ static int sc_hsm_pin_cmd(sc_card_t *card, struct sc_pin_cmd_data *data, |
94 |
+ data->cmd = SC_PIN_CMD_GET_SESSION_PIN; |
95 |
+ if (data->pin_reference == 0x81) { |
96 |
+ u8 recvbuf[SC_MAX_APDU_BUFFER_SIZE]; |
97 |
++#ifdef ENABLE_SM |
98 |
+ if (card->sm_ctx.sm_mode != SM_MODE_TRANSMIT) { |
99 |
+ sc_debug(card->ctx, SC_LOG_DEBUG_NORMAL, |
100 |
+ "Session PIN generation only supported in SM"); |
101 |
+ LOG_FUNC_RETURN(card->ctx, SC_SUCCESS); |
102 |
+ } |
103 |
++#else |
104 |
++ sc_debug(card->ctx, SC_LOG_DEBUG_NORMAL, |
105 |
++ "Session PIN generation only supported in SM"); |
106 |
++ LOG_FUNC_RETURN(card->ctx, SC_SUCCESS); |
107 |
++#endif |
108 |
+ sc_format_apdu(card, &apdu, SC_APDU_CASE_2_SHORT, 0x5A, 0x01, data->pin_reference); |
109 |
+ apdu.cla = 0x80; |
110 |
+ apdu.resp = recvbuf; |
111 |
+@@ -669,7 +684,9 @@ static int sc_hsm_logout(sc_card_t * card) |
112 |
+ sc_path_t path; |
113 |
+ sc_hsm_private_data_t *priv = (sc_hsm_private_data_t *) card->drv_data; |
114 |
+ memset(priv->sopin, 0, sizeof(priv->sopin)); |
115 |
++#ifdef ENABLE_SM |
116 |
+ sc_sm_stop(card); |
117 |
++#endif |
118 |
+ |
119 |
+ sc_path_set(&path, SC_PATH_TYPE_DF_NAME, sc_hsm_aid.value, sc_hsm_aid.len, 0, 0); |
120 |
+ |
121 |
+@@ -1586,7 +1603,9 @@ static int sc_hsm_init(struct sc_card *card) |
122 |
+ static int sc_hsm_finish(sc_card_t * card) |
123 |
+ { |
124 |
+ sc_hsm_private_data_t *priv = (sc_hsm_private_data_t *) card->drv_data; |
125 |
++#ifdef ENABLE_SM |
126 |
+ sc_sm_stop(card); |
127 |
++#endif |
128 |
+ if (priv->serialno) { |
129 |
+ free(priv->serialno); |
130 |
+ } |
131 |
|
132 |
diff --git a/dev-libs/opensc/opensc-0.17.0.ebuild b/dev-libs/opensc/opensc-0.17.0.ebuild |
133 |
new file mode 100644 |
134 |
index 00000000000..0612c40f2bb |
135 |
--- /dev/null |
136 |
+++ b/dev-libs/opensc/opensc-0.17.0.ebuild |
137 |
@@ -0,0 +1,60 @@ |
138 |
+# Copyright 1999-2017 Gentoo Foundation |
139 |
+# Distributed under the terms of the GNU General Public License v2 |
140 |
+ |
141 |
+EAPI=6 |
142 |
+ |
143 |
+inherit ltprune |
144 |
+ |
145 |
+DESCRIPTION="Libraries and applications to access smartcards" |
146 |
+HOMEPAGE="https://github.com/OpenSC/OpenSC/wiki" |
147 |
+SRC_URI="https://github.com/OpenSC/OpenSC/releases/download/${PV}/${P}.tar.gz" |
148 |
+ |
149 |
+LICENSE="LGPL-2.1" |
150 |
+SLOT="0" |
151 |
+KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~m68k ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86" |
152 |
+IUSE="doc +pcsc-lite secure-messaging openct ctapi readline libressl ssl zlib" |
153 |
+ |
154 |
+RDEPEND="zlib? ( sys-libs/zlib ) |
155 |
+ readline? ( sys-libs/readline:0= ) |
156 |
+ ssl? ( |
157 |
+ !libressl? ( dev-libs/openssl:0= ) |
158 |
+ libressl? ( dev-libs/libressl:0= ) |
159 |
+ ) |
160 |
+ openct? ( >=dev-libs/openct-0.5.0 ) |
161 |
+ pcsc-lite? ( >=sys-apps/pcsc-lite-1.3.0 )" |
162 |
+DEPEND="${RDEPEND} |
163 |
+ virtual/pkgconfig |
164 |
+ app-text/docbook-xsl-stylesheets |
165 |
+ dev-libs/libxslt" |
166 |
+ |
167 |
+REQUIRED_USE=" |
168 |
+ pcsc-lite? ( !openct !ctapi ) |
169 |
+ openct? ( !pcsc-lite !ctapi ) |
170 |
+ ctapi? ( !pcsc-lite !openct ) |
171 |
+ || ( pcsc-lite openct ctapi )" |
172 |
+ |
173 |
+PATCHES=( |
174 |
+ "${FILESDIR}/${P}-build.patch" |
175 |
+) |
176 |
+ |
177 |
+src_configure() { |
178 |
+ econf \ |
179 |
+ --docdir="/usr/share/doc/${PF}" \ |
180 |
+ --htmldir='$(docdir)/html' \ |
181 |
+ --disable-static \ |
182 |
+ --disable-openpace \ |
183 |
+ $(use_enable doc) \ |
184 |
+ $(use_enable openct) \ |
185 |
+ $(use_enable readline) \ |
186 |
+ $(use_enable zlib) \ |
187 |
+ $(use_enable secure-messaging sm) \ |
188 |
+ $(use_enable ssl openssl) \ |
189 |
+ $(use_enable pcsc-lite pcsc) \ |
190 |
+ $(use_enable openct) \ |
191 |
+ $(use_enable ctapi) |
192 |
+} |
193 |
+ |
194 |
+src_install() { |
195 |
+ default |
196 |
+ prune_libtool_files --all |
197 |
+} |