[Gpa-commits] r1002 - in trunk: . src

scm-commit@wald.intevation.org scm-commit at wald.intevation.org
Tue Jun 9 19:53:29 CEST 2009


Author: werner
Date: 2009-06-09 19:53:28 +0200 (Tue, 09 Jun 2009)
New Revision: 1002

Modified:
   trunk/ChangeLog
   trunk/src/ChangeLog
   trunk/src/gpagenkeycardop.c
   trunk/src/gpgmeedit.c
Log:
better error message for key generation.


Modified: trunk/ChangeLog
===================================================================
--- trunk/ChangeLog	2009-06-09 14:54:22 UTC (rev 1001)
+++ trunk/ChangeLog	2009-06-09 17:53:28 UTC (rev 1002)
@@ -1,6 +1,6 @@
 2009-06-09  Werner Koch  <wk at g10code.com>
 
-	* configure.ac: test for gpgme-io_write.
+	* configure.ac: Test for gpgme_io_write.
 
 2009-03-30  Moritz  <moritz at gnu.org>
 

Modified: trunk/src/ChangeLog
===================================================================
--- trunk/src/ChangeLog	2009-06-09 14:54:22 UTC (rev 1001)
+++ trunk/src/ChangeLog	2009-06-09 17:53:28 UTC (rev 1002)
@@ -2,6 +2,9 @@
 
 	* gpgmeedit.c (edit_fnc): Use gpgme_io_write.
 	(gpgme_io_write) [!HAVE_GPGME_IO_WRITE]: Define replacement.
+	(edit_fnc): Handle SC_OP status codes.
+	* gpagenkeycardop.c (gpa_gen_key_card_operation_done_error_cb):
+	Show a useful message for GPG_ERR_BAD_PIN.
 
 2009-06-08  Werner Koch  <wk at g10code.com>
 

Modified: trunk/src/gpagenkeycardop.c
===================================================================
--- trunk/src/gpagenkeycardop.c	2009-06-09 14:54:22 UTC (rev 1001)
+++ trunk/src/gpagenkeycardop.c	2009-06-09 17:53:28 UTC (rev 1002)
@@ -207,6 +207,11 @@
     case GPG_ERR_CANCELED:
       /* Ignore these */
       break;
+
+    case GPG_ERR_BAD_PIN:
+      gpa_window_error (gpg_strerror (err), NULL);
+      break;
+
     default:
       gpa_gpgme_warning_ext (err, op->parms? op->parms->r_error_desc : NULL);
       break;

Modified: trunk/src/gpgmeedit.c
===================================================================
--- trunk/src/gpgmeedit.c	2009-06-09 14:54:22 UTC (rev 1001)
+++ trunk/src/gpgmeedit.c	2009-06-09 17:53:28 UTC (rev 1002)
@@ -201,6 +201,7 @@
   int need_status_passphrase_sym;
 };
 
+
 /* The edit callback proper */
 static gpg_error_t
 edit_fnc (void *opaque, gpgme_status_code_t status,
@@ -210,7 +211,6 @@
   char *result = NULL;
 
   /* Ignore these status lines, as they don't require any response */
-  /* FIXME: should GPGME_STATUS_CARDCTRL be included here as well? -mo */
   if (status == GPGME_STATUS_EOF 
       || status == GPGME_STATUS_GOT_IT
       || status == GPGME_STATUS_NEED_PASSPHRASE
@@ -221,6 +221,8 @@
       || status == GPGME_STATUS_SIGEXPIRED
       || status == GPGME_STATUS_KEYEXPIRED
       || status == GPGME_STATUS_BACKUP_KEY_CREATED
+      || status == GPGME_STATUS_CARDCTRL       /* Issued by gpg1.  */
+      || status == GPGME_STATUS_SC_OP_SUCCESS
       || status == GPGME_STATUS_PROGRESS)
     {
       return parms->err;
@@ -230,7 +232,24 @@
     {
       return parms->err;
     }
+  else if (status == GPGME_STATUS_SC_OP_FAILURE)
+    {
+      if (args && !parms->err)
+        {
+          gpg_err_code_t ec;
 
+          switch (strtoul (args, NULL, 10))
+            {
+            case 1: ec = GPG_ERR_CANCELED; break;
+            case 2: ec = GPG_ERR_BAD_PIN; break;
+            default: ec = GPG_ERR_CARD; break;
+            }
+          if (ec)
+            parms->err = gpg_error (ec);
+        }
+      return parms->err;
+    }
+
   /* Call the save_error function.  */
   if (status == GPGME_STATUS_ERROR && args && parms->save_error)
     {



More information about the Gpa-commits mailing list