[Pkg-gnupg-commit] [gnupg2] 01/02: clean up sc patch
Daniel Kahn Gillmor
dkg at fifthhorseman.net
Mon Feb 13 15:00:56 UTC 2017
This is an automated email from the git hooks/post-receive script.
dkg pushed a commit to branch master
in repository gnupg2.
commit ea66e9fc5a2c0ea9a69ad418b979c2a81de8068a
Author: Daniel Kahn Gillmor <dkg at fifthhorseman.net>
Date: Mon Feb 13 09:15:02 2017 -0500
clean up sc patch
---
.../patches/0029-scd-Fix-use-case-of-PC-SC.patch | 186 ++++++++++-----------
1 file changed, 93 insertions(+), 93 deletions(-)
diff --git a/debian/patches/0029-scd-Fix-use-case-of-PC-SC.patch b/debian/patches/0029-scd-Fix-use-case-of-PC-SC.patch
index b981c97..a26360d 100644
--- a/debian/patches/0029-scd-Fix-use-case-of-PC-SC.patch
+++ b/debian/patches/0029-scd-Fix-use-case-of-PC-SC.patch
@@ -1,93 +1,93 @@
-From: NIIBE Yutaka <gniibe at fsij.org>
-Date: Mon, 13 Feb 2017 11:09:13 +0900
-Subject: [PATCH] scd: Fix use case of PC/SC.
-
-* scd/apdu.c (apdu_open_reader): Add an argument APP_EMPTY.
-When CCID driver fails to open, try PC/SC if APP is nothing.
-* scd/app.c (select_application): Supply arg if APP is nothing.
-
---
-
-After scanning available card readers by CCID driver, scdaemon should
-try PC/SC service if no APP is registered yet. Also, when the slot
-is allocated for PC/SC (ccid.handle==NULL), it should not call
-ccid_compare_BAI, otherwise scdaemon crashes.
-
-Debian-bug-id: 852702, 854005, 854595, 854616
-
-Signed-off-by: NIIBE Yutaka <gniibe at fsij.org>
----
- scd/apdu.c | 14 +++++++++++---
- scd/apdu.h | 2 +-
- scd/app.c | 2 +-
- 3 files changed, 13 insertions(+), 5 deletions(-)
-
-Index: gnupg-debian/scd/apdu.c
-===================================================================
---- gnupg-debian.orig/scd/apdu.c
-+++ gnupg-debian/scd/apdu.c
-@@ -3117,7 +3117,7 @@ apdu_open_one_reader (const char *portst
- }
-
- int
--apdu_open_reader (struct dev_list *dl)
-+apdu_open_reader (struct dev_list *dl, int app_empty)
- {
- int slot;
-
-@@ -3167,6 +3167,7 @@ apdu_open_reader (struct dev_list *dl)
- /* Check identity by BAI against already opened HANDLEs. */
- for (slot = 0; slot < MAX_READER; slot++)
- if (reader_table[slot].used
-+ && reader_table[slot].ccid.handle
- && ccid_compare_BAI (reader_table[slot].ccid.handle, bai))
- break;
-
-@@ -3191,12 +3192,19 @@ apdu_open_reader (struct dev_list *dl)
- dl->idx++;
- }
-
-- slot = -1;
-+ /* Not found. Try one for PC/SC, only when it's the initial scan. */
-+ if (app_empty && dl->idx == dl->idx_max)
-+ {
-+ dl->idx++;
-+ slot = apdu_open_one_reader (dl->portstr);
-+ }
-+ else
-+ slot = -1;
- }
- else
- #endif
- { /* PC/SC readers. */
-- if (dl->idx == 0)
-+ if (app_empty && dl->idx == 0)
- {
- dl->idx++;
- slot = apdu_open_one_reader (dl->portstr);
-Index: gnupg-debian/scd/apdu.h
-===================================================================
---- gnupg-debian.orig/scd/apdu.h
-+++ gnupg-debian/scd/apdu.h
-@@ -91,7 +91,7 @@ gpg_error_t apdu_dev_list_start (const c
- void apdu_dev_list_finish (struct dev_list *l);
-
- /* Note, that apdu_open_reader returns no status word but -1 on error. */
--int apdu_open_reader (struct dev_list *l);
-+int apdu_open_reader (struct dev_list *l, int app_empty);
- int apdu_open_remote_reader (const char *portstr,
- const unsigned char *cookie, size_t length,
- int (*readfnc) (void *opaque,
-Index: gnupg-debian/scd/app.c
-===================================================================
---- gnupg-debian.orig/scd/app.c
-+++ gnupg-debian/scd/app.c
-@@ -340,7 +340,7 @@ select_application (ctrl_t ctrl, const c
- int slot;
- int sw;
-
-- slot = apdu_open_reader (l);
-+ slot = apdu_open_reader (l, !app_top);
- if (slot < 0)
- break;
-
+From: NIIBE Yutaka <gniibe at fsij.org>
+Date: Mon, 13 Feb 2017 11:09:13 +0900
+Subject: scd: Fix use case of PC/SC.
+
+* scd/apdu.c (apdu_open_reader): Add an argument APP_EMPTY.
+When CCID driver fails to open, try PC/SC if APP is nothing.
+* scd/app.c (select_application): Supply arg if APP is nothing.
+
+--
+
+After scanning available card readers by CCID driver, scdaemon should
+try PC/SC service if no APP is registered yet. Also, when the slot
+is allocated for PC/SC (ccid.handle==NULL), it should not call
+ccid_compare_BAI, otherwise scdaemon crashes.
+
+Debian-bug-id: 852702, 854005, 854595, 854616
+
+Signed-off-by: NIIBE Yutaka <gniibe at fsij.org>
+---
+ scd/apdu.c | 14 +++++++++++---
+ scd/apdu.h | 2 +-
+ scd/app.c | 2 +-
+ 3 files changed, 13 insertions(+), 5 deletions(-)
+
+diff --git a/scd/apdu.c b/scd/apdu.c
+index 38ebd2be5..149154cf3 100644
+--- a/scd/apdu.c
++++ b/scd/apdu.c
+@@ -3117,7 +3117,7 @@ apdu_open_one_reader (const char *portstr)
+ }
+
+ int
+-apdu_open_reader (struct dev_list *dl)
++apdu_open_reader (struct dev_list *dl, int app_empty)
+ {
+ int slot;
+
+@@ -3167,6 +3167,7 @@ apdu_open_reader (struct dev_list *dl)
+ /* Check identity by BAI against already opened HANDLEs. */
+ for (slot = 0; slot < MAX_READER; slot++)
+ if (reader_table[slot].used
++ && reader_table[slot].ccid.handle
+ && ccid_compare_BAI (reader_table[slot].ccid.handle, bai))
+ break;
+
+@@ -3191,12 +3192,19 @@ apdu_open_reader (struct dev_list *dl)
+ dl->idx++;
+ }
+
+- slot = -1;
++ /* Not found. Try one for PC/SC, only when it's the initial scan. */
++ if (app_empty && dl->idx == dl->idx_max)
++ {
++ dl->idx++;
++ slot = apdu_open_one_reader (dl->portstr);
++ }
++ else
++ slot = -1;
+ }
+ else
+ #endif
+ { /* PC/SC readers. */
+- if (dl->idx == 0)
++ if (app_empty && dl->idx == 0)
+ {
+ dl->idx++;
+ slot = apdu_open_one_reader (dl->portstr);
+diff --git a/scd/apdu.h b/scd/apdu.h
+index 473def518..6751e8c9b 100644
+--- a/scd/apdu.h
++++ b/scd/apdu.h
+@@ -91,7 +91,7 @@ gpg_error_t apdu_dev_list_start (const char *portstr, struct dev_list **l_p);
+ void apdu_dev_list_finish (struct dev_list *l);
+
+ /* Note, that apdu_open_reader returns no status word but -1 on error. */
+-int apdu_open_reader (struct dev_list *l);
++int apdu_open_reader (struct dev_list *l, int app_empty);
+ int apdu_open_remote_reader (const char *portstr,
+ const unsigned char *cookie, size_t length,
+ int (*readfnc) (void *opaque,
+diff --git a/scd/app.c b/scd/app.c
+index 989e0c060..8fb0d4553 100644
+--- a/scd/app.c
++++ b/scd/app.c
+@@ -340,7 +340,7 @@ select_application (ctrl_t ctrl, const char *name, app_t *r_app,
+ int slot;
+ int sw;
+
+- slot = apdu_open_reader (l);
++ slot = apdu_open_reader (l, !app_top);
+ if (slot < 0)
+ break;
+
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-gnupg/gnupg2.git
More information about the Pkg-gnupg-commit
mailing list