[git] GPA - branch, master, updated. gpa-0.9.6-4-g5c763a2

by Werner Koch cvs at cvs.gnupg.org
Mon Dec 8 11:30:12 CET 2014


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 Assistant".

The branch, master has been updated
       via  5c763a21f2a8d3a47399bec6dc042651d1f84a28 (commit)
       via  e37fe5c07a73c4c56892842d2cfdb1793c94275d (commit)
       via  e4e9d6f82993404453dfb00e6059a7bb8b7ae577 (commit)
      from  a46182fed6094502341d0192208e5567b6a2b155 (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 5c763a21f2a8d3a47399bec6dc042651d1f84a28
Author: Werner Koch <wk at gnupg.org>
Date:   Mon Dec 8 11:30:36 2014 +0100

    po: Update the German translation.
    
    --

diff --git a/po/de.po b/po/de.po
index dc3d699..d6595f5 100644
--- a/po/de.po
+++ b/po/de.po
@@ -6,7 +6,7 @@ msgid ""
 msgstr ""
 "Project-Id-Version: gpa\n"
 "Report-Msgid-Bugs-To: gpa-dev at gnupg.org\n"
-"PO-Revision-Date: 2014-11-21 09:40+0100\n"
+"PO-Revision-Date: 2014-12-08 11:30+0100\n"
 "Last-Translator: Werner Koch <wk at gnupg.org>\n"
 "Language-Team: German <de at li.org>\n"
 "Language: de\n"
@@ -146,6 +146,21 @@ msgstr "Fortgeschritten"
 msgid "Expert"
 msgstr "Experte"
 
+msgid "A keyserver has not been configured."
+msgstr "Es ist kein Schlüssel-Server konfiguriert."
+
+msgid "Configure backend to use a keyserver?"
+msgstr "Soll ein Schlüssel-Server konfiguriert werden?"
+
+msgid "_Yes"
+msgstr "_Ja"
+
+msgid "_No"
+msgstr "_Nein"
+
+msgid "Configuring the backend to use a keyserver failed"
+msgstr "Konfiguration eines Schlüssel-Servers ist fehlgeschlagen"
+
 msgid "days"
 msgstr "Tage"
 
@@ -356,19 +371,17 @@ msgstr "Nur Schlüssel eines Protokolls können zusammen exportiert werden"
 
 #, c-format
 msgid ""
-"The selected key will be sent to a public key\n"
-"server (\"%s\").\n"
-"Are you sure you want to distribute this key?"
+"The selected key(s) will be sent to a public key\n"
+"server (\"%s\")."
 msgstr ""
-"Der ausgewählte Schlüssel wird an einen öffentlichen\n"
-"Schlüssel-Server (\"%s\") gesandt.\n"
-"Sind Sie sicher, dass Sie diesen Schlüssel veröffentlichen wollen?"
+"Der oder die ausgewählte(n) Schlüssel wird an einen öffentlichen\n"
+"Schlüssel-Server (\"%s\") gesandt."
 
-msgid "_Yes"
-msgstr "_Ja"
+msgid "Are you sure you want to distribute this key?"
+msgstr "Wollen Sie diesen Schlüssel wirklich veröffentlichen?"
 
-msgid "_No"
-msgstr "_Nein"
+msgid "Error sending key(s) to the server."
+msgstr "Schlüssel konnte(n) nicht zum Server gesendet werden"
 
 msgid "The keys have been sent to the server."
 msgstr "Die Schlüssel wurden zum Server gesandt."
@@ -1661,7 +1674,7 @@ msgid "Key incomplete"
 msgstr "Unvollständiger Schlüssel"
 
 msgid "Could not contact keyserver"
-msgstr "Keinve Verbindung zum Schlüssel-Server möglich."
+msgstr "Keine Verbindung zum Schlüssel-Server möglich."
 
 msgid "Unknown Error"
 msgstr "Unbekannter Fehler"
@@ -2017,7 +2030,7 @@ msgid ""
 "\n"
 "A fresh standard card has set the Admin-PIN to the value <i>12345678</i>.  "
 "However, the issuer of your card might have initialized the card with a "
-"different Admin-PIN and that Admin-PIN might only be nown to the issuer.  "
+"different Admin-PIN and that Admin-PIN might only be known to the issuer.  "
 "Please check the instructions of your issuer.\n"
 "\n"
 "If you proceed you will be asked to enter the current value of the <b>Admin-"

commit e37fe5c07a73c4c56892842d2cfdb1793c94275d
Author: Werner Koch <wk at gnupg.org>
Date:   Mon Dec 8 11:23:40 2014 +0100

    Support sending keys with GnuPG 2.1.
    
    * src/confdialog.c (gpa_configure_keyserver): New.
    * src/gpa.c (main): Do no get a default keyserver for GnuPG 2.1.
    * src/options.c (gpa_options_read_settings): Ditto.
    * src/settingsdlg.c (save_settings): Do not set a default keyserver
    for GnuPG 2.1
    * src/gpaexportserverop.c (confirm_send): Ask to configure keyserver.
    Support GnuPG 2.1.
    (send_keys): New.
    (gpa_export_server_operation_complete_export): Support GnuPG 2.1.

diff --git a/src/confdialog.c b/src/confdialog.c
index 892aee6..005d55d 100644
--- a/src/confdialog.c
+++ b/src/confdialog.c
@@ -32,6 +32,7 @@
 
 #include "i18n.h"
 #include "gpgmetools.h"
+#include "gtktools.h"
 #include "options.h"
 
 /* Violation of GNOME standards: Cancel does not revert previous
@@ -1569,3 +1570,44 @@ gpa_store_configured_keyserver (const char *value)
   gpa_store_gpgconf_string ("gpg", "keyserver", value);
 #endif
 }
+
+
+/* Ask the user whether to configure GnuPG to use a keyserver.  Return
+   NULL if it could or shall not be configured or the name of the
+   keyserver which needs to be g_freed.  */
+char *
+gpa_configure_keyserver (GtkWidget *parent)
+{
+#ifdef ENABLE_KEYSERVER_SUPPORT
+  GtkWidget *msgbox;
+  char *keyserver;
+
+  msgbox = gtk_message_dialog_new
+    (GTK_WINDOW(parent), GTK_DIALOG_MODAL,
+     GTK_MESSAGE_WARNING, GTK_BUTTONS_NONE,
+     "%s\n\n%s",
+     _("A keyserver has not been configured."),
+     _("Configure backend to use a keyserver?"));
+  gtk_dialog_add_buttons (GTK_DIALOG (msgbox),
+                          _("_Yes"), GTK_RESPONSE_YES,
+                          _("_No"), GTK_RESPONSE_NO, NULL);
+  if (gtk_dialog_run (GTK_DIALOG (msgbox)) == GTK_RESPONSE_NO)
+    {
+      gtk_widget_destroy (msgbox);
+      return NULL;
+    }
+  gtk_widget_destroy (msgbox);
+  gpa_store_configured_keyserver ("hkp://keys.gnupg.net");
+  keyserver = gpa_load_configured_keyserver ();
+  if (!keyserver)
+    {
+      gpa_show_warning
+        (parent, _("Configuring the backend to use a keyserver failed"));
+      return NULL;
+    }
+  return keyserver;
+#else
+  (void)parent;
+  return NULL
+#endif
+}
diff --git a/src/confdialog.h b/src/confdialog.h
index 1d7857e..5a91650 100644
--- a/src/confdialog.h
+++ b/src/confdialog.h
@@ -25,13 +25,14 @@ GtkWidget *gpa_backend_config_dialog_new (void);
 
 
 char *gpa_load_gpgconf_string (const char *cname, const char *name);
-void gpa_store_gpgconf_string (const char *cname, 
+void gpa_store_gpgconf_string (const char *cname,
                                const char *name, const char *value);
 
 
 
 char *gpa_load_configured_keyserver (void);
 void gpa_store_configured_keyserver (const char *value);
+char *gpa_configure_keyserver (GtkWidget *parent);
 
 
 #endif
diff --git a/src/gpa.c b/src/gpa.c
index 73335bd..d9db079 100644
--- a/src/gpa.c
+++ b/src/gpa.c
@@ -592,7 +592,8 @@ main (int argc, char *argv[])
   gpa_options_update_default_key (gpa_options_get_instance ());
   /* Now, make sure there are reasonable defaults for the default key
     and keyserver.  */
-  if (!gpa_options_get_default_keyserver (gpa_options_get_instance ()))
+  if (!is_gpg_version_at_least ("2.1.0")
+      && !gpa_options_get_default_keyserver (gpa_options_get_instance ()))
     {
       GList *keyservers = keyserver_get_as_glist ();
       gpa_options_set_default_keyserver (gpa_options_get_instance (),
diff --git a/src/gpaexportserverop.c b/src/gpaexportserverop.c
index 9500ccb..4691423 100644
--- a/src/gpaexportserverop.c
+++ b/src/gpaexportserverop.c
@@ -27,6 +27,7 @@
 #include "gtktools.h"
 #include "gpgmetools.h"
 #include "server-access.h"
+#include "confdialog.h"
 #include "gpaexportserverop.h"
 
 static GObjectClass *parent_class = NULL;
@@ -121,15 +122,38 @@ gpa_export_server_operation_get_type (void)
 /* Internal */
 
 static gboolean
-confirm_send (GtkWidget * parent, const gchar *server)
+confirm_send (GtkWidget *parent, const gchar *server)
 {
-  GtkWidget *msgbox = gtk_message_dialog_new
-	(GTK_WINDOW(parent), GTK_DIALOG_MODAL,
-	 GTK_MESSAGE_WARNING, GTK_BUTTONS_NONE,
-	 _("The selected key will be sent to a public key\n"
-	   "server (\"%s\").\n"
-	   "Are you sure you want to distribute this key?"),
-	 server);
+  GtkWidget *msgbox;
+  char *info;
+  char *keyserver = NULL;
+
+  if (is_gpg_version_at_least ("2.1.0"))
+    {
+      keyserver = gpa_load_configured_keyserver ();
+      server = keyserver;
+    }
+
+  if (!server)
+    {
+      keyserver = gpa_configure_keyserver (parent);
+      if (!keyserver)
+        return FALSE;
+      server = keyserver;
+    }
+
+
+  info = g_strdup_printf (_("The selected key(s) will be sent to a public key\n"
+                            "server (\"%s\")."), server);
+  g_free (keyserver);
+  msgbox = gtk_message_dialog_new
+    (GTK_WINDOW(parent), GTK_DIALOG_MODAL,
+     GTK_MESSAGE_WARNING, GTK_BUTTONS_NONE,
+     "%s\n\n%s",
+     info,
+     _("Are you sure you want to distribute this key?"));
+  g_free (info);
+
   gtk_dialog_add_buttons (GTK_DIALOG (msgbox),
 			  _("_Yes"), GTK_RESPONSE_YES,
 			  _("_No"), GTK_RESPONSE_NO, NULL);
@@ -172,21 +196,77 @@ gpa_export_server_operation_get_destination (GpaExportOperation *operation,
     }
 }
 
+
+/* GnuPG 2.1 method to send keys to the keyserver.  KEYLIST has a list
+   of keys to be sent.  Returns true on success. */
+static gboolean
+send_keys (GpaExportServerOperation *op, GList *keylist)
+{
+  gpg_error_t err;
+  GList *item;
+  gpgme_key_t *keyarray;
+  gpgme_key_t key;
+  int i;
+
+  keyarray = g_malloc0_n (g_list_length (keylist)+1, sizeof *keyarray);
+  i = 0;
+  for (item = keylist; item; i++, item = g_list_next (item))
+    {
+      key = (gpgme_key_t) item->data;
+      if (!key || key->protocol != GPGME_PROTOCOL_OpenPGP)
+        continue;
+      gpgme_key_ref (key);
+      keyarray[i++] = key;
+    }
+
+  gpgme_set_protocol (GPA_OPERATION (op)->context->ctx, GPGME_PROTOCOL_OpenPGP);
+  err = gpgme_op_export_keys (GPA_OPERATION (op)->context->ctx,
+                              keyarray, GPGME_KEYLIST_MODE_EXTERN, NULL);
+  for (i=0; keyarray[i]; i++)
+    gpgme_key_unref (keyarray[i]);
+  g_free (keyarray);
+
+  if (err)
+    {
+      gpa_show_warning (GPA_OPERATION (op)->window,
+                        "%s\n\n(%s <%s>)",
+                        _("Error sending key(s) to the server."),
+                        gpg_strerror (err), gpg_strsource (err));
+      return FALSE;
+    }
+
+  return TRUE;
+}
+
+
+
 static void
 gpa_export_server_operation_complete_export (GpaExportOperation *operation)
 {
   GpaExportServerOperation *op = GPA_EXPORT_SERVER_OPERATION (operation);
-  gpgme_key_t key;
-  op->server = g_strdup (gpa_options_get_default_keyserver
-			 (gpa_options_get_instance ()));
+  int okay = 0;
 
-  key = (gpgme_key_t) operation->keys->data;
-  if (server_send_keys (op->server, key->subkeys->keyid, operation->dest,
-			GPA_OPERATION (op)->window))
+  if (is_gpg_version_at_least ("2.1.0"))
+    {
+      /* GnuPG 2.1.0 does not anymore use the keyserver helpers and
+         thus we need to use the real API for sending keys.  */
+      if (send_keys (op, operation->keys))
+        okay = 1;
+    }
+  else
     {
-      gpa_window_message (_("The keys have been sent to the server."),
-			  GPA_OPERATION (op)->window);
+      gpgme_key_t key = (gpgme_key_t) operation->keys->data;
+
+      op->server = g_strdup (gpa_options_get_default_keyserver
+                             (gpa_options_get_instance ()));
+      if (server_send_keys (op->server, key->subkeys->keyid, operation->dest,
+                             GPA_OPERATION (op)->window))
+        okay = 1;
     }
+
+  if (okay)
+    gpa_window_message (_("The keys have been sent to the server."),
+                        GPA_OPERATION (op)->window);
 }
 
 /* API */
diff --git a/src/options.c b/src/options.c
index ccdd183..fc67c46 100644
--- a/src/options.c
+++ b/src/options.c
@@ -3,17 +3,17 @@
    Copyright (C) 2005, 2008 g10 Code GmbH.
 
    This file is part of GPA
-  
+
    GPA is free software; you can redistribute it and/or modify it
    under the terms of the GNU General Public License as published by
    the Free Software Foundation; either version 3 of the License, or
    (at your option) any later version.
-  
+
    GPA is distributed in the hope that it will be useful, but WITHOUT
    ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
    or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public
    License for more details.
-  
+
    You should have received a copy of the GNU General Public License
    along with this program; if not, see <http://www.gnu.org/licenses/>. */
 
@@ -61,7 +61,7 @@ GType
 gpa_options_get_type (void)
 {
   static GType style_type = 0;
-  
+
   if (!style_type)
     {
       static const GTypeInfo style_info =
@@ -76,12 +76,12 @@ gpa_options_get_type (void)
         0,              /* n_preallocs */
         (GInstanceInitFunc) gpa_options_init,
       };
-      
+
       style_type = g_type_register_static (G_TYPE_OBJECT,
 					   "GpaOptions",
 					   &style_info, 0);
     }
-  
+
   return style_type;
 }
 
@@ -105,7 +105,7 @@ static void
 gpa_options_class_init (GpaOptionsClass *klass)
 {
   GObjectClass *object_class = G_OBJECT_CLASS (klass);
-  
+
   parent_class = g_type_class_peek_parent (klass);
 
   object_class->finalize = gpa_options_finalize;
@@ -121,7 +121,7 @@ gpa_options_class_init (GpaOptionsClass *klass)
   make_signal (CHANGED_UI_MODE, object_class,
                "changed_ui_mode",
                G_STRUCT_OFFSET (GpaOptionsClass, changed_ui_mode));
-  make_signal (CHANGED_SHOW_ADVANCED_OPTIONS, object_class, 
+  make_signal (CHANGED_SHOW_ADVANCED_OPTIONS, object_class,
                "changed_show_advanced_options",
                G_STRUCT_OFFSET (GpaOptionsClass,
                                 changed_show_advanced_options));
@@ -156,12 +156,12 @@ static void
 gpa_options_finalize (GObject *object)
 {
   GpaOptions *options = GPA_OPTIONS (object);
-  
+
   g_free (options->options_file);
   gpgme_key_unref (options->default_key);
   g_free (options->default_key_fpr);
   g_free (options->default_keyserver);
-  
+
   G_OBJECT_CLASS (parent_class)->finalize (object);
 }
 
@@ -176,7 +176,7 @@ static GpaOptions *
 gpa_options_new (void)
 {
   GpaOptions *options;
-  
+
   options = g_object_new (GPA_OPTIONS_TYPE, NULL);
 
   return options;
@@ -300,7 +300,7 @@ determine_default_key (void)
 	  err = gpgme_op_keylist_end (ctx);
 	  if (gpg_err_code (err) != GPG_ERR_NO_ERROR)
 	    {
-	      gpa_gpgme_warning (err); 
+	      gpa_gpgme_warning (err);
 	    }
 	}
       else if (gpg_err_code (err) != GPG_ERR_EOF)
@@ -323,7 +323,7 @@ gpa_options_update_default_key (GpaOptions *options)
 
   if (! options->default_key_fpr)
     update = TRUE;
-  else if (gpg_err_code (gpgme_get_key (ctx, options->default_key_fpr, 
+  else if (gpg_err_code (gpgme_get_key (ctx, options->default_key_fpr,
 					&key, TRUE)) == GPG_ERR_EOF)
     {
       gpa_window_error (_("The private key you selected as default is no "
@@ -357,6 +357,9 @@ gpa_options_update_default_key (GpaOptions *options)
 void
 gpa_options_set_default_keyserver (GpaOptions *options, const gchar *keyserver)
 {
+  if (is_gpg_version_at_least ("2.1.0"))
+    return;
+
   if (options->default_keyserver)
     {
       g_free (options->default_keyserver);
@@ -404,7 +407,7 @@ static void
 gpa_options_save_settings (GpaOptions *options)
 {
   FILE *options_file;
-  
+
   g_assert(options->options_file != NULL);
   options_file = g_fopen (options->options_file, "w");
   if (!options_file)
@@ -420,7 +423,7 @@ gpa_options_save_settings (GpaOptions *options)
         }
       if (options->default_keyserver)
         {
-          /* we do not write the keyserver anymore to gpg.conf.  */
+          /* we do not write the keyserver anymore to gpa.conf.  */
 /*           fprintf (options_file, "keyserver %s\n",  */
 /*                    options->default_keyserver); */
         }
@@ -444,7 +447,7 @@ gpa_options_save_settings (GpaOptions *options)
     }
 
   /* Write the keyserver to the backend.  */
-  if (options->default_keyserver)
+  if (options->default_keyserver && !is_gpg_version_at_least ("2.1.0"))
     gpa_store_configured_keyserver (options->default_keyserver);
 }
 
@@ -472,12 +475,12 @@ read_next_word (FILE *file, char *buffer, int size)
           buffer[i++] = c;
         }
       buffer[i] = '\0';
-      
+
       return TRUE;
     }
 }
 
-typedef enum 
+typedef enum
  {
    PARSE_OPTIONS_STATE_START,
    PARSE_OPTIONS_STATE_HAVE_KEY,
@@ -490,7 +493,7 @@ static void
 gpa_options_read_settings (GpaOptions *options)
 {
   FILE *options_file;
-  
+
   g_assert(options->options_file != NULL);
   options_file = g_fopen (options->options_file, "r");
   if (!options_file)
@@ -558,5 +561,7 @@ gpa_options_read_settings (GpaOptions *options)
 
   /* Read the keyserver from the abckend.  */
   g_free (options->default_keyserver);
-  options->default_keyserver = gpa_load_configured_keyserver ();
+  options->default_keyserver = NULL;
+  if (!is_gpg_version_at_least ("2.1.0"))
+    options->default_keyserver = gpa_load_configured_keyserver ();
 }
diff --git a/src/settingsdlg.c b/src/settingsdlg.c
index fe9e529..ce57ee6 100644
--- a/src/settingsdlg.c
+++ b/src/settingsdlg.c
@@ -798,8 +798,9 @@ save_settings (SettingsDlg *dialog)
 
 
 #ifdef ENABLE_KEYSERVER_SUPPORT
-  gpa_options_set_default_keyserver (gpa_options_get_instance (),
-                                     dialog->keyserver.url);
+  if (!dialog->gnupg21)
+    gpa_options_set_default_keyserver (gpa_options_get_instance (),
+                                       dialog->keyserver.url);
 #endif /*ENABLE_KEYSERVER_SUPPORT*/
 
   if (!dialog->akl.enabled)

commit e4e9d6f82993404453dfb00e6059a7bb8b7ae577
Author: Werner Koch <wk at gnupg.org>
Date:   Fri Dec 5 10:58:47 2014 +0100

    Update card vendor list and fix one typo.
    
    --

diff --git a/src/cm-openpgp.c b/src/cm-openpgp.c
index 39ea38d..b559dcd 100644
--- a/src/cm-openpgp.c
+++ b/src/cm-openpgp.c
@@ -132,12 +132,18 @@ get_manufacturer (unsigned int no)
     case 0x0001: return "PPC Card Systems";
     case 0x0002: return "Prism";
     case 0x0003: return "OpenFortress";
-    case 0x0004: return "Wewid AB";
+    case 0x0004: return "Wewid";
     case 0x0005: return "ZeitControl";
+    case 0x0006: return "Yubico";
+    case 0x0007: return "OpenKMS";
+    case 0x0008: return "LogoEmail";
 
     case 0x002A: return "Magrathea";
-      /* 0x00000 and 0xFFFF are defined as test cards per spec,
-         0xFFF00 to 0xFFFE are assigned for use with randomly created
+
+    case 0xF517: return "FSIJ";
+
+      /* 0x0000 and 0xFFFF are defined as test cards per spec,
+         0xFF00 to 0xFFFE are assigned for use with randomly created
          serial numbers.  */
     case 0x0000:
     case 0xffff: return "test card";
@@ -1121,7 +1127,7 @@ change_pin (GpaCMOpenpgp *card, int pinno)
                "A fresh standard card has set the Admin-PIN to the value "
                "<i>12345678</i>.  However, the issuer of your card might "
                "have initialized the card with a different Admin-PIN and "
-               "that Admin-PIN might only be nown to the issuer.  "
+               "that Admin-PIN might only be known to the issuer.  "
                "Please check the instructions of your issuer.\n"
                "\n"
                "If you proceed you will be asked to enter the current "

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

Summary of changes:
 po/de.po                |   39 +++++++++++------
 src/cm-openpgp.c        |   14 ++++--
 src/confdialog.c        |   42 ++++++++++++++++++
 src/confdialog.h        |    3 +-
 src/gpa.c               |    3 +-
 src/gpaexportserverop.c |  112 ++++++++++++++++++++++++++++++++++++++++-------
 src/options.c           |   45 ++++++++++---------
 src/settingsdlg.c       |    5 ++-
 8 files changed, 206 insertions(+), 57 deletions(-)


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




More information about the Gnupg-commits mailing list