[git] GnuPG - branch, master, updated. gnupg-2.1.15-52-gd1ae710

by NIIBE Yutaka cvs at cvs.gnupg.org
Fri Sep 2 07:01:13 CEST 2016


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "The GNU Privacy Guard".

The branch, master has been updated
       via  d1ae7103352fbda2a05f098379cd3043a0ab5566 (commit)
      from  8b6c0bae33bdc36892f4595806665ce61f77dfd2 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit d1ae7103352fbda2a05f098379cd3043a0ab5566
Author: NIIBE Yutaka <gniibe at fsij.org>
Date:   Fri Sep 2 13:58:33 2016 +0900

    scd: Clean up unused shutdown method.
    
    * scd/apdu.c (shutdown_ccid_reader, apdu_shutdown_reader): Remove.
    (reset_ccid_reader): Don't set shutdown_reader.
    * scd/ccid-driver.c (ccid_shutdown_reader): Remove.
    
    --
    
    Signed-off-by: NIIBE Yutaka <gniibe at fsij.org>

diff --git a/scd/apdu.c b/scd/apdu.c
index 268a2c6..c139d76 100644
--- a/scd/apdu.c
+++ b/scd/apdu.c
@@ -101,7 +101,6 @@ struct reader_table_s {
   int (*connect_card)(int);
   int (*disconnect_card)(int);
   int (*close_reader)(int);
-  int (*shutdown_reader)(int);
   int (*reset_reader)(int);
   int (*get_status_reader)(int, unsigned int *);
   int (*send_apdu_reader)(int,unsigned char *,size_t,
@@ -462,7 +461,6 @@ new_reader_slot (void)
   reader_table[reader].connect_card = NULL;
   reader_table[reader].disconnect_card = NULL;
   reader_table[reader].close_reader = NULL;
-  reader_table[reader].shutdown_reader = NULL;
   reader_table[reader].reset_reader = NULL;
   reader_table[reader].get_status_reader = NULL;
   reader_table[reader].send_apdu_reader = NULL;
@@ -2476,14 +2474,6 @@ close_ccid_reader (int slot)
 
 
 static int
-shutdown_ccid_reader (int slot)
-{
-  ccid_shutdown_reader (reader_table[slot].ccid.handle);
-  return 0;
-}
-
-
-static int
 reset_ccid_reader (int slot)
 {
   int err;
@@ -2649,7 +2639,6 @@ open_ccid_reader (const char *portstr)
     }
 
   reader_table[slot].close_reader = close_ccid_reader;
-  reader_table[slot].shutdown_reader = shutdown_ccid_reader;
   reader_table[slot].reset_reader = reset_ccid_reader;
   reader_table[slot].get_status_reader = get_status_ccid;
   reader_table[slot].send_apdu_reader = send_apdu_ccid;
@@ -3264,43 +3253,6 @@ apdu_prepare_exit (void)
 }
 
 
-/* Shutdown a reader; that is basically the same as a close but keeps
-   the handle ready for later use. A apdu_reset_reader or apdu_connect
-   should be used to get it active again. */
-int
-apdu_shutdown_reader (int slot)
-{
-  int sw;
-
-  if (DBG_READER)
-    log_debug ("enter: apdu_shutdown_reader: slot=%d\n", slot);
-
-  if (slot < 0 || slot >= MAX_READER || !reader_table[slot].used )
-    {
-      if (DBG_READER)
-        log_debug ("leave: apdu_shutdown_reader => SW_HOST_NO_DRIVER\n");
-      return SW_HOST_NO_DRIVER;
-    }
-  sw = apdu_disconnect (slot);
-  if (sw)
-    {
-      if (DBG_READER)
-        log_debug ("leave: apdu_shutdown_reader => 0x%x (apdu_disconnect)\n",
-                   sw);
-      return sw;
-    }
-  if (reader_table[slot].shutdown_reader)
-    {
-      sw = reader_table[slot].shutdown_reader (slot);
-      if (DBG_READER)
-        log_debug ("leave: apdu_shutdown_reader => 0x%x (close_reader)\n", sw);
-      return sw;
-    }
-  if (DBG_READER)
-    log_debug ("leave: apdu_shutdown_reader => SW_HOST_NOT_SUPPORTED\n");
-  return SW_HOST_NOT_SUPPORTED;
-}
-
 /* Enumerate all readers and return information on whether this reader
    is in use.  The caller should start with SLOT set to 0 and
    increment it with each call until an error is returned. */
diff --git a/scd/apdu.h b/scd/apdu.h
index 1694eac..7ca4c14 100644
--- a/scd/apdu.h
+++ b/scd/apdu.h
@@ -96,7 +96,6 @@ int apdu_open_remote_reader (const char *portstr,
                              void *writefnc_value,
                              void (*closefnc) (void *opaque),
                              void *closefnc_value);
-int apdu_shutdown_reader (int slot);
 int apdu_close_reader (int slot);
 void apdu_prepare_exit (void);
 int apdu_enum_reader (int slot, int *used);
diff --git a/scd/ccid-driver.c b/scd/ccid-driver.c
index b1523cb..478e038 100644
--- a/scd/ccid-driver.c
+++ b/scd/ccid-driver.c
@@ -1717,78 +1717,6 @@ do_close_reader (ccid_driver_t handle)
 }
 
 
-/* Reset a reader on HANDLE.  This is useful in case a reader has been
-   plugged of and inserted at a different port.  By resetting the
-   handle, the same reader will be get used.  Note, that on error the
-   handle won't get released.
-
-   This does not return an ATR, so ccid_get_atr should be called right
-   after this one.
-*/
-int
-ccid_shutdown_reader (ccid_driver_t handle)
-{
-  int rc = 0;
-  libusb_device_handle *idev = NULL;
-  unsigned char *ifcdesc_extra = NULL;
-  size_t ifcdesc_extra_len;
-  int ifc_no, ep_bulk_out, ep_bulk_in, ep_intr;
-
-  if (!handle || !handle->rid)
-    return CCID_DRIVER_ERR_INV_VALUE;
-
-  do_close_reader (handle);
-
-  if (scan_or_find_devices (-1, handle->rid, NULL, NULL,
-                            &ifcdesc_extra, &ifcdesc_extra_len,
-                            &ifc_no, &ep_bulk_out, &ep_bulk_in, &ep_intr,
-                            &idev, NULL) || !idev)
-    {
-      DEBUGOUT_1 ("no CCID reader with ID %s\n", handle->rid);
-      return CCID_DRIVER_ERR_NO_READER;
-    }
-
-  if (idev)
-    {
-      handle->idev = idev;
-      handle->ifc_no = ifc_no;
-      handle->ep_bulk_out = ep_bulk_out;
-      handle->ep_bulk_in = ep_bulk_in;
-      handle->ep_intr = ep_intr;
-
-      if (parse_ccid_descriptor (handle, ifcdesc_extra, ifcdesc_extra_len))
-        {
-          DEBUGOUT ("device not supported\n");
-          rc = CCID_DRIVER_ERR_NO_READER;
-          goto leave;
-        }
-
-      rc = libusb_claim_interface (idev, ifc_no);
-      if (rc)
-        {
-          DEBUGOUT_1 ("usb_claim_interface failed: %d\n", rc);
-          rc = CCID_DRIVER_ERR_CARD_IO_ERROR;
-          goto leave;
-        }
-    }
-
- leave:
-  free (ifcdesc_extra);
-  if (rc)
-    {
-      if (handle->idev)
-        libusb_close (handle->idev);
-      handle->idev = NULL;
-      if (handle->dev_fd != -1)
-        close (handle->dev_fd);
-      handle->dev_fd = -1;
-    }
-
-  return rc;
-
-}
-
-
 int
 ccid_set_progress_cb (ccid_driver_t handle,
                       void (*cb)(void *, const char *, int, int, int),

-----------------------------------------------------------------------

Summary of changes:
 scd/apdu.c        | 48 -------------------------------------
 scd/apdu.h        |  1 -
 scd/ccid-driver.c | 72 -------------------------------------------------------
 3 files changed, 121 deletions(-)


hooks/post-receive
-- 
The GNU Privacy Guard
http://git.gnupg.org




More information about the Gnupg-commits mailing list