summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlon Bar-Lev <alonbl@gentoo.org>2017-07-19 16:46:05 +0300
committerAlon Bar-Lev <alonbl@gentoo.org>2017-07-19 16:52:26 +0300
commit8f51b98ef781174c33af1e0d92ec8def54ec0be2 (patch)
tree3b30a2425e04ac40f27b6c9eef52526c6d919309 /dev-libs/opensc/files
parentdev-libs/volume_key: No need to depend on specific autoconf slot (bug #625630). (diff)
downloadgentoo-8f51b98ef781174c33af1e0d92ec8def54ec0be2.tar.gz
gentoo-8f51b98ef781174c33af1e0d92ec8def54ec0be2.tar.bz2
gentoo-8f51b98ef781174c33af1e0d92ec8def54ec0be2.zip
dev-libs/opensc: version bump
Package-Manager: Portage-2.3.6, Repoman-2.3.1
Diffstat (limited to 'dev-libs/opensc/files')
-rw-r--r--dev-libs/opensc/files/opensc-0.17.0-build.patch100
1 files changed, 100 insertions, 0 deletions
diff --git a/dev-libs/opensc/files/opensc-0.17.0-build.patch b/dev-libs/opensc/files/opensc-0.17.0-build.patch
new file mode 100644
index 000000000000..8a51d7ac4450
--- /dev/null
+++ b/dev-libs/opensc/files/opensc-0.17.0-build.patch
@@ -0,0 +1,100 @@
+From 65b302e33b710833d4d14bf8eaf00acdaa436c39 Mon Sep 17 00:00:00 2001
+From: Frank Morgner <frankmorgner@gmail.com>
+Date: Wed, 19 Jul 2017 00:09:36 +0200
+Subject: [PATCH] sc-hsm: fixed building with --disable-sm
+
+Closes https://github.com/OpenSC/OpenSC/pull/1103
+---
+ src/libopensc/card-sc-hsm.c | 21 ++++++++++++++++++++-
+ 1 file changed, 20 insertions(+), 1 deletion(-)
+
+diff --git a/src/libopensc/card-sc-hsm.c b/src/libopensc/card-sc-hsm.c
+index cfa084a06..1f61e0138 100644
+--- a/src/libopensc/card-sc-hsm.c
++++ b/src/libopensc/card-sc-hsm.c
+@@ -284,7 +284,9 @@ static int sc_hsm_soc_select_minbioclient(sc_card_t *card)
+ };
+
+ /* Select MinBioClient */
++#ifdef ENABLE_SM
+ sc_sm_stop(card);
++#endif
+ sc_format_apdu(card, &apdu, SC_APDU_CASE_3_SHORT, 0xA4, 0x04, 0x0C);
+ apdu.data = minBioClient_aid.value;
+ apdu.datalen = minBioClient_aid.len;
+@@ -533,7 +535,9 @@ static int sc_hsm_pin_cmd(sc_card_t *card, struct sc_pin_cmd_data *data,
+ sc_hsm_private_data_t *priv = (sc_hsm_private_data_t *) card->drv_data;
+ sc_apdu_t apdu;
+ u8 cmdbuff[16];
++#ifdef ENABLE_SM
+ u8 rbuf[SC_MAX_APDU_BUFFER_SIZE];
++#endif
+ int r;
+ int cmd = data->cmd;
+ size_t pin2_len = data->pin2.len;
+@@ -563,7 +567,10 @@ static int sc_hsm_pin_cmd(sc_card_t *card, struct sc_pin_cmd_data *data,
+ if ((card->type == SC_CARD_TYPE_SC_HSM_SOC || card->reader->uid.len
+ || cmd == SC_PIN_CMD_GET_SESSION_PIN)
+ && (data->cmd != SC_PIN_CMD_GET_INFO)
+- && card->sm_ctx.sm_mode != SM_MODE_TRANSMIT) {
++#ifdef ENABLE_SM
++ && card->sm_ctx.sm_mode != SM_MODE_TRANSMIT
++#endif
++ ) {
+ LOG_TEST_RET(card->ctx,
+ sc_hsm_perform_chip_authentication(card),
+ "Could not perform chip authentication");
+@@ -604,6 +611,7 @@ static int sc_hsm_pin_cmd(sc_card_t *card, struct sc_pin_cmd_data *data,
+ data->apdu = &apdu;
+ }
+
++#ifdef ENABLE_SM
+ if ((data->cmd == SC_PIN_CMD_GET_INFO)
+ && (card->sm_ctx.sm_mode == SM_MODE_TRANSMIT)) {
+ /* JCOP's SM accelerator is incapable of using case 1 APDU in SM */
+@@ -612,6 +620,7 @@ static int sc_hsm_pin_cmd(sc_card_t *card, struct sc_pin_cmd_data *data,
+ apdu.resplen = sizeof rbuf;
+ data->apdu = &apdu;
+ }
++#endif
+
+ data->pin1.offset = 5;
+ data->pin1.length_offset = 4;
+@@ -627,11 +636,17 @@ static int sc_hsm_pin_cmd(sc_card_t *card, struct sc_pin_cmd_data *data,
+ data->cmd = SC_PIN_CMD_GET_SESSION_PIN;
+ if (data->pin_reference == 0x81) {
+ u8 recvbuf[SC_MAX_APDU_BUFFER_SIZE];
++#ifdef ENABLE_SM
+ if (card->sm_ctx.sm_mode != SM_MODE_TRANSMIT) {
+ sc_debug(card->ctx, SC_LOG_DEBUG_NORMAL,
+ "Session PIN generation only supported in SM");
+ LOG_FUNC_RETURN(card->ctx, SC_SUCCESS);
+ }
++#else
++ sc_debug(card->ctx, SC_LOG_DEBUG_NORMAL,
++ "Session PIN generation only supported in SM");
++ LOG_FUNC_RETURN(card->ctx, SC_SUCCESS);
++#endif
+ sc_format_apdu(card, &apdu, SC_APDU_CASE_2_SHORT, 0x5A, 0x01, data->pin_reference);
+ apdu.cla = 0x80;
+ apdu.resp = recvbuf;
+@@ -669,7 +684,9 @@ static int sc_hsm_logout(sc_card_t * card)
+ sc_path_t path;
+ sc_hsm_private_data_t *priv = (sc_hsm_private_data_t *) card->drv_data;
+ memset(priv->sopin, 0, sizeof(priv->sopin));
++#ifdef ENABLE_SM
+ sc_sm_stop(card);
++#endif
+
+ sc_path_set(&path, SC_PATH_TYPE_DF_NAME, sc_hsm_aid.value, sc_hsm_aid.len, 0, 0);
+
+@@ -1586,7 +1603,9 @@ static int sc_hsm_init(struct sc_card *card)
+ static int sc_hsm_finish(sc_card_t * card)
+ {
+ sc_hsm_private_data_t *priv = (sc_hsm_private_data_t *) card->drv_data;
++#ifdef ENABLE_SM
+ sc_sm_stop(card);
++#endif
+ if (priv->serialno) {
+ free(priv->serialno);
+ }