[git] GnuPG - branch, master, updated. gnupg-2.2.1-58-gd63b796

by NIIBE Yutaka cvs at cvs.gnupg.org
Mon Oct 30 06:18:48 CET 2017


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  d63b7966cdd72548c60466c620de5cd6104a779e (commit)
      from  f6ab97fd9620bb8f512ffb471a66e5f96098a7cc (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 d63b7966cdd72548c60466c620de5cd6104a779e
Author: NIIBE Yutaka <gniibe at fsij.org>
Date:   Mon Oct 30 11:59:11 2017 +0900

    g10: Simplify "factory-reset" procedure.
    
    * g10/card-util.c (factory_reset): Simplify.
    
    --
    
    In this summer, I got report about old code before this change didn't
    work with newer Yubikey.  I got another report test version of OpenPGP
    card V3.3 implementation didn't work, either.  Then, I confirmed that
    according to the OpenPGP card specification, the procedure of old code
    is not expected by its author.
    
    This change simplify "factory-reset" as simple.
    
    Only versions of Gnuk 1.2.2, 1.2.3, 1.2.4, won't work with this
    change.  That's because the factory-reset feature of Gnuk was
    introduced by reading the implementation of GnuPG, instead of reading
    the specification.  Gnuk 1.2.5 and later works well.  All OpenPGPcard
    implementations I have work well (2.0, 2.1, 2.2, test version of 3).
    
    GnuPG-bug-id: 3286
    Signed-off-by: NIIBE Yutaka <gniibe at fsij.org>

diff --git a/g10/card-util.c b/g10/card-util.c
index 790f95e..dae11b0 100644
--- a/g10/card-util.c
+++ b/g10/card-util.c
@@ -1729,9 +1729,6 @@ factory_reset (void)
         scd apdu 00 20 00 83 08 40 40 40 40 40 40 40 40
         scd apdu 00 20 00 83 08 40 40 40 40 40 40 40 40
         scd apdu 00 e6 00 00
-        scd reset
-        scd serialno undefined
-        scd apdu 00 A4 04 00 06 D2 76 00 01 24 01
         scd apdu 00 44 00 00
         /echo Card has been reset to factory defaults
 
@@ -1806,17 +1803,6 @@ factory_reset (void)
         goto leave;
     }
 
-  /* The card is in termination state - reset and select again.  */
-  err = send_apdu (NULL, "RESET", 0);
-  if (err)
-    goto leave;
-  err = send_apdu ("undefined", "dummy select", 0);
-  if (err)
-    goto leave;
-
-  /* Select the OpenPGP application. (no error checking here). */
-  send_apdu ("00A4040006D27600012401", "SELECT AID", 0xffff);
-
   /* Send activate datafile command.  This is used without
      confirmation if the card is already in termination state.  */
   err = send_apdu ("00440000", "ACTIVATE DF", 0);

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

Summary of changes:
 g10/card-util.c | 14 --------------
 1 file changed, 14 deletions(-)


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




More information about the Gnupg-commits mailing list