[Pkg-gnupg-commit] [gnupg2] 52/124: g10: Remove unused function.

Daniel Kahn Gillmor dkg at fifthhorseman.net
Wed Apr 5 15:55:32 UTC 2017


This is an automated email from the git hooks/post-receive script.

dkg pushed a commit to branch experimental
in repository gnupg2.

commit ed3248219e921ee24f6f1b2985abb7e0945d70e9
Author: NIIBE Yutaka <gniibe at fsij.org>
Date:   Wed Mar 15 16:48:01 2017 +0900

    g10: Remove unused function.
    
    * g10/call-agent.c (select_openpgp): Remove.
    
    --
    
    By this change, the function get_serialno_cb will be also unused.  But
    please don't remove the function, because it will be soon used.
    
    Signed-off-by: NIIBE Yutaka <gniibe at fsij.org>
---
 g10/call-agent.c | 92 --------------------------------------------------------
 1 file changed, 92 deletions(-)

diff --git a/g10/call-agent.c b/g10/call-agent.c
index 7d627bb..1606797 100644
--- a/g10/call-agent.c
+++ b/g10/call-agent.c
@@ -1028,98 +1028,6 @@ agent_scd_genkey (int keyno, int force, u32 *createtime)
 
 
 

-/* Issue an SCD SERIALNO openpgp command and if SERIALNO is not NULL
-   ask the user to insert the requested card.  */
-gpg_error_t
-select_openpgp (const char *serialno)
-{
-  gpg_error_t err;
-
-  /* Send the serialno command to initialize the connection.  Without
-     a given S/N we don't care about the data returned.  If the card
-     has already been initialized, this is a very fast command.  We
-     request the openpgp card because that is what we expect.
-
-     Note that an opt.limit_card_insert_tries of 1 means: No tries at
-     all whereas 0 means do not limit the number of tries.  Due to the
-     sue of a pinentry prompt with a cancel option we use it here in a
-     boolean sense.  */
-  if (!serialno || opt.limit_card_insert_tries == 1)
-    err = assuan_transact (agent_ctx, "SCD SERIALNO openpgp",
-                           NULL, NULL, NULL, NULL, NULL, NULL);
-  else
-    {
-      char *this_sn = NULL;
-      char *desc;
-      int ask;
-      char *want_sn;
-      char *p;
-
-      want_sn = xtrystrdup (serialno);
-      if (!want_sn)
-        return gpg_error_from_syserror ();
-      p = strchr (want_sn, '/');
-      if (p)
-        *p = 0;
-
-      do
-        {
-          ask = 0;
-          err = assuan_transact (agent_ctx, "SCD SERIALNO openpgp",
-                                 NULL, NULL, NULL, NULL,
-                                 get_serialno_cb, &this_sn);
-          if (gpg_err_code (err) == GPG_ERR_CARD_NOT_PRESENT)
-            ask = 1;
-          else if (gpg_err_code (err) == GPG_ERR_NOT_SUPPORTED)
-            ask = 2;
-          else if (err)
-            ;
-          else if (this_sn)
-            {
-              if (strcmp (want_sn, this_sn))
-                ask = 2;
-            }
-
-          xfree (this_sn);
-          this_sn = NULL;
-
-          if (ask)
-            {
-              char *formatted = NULL;
-              char *ocodeset = i18n_switchto_utf8 ();
-
-              if (!strncmp (want_sn, "D27600012401", 12)
-                  && strlen (want_sn) == 32 )
-                formatted = xtryasprintf ("(%.4s) %.8s",
-                                          want_sn + 16, want_sn + 20);
-
-              err = 0;
-              desc = xtryasprintf
-                ("%s:\n\n"
-                 "  \"%s\"",
-                 ask == 1
-                 ? _("Please insert the card with serial number")
-                 : _("Please remove the current card and "
-                     "insert the one with serial number"),
-                 formatted? formatted : want_sn);
-              if (!desc)
-                err = gpg_error_from_syserror ();
-              xfree (formatted);
-              i18n_switchback (ocodeset);
-              if (!err)
-                err = gpg_agent_get_confirmation (desc);
-              xfree (desc);
-            }
-        }
-      while (ask && !err);
-      xfree (want_sn);
-    }
-
-  return err;
-}
-
-
-

 /* Send a READCERT command to the SCdaemon. */
 int
 agent_scd_readcert (const char *certidstr,

-- 
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