From cvs at cvs.gnupg.org Mon Jun 1 17:57:40 2015 From: cvs at cvs.gnupg.org (by Neal H. Walfield) Date: Mon, 01 Jun 2015 17:57:40 +0200 Subject: [git] Assuan - branch, master, updated. libassuan-2.2.1-2-gc6b1319 Message-ID: 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 "IPC library used by GnuPG". The branch, master has been updated via c6b131949bb6c77392af2cbbbeb8ea1bed129b79 (commit) from 28f8b3977a3d5ce830feb9bbb9d1a51c3579aedc (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 c6b131949bb6c77392af2cbbbeb8ea1bed129b79 Author: Neal H. Walfield Date: Mon Jun 1 17:56:23 2015 +0200 Fix documentation for assuan_inquire. * doc/assuan.texi (assuan_inquire): Fix and improve description of this function. diff --git a/doc/assuan.texi b/doc/assuan.texi index 7ea7d81..358357c 100644 --- a/doc/assuan.texi +++ b/doc/assuan.texi @@ -1752,12 +1752,12 @@ need to pass it the @var{keyword} and the content of the status line in @deftypefun gpg_error_t assuan_inquire (@w{assuan_context_t @var{ctx}}, @w{const char *@var{keyword}}, @w{unsigned char **@var{r_buffer}}, @w{size_t *@var{r_length}}, @w{size_t @var{maxlen}}) -A server may use this function to inquire data from a client. It sends -an @code{INQUIRE} command back to the server and returns the response -conveniently in a newly allocated buffer. You need to pass at least the -server's context @var{ctx} and the @var{keyword} describing the -requested data. All other parameters may be @code{NULL} or @code{0}, -although this is rarely useful. +A server may use this function to request specific data from a client. +This function sends an 'INQUIRE' command back to the client and +returns the client's response in a newly allocated buffer. You need +to pass at least the server's context (@var{ctx}) and a description of +the required data (@var{keyword}). All other parameters may be + at code{NULL} or @code{0}, but this is rarely useful. On success the result is stored in a newly allocated buffer stored at @var{r_buffer}. The length of the data is stored at @var{r_length}. ----------------------------------------------------------------------- Summary of changes: doc/assuan.texi | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) hooks/post-receive -- IPC library used by GnuPG http://git.gnupg.org From cvs at cvs.gnupg.org Mon Jun 1 18:32:40 2015 From: cvs at cvs.gnupg.org (by Werner Koch) Date: Mon, 01 Jun 2015 18:32:40 +0200 Subject: [git] Pinentry - branch, master, updated. pinentry-0.9.3-1-gec2bee5 Message-ID: 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 standard pinentry collection". The branch, master has been updated via ec2bee55f9d533db4ad4357f18ee8cb6b7f29758 (commit) via 9f98bbfa7f05f1c7e02443bc8d0bd74a61eb39bc (commit) from eab03a469d82018e53380f26390594f47bb4c5c8 (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 ec2bee55f9d533db4ad4357f18ee8cb6b7f29758 Author: Werner Koch Date: Mon Jun 1 18:30:38 2015 +0200 Post release updates -- diff --git a/NEWS b/NEWS index 7e000c0..95caa4c 100644 --- a/NEWS +++ b/NEWS @@ -1,3 +1,7 @@ +Noteworthy changes in version 0.9.4 (unreleased) +------------------------------------------------ + + Noteworthy changes in version 0.9.3 (2015-06-01) ------------------------------------------------ diff --git a/configure.ac b/configure.ac index 9948d1f..a66f830 100644 --- a/configure.ac +++ b/configure.ac @@ -26,7 +26,7 @@ min_automake_version="1.14" # (git tag -s pinentry-n.m.k) and run "./autogen.sh --force". Please # bump the version number immediately after the release, do another # commit, and a push so that the git magic is able to work. -m4_define(mym4_version, [0.9.3]) +m4_define(mym4_version, [0.9.4]) # Below is m4 magic to extract and compute the git revision number, # the decimalized short revision number, a beta version string and a commit 9f98bbfa7f05f1c7e02443bc8d0bd74a61eb39bc Author: Werner Koch Date: Mon Jun 1 18:13:58 2015 +0200 Release 0.9.3 diff --git a/NEWS b/NEWS index a7e1613..7e000c0 100644 --- a/NEWS +++ b/NEWS @@ -1,6 +1,21 @@ -Noteworthy changes in version 0.9.3 (unreleased) +Noteworthy changes in version 0.9.3 (2015-06-01) ------------------------------------------------ + * Improved documentation + + * New pinentry-gnome3 + + * More improvements for pinentry-tty. + + * Fixes for pinentry-curses including support for Ctrl-W, Ctrl-U, + Ctrl-H, Ctrl-L, and Alt-Backspace + + * New Assuan command to request clearing an external cache. + + * Fixed problems linking to ncursesw. + + * All kind of other minor fixes. + Noteworthy changes in version 0.9.2 (2015-05-11) ------------------------------------------------ ----------------------------------------------------------------------- Summary of changes: NEWS | 21 ++++++++++++++++++++- configure.ac | 2 +- 2 files changed, 21 insertions(+), 2 deletions(-) hooks/post-receive -- The standard pinentry collection http://git.gnupg.org From cvs at cvs.gnupg.org Tue Jun 2 11:38:37 2015 From: cvs at cvs.gnupg.org (by Werner Koch) Date: Tue, 02 Jun 2015 11:38:37 +0200 Subject: [git] Pinentry - branch, master, updated. pinentry-0.9.3-4-gee23924 Message-ID: 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 standard pinentry collection". The branch, master has been updated via ee23924390a45700b35ab37a75278cfeb965b8c8 (commit) via f74e40465f979749af6df5b9ea325324a428a669 (commit) via 87e6811f2d1e72c501d14670ad911245a41c0828 (commit) from ec2bee55f9d533db4ad4357f18ee8cb6b7f29758 (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 ee23924390a45700b35ab37a75278cfeb965b8c8 Author: Werner Koch Date: Tue Jun 2 11:36:36 2015 +0200 Fixed compiler warnings - mostly unused parameter. diff --git a/assuan/assuan-handler.c b/assuan/assuan-handler.c index 947ab9d..aadad21 100644 --- a/assuan/assuan-handler.c +++ b/assuan/assuan-handler.c @@ -1,4 +1,4 @@ -/* assuan-handler.c - dispatch commands +/* assuan-handler.c - dispatch commands * Copyright (C) 2001 Free Software Foundation, Inc. * * This file is part of GnuPG. @@ -32,6 +32,7 @@ static int dummy_handler (ASSUAN_CONTEXT ctx, char *line) { + (void)line; return set_error (ctx, Server_Fault, "no handler registered"); } @@ -39,15 +40,18 @@ dummy_handler (ASSUAN_CONTEXT ctx, char *line) static int std_handler_nop (ASSUAN_CONTEXT ctx, char *line) { + (void)ctx; + (void)line; return 0; /* okay */ } - + static int std_handler_cancel (ASSUAN_CONTEXT ctx, char *line) { + (void)line; if (ctx->cancel_notify_fnc) ctx->cancel_notify_fnc (ctx); - return set_error (ctx, Not_Implemented, NULL); + return set_error (ctx, Not_Implemented, NULL); } static int @@ -96,37 +100,41 @@ std_handler_option (ASSUAN_CONTEXT ctx, char *line) return ctx->option_handler_fnc (ctx, key, value); return 0; } - + static int std_handler_bye (ASSUAN_CONTEXT ctx, char *line) { + (void)line; if (ctx->bye_notify_fnc) ctx->bye_notify_fnc (ctx); assuan_close_input_fd (ctx); assuan_close_output_fd (ctx); return -1; /* pretty simple :-) */ } - + static int std_handler_auth (ASSUAN_CONTEXT ctx, char *line) { - return set_error (ctx, Not_Implemented, NULL); + (void)line; + return set_error (ctx, Not_Implemented, NULL); } - + static int std_handler_reset (ASSUAN_CONTEXT ctx, char *line) { + (void)line; if (ctx->reset_notify_fnc) ctx->reset_notify_fnc (ctx); assuan_close_input_fd (ctx); assuan_close_output_fd (ctx); return 0; } - + static int std_handler_end (ASSUAN_CONTEXT ctx, char *line) { - return set_error (ctx, Not_Implemented, NULL); + (void)line; + return set_error (ctx, Not_Implemented, NULL); } static int @@ -182,7 +190,7 @@ std_handler_output (ASSUAN_CONTEXT ctx, char *line) - + /* This is a table with the standard commands and handler for them. The table is used to initialize a new context and assuciate strings @@ -214,13 +222,13 @@ static struct { * @cmd_id: An ID value for the command * @cmd_name: A string with the command name * @handler: The handler function to be called - * + * * Register a handler to be used for a given command. - * + * * The @cmd_name must be %NULL or an empty string for all @cmd_ids * below %ASSUAN_CMD_USER because predefined values are used. - * - * Return value: + * + * Return value: **/ int assuan_register_command (ASSUAN_CONTEXT ctx, @@ -233,7 +241,7 @@ assuan_register_command (ASSUAN_CONTEXT ctx, cmd_name = NULL; if (cmd_id < ASSUAN_CMD_USER) - { + { if (cmd_name) return ASSUAN_Invalid_Value; /* must be NULL for these values*/ @@ -250,7 +258,7 @@ assuan_register_command (ASSUAN_CONTEXT ctx, if (!std_cmd_table[i].name) return ASSUAN_Invalid_Value; /* not a pre-registered one */ } - + if (!handler) handler = dummy_handler; @@ -359,7 +367,7 @@ _assuan_register_std_commands (ASSUAN_CONTEXT ctx) if (rc) return rc; } - } + } return 0; } @@ -370,6 +378,8 @@ _assuan_register_std_commands (ASSUAN_CONTEXT ctx) static int handle_data_line (ASSUAN_CONTEXT ctx, char *line, int linelen) { + (void)line; + (void)linelen; return set_error (ctx, Not_Implemented, NULL); } @@ -391,7 +401,7 @@ my_strcasecmp (const char *a, const char *b) /* Parse the line, break out the command, find it in the command table, remove leading and white spaces from the arguments, all the handler with the argument line and return the error */ -static int +static int dispatch_command (ASSUAN_CONTEXT ctx, char *line, int linelen) { char *p; @@ -404,8 +414,8 @@ dispatch_command (ASSUAN_CONTEXT ctx, char *line, int linelen) for (p=line; *p && *p != ' ' && *p != '\t'; p++) ; if (p==line) - return set_error (ctx, Syntax_Error, "leading white-space"); - if (*p) + return set_error (ctx, Syntax_Error, "leading white-space"); + if (*p) { /* Skip over leading WS after the keyword */ *p++ = 0; while ( *p == ' ' || *p == '\t') @@ -476,11 +486,11 @@ process_request (ASSUAN_CONTEXT ctx) rc = assuan_write_line (ctx, ctx->okay_line? ctx->okay_line : "OK"); } else if (rc == -1) - { /* No error checking because the peer may have already disconnect */ + { /* No error checking because the peer may have already disconnect */ assuan_write_line (ctx, "OK closing connection"); ctx->finish_handler (ctx); } - else + else { char errline[256]; @@ -509,11 +519,11 @@ process_request (ASSUAN_CONTEXT ctx) /** * assuan_process: * @ctx: assuan context - * + * * This fucntion is used to handle the assuan protocol after a * connection has been established using assuan_accept(). This is the * main protocol handler. - * + * * Return value: 0 on success or an error code if the assuan operation * failed. Note, that no error is returned for operational errors. **/ @@ -536,15 +546,15 @@ assuan_process (ASSUAN_CONTEXT ctx) /** * assuan_process_next: * @ctx: Assuan context - * + * * Same as assuan_process() but the user has to provide the outer * loop. He should loop as long as the return code is zero and stop * otherwise; -1 is regular end. - * + * * See also: assuan_get_active_fds() * Return value: -1 for end of server, 0 on success or an error code **/ -int +int assuan_process_next (ASSUAN_CONTEXT ctx) { return process_request (ctx); @@ -557,18 +567,18 @@ assuan_process_next (ASSUAN_CONTEXT ctx) * @what: 0 for read fds, 1 for write fds * @fdarray: Caller supplied array to store the FDs * @fdarraysize: size of that array - * + * * Return all active filedescriptors for the given context. This * function can be used to select on the fds and call * assuan_process_next() if there is an active one. The first fd in * the array is the one used for the command connection. * * Note, that write FDs are not yet supported. - * + * * Return value: number of FDs active and put into @fdarray or -1 on * error which is most likely a too small fdarray. **/ -int +int assuan_get_active_fds (ASSUAN_CONTEXT ctx, int what, int *fdarray, int fdarraysize) { diff --git a/assuan/assuan-pipe-server.c b/assuan/assuan-pipe-server.c index 07373e1..c0d464f 100644 --- a/assuan/assuan-pipe-server.c +++ b/assuan/assuan-pipe-server.c @@ -1,4 +1,4 @@ -/* assuan-pipe-server.c - Assuan server working over a pipe +/* assuan-pipe-server.c - Assuan server working over a pipe * Copyright (C) 2001 Free Software Foundation, Inc. * * This file is part of GnuPG. @@ -27,12 +27,14 @@ static void deinit_pipe_server (ASSUAN_CONTEXT ctx) { + (void)ctx; /* nothing to do for this simple server */ } static int accept_connection (ASSUAN_CONTEXT ctx) { + (void)ctx; /* This is a NOP for a pipe server */ return 0; } @@ -40,6 +42,7 @@ accept_connection (ASSUAN_CONTEXT ctx) static int finish_connection (ASSUAN_CONTEXT ctx) { + (void)ctx; /* This is a NOP for a pipe server */ return 0; } diff --git a/configure.ac b/configure.ac index 88bc00b..c453e45 100644 --- a/configure.ac +++ b/configure.ac @@ -169,7 +169,7 @@ if test "$GCC" = yes; then CFLAGS=$_gcc_cflags_save; fi if test x"$_gcc_warn" = xyes ; then - CFLAGS="$CFLAGS -W -Wno-missing-field-initializers" + CFLAGS="$CFLAGS -W -Wno-sign-compare -Wno-missing-field-initializers" fi AC_MSG_CHECKING([if gcc supports -Wdeclaration-after-statement]) diff --git a/gtk+-2/gtksecentry.c b/gtk+-2/gtksecentry.c index 10f41c3..112d7c2 100644 --- a/gtk+-2/gtksecentry.c +++ b/gtk+-2/gtksecentry.c @@ -1350,6 +1350,8 @@ gtk_secure_entry_focus_in(GtkWidget * widget, GdkEventFocus * event) { GtkSecureEntry *entry = GTK_SECURE_ENTRY(widget); + (void)event; + gtk_widget_queue_draw(widget); entry->need_im_reset = TRUE; @@ -1370,6 +1372,8 @@ gtk_secure_entry_focus_out(GtkWidget * widget, GdkEventFocus * event) { GtkSecureEntry *entry = GTK_SECURE_ENTRY(widget); + (void)event; + gtk_widget_queue_draw(widget); entry->need_im_reset = TRUE; @@ -1423,6 +1427,8 @@ gtk_secure_entry_state_changed(GtkWidget * widget, { GtkSecureEntry *entry = GTK_SECURE_ENTRY(widget); + (void)previous_state; + if (GTK_WIDGET_REALIZED(widget)) { gdk_window_set_background(widget->window, &widget->style-> @@ -1444,6 +1450,8 @@ gtk_secure_entry_state_changed(GtkWidget * widget, static void gtk_secure_entry_screen_changed(GtkWidget * widget, GdkScreen * old_screen) { + (void)old_screen; + gtk_secure_entry_recompute(GTK_SECURE_ENTRY(widget)); } @@ -1575,6 +1583,8 @@ gtk_secure_entry_style_set(GtkWidget * widget, GtkStyle * previous_style) static void gtk_cell_editable_secure_entry_activated(GtkSecureEntry * entry, gpointer data) { + (void)data; + gtk_cell_editable_editing_done(GTK_CELL_EDITABLE(entry)); gtk_cell_editable_remove_widget(GTK_CELL_EDITABLE(entry)); } @@ -1583,6 +1593,8 @@ static gboolean gtk_cell_editable_key_press_event(GtkSecureEntry * entry, GdkEventKey * key_event, gpointer data) { + (void)data; + if (key_event->keyval == GDK_Escape) { entry->editing_canceled = TRUE; gtk_cell_editable_editing_done(GTK_CELL_EDITABLE(entry)); @@ -1606,6 +1618,8 @@ static void gtk_secure_entry_start_editing(GtkCellEditable * cell_editable, GdkEvent * event) { + (void)event; + GTK_SECURE_ENTRY(cell_editable)->is_cell_renderer = TRUE; g_signal_connect(cell_editable, "activate", @@ -1950,6 +1964,8 @@ paste_received (GtkClipboard *clipboard, GtkSecureEntry *entry = GTK_SECURE_ENTRY (data); GtkEditable *editable = GTK_EDITABLE (entry); + (void)clipboard; + if (entry->button == 2) { gint pos, start, end; @@ -2043,7 +2059,9 @@ static void gtk_secure_entry_keymap_direction_changed(GdkKeymap * keymap, GtkSecureEntry * entry) { - gtk_secure_entry_recompute(entry); + (void)keymap; + + gtk_secure_entry_recompute(entry); } /* IM Context Callbacks @@ -2053,7 +2071,9 @@ static void gtk_secure_entry_commit_cb(GtkIMContext * context, const gchar * str, GtkSecureEntry * entry) { - gtk_secure_entry_enter_text(entry, str); + (void)context; + + gtk_secure_entry_enter_text(entry, str); } static void @@ -2063,6 +2083,8 @@ gtk_secure_entry_preedit_changed_cb(GtkIMContext * context, gchar *preedit_string; gint cursor_pos; + (void)context; + gtk_im_context_get_preedit_string(entry->im_context, &preedit_string, NULL, &cursor_pos); entry->preedit_length = strlen(preedit_string); @@ -2094,6 +2116,8 @@ gtk_secure_entry_delete_surrounding_cb(GtkIMContext * slave, gint n_chars, GtkSecureEntry * entry) { + (void)slave; + gtk_editable_delete_text(GTK_EDITABLE(entry), entry->current_pos + offset, entry->current_pos + offset + n_chars); @@ -3287,6 +3311,8 @@ static gboolean gtk_secure_entry_mnemonic_activate(GtkWidget * widget, gboolean group_cycling) { + (void)group_cycling; + gtk_widget_grab_focus(widget); return TRUE; } @@ -3476,6 +3502,9 @@ _gtk_marshal_VOID__ENUM_INT_BOOLEAN(GClosure * closure, register GCClosure *cc = (GCClosure *) closure; register gpointer data1, data2; + (void)return_value; + (void)invocation_hint; + g_return_if_fail(n_param_values == 4); if (G_CCLOSURE_SWAP_DATA(closure)) { @@ -3511,6 +3540,9 @@ _gtk_marshal_VOID__ENUM_INT(GClosure * closure, register GCClosure *cc = (GCClosure *) closure; register gpointer data1, data2; + (void)return_value; + (void)invocation_hint; + g_return_if_fail(n_param_values == 3); if (G_CCLOSURE_SWAP_DATA(closure)) { diff --git a/gtk+-2/pinentry-gtk-2.c b/gtk+-2/pinentry-gtk-2.c index 1a88e5a..1666698 100644 --- a/gtk+-2/pinentry-gtk-2.c +++ b/gtk+-2/pinentry-gtk-2.c @@ -93,6 +93,8 @@ constrain_size (GtkWidget *win, GtkRequisition *req, gpointer data) static gint width, height; GdkGeometry geo; + (void)data; + if (req->width == width && req->height == height) return; width = req->width; @@ -126,6 +128,9 @@ make_transient (GtkWidget *win, GdkEvent *event, gpointer data) GdkScreen *screen; GdkWindow *root; + (void)event; + (void)data; + if (! pinentry->grab) return; @@ -140,6 +145,8 @@ make_transient (GtkWidget *win, GdkEvent *event, gpointer data) static int grab_keyboard (GtkWidget *win, GdkEvent *event, gpointer data) { + (void)data; + if (! pinentry->grab) return FALSE; @@ -157,6 +164,8 @@ grab_keyboard (GtkWidget *win, GdkEvent *event, gpointer data) static int ungrab_keyboard (GtkWidget *win, GdkEvent *event, gpointer data) { + (void)data; + gdk_keyboard_ungrab (gdk_event_get_time (event)); /* Unmake window transient for the root window. */ /* gdk_window_set_transient_for cannot be used with parent = NULL to @@ -171,6 +180,10 @@ ungrab_keyboard (GtkWidget *win, GdkEvent *event, gpointer data) static int delete_event (GtkWidget *widget, GdkEvent *event, gpointer data) { + (void)widget; + (void)event; + (void)data; + pinentry->close_button = 1; gtk_main_quit (); return TRUE; @@ -180,6 +193,8 @@ delete_event (GtkWidget *widget, GdkEvent *event, gpointer data) static void button_clicked (GtkWidget *widget, gpointer data) { + (void)widget; + if (data) { const char *s, *s2; @@ -218,6 +233,8 @@ button_clicked (GtkWidget *widget, gpointer data) static void enter_callback (GtkWidget *widget, GtkWidget *anentry) { + (void)anentry; + button_clicked (widget, (gpointer) CONFIRM_OK); } @@ -225,6 +242,8 @@ enter_callback (GtkWidget *widget, GtkWidget *anentry) static void confirm_button_clicked (GtkWidget *widget, gpointer data) { + (void)widget; + confirm_value = (confirm_value_t) data; gtk_main_quit (); } @@ -236,6 +255,10 @@ cancel_callback (GtkAccelGroup *acc, GObject *accelerable, { int confirm_mode = !!data; + (void)acc; + (void)keyval; + (void)modifier; + if (confirm_mode) confirm_button_clicked (GTK_WIDGET (accelerable), (gpointer)CONFIRM_CANCEL); diff --git a/pinentry/pinentry.c b/pinentry/pinentry.c index 9a6a090..a0737ad 100644 --- a/pinentry/pinentry.c +++ b/pinentry/pinentry.c @@ -168,8 +168,11 @@ pinentry_reset (int use_defaults) static void pinentry_assuan_reset_handler (ASSUAN_CONTEXT ctx) { + (void)ctx; pinentry_reset (0); } + + static int lc_ctype_unknown_warning = 0; @@ -514,8 +517,9 @@ pinentry_init (const char *pgmname) drop_privs (); if (atexit (secmem_term)) - /* FIXME: Could not register at-exit function, bail out. */ - ; + { + /* FIXME: Could not register at-exit function, bail out. */ + } assuan_set_malloc_hooks (secmem_malloc, secmem_realloc, secmem_free); } @@ -754,6 +758,8 @@ pinentry_parse_opts (int argc, char *argv[]) static int option_handler (ASSUAN_CONTEXT ctx, const char *key, const char *value) { + (void)ctx; + if (!strcmp (key, "no-grab") && !*value) pinentry.grab = 0; else if (!strcmp (key, "grab") && !*value) @@ -879,8 +885,10 @@ static int cmd_setdesc (ASSUAN_CONTEXT ctx, char *line) { char *newd; - newd = malloc (strlen (line) + 1); + (void)ctx; + + newd = malloc (strlen (line) + 1); if (!newd) return ASSUAN_Out_Of_Core; @@ -896,8 +904,10 @@ static int cmd_setprompt (ASSUAN_CONTEXT ctx, char *line) { char *newp; - newp = malloc (strlen (line) + 1); + (void)ctx; + + newp = malloc (strlen (line) + 1); if (!newp) return ASSUAN_Out_Of_Core; @@ -916,6 +926,8 @@ cmd_setprompt (ASSUAN_CONTEXT ctx, char *line) static int cmd_setkeyinfo (ASSUAN_CONTEXT ctx, char *line) { + (void)ctx; + if (pinentry.keyinfo) free (pinentry.keyinfo); @@ -933,6 +945,8 @@ cmd_setrepeat (ASSUAN_CONTEXT ctx, char *line) { char *p; + (void)ctx; + p = malloc (strlen (line) + 1); if (!p) return ASSUAN_Out_Of_Core; @@ -949,6 +963,8 @@ cmd_setrepeaterror (ASSUAN_CONTEXT ctx, char *line) { char *p; + (void)ctx; + p = malloc (strlen (line) + 1); if (!p) return ASSUAN_Out_Of_Core; @@ -964,8 +980,10 @@ static int cmd_seterror (ASSUAN_CONTEXT ctx, char *line) { char *newe; - newe = malloc (strlen (line) + 1); + (void)ctx; + + newe = malloc (strlen (line) + 1); if (!newe) return ASSUAN_Out_Of_Core; @@ -981,8 +999,10 @@ static int cmd_setok (ASSUAN_CONTEXT ctx, char *line) { char *newo; - newo = malloc (strlen (line) + 1); + (void)ctx; + + newo = malloc (strlen (line) + 1); if (!newo) return ASSUAN_Out_Of_Core; @@ -998,8 +1018,10 @@ static int cmd_setnotok (ASSUAN_CONTEXT ctx, char *line) { char *newo; - newo = malloc (strlen (line) + 1); + (void)ctx; + + newo = malloc (strlen (line) + 1); if (!newo) return ASSUAN_Out_Of_Core; @@ -1015,8 +1037,10 @@ static int cmd_setcancel (ASSUAN_CONTEXT ctx, char *line) { char *newc; - newc = malloc (strlen (line) + 1); + (void)ctx; + + newc = malloc (strlen (line) + 1); if (!newc) return ASSUAN_Out_Of_Core; @@ -1031,18 +1055,22 @@ cmd_setcancel (ASSUAN_CONTEXT ctx, char *line) static int cmd_settimeout (ASSUAN_CONTEXT ctx, char *line) { - if (line && *line) - pinentry.timeout = atoi(line); + (void)ctx; - return 0; + if (line && *line) + pinentry.timeout = atoi (line); + + return 0; } static int cmd_settitle (ASSUAN_CONTEXT ctx, char *line) { char *newt; - newt = malloc (strlen (line) + 1); + (void)ctx; + + newt = malloc (strlen (line) + 1); if (!newt) return ASSUAN_Out_Of_Core; @@ -1058,6 +1086,8 @@ cmd_setqualitybar (ASSUAN_CONTEXT ctx, char *line) { char *newval; + (void)ctx; + if (!*line) line = "Quality:"; @@ -1078,6 +1108,8 @@ cmd_setqualitybar_tt (ASSUAN_CONTEXT ctx, char *line) { char *newval; + (void)ctx; + if (*line) { newval = malloc (strlen (line) + 1); @@ -1102,6 +1134,8 @@ cmd_getpin (ASSUAN_CONTEXT ctx, char *line) int set_prompt = 0; int just_read_password_from_cache = 0; + (void)line; + pinentry_setbuffer_init (&pinentry); if (!pinentry.pin) return ASSUAN_Out_Of_Core; @@ -1268,6 +1302,8 @@ cmd_confirm (ASSUAN_CONTEXT ctx, char *line) static int cmd_message (ASSUAN_CONTEXT ctx, char *line) { + (void)line; + return cmd_confirm (ctx, "--one-button"); } @@ -1309,6 +1345,8 @@ cmd_getinfo (assuan_context_t ctx, char *line) static int cmd_clear_passphrase (ASSUAN_CONTEXT ctx, char *line) { + (void)ctx; + if (! line) return ASSUAN_Invalid_Value; diff --git a/qt4/secstring.cpp b/qt4/secstring.cpp index c8b9276..42207be 100644 --- a/qt4/secstring.cpp +++ b/qt4/secstring.cpp @@ -1,20 +1,20 @@ -/* +/* secstring.h - typedefs and conversion for secmem-backed std::strings. Copyright (C) 2008 Klar?lvdalens Datakonsult AB (KDAB) Written by Marc Mutz . - + This program 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 2 of the License, or (at your option) any later version. - + This program 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, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. @@ -68,7 +68,7 @@ secstring toUtf8( const secqstring & str ) if (const int l = str.size()) { int rlen = l*3+1; ba.reserve(rlen); - uchar *cursor = (uchar*)ba.data(); + /*uchar *cursor = (uchar*)ba.data();*/ const QChar *ch = str.data(); for (int i=0; i < l; i++) { uint u = ch->unicode(); commit f74e40465f979749af6df5b9ea325324a428a669 Author: Werner Koch Date: Tue Jun 2 11:19:57 2015 +0200 Add more GCC warnings flags. * configure.ac: Add GCC specific -W flags. -- Note that --enable-maintainer-mode is required to see all warnings. diff --git a/configure.ac b/configure.ac index a66f830..88bc00b 100644 --- a/configure.ac +++ b/configure.ac @@ -144,17 +144,73 @@ AM_CONDITIONAL(HAVE_W32CE_SYSTEM, test "$have_w32ce_system" = yes) dnl Checks for compiler features. if test "$GCC" = yes; then - CFLAGS="$CFLAGS -Wall -Wcast-align -Wshadow -Wstrict-prototypes" + # Check whether gcc does not emit a diagnositc for unknown -Wno-* + # options. This is the case for gcc >= 4.6 + AC_MSG_CHECKING([if gcc ignores unknown -Wno-* options]) + AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ +#if __GNUC__ < 4 || (__GNUC__ == 4 && __GNUC_MINOR__ < 6 ) +#kickerror +#endif]],[])],[_gcc_silent_wno=yes],[_gcc_silent_wno=no]) + AC_MSG_RESULT($_gcc_silent_wno) + + if test "$USE_MAINTAINER_MODE" = "yes"; then + CFLAGS="$CFLAGS -Wall -Wcast-align -Wshadow -Wstrict-prototypes" + CFLAGS="$CFLAGS -Wformat -Wno-format-y2k -Wformat-security" + + if test x"$_gcc_silent_wno" = xyes ; then + _gcc_warn=yes + else + AC_MSG_CHECKING([if gcc supports -Wno-missing-field-initializers]) + _gcc_cflags_save=$CFLAGS + CFLAGS="-Wno-missing-field-initializers" + AC_COMPILE_IFELSE([AC_LANG_PROGRAM([],[])], + [_gcc_warn=yes],[_gcc_warn=no]) + AC_MSG_RESULT($_gcc_warn) + CFLAGS=$_gcc_cflags_save; + fi + if test x"$_gcc_warn" = xyes ; then + CFLAGS="$CFLAGS -W -Wno-missing-field-initializers" + fi + + AC_MSG_CHECKING([if gcc supports -Wdeclaration-after-statement]) + _gcc_cflags_save=$CFLAGS + CFLAGS="-Wdeclaration-after-statement" + AC_COMPILE_IFELSE([AC_LANG_PROGRAM([],[])],_gcc_warn=yes,_gcc_warn=no) + AC_MSG_RESULT($_gcc_warn) + CFLAGS=$_gcc_cflags_save; + if test x"$_gcc_warn" = xyes ; then + CFLAGS="$CFLAGS -Wdeclaration-after-statement" + fi + + else + # Not in maintainer mode: Use standard warnings. + CFLAGS="$CFLAGS -Wall" + fi + CPPFLAGS="$CPPFLAGS -Wall" - AC_MSG_CHECKING([if gcc supports -Wno-pointer-sign]) + if test x"$_gcc_silent_wno" = xyes ; then + _gcc_warn=yes + else + AC_MSG_CHECKING([if gcc supports -Wno-pointer-sign]) + _gcc_cflags_save=$CFLAGS + CFLAGS="-Wno-pointer-sign" + AC_COMPILE_IFELSE([AC_LANG_PROGRAM([],[])],[_gcc_warn=yes],[_gcc_warn=no]) + AC_MSG_RESULT($_gcc_warn) + CFLAGS=$_gcc_cflags_save; + fi + if test x"$_gcc_warn" = xyes ; then + CFLAGS="$CFLAGS -Wno-pointer-sign" + fi + + AC_MSG_CHECKING([if gcc supports -Wpointer-arith]) _gcc_cflags_save=$CFLAGS - CFLAGS="-Wno-pointer-sign" - AC_COMPILE_IFELSE([AC_LANG_PROGRAM([],[])],_gcc_psign=yes,_gcc_psign=no) - AC_MSG_RESULT($_gcc_psign) + CFLAGS="-Wpointer-arith" + AC_COMPILE_IFELSE([AC_LANG_PROGRAM([],[])],_gcc_warn=yes,_gcc_warn=no) + AC_MSG_RESULT($_gcc_warn) CFLAGS=$_gcc_cflags_save; - if test x"$_gcc_psign" = xyes ; then - CFLAGS="$CFLAGS -Wno-pointer-sign" + if test x"$_gcc_warn" = xyes ; then + CFLAGS="$CFLAGS -Wpointer-arith" fi fi commit 87e6811f2d1e72c501d14670ad911245a41c0828 Author: Daniel Kahn Gillmor Date: Mon Jun 1 22:52:23 2015 -0400 use g_debug(format, ...) safely * pinentry/password-cache.c (password_cache_clear): use g_debug safely in case error->message is malformed. -- Without this change, with -Werror=format-security, we see: password-cache.c: In function ???password_cache_clear???: password-cache.c:153:7: error: format not a string literal and no format arguments [-Werror=format-security] g_debug(error->message); ^ diff --git a/pinentry/password-cache.c b/pinentry/password-cache.c index 60a9c3a..70b33f4 100644 --- a/pinentry/password-cache.c +++ b/pinentry/password-cache.c @@ -150,7 +150,7 @@ password_cache_clear (const char *keygrip) { printf("Failed to clear password for key %s with secret service: %s\n", keygrip, error->message); - g_debug(error->message); + g_debug("%s", error->message); g_error_free (error); return -1; } ----------------------------------------------------------------------- Summary of changes: assuan/assuan-handler.c | 70 ++++++++++++++++++++++++++------------------- assuan/assuan-pipe-server.c | 5 +++- configure.ac | 70 ++++++++++++++++++++++++++++++++++++++++----- gtk+-2/gtksecentry.c | 36 +++++++++++++++++++++-- gtk+-2/pinentry-gtk-2.c | 23 +++++++++++++++ pinentry/password-cache.c | 2 +- pinentry/pinentry.c | 62 +++++++++++++++++++++++++++++++-------- qt4/secstring.cpp | 10 +++---- 8 files changed, 220 insertions(+), 58 deletions(-) hooks/post-receive -- The standard pinentry collection http://git.gnupg.org From cvs at cvs.gnupg.org Tue Jun 2 17:48:58 2015 From: cvs at cvs.gnupg.org (by Werner Koch) Date: Tue, 02 Jun 2015 17:48:58 +0200 Subject: [git] GnuPG - branch, STABLE-BRANCH-2-0, updated. gnupg-2.0.28-5-g0de9aed Message-ID: 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, STABLE-BRANCH-2-0 has been updated via 0de9aedf3eb73608eb4d1197b80e8cae6a0736a6 (commit) via 8a2134b8d50bd6a98a0a20fac9c2ac645e554e05 (commit) via b2d9d105f717dc6c02ac81b5d987851279c4cd97 (commit) via 9dcf345a845c87e3beea1f757cd93ce229423972 (commit) from 03fb2db9f8d703c6484973ffbee7ff3520333b2c (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 0de9aedf3eb73608eb4d1197b80e8cae6a0736a6 Author: Werner Koch Date: Tue Jun 2 17:46:42 2015 +0200 doc: Replace "conventional encryption" by "symmetric encryption". -- Suggested-by: Daniel Kahn Gillmor diff --git a/doc/DETAILS b/doc/DETAILS index 65974dd..645814a 100644 --- a/doc/DETAILS +++ b/doc/DETAILS @@ -434,9 +434,9 @@ more arguments in future versions. DECRYPTION_OKAY The decryption process succeeded. This means, that either the correct secret key has been used or the correct passphrase - for a conventional encrypted message was given. The program - itself may return an errorcode because it may not be possible to - verify a signature for some reasons. + for a symmetric with passphrase encrypted message was given. + The program itself may return an errorcode because it may not + be possible to verify a signature for some reasons. NO_PUBKEY NO_SECKEY diff --git a/doc/gpg-agent.texi b/doc/gpg-agent.texi index b7b0d4c..9f20704 100644 --- a/doc/gpg-agent.texi +++ b/doc/gpg-agent.texi @@ -1177,7 +1177,7 @@ Replaced by a single @code{@@} @subsection Ask for a passphrase This function is usually used to ask for a passphrase to be used for -conventional encryption, but may also be used by programs which need +symmetric encryption, but may also be used by programs which need special handling of passphrases. This command uses a syntax which helps clients to use the agent with minimum effort. diff --git a/doc/gpg.texi b/doc/gpg.texi index f5ffc04..2808562 100644 --- a/doc/gpg.texi +++ b/doc/gpg.texi @@ -2266,9 +2266,9 @@ to consider (e.g. @option{--symmetric}). @item --s2k-cipher-algo @code{name} @opindex s2k-cipher-algo Use @code{name} as the cipher algorithm used to protect secret keys. -The default cipher is CAST5. This cipher is also used for -conventional encryption if @option{--personal-cipher-preferences} and - at option{--cipher-algo} is not given. +The default cipher is CAST5. This cipher is also used for symmetric +encryption with a passphrase if @option{--personal-cipher-preferences} +and @option{--cipher-algo} is not given. @item --s2k-digest-algo @code{name} @opindex s2k-digest-algo @@ -2281,7 +2281,7 @@ Selects how passphrases are mangled. If @code{n} is 0 a plain passphrase (which is not recommended) will be used, a 1 adds a salt to the passphrase and a 3 (the default) iterates the whole process a number of times (see --s2k-count). Unless @option{--rfc1991} is used, -this mode is also used for conventional encryption. +this mode is also used for symmetric encryption with a passphrase. @item --s2k-count @code{n} @opindex s2k-count commit 8a2134b8d50bd6a98a0a20fac9c2ac645e554e05 Author: Werner Koch Date: Tue Jun 2 17:41:30 2015 +0200 gpg: Consider that gcry_mpi_get_opaque may return NULL. * g10/seckey-cert.c (do_check): Handle a NULL opaque MPI. -- This patch extends b2d9d10 for secret keys. The problem is that we changed the semantics so that opaque MPIs may be NULL with a bit length. This patch is not required in GnuPG 2 because we do not use secret keys there. Signed-off-by: Werner Koch diff --git a/g10/seckey-cert.c b/g10/seckey-cert.c index 9995aa4..ad2f52d 100644 --- a/g10/seckey-cert.c +++ b/g10/seckey-cert.c @@ -40,7 +40,6 @@ do_check( PKT_secret_key *sk, const char *tryagain_text, int mode, int *canceled ) { gpg_error_t err; - byte *buffer; u16 csum=0; int i, res; size_t nbytes; @@ -116,10 +115,13 @@ do_check( PKT_secret_key *sk, const char *tryagain_text, int mode, p = gcry_mpi_get_opaque ( sk->skey[i], &ndatabits ); ndata = (ndatabits+7)/8; - if ( ndata > 1 ) + if ( ndata > 1 && p ) csumc = p[ndata-2] << 8 | p[ndata-1]; data = xmalloc_secure ( ndata ); - gcry_cipher_decrypt ( cipher_hd, data, ndata, p, ndata ); + if (p) + gcry_cipher_decrypt ( cipher_hd, data, ndata, p, ndata ); + else + memset (data, 0, ndata); gcry_mpi_release (sk->skey[i]); sk->skey[i] = NULL ; p = data; @@ -129,7 +131,7 @@ do_check( PKT_secret_key *sk, const char *tryagain_text, int mode, attack */ sk->csum = 0; csum = 1; - if( ndata < 20 ) + if( ndata < 20 ) log_error("not enough bytes for SHA-1 checksum\n"); else { gcry_md_hd_t h; @@ -139,7 +141,7 @@ do_check( PKT_secret_key *sk, const char *tryagain_text, int mode, gcry_md_write (h, data, ndata - 20); gcry_md_final (h); if (!memcmp (gcry_md_read (h, DIGEST_ALGO_SHA1), - data + ndata - 20, 20) ) + data + ndata - 20, 20) ) { /* Digest does match. We have to keep the old style checksum in sk->csum, so that the @@ -147,7 +149,7 @@ do_check( PKT_secret_key *sk, const char *tryagain_text, int mode, This test gets used when we are adding new keys. */ sk->csum = csum = checksum (data, ndata-20); - } + } gcry_md_close (h); } } @@ -197,21 +199,28 @@ do_check( PKT_secret_key *sk, const char *tryagain_text, int mode, assert (gcry_mpi_get_flag (sk->skey[i], GCRYMPI_FLAG_OPAQUE)); p = gcry_mpi_get_opaque (sk->skey[i], &ndatabits); - ndata = (ndatabits+7)/8; - assert (ndata >= 2); - assert (ndata == ((p[0] << 8 | p[1]) + 7)/8 + 2); - buffer = xmalloc_secure (ndata); - gcry_cipher_sync (cipher_hd); - buffer[0] = p[0]; - buffer[1] = p[1]; - gcry_cipher_decrypt (cipher_hd, buffer+2, ndata-2, - p+2, ndata-2); - csum += checksum (buffer, ndata); - gcry_mpi_release (sk->skey[i]); - - err = gcry_mpi_scan( &sk->skey[i], GCRYMPI_FMT_PGP, - buffer, ndata, &ndata ); - xfree (buffer); + if (!p) + err = -1; + else + { + byte *buffer; + + ndata = (ndatabits+7)/8; + assert (ndata >= 2); + assert (ndata == ((p[0] << 8 | p[1]) + 7)/8 + 2); + buffer = xmalloc_secure (ndata); + gcry_cipher_sync (cipher_hd); + buffer[0] = p[0]; + buffer[1] = p[1]; + gcry_cipher_decrypt (cipher_hd, buffer+2, ndata-2, + p+2, ndata-2); + csum += checksum (buffer, ndata); + gcry_mpi_release (sk->skey[i]); + + err = gcry_mpi_scan( &sk->skey[i], GCRYMPI_FMT_PGP, + buffer, ndata, &ndata ); + xfree (buffer); + } if (err) { /* Checksum was okay, but not correctly @@ -346,11 +355,11 @@ protect_secret_key( PKT_secret_key *sk, DEK *dek ) if ( openpgp_cipher_test_algo ( sk->protect.algo ) ) { /* Unsupport protection algorithm. */ - rc = gpg_error (GPG_ERR_CIPHER_ALGO); + rc = gpg_error (GPG_ERR_CIPHER_ALGO); } else { print_cipher_algo_note( sk->protect.algo ); - + if ( openpgp_cipher_open (&cipher_hd, sk->protect.algo, GCRY_CIPHER_MODE_CFB, (GCRY_CIPHER_SECURE @@ -399,10 +408,10 @@ protect_secret_key( PKT_secret_key *sk, DEK *dek ) p += narr[j]; xfree(bufarr[j]); } - + if (opt.simple_sk_checksum) { log_info (_("generating the deprecated 16-bit checksum" - " for secret key protection\n")); + " for secret key protection\n")); csum = checksum( data, ndata-2); sk->csum = csum; *p++ = csum >> 8; @@ -458,7 +467,7 @@ protect_secret_key( PKT_secret_key *sk, DEK *dek ) gcry_cipher_encrypt (cipher_hd, data+2, nbytes, buffer, nbytes); xfree( buffer ); - + gcry_mpi_release (sk->skey[i]); sk->skey[i] = gcry_mpi_set_opaque (NULL, data, (nbytes+2)*8 ); commit b2d9d105f717dc6c02ac81b5d987851279c4cd97 Author: Daniel Kahn Gillmor Date: Sat Feb 21 18:23:44 2015 -0500 gpg: Fix segv due to NULL value stored as opaque MPI (BRANCH 2.0) * g10/build-packet.c (do_secret_key): Check for NULL return from gcry_mpi_get_opaque. * g10/keyid.c (hash_public_key): Ditto. -- This is a backport of 76c8122adfed0f0f443cce7bda702ba2b39661b3 from master to the STABLE-BRANCH-2-0 On the STABLE-BRANCH-2-0, we may also want to patch g10/seckey-cert.c, but that has not been done in this patch. This fix extends commmit 0835d2f44ef62eab51fce6a927908f544e01cf8f. gpg2 --export --no-default-keyring --keyring TESTDATA With TESTDATA being below after unpacking. -----BEGIN PGP ARMORED FILE----- mBMEhdkMmS8BcX8F//8F5voEhQAQmBMEnAAAZwAAo4D/f/8EhQAAAIAEnP8EhQAQ iBMEnP8AAAAABf8jIID///8EhQYQmBMEnIUAEIgTBKT/AAAAAAUAACCA/f//BIUA EJgTBJx/AP8ABPPzBJx/AP8ABPPz =2yE0 -----END PGP ARMORED FILE----- Reported-by: Jodie Cunningham Signed-off-by: Daniel Kahn Gillmor diff --git a/g10/build-packet.c b/g10/build-packet.c index e986987..5cc03cf 100644 --- a/g10/build-packet.c +++ b/g10/build-packet.c @@ -398,7 +398,8 @@ do_secret_key( IOBUF out, int ctb, PKT_secret_key *sk ) assert (gcry_mpi_get_flag (sk->skey[npkey], GCRYMPI_FLAG_OPAQUE)); p = gcry_mpi_get_opaque (sk->skey[npkey], &ndatabits ); - iobuf_write (a, p, (ndatabits+7)/8 ); + if (p) + iobuf_write (a, p, (ndatabits+7)/8 ); } else if ( sk->is_protected ) { @@ -410,7 +411,8 @@ do_secret_key( IOBUF out, int ctb, PKT_secret_key *sk ) assert (gcry_mpi_get_flag (sk->skey[i], GCRYMPI_FLAG_OPAQUE)); p = gcry_mpi_get_opaque (sk->skey[i], &ndatabits); - iobuf_write (a, p, (ndatabits+7)/8); + if (p) + iobuf_write (a, p, (ndatabits+7)/8); } write_16(a, sk->csum ); } diff --git a/g10/keyid.c b/g10/keyid.c index 6af0f48..ef6ee1c 100644 --- a/g10/keyid.c +++ b/g10/keyid.c @@ -115,14 +115,18 @@ hash_public_key( gcry_md_hd_t md, PKT_public_key *pk ) if(npkey==0 && pk->pkey[0] && gcry_mpi_get_flag (pk->pkey[0], GCRYMPI_FLAG_OPAQUE)) { - gcry_md_write (md, pp[0], nn[0]); + if (pp[0]) + gcry_md_write (md, pp[0], nn[0]); } else - for(i=0; i < npkey; i++ ) - { - gcry_md_write ( md, pp[i], nn[i] ); - xfree(pp[i]); - } + { + for(i=0; i < npkey; i++ ) + { + if (pp[i]) + gcry_md_write ( md, pp[i], nn[i] ); + xfree(pp[i]); + } + } } static gcry_md_hd_t commit 9dcf345a845c87e3beea1f757cd93ce229423972 Author: Werner Koch Date: Tue Jun 2 17:20:56 2015 +0200 doc: Typo fix for "Creation-Date". -- Debian-bug-id: 760273 This has already been fixed in master. diff --git a/doc/gpg.texi b/doc/gpg.texi index 06e772e..f5ffc04 100644 --- a/doc/gpg.texi +++ b/doc/gpg.texi @@ -3473,7 +3473,7 @@ sense. Although OpenPGP works with time intervals, GnuPG uses an absolute value internally and thus the last year we can represent is 2105. - at item Ceation-Date: @var{iso-date} + at item Creation-Date: @var{iso-date} Set the creation date of the key as stored in the key information and which is also part of the fingerprint calculation. Either a date like "1986-04-26" or a full timestamp like "19860426T042640" may be used. ----------------------------------------------------------------------- Summary of changes: doc/DETAILS | 6 +++--- doc/gpg-agent.texi | 2 +- doc/gpg.texi | 10 ++++----- g10/build-packet.c | 6 ++++-- g10/keyid.c | 16 ++++++++------ g10/seckey-cert.c | 61 +++++++++++++++++++++++++++++++----------------------- 6 files changed, 58 insertions(+), 43 deletions(-) hooks/post-receive -- The GNU Privacy Guard http://git.gnupg.org From cvs at cvs.gnupg.org Tue Jun 2 17:55:13 2015 From: cvs at cvs.gnupg.org (by Werner Koch) Date: Tue, 02 Jun 2015 17:55:13 +0200 Subject: [git] GnuPG - branch, master, updated. gnupg-2.1.4-11-ga7f7aa7 Message-ID: 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 a7f7aa766fc78414821d8ece52a4fed68e516a0e (commit) from e5c69e87beebe99d362ac721ce4ea6b057a30a99 (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 a7f7aa766fc78414821d8ece52a4fed68e516a0e Author: Werner Koch Date: Tue Jun 2 17:46:42 2015 +0200 doc: Replace "conventional encryption" by "symmetric encryption". -- Suggested-by: Daniel Kahn Gillmor Ported from 2.0. diff --git a/doc/DETAILS b/doc/DETAILS index fd72b88..db01baa 100644 --- a/doc/DETAILS +++ b/doc/DETAILS @@ -463,7 +463,7 @@ pkd:0:1024:B665B1435F4C2 .... FF26ABB: *** DECRYPTION_OKAY The decryption process succeeded. This means, that either the correct secret key has been used or the correct passphrase for a - conventional encrypted message was given. The program itself may + symmetric encrypted message was given. The program itself may return an errorcode because it may not be possible to verify a signature for some reasons. diff --git a/doc/gpg-agent.texi b/doc/gpg-agent.texi index dea462e..eb02c9c 100644 --- a/doc/gpg-agent.texi +++ b/doc/gpg-agent.texi @@ -1273,7 +1273,7 @@ Replaced by a single @code{@@} @subsection Ask for a passphrase This function is usually used to ask for a passphrase to be used for -conventional encryption, but may also be used by programs which need +symmetric encryption, but may also be used by programs which need special handling of passphrases. This command uses a syntax which helps clients to use the agent with minimum effort. diff --git a/doc/gpg.texi b/doc/gpg.texi index 887a624..0d855c9 100644 --- a/doc/gpg.texi +++ b/doc/gpg.texi @@ -2291,9 +2291,10 @@ to consider (e.g. @option{--symmetric}). @item --s2k-cipher-algo @code{name} @opindex s2k-cipher-algo Use @code{name} as the cipher algorithm used to protect secret keys. -The default cipher is @value{DEFSYMENCALGO}. This cipher is also used for -conventional encryption if @option{--personal-cipher-preferences} and - at option{--cipher-algo} is not given. +The default cipher is @value{DEFSYMENCALGO}. This cipher is also used +for symmetric encryption with a passphrase if + at option{--personal-cipher-preferences} and @option{--cipher-algo} is +not given. @item --s2k-digest-algo @code{name} @opindex s2k-digest-algo @@ -2306,7 +2307,7 @@ Selects how passphrases are mangled. If @code{n} is 0 a plain passphrase (which is not recommended) will be used, a 1 adds a salt to the passphrase and a 3 (the default) iterates the whole process a number of times (see --s2k-count). Unless @option{--rfc1991} is used, -this mode is also used for conventional encryption. +this mode is also used for symmetric encryption with a passphrase. @item --s2k-count @code{n} @opindex s2k-count ----------------------------------------------------------------------- Summary of changes: doc/DETAILS | 2 +- doc/gpg-agent.texi | 2 +- doc/gpg.texi | 9 +++++---- 3 files changed, 7 insertions(+), 6 deletions(-) hooks/post-receive -- The GNU Privacy Guard http://git.gnupg.org From cvs at cvs.gnupg.org Thu Jun 4 17:46:52 2015 From: cvs at cvs.gnupg.org (by Daniel Kahn Gillmor) Date: Thu, 04 Jun 2015 17:46:52 +0200 Subject: [git] Pinentry - branch, master, updated. pinentry-0.9.3-5-gc29c565 Message-ID: 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 standard pinentry collection". The branch, master has been updated via c29c5657fd77e212799715c23806a0cb6e1cfd47 (commit) from ee23924390a45700b35ab37a75278cfeb965b8c8 (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 c29c5657fd77e212799715c23806a0cb6e1cfd47 Author: Daniel Kahn Gillmor Date: Wed Jun 3 13:27:26 2015 -0400 Make pinentry_setbufferlen always return the pin buffer. * pinentry/pinentry.c (pinentry_setbufferlen): When the pin buffer is already large enough, return the buffer instead of NULL. -- Signed-Off-By: Daniel Kahn Gillmor Debian-Bug-Id: 787639 diff --git a/pinentry/pinentry.c b/pinentry/pinentry.c index a0737ad..6f7a62c 100644 --- a/pinentry/pinentry.c +++ b/pinentry/pinentry.c @@ -438,7 +438,7 @@ pinentry_setbufferlen (pinentry_t pin, int len) len = 2048; if (len <= pin->pin_len) - return NULL; + return pin->pin; newp = secmem_realloc (pin->pin, len); if (newp) ----------------------------------------------------------------------- Summary of changes: pinentry/pinentry.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) hooks/post-receive -- The standard pinentry collection http://git.gnupg.org From cvs at cvs.gnupg.org Thu Jun 4 18:10:35 2015 From: cvs at cvs.gnupg.org (by Werner Koch) Date: Thu, 04 Jun 2015 18:10:35 +0200 Subject: [git] GnuPG - branch, master, updated. gnupg-2.1.4-15-ga4a1519 Message-ID: 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 a4a15195c2a3729025a3ba3439ac8860083fceeb (commit) via f170240ef735edc481f60e51527cbb5ee1acfd55 (commit) via bf06d04f53296f4b4b73b9360cf1571559bb2295 (commit) via 840f807a908ee90cd784009f69e783e2e8f7a2cd (commit) from a7f7aa766fc78414821d8ece52a4fed68e516a0e (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 a4a15195c2a3729025a3ba3439ac8860083fceeb Author: Werner Koch Date: Thu Jun 4 18:08:26 2015 +0200 gpg: Replace -1 by GPG_ERR_NOT_FOUND in tdbio.c * g10/tdbio.c (lookup_hashtable): Return GPG_ERR_NOT_FOUND. * g10/tdbdump.c (import_ownertrust): Test for GPG_ERR_NOT_FOUND. * g10/trustdb.c (read_trust_record): Ditto. (tdb_get_ownertrust, tdb_get_min_ownertrust): Ditto. (tdb_update_ownertrust, update_min_ownertrust): Ditto. (tdb_clear_ownertrusts, update_validity): Ditto. (tdb_cache_disabled_value): Ditto. Signed-off-by: Werner Koch diff --git a/g10/tdbdump.c b/g10/tdbdump.c index ff90b46..893c982 100644 --- a/g10/tdbdump.c +++ b/g10/tdbdump.c @@ -204,7 +204,7 @@ import_ownertrust( const char *fname ) any = 1; } } - else if( rc == -1 ) { /* not found: insert */ + else if (gpg_err_code (rc) == GPG_ERR_NOT_FOUND) { /* insert */ log_info("inserting ownertrust of %u\n", otrust ); memset (&rec, 0, sizeof rec); rec.recnum = tdbio_new_recnum (); diff --git a/g10/tdbio.c b/g10/tdbio.c index 4c93c96..69b9789 100644 --- a/g10/tdbio.c +++ b/g10/tdbio.c @@ -1245,10 +1245,9 @@ drop_from_hashtable (ulong table, byte *key, int keylen, ulong recnum) * the result in REC. The return value of CMP() should be True if the * record is the desired one. * - * Return: -1 if not found, 0 if found or another error code. - * FIXME: Use GPG_ERR_NOT_FOUND instead of -1. + * Return: 0 if found, GPG_ERR_NOT_FOUND, or another error code. */ -static int +static gpg_error_t lookup_hashtable (ulong table, const byte *key, size_t keylen, int (*cmpfnc)(const void*, const TRUSTREC *), const void *cmpdata, TRUSTREC *rec ) @@ -1271,7 +1270,7 @@ lookup_hashtable (ulong table, const byte *key, size_t keylen, item = rec->r.htbl.item[msb % ITEMS_PER_HTBL_RECORD]; if (!item) - return -1; /* Not found. */ + return gpg_error (GPG_ERR_NOT_FOUND); rc = tdbio_read_record (item, rec, 0); if (rc) @@ -1327,14 +1326,14 @@ lookup_hashtable (ulong table, const byte *key, size_t keylen, } } else - return -1; /* not found */ + return gpg_error (GPG_ERR_NOT_FOUND); } } if ((*cmpfnc)(cmpdata, rec)) return 0; /* really found */ - return -1; /* no: not found */ + return gpg_error (GPG_ERR_NOT_FOUND); /* no: not found */ } @@ -1805,10 +1804,9 @@ cmp_trec_fpr ( const void *fpr, const TRUSTREC *rec ) * Given a 20 byte FINGERPRINT search its trust record and return * that at REC. * - * Return: -1 if not found, 0 if found or another error code. - * FIXME: Use GPG_ERR_NOT_FOUND instead of -1. + * Return: 0 if found, GPG_ERR_NOT_FOUND, or another error code. */ -int +gpg_error_t tdbio_search_trust_byfpr (const byte *fingerprint, TRUSTREC *rec) { int rc; @@ -1824,10 +1822,9 @@ tdbio_search_trust_byfpr (const byte *fingerprint, TRUSTREC *rec) * Given a primary public key object PK search its trust record and * return that at REC. * - * Return: -1 if not found, 0 if found or another error code. - * FIXME: Use GPG_ERR_NOT_FOUND instead of -1. + * Return: 0 if found, GPG_ERR_NOT_FOUND, or another error code. */ -int +gpg_error_t tdbio_search_trust_bypk (PKT_public_key *pk, TRUSTREC *rec) { byte fingerprint[MAX_FINGERPRINT_LEN]; diff --git a/g10/tdbio.h b/g10/tdbio.h index d259518..2e15ffe 100644 --- a/g10/tdbio.h +++ b/g10/tdbio.h @@ -109,8 +109,8 @@ int tdbio_end_transaction(void); int tdbio_cancel_transaction(void); int tdbio_delete_record( ulong recnum ); ulong tdbio_new_recnum(void); -int tdbio_search_trust_byfpr(const byte *fingerprint, TRUSTREC *rec ); -int tdbio_search_trust_bypk(PKT_public_key *pk, TRUSTREC *rec ); +gpg_error_t tdbio_search_trust_byfpr (const byte *fingerprint, TRUSTREC *rec); +gpg_error_t tdbio_search_trust_bypk (PKT_public_key *pk, TRUSTREC *rec); void tdbio_how_to_fix (void); void tdbio_invalid(void); diff --git a/g10/trustdb.c b/g10/trustdb.c index fda8674..1826e98 100644 --- a/g10/trustdb.c +++ b/g10/trustdb.c @@ -598,12 +598,11 @@ read_trust_record (PKT_public_key *pk, TRUSTREC *rec) init_trustdb(); rc = tdbio_search_trust_bypk (pk, rec); - if (rc == -1) - return -1; /* no record yet */ if (rc) { - log_error ("trustdb: searching trust record failed: %s\n", - gpg_strerror (rc)); + if (gpg_err_code (rc) != GPG_ERR_NOT_FOUND) + log_error ("trustdb: searching trust record failed: %s\n", + gpg_strerror (rc)); return rc; } @@ -625,18 +624,18 @@ unsigned int tdb_get_ownertrust ( PKT_public_key *pk) { TRUSTREC rec; - int rc; + gpg_error_t err; if (trustdb_args.no_trustdb && opt.trust_model == TM_ALWAYS) return TRUST_UNKNOWN; - rc = read_trust_record (pk, &rec); - if (rc == -1) + err = read_trust_record (pk, &rec); + if (gpg_err_code (err) == GPG_ERR_NOT_FOUND) return TRUST_UNKNOWN; /* no record yet */ - if (rc) + if (err) { tdbio_invalid (); - return rc; /* actually never reached */ + return TRUST_UNKNOWN; /* actually never reached */ } return rec.r.trust.ownertrust; @@ -647,18 +646,18 @@ unsigned int tdb_get_min_ownertrust (PKT_public_key *pk) { TRUSTREC rec; - int rc; + gpg_error_t err; if (trustdb_args.no_trustdb && opt.trust_model == TM_ALWAYS) return TRUST_UNKNOWN; - rc = read_trust_record (pk, &rec); - if (rc == -1) + err = read_trust_record (pk, &rec); + if (gpg_err_code (err) == GPG_ERR_NOT_FOUND) return TRUST_UNKNOWN; /* no record yet */ - if (rc) + if (err) { tdbio_invalid (); - return rc; /* actually never reached */ + return TRUST_UNKNOWN; /* actually never reached */ } return rec.r.trust.min_ownertrust; @@ -673,13 +672,13 @@ void tdb_update_ownertrust (PKT_public_key *pk, unsigned int new_trust ) { TRUSTREC rec; - int rc; + gpg_error_t err; if (trustdb_args.no_trustdb && opt.trust_model == TM_ALWAYS) return; - rc = read_trust_record (pk, &rec); - if (!rc) + err = read_trust_record (pk, &rec); + if (!err) { if (DBG_TRUST) log_debug ("update ownertrust from %u to %u\n", @@ -692,7 +691,7 @@ tdb_update_ownertrust (PKT_public_key *pk, unsigned int new_trust ) do_sync (); } } - else if (rc == -1) + else if (gpg_err_code (err) == GPG_ERR_NOT_FOUND) { /* no record yet - create a new one */ size_t dummy; @@ -707,7 +706,7 @@ tdb_update_ownertrust (PKT_public_key *pk, unsigned int new_trust ) write_record (&rec); tdb_revalidation_mark (); do_sync (); - rc = 0; + err = 0; } else { @@ -720,21 +719,22 @@ update_min_ownertrust (u32 *kid, unsigned int new_trust ) { PKT_public_key *pk; TRUSTREC rec; - int rc; + gpg_error_t err; if (trustdb_args.no_trustdb && opt.trust_model == TM_ALWAYS) return; pk = xmalloc_clear (sizeof *pk); - rc = get_pubkey (pk, kid); - if (rc) + err = get_pubkey (pk, kid); + if (err) { - log_error(_("public key %s not found: %s\n"),keystr(kid),gpg_strerror (rc)); + log_error (_("public key %s not found: %s\n"), + keystr (kid), gpg_strerror (err)); return; } - rc = read_trust_record (pk, &rec); - if (!rc) + err = read_trust_record (pk, &rec); + if (!err) { if (DBG_TRUST) log_debug ("key %08lX%08lX: update min_ownertrust from %u to %u\n", @@ -749,7 +749,7 @@ update_min_ownertrust (u32 *kid, unsigned int new_trust ) do_sync (); } } - else if (rc == -1) + else if (gpg_err_code (err) == GPG_ERR_NOT_FOUND) { /* no record yet - create a new one */ size_t dummy; @@ -764,7 +764,7 @@ update_min_ownertrust (u32 *kid, unsigned int new_trust ) write_record (&rec); tdb_revalidation_mark (); do_sync (); - rc = 0; + err = 0; } else { @@ -773,21 +773,24 @@ update_min_ownertrust (u32 *kid, unsigned int new_trust ) } -/* Clear the ownertrust and min_ownertrust values. Return true if a - change actually happened. */ +/* + * Clear the ownertrust and min_ownertrust values. + * + * Return: True if a change actually happened. + */ int tdb_clear_ownertrusts (PKT_public_key *pk) { TRUSTREC rec; - int rc; + gpg_error_t err; init_trustdb (); if (trustdb_args.no_trustdb && opt.trust_model == TM_ALWAYS) return 0; - rc = read_trust_record (pk, &rec); - if (!rc) + err = read_trust_record (pk, &rec); + if (!err) { if (DBG_TRUST) { @@ -806,7 +809,7 @@ tdb_clear_ownertrusts (PKT_public_key *pk) return 1; } } - else if (rc != -1) + else if (gpg_err_code (err) != GPG_ERR_NOT_FOUND) { tdbio_invalid (); } @@ -821,22 +824,23 @@ update_validity (PKT_public_key *pk, PKT_user_id *uid, int depth, int validity) { TRUSTREC trec, vrec; - int rc; + gpg_error_t err; ulong recno; namehash_from_uid(uid); - rc = read_trust_record (pk, &trec); - if (rc && rc != -1) + err = read_trust_record (pk, &trec); + if (err && gpg_err_code (err) != GPG_ERR_NOT_FOUND) { tdbio_invalid (); return; } - if (rc == -1) /* no record yet - create a new one */ + if (gpg_err_code (err) == GPG_ERR_NOT_FOUND) { + /* No record yet - create a new one. */ size_t dummy; - rc = 0; + err = 0; memset (&trec, 0, sizeof trec); trec.recnum = tdbio_new_recnum (); trec.rectype = RECTYPE_TRUST; @@ -881,7 +885,7 @@ update_validity (PKT_public_key *pk, PKT_user_id *uid, int tdb_cache_disabled_value (PKT_public_key *pk) { - int rc; + gpg_error_t err; TRUSTREC trec; int disabled = 0; @@ -893,16 +897,19 @@ tdb_cache_disabled_value (PKT_public_key *pk) if (trustdb_args.no_trustdb) return 0; /* No trustdb => not disabled. */ - rc = read_trust_record (pk, &trec); - if (rc && rc != -1) + err = read_trust_record (pk, &trec); + if (err && gpg_err_code (err) != GPG_ERR_NOT_FOUND) { tdbio_invalid (); goto leave; } - if (rc == -1) /* no record found, so assume not disabled */ - goto leave; + if (gpg_err_code (err) == GPG_ERR_NOT_FOUND) + { + /* No record found, so assume not disabled. */ + goto leave; + } - if (trec.r.trust.ownertrust & TRUST_FLAG_DISABLED) + if ((trec.r.trust.ownertrust & TRUST_FLAG_DISABLED)) disabled = 1; /* Cache it for later so we don't need to look at the trustdb every @@ -911,7 +918,7 @@ tdb_cache_disabled_value (PKT_public_key *pk) pk->flags.disabled_valid = 1; leave: - return disabled; + return disabled; } @@ -960,7 +967,7 @@ tdb_get_validity_core (PKT_public_key *pk, PKT_user_id *uid, PKT_public_key *main_pk) { TRUSTREC trec, vrec; - int rc; + gpg_error_t err; ulong recno; unsigned int validity; @@ -983,19 +990,20 @@ tdb_get_validity_core (PKT_public_key *pk, PKT_user_id *uid, goto leave; } - rc = read_trust_record (main_pk, &trec); - if (rc && rc != -1) + err = read_trust_record (main_pk, &trec); + if (err && gpg_err_code (err) != GPG_ERR_NOT_FOUND) { tdbio_invalid (); return 0; } - if (rc == -1) /* no record found */ + if (gpg_err_code (err) == GPG_ERR_NOT_FOUND) { + /* No record found. */ validity = TRUST_UNKNOWN; goto leave; } - /* loop over all user IDs */ + /* Loop over all user IDs */ recno = trec.r.trust.validlist; validity = 0; while (recno) @@ -1057,7 +1065,7 @@ get_validity_counts (PKT_public_key *pk, PKT_user_id *uid) init_trustdb (); - if(read_trust_record (pk, &trec)!=0) + if(read_trust_record (pk, &trec)) return; /* loop over all user IDs */ commit f170240ef735edc481f60e51527cbb5ee1acfd55 Author: Werner Koch Date: Thu Jun 4 17:39:55 2015 +0200 gpg: Cleanup error code path in case of a bad trustdb. * g10/tdbio.c (tdbio_read_record): Fix returning of the error. -- Actually the returned error will anyway be GPG_ERR_TRUSTDB but the old code was not correct. Signed-off-by: Werner Koch diff --git a/g10/tdbio.c b/g10/tdbio.c index b6b5938..4c93c96 100644 --- a/g10/tdbio.c +++ b/g10/tdbio.c @@ -1487,34 +1487,36 @@ tdbio_read_record (ulong recnum, TRUSTREC *rec, int expected) { log_error (_("%s: not a trustdb file\n"), db_name ); err = gpg_error (GPG_ERR_TRUSTDB); - /* FIXME ^ */ } - p += 2; /* skip "gpg" */ - rec->r.ver.version = *p++; - rec->r.ver.marginals = *p++; - rec->r.ver.completes = *p++; - rec->r.ver.cert_depth = *p++; - rec->r.ver.trust_model = *p++; - rec->r.ver.min_cert_level = *p++; - p += 2; - rec->r.ver.created = buf32_to_ulong(p); p += 4; - rec->r.ver.nextcheck = buf32_to_ulong(p); p += 4; - p += 4; - p += 4; - rec->r.ver.firstfree =buf32_to_ulong(p); p += 4; - p += 4; - rec->r.ver.trusthashtbl =buf32_to_ulong(p); p += 4; - if (recnum) - { - log_error( _("%s: version record with recnum %lu\n"), db_name, - (ulong)recnum ); - err = gpg_error (GPG_ERR_TRUSTDB); - } - else if (rec->r.ver.version != 3) + else { - log_error( _("%s: invalid file version %d\n"), db_name, - rec->r.ver.version ); - err = gpg_error (GPG_ERR_TRUSTDB); + p += 2; /* skip "gpg" */ + rec->r.ver.version = *p++; + rec->r.ver.marginals = *p++; + rec->r.ver.completes = *p++; + rec->r.ver.cert_depth = *p++; + rec->r.ver.trust_model = *p++; + rec->r.ver.min_cert_level = *p++; + p += 2; + rec->r.ver.created = buf32_to_ulong(p); p += 4; + rec->r.ver.nextcheck = buf32_to_ulong(p); p += 4; + p += 4; + p += 4; + rec->r.ver.firstfree =buf32_to_ulong(p); p += 4; + p += 4; + rec->r.ver.trusthashtbl =buf32_to_ulong(p); p += 4; + if (recnum) + { + log_error( _("%s: version record with recnum %lu\n"), db_name, + (ulong)recnum ); + err = gpg_error (GPG_ERR_TRUSTDB); + } + else if (rec->r.ver.version != 3) + { + log_error( _("%s: invalid file version %d\n"), db_name, + rec->r.ver.version ); + err = gpg_error (GPG_ERR_TRUSTDB); + } } break; commit bf06d04f53296f4b4b73b9360cf1571559bb2295 Author: Werner Koch Date: Thu Jun 4 17:34:33 2015 +0200 gpg: Fix output in case of a corrupted trustdb. * g10/tdbdump.c (list_trustdb): Add arg FP and change callers to pass es_stdout. * g10/tdbio.c (upd_hashtable): On a corrupted trustdb call list_trustdb only in verbose > 1 mode and let it dump to stderr. Signed-off-by: Werner Koch diff --git a/g10/gpg.c b/g10/gpg.c index 5a8a662..1801c87 100644 --- a/g10/gpg.c +++ b/g10/gpg.c @@ -4167,10 +4167,10 @@ main (int argc, char **argv) #ifndef NO_TRUST_MODELS case aListTrustDB: if( !argc ) - list_trustdb(NULL); + list_trustdb (es_stdout, NULL); else { for( ; argc; argc--, argv++ ) - list_trustdb( *argv ); + list_trustdb (es_stdout, *argv ); } break; diff --git a/g10/tdbdump.c b/g10/tdbdump.c index f9a0473..ff90b46 100644 --- a/g10/tdbdump.c +++ b/g10/tdbdump.c @@ -61,11 +61,11 @@ write_record( TRUSTREC *rec ) } -/**************** - * Dump the entire trustdb or only the entries of one key. +/* + * Dump the entire trustdb to FP or only the entries of one key. */ void -list_trustdb (const char *username) +list_trustdb (estream_t fp, const char *username) { TRUSTREC rec; @@ -78,12 +78,12 @@ list_trustdb (const char *username) ulong recnum; int i; - es_printf ("TrustDB: %s\n", tdbio_get_dbname() ); - for(i=9+strlen(tdbio_get_dbname()); i > 0; i-- ) - es_putc ('-', es_stdout); - es_putc ('\n', es_stdout); - for(recnum=0; !tdbio_read_record( recnum, &rec, 0); recnum++ ) - tdbio_dump_record (&rec, es_stdout); + es_fprintf (fp, "TrustDB: %s\n", tdbio_get_dbname ()); + for (i = 9 + strlen (tdbio_get_dbname()); i > 0; i-- ) + es_fputc ('-', fp); + es_putc ('\n', fp); + for (recnum=0; !tdbio_read_record (recnum, &rec, 0); recnum++) + tdbio_dump_record (&rec, fp); } } diff --git a/g10/tdbio.c b/g10/tdbio.c index 4d65e61..b6b5938 100644 --- a/g10/tdbio.c +++ b/g10/tdbio.c @@ -1132,7 +1132,8 @@ upd_hashtable (ulong table, byte *key, int keylen, ulong newrecnum) { log_error ("hashtbl %lu: %lu/%d points to an invalid record %lu\n", table, hashrec, (msb % ITEMS_PER_HTBL_RECORD), item); - list_trustdb (NULL); /*FIXME: Bad - prints to stdout!!! */ + if (opt.verbose > 1) + list_trustdb (es_stderr, NULL); return GPG_ERR_TRUSTDB; } } diff --git a/g10/trustdb.h b/g10/trustdb.h index f190f72..771a821 100644 --- a/g10/trustdb.h +++ b/g10/trustdb.h @@ -141,7 +141,7 @@ void tdb_update_ownertrust (PKT_public_key *pk, unsigned int new_trust); int tdb_clear_ownertrusts (PKT_public_key *pk); /*-- tdbdump.c --*/ -void list_trustdb(const char *username); +void list_trustdb (estream_t fp, const char *username); void export_ownertrust(void); void import_ownertrust(const char *fname); commit 840f807a908ee90cd784009f69e783e2e8f7a2cd Author: Werner Koch Date: Thu Jun 4 17:25:09 2015 +0200 gpg: Re-indent and improve documentation of g10/tdbio.c -- diff --git a/g10/tdbdump.c b/g10/tdbdump.c index bf9f387..f9a0473 100644 --- a/g10/tdbdump.c +++ b/g10/tdbdump.c @@ -46,8 +46,8 @@ (x) >= 'A' && (x) <= 'F' ? ((x)-'A'+10) : ((x)-'a'+10)) -/**************** - * Wirte a record but die on error +/* + * Write a record; die on error. */ static void write_record( TRUSTREC *rec ) @@ -65,7 +65,7 @@ write_record( TRUSTREC *rec ) * Dump the entire trustdb or only the entries of one key. */ void -list_trustdb( const char *username ) +list_trustdb (const char *username) { TRUSTREC rec; diff --git a/g10/tdbio.c b/g10/tdbio.c index 940165c..4d65e61 100644 --- a/g10/tdbio.c +++ b/g10/tdbio.c @@ -1,5 +1,6 @@ /* tdbio.c - trust database I/O operations * Copyright (C) 1998-2002, 2012 Free Software Foundation, Inc. + * Copyright (C) 1998-2015 Werner Koch * * This file is part of GnuPG. * @@ -56,50 +57,81 @@ #define strerror(a) ("[errno not available]") #endif -/**************** +/* * Yes, this is a very simple implementation. We should really * use a page aligned buffer and read complete pages. * To implement a simple trannsaction system, this is sufficient. */ typedef struct cache_ctrl_struct *CACHE_CTRL; -struct cache_ctrl_struct { - CACHE_CTRL next; - struct { - unsigned used:1; - unsigned dirty:1; - } flags; - ulong recno; - char data[TRUST_RECORD_LEN]; +struct cache_ctrl_struct +{ + CACHE_CTRL next; + struct { + unsigned used:1; + unsigned dirty:1; + } flags; + ulong recno; + char data[TRUST_RECORD_LEN]; }; -#define MAX_CACHE_ENTRIES_SOFT 200 /* may be increased while in a */ -#define MAX_CACHE_ENTRIES_HARD 10000 /* transaction to this one */ +/* Size of the cache. The SOFT value is the general one. While in a + transaction this may not be sufficient and thus we may increase it + then up to the HARD limit. */ +#define MAX_CACHE_ENTRIES_SOFT 200 +#define MAX_CACHE_ENTRIES_HARD 10000 + + +/* The cache is controlled by these variables. */ static CACHE_CTRL cache_list; static int cache_entries; static int cache_is_dirty; -/* a type used to pass infomation to cmp_krec_fpr */ -struct cmp_krec_fpr_struct { - int pubkey_algo; - const char *fpr; - int fprlen; + +/* An object to pass infomation to cmp_krec_fpr. */ +struct cmp_krec_fpr_struct +{ + int pubkey_algo; + const char *fpr; + int fprlen; }; -/* a type used to pass infomation to cmp_[s]dir */ -struct cmp_xdir_struct { - int pubkey_algo; - u32 keyid[2]; +/* An object used to pass infomation to cmp_[s]dir. */ +struct cmp_xdir_struct +{ + int pubkey_algo; + u32 keyid[2]; }; +/* The name of the trustdb file. */ static char *db_name; + +/* The handle for locking the trustdb file and a flag to record + whether a lock has been taken. */ static dotlock_t lockhandle; static int is_locked; + +/* The file descriptor of the trustdb. */ static int db_fd = -1; + +/* A flag indicating that a transaction is active. */ static int in_transaction; -static void open_db(void); + +static void open_db (void); + + + +/* + * Take a lock on the trustdb file name. I a lock file can't be + * created the function terminates the process. Excvept for a + * different return code the function does nothing if the lock has + * already been taken. + * + * Returns: True if lock already exists, False if the lock has + * actually been taken. + */ static int take_write_lock (void) { @@ -120,6 +152,11 @@ take_write_lock (void) return 1; } + +/* + * Release a lock from the trustdb file unless the global option + * --lock-once has been used. + */ static void release_write_lock (void) { @@ -132,193 +169,245 @@ release_write_lock (void) ************* record cache ********** *************************************/ -/**************** - * Get the data from therecord cache and return a - * pointer into that cache. Caller should copy - * the return data. NULL is returned on a cache miss. +/* + * Get the data from the record cache and return a pointer into that + * cache. Caller should copy the returned data. NULL is returned on + * a cache miss. */ static const char * -get_record_from_cache( ulong recno ) +get_record_from_cache (ulong recno) { - CACHE_CTRL r; + CACHE_CTRL r; - for( r = cache_list; r; r = r->next ) { - if( r->flags.used && r->recno == recno ) - return r->data; + for (r = cache_list; r; r = r->next) + { + if (r->flags.used && r->recno == recno) + return r->data; } - return NULL; + return NULL; } +/* + * Write a cached item back to the trustdb file. + * + * Returns: 0 on success or an error code. + */ static int -write_cache_item( CACHE_CTRL r ) +write_cache_item (CACHE_CTRL r) { - gpg_error_t err; - int n; - - if( lseek( db_fd, r->recno * TRUST_RECORD_LEN, SEEK_SET ) == -1 ) { - err = gpg_error_from_syserror (); - log_error(_("trustdb rec %lu: lseek failed: %s\n"), - r->recno, strerror(errno) ); - return err; + gpg_error_t err; + int n; + + if (lseek (db_fd, r->recno * TRUST_RECORD_LEN, SEEK_SET) == -1) + { + err = gpg_error_from_syserror (); + log_error (_("trustdb rec %lu: lseek failed: %s\n"), + r->recno, strerror (errno)); + return err; } - n = write( db_fd, r->data, TRUST_RECORD_LEN); - if( n != TRUST_RECORD_LEN ) { - err = gpg_error_from_syserror (); - log_error(_("trustdb rec %lu: write failed (n=%d): %s\n"), - r->recno, n, strerror(errno) ); - return err; + n = write (db_fd, r->data, TRUST_RECORD_LEN); + if (n != TRUST_RECORD_LEN) + { + err = gpg_error_from_syserror (); + log_error (_("trustdb rec %lu: write failed (n=%d): %s\n"), + r->recno, n, strerror (errno) ); + return err; } - r->flags.dirty = 0; - return 0; + r->flags.dirty = 0; + return 0; } -/**************** - * Put data into the cache. This function may flush the - * some cache entries if there is not enough space available. + +/* + * Put data into the cache. This function may flush + * some cache entries if the cache is filled up. + * + * Returns: 0 on success or an error code. */ int -put_record_into_cache( ulong recno, const char *data ) +put_record_into_cache (ulong recno, const char *data) { - CACHE_CTRL r, unused; - int dirty_count = 0; - int clean_count = 0; - - /* see whether we already cached this one */ - for( unused = NULL, r = cache_list; r; r = r->next ) { - if( !r->flags.used ) { - if( !unused ) - unused = r; + CACHE_CTRL r, unused; + int dirty_count = 0; + int clean_count = 0; + + /* See whether we already cached this one. */ + for (unused = NULL, r = cache_list; r; r = r->next) + { + if (!r->flags.used) + { + if (!unused) + unused = r; } - else if( r->recno == recno ) { - if( !r->flags.dirty ) { - /* Hmmm: should we use a a copy and compare? */ - if( memcmp(r->data, data, TRUST_RECORD_LEN ) ) { - r->flags.dirty = 1; - cache_is_dirty = 1; + else if (r->recno == recno) + { + if (!r->flags.dirty) + { + /* Hmmm: should we use a copy and compare? */ + if (memcmp (r->data, data, TRUST_RECORD_LEN)) + { + r->flags.dirty = 1; + cache_is_dirty = 1; } } - memcpy( r->data, data, TRUST_RECORD_LEN ); - return 0; + memcpy (r->data, data, TRUST_RECORD_LEN); + return 0; } - if( r->flags.used ) { - if( r->flags.dirty ) - dirty_count++; - else - clean_count++; + if (r->flags.used) + { + if (r->flags.dirty) + dirty_count++; + else + clean_count++; } } - /* not in the cache: add a new entry */ - if( unused ) { /* reuse this entry */ - r = unused; - r->flags.used = 1; - r->recno = recno; - memcpy( r->data, data, TRUST_RECORD_LEN ); - r->flags.dirty = 1; - cache_is_dirty = 1; - cache_entries++; - return 0; + + /* Not in the cache: add a new entry. */ + if (unused) + { + /* Reuse this entry. */ + r = unused; + r->flags.used = 1; + r->recno = recno; + memcpy (r->data, data, TRUST_RECORD_LEN); + r->flags.dirty = 1; + cache_is_dirty = 1; + cache_entries++; + return 0; } - /* see whether we reached the limit */ - if( cache_entries < MAX_CACHE_ENTRIES_SOFT ) { /* no */ - r = xmalloc( sizeof *r ); - r->flags.used = 1; - r->recno = recno; - memcpy( r->data, data, TRUST_RECORD_LEN ); - r->flags.dirty = 1; - r->next = cache_list; - cache_list = r; - cache_is_dirty = 1; - cache_entries++; - return 0; + + /* See whether we reached the limit. */ + if (cache_entries < MAX_CACHE_ENTRIES_SOFT) + { + /* No: Put into cache. */ + r = xmalloc (sizeof *r); + r->flags.used = 1; + r->recno = recno; + memcpy (r->data, data, TRUST_RECORD_LEN); + r->flags.dirty = 1; + r->next = cache_list; + cache_list = r; + cache_is_dirty = 1; + cache_entries++; + return 0; } - /* cache is full: discard some clean entries */ - if( clean_count ) { - int n = clean_count / 3; /* discard a third of the clean entries */ - if( !n ) - n = 1; - for( unused = NULL, r = cache_list; r; r = r->next ) { - if( r->flags.used && !r->flags.dirty ) { - if( !unused ) - unused = r; - r->flags.used = 0; - cache_entries--; - if( !--n ) - break; + + /* Cache is full: discard some clean entries. */ + if (clean_count) + { + int n; + + /* We discard a third of the clean entries. */ + n = clean_count / 3; + if (!n) + n = 1; + + for (unused = NULL, r = cache_list; r; r = r->next) + { + if (r->flags.used && !r->flags.dirty) + { + if (!unused) + unused = r; + r->flags.used = 0; + cache_entries--; + if (!--n) + break; } } - assert( unused ); - r = unused; - r->flags.used = 1; - r->recno = recno; - memcpy( r->data, data, TRUST_RECORD_LEN ); - r->flags.dirty = 1; - cache_is_dirty = 1; - cache_entries++; - return 0; + + /* Now put into the cache. */ + assert (unused); + r = unused; + r->flags.used = 1; + r->recno = recno; + memcpy (r->data, data, TRUST_RECORD_LEN); + r->flags.dirty = 1; + cache_is_dirty = 1; + cache_entries++; + return 0; } - /* no clean entries: have to flush some dirty entries */ - if( in_transaction ) { - /* but we can't do this while in a transaction - * we increase the cache size instead */ - if( cache_entries < MAX_CACHE_ENTRIES_HARD ) { /* no */ - if( opt.debug && !(cache_entries % 100) ) - log_debug("increasing tdbio cache size\n"); - r = xmalloc( sizeof *r ); - r->flags.used = 1; - r->recno = recno; - memcpy( r->data, data, TRUST_RECORD_LEN ); - r->flags.dirty = 1; - r->next = cache_list; - cache_list = r; - cache_is_dirty = 1; - cache_entries++; - return 0; + + /* No clean entries: We have to flush some dirty entries. */ + if (in_transaction) + { + /* But we can't do this while in a transaction. Thus we + * increase the cache size instead. */ + if (cache_entries < MAX_CACHE_ENTRIES_HARD) + { + if (opt.debug && !(cache_entries % 100)) + log_debug ("increasing tdbio cache size\n"); + r = xmalloc (sizeof *r); + r->flags.used = 1; + r->recno = recno; + memcpy (r->data, data, TRUST_RECORD_LEN); + r->flags.dirty = 1; + r->next = cache_list; + cache_list = r; + cache_is_dirty = 1; + cache_entries++; + return 0; } - log_info(_("trustdb transaction too large\n")); - return GPG_ERR_RESOURCE_LIMIT; + /* Hard limit for the cache size reached. */ + log_info (_("trustdb transaction too large\n")); + return GPG_ERR_RESOURCE_LIMIT; } - if( dirty_count ) { - int n = dirty_count / 5; /* discard some dirty entries */ - if( !n ) - n = 1; - take_write_lock (); - for( unused = NULL, r = cache_list; r; r = r->next ) { - if( r->flags.used && r->flags.dirty ) { - int rc = write_cache_item( r ); - if( rc ) - return rc; - if( !unused ) - unused = r; - r->flags.used = 0; - cache_entries--; - if( !--n ) - break; + + if (dirty_count) + { + int n; + + /* Discard some dirty entries. */ + n = dirty_count / 5; + if (!n) + n = 1; + + take_write_lock (); + for (unused = NULL, r = cache_list; r; r = r->next) + { + if (r->flags.used && r->flags.dirty) + { + int rc; + + rc = write_cache_item (r); + if (rc) + return rc; + if (!unused) + unused = r; + r->flags.used = 0; + cache_entries--; + if (!--n) + break; } } - release_write_lock (); - assert( unused ); - r = unused; - r->flags.used = 1; - r->recno = recno; - memcpy( r->data, data, TRUST_RECORD_LEN ); - r->flags.dirty = 1; - cache_is_dirty = 1; - cache_entries++; - return 0; + release_write_lock (); + + /* Now put into the cache. */ + assert (unused); + r = unused; + r->flags.used = 1; + r->recno = recno; + memcpy (r->data, data, TRUST_RECORD_LEN); + r->flags.dirty = 1; + cache_is_dirty = 1; + cache_entries++; + return 0; } - BUG(); + + /* We should never reach this. */ + BUG(); } +/* Return true if the cache is dirty. */ int tdbio_is_dirty() { - return cache_is_dirty; + return cache_is_dirty; } -/**************** +/* * Flush the cache. This cannot be used while in a transaction. */ int @@ -352,97 +441,109 @@ tdbio_sync() return 0; } -#if 0 -/* The transaction code is disabled in the 1.2.x branch, as it is not - yet used. It will be enabled in 1.3.x. */ -/**************** +#if 0 /* Not yet used. */ +/* * Simple transactions system: * Everything between begin_transaction and end/cancel_transaction * is not immediatly written but at the time of end_transaction. * + * NOTE: The transaction code is disabled in the 1.2 branch, as it is + * not yet used. */ int -tdbio_begin_transaction() +tdbio_begin_transaction () /* Not yet used. */ { - int rc; + int rc; - if( in_transaction ) - log_bug("tdbio: nested transactions\n"); - /* flush everything out */ - rc = tdbio_sync(); - if( rc ) - return rc; - in_transaction = 1; - return 0; + if (in_transaction) + log_bug ("tdbio: nested transactions\n"); + /* Flush everything out. */ + rc = tdbio_sync(); + if (rc) + return rc; + in_transaction = 1; + return 0; } int -tdbio_end_transaction() +tdbio_end_transaction () /* Not yet used. */ { - int rc; - - if( !in_transaction ) - log_bug("tdbio: no active transaction\n"); - take_write_lock (); - gnupg_block_all_signals(); - in_transaction = 0; - rc = tdbio_sync(); - gnupg_unblock_all_signals(); - release_write_lock (); - return rc; + int rc; + + if (!in_transaction) + log_bug ("tdbio: no active transaction\n"); + take_write_lock (); + gnupg_block_all_signals (); + in_transaction = 0; + rc = tdbio_sync(); + gnupg_unblock_all_signals(); + release_write_lock (); + return rc; } int -tdbio_cancel_transaction() +tdbio_cancel_transaction () /* Not yet used. */ { - CACHE_CTRL r; + CACHE_CTRL r; - if( !in_transaction ) - log_bug("tdbio: no active transaction\n"); + if (!in_transaction) + log_bug ("tdbio: no active transaction\n"); - /* remove all dirty marked entries, so that the original ones - * are read back the next time */ - if( cache_is_dirty ) { - for( r = cache_list; r; r = r->next ) { - if( r->flags.used && r->flags.dirty ) { - r->flags.used = 0; - cache_entries--; + /* Remove all dirty marked entries, so that the original ones are + * read back the next time. */ + if (cache_is_dirty) + { + for (r = cache_list; r; r = r->next) + { + if (r->flags.used && r->flags.dirty) + { + r->flags.used = 0; + cache_entries--; } } - cache_is_dirty = 0; + cache_is_dirty = 0; } - in_transaction = 0; - return 0; + in_transaction = 0; + return 0; } -#endif +#endif /* Not yet used. */ + /******************************************************** **************** cached I/O functions ****************** ********************************************************/ +/* The cleanup handler for this module. */ static void -cleanup(void) +cleanup (void) { - if( is_locked ) { - if( !dotlock_release (lockhandle) ) - is_locked = 0; + if (is_locked) + { + if (!dotlock_release (lockhandle)) + is_locked = 0; } } -/* Caller must sync */ + +/* + * Update an existing trustdb record. The caller must call + * tdbio_sync. + * + * Returns: 0 on success or an error code. + */ int tdbio_update_version_record (void) { TRUSTREC rec; int rc; - memset( &rec, 0, sizeof rec ); + memset (&rec, 0, sizeof rec); - rc=tdbio_read_record( 0, &rec, RECTYPE_VER); - if(rc==0) + rc = tdbio_read_record (0, &rec, RECTYPE_VER); + if (!rc) { rec.r.ver.created = make_timestamp(); rec.r.ver.marginals = opt.marginals_needed; @@ -456,75 +557,97 @@ tdbio_update_version_record (void) return rc; } + +/* + * Create and write the trustdb version record. + * + * Returns: 0 on success or an error code. + */ static int create_version_record (void) { TRUSTREC rec; int rc; - memset( &rec, 0, sizeof rec ); + memset (&rec, 0, sizeof rec); rec.r.ver.version = 3; - rec.r.ver.created = make_timestamp(); + rec.r.ver.created = make_timestamp (); rec.r.ver.marginals = opt.marginals_needed; rec.r.ver.completes = opt.completes_needed; rec.r.ver.cert_depth = opt.max_cert_depth; - if(opt.trust_model==TM_PGP || opt.trust_model==TM_CLASSIC) + if (opt.trust_model == TM_PGP || opt.trust_model == TM_CLASSIC) rec.r.ver.trust_model = opt.trust_model; else rec.r.ver.trust_model = TM_PGP; rec.r.ver.min_cert_level = opt.min_cert_level; rec.rectype = RECTYPE_VER; rec.recnum = 0; - rc = tdbio_write_record( &rec ); - if( !rc ) - tdbio_sync(); + rc = tdbio_write_record (&rec); + if (!rc) + tdbio_sync (); return rc; } - +/* + * Set the file name for the trustdb to NEW_DBNAME and if CREATE is + * true create that file. If NEW_DBNAME is NULL a default name is + * used, if the it does not contain a path component separator ('/') + * the global GnuPG home directory is used. + * + * Returns: 0 on success or an error code. + * + * On the first call this function registers an atexit handler. + * + */ int -tdbio_set_dbname( const char *new_dbname, int create, int *r_nofile) +tdbio_set_dbname (const char *new_dbname, int create, int *r_nofile) { - char *fname; - struct stat statbuf; - static int initialized = 0; + char *fname; + struct stat statbuf; + static int initialized = 0; - if( !initialized ) { - atexit( cleanup ); - initialized = 1; + if (!initialized) + { + atexit (cleanup); + initialized = 1; } - *r_nofile = 0; + *r_nofile = 0; - if(new_dbname==NULL) - fname=make_filename(opt.homedir,"trustdb" EXTSEP_S GPGEXT_GPG, NULL); - else if (*new_dbname != DIRSEP_C ) - { - if (strchr(new_dbname, DIRSEP_C) ) - fname = make_filename (new_dbname, NULL); - else - fname = make_filename (opt.homedir, new_dbname, NULL); - } - else + if (!new_dbname) + { + fname = make_filename (opt.homedir, "trustdb" EXTSEP_S GPGEXT_GPG, NULL); + } + else if (*new_dbname != DIRSEP_C ) + { + if (strchr (new_dbname, DIRSEP_C)) + fname = make_filename (new_dbname, NULL); + else + fname = make_filename (opt.homedir, new_dbname, NULL); + } + else + { fname = xstrdup (new_dbname); + } - xfree (db_name); - db_name = fname; + xfree (db_name); + db_name = fname; - /* - * Quick check for (likely) case where there is trustdb.gpg - * already. This check is not required in theory, but it helps in - * practice, avoiding costly operations of preparing and taking - * the lock. - */ - if (stat (fname, &statbuf) == 0 && statbuf.st_size > 0) + /* Quick check for (likely) case where there already is a + * trustdb.gpg. This check is not required in theory, but it helps + * in practice avoiding costly operations of preparing and taking + * the lock. */ + if (!stat (fname, &statbuf) && statbuf.st_size > 0) + { /* OK, we have the valid trustdb.gpg already. */ return 0; + } - take_write_lock (); + take_write_lock (); - if( access( fname, R_OK ) ) { + if (access (fname, R_OK)) + { #ifdef HAVE_W32CE_SYSTEM /* We know how the cegcc implementation of access works ;-). */ if (GetLastError () == ERROR_FILE_NOT_FOUND) @@ -532,83 +655,93 @@ tdbio_set_dbname( const char *new_dbname, int create, int *r_nofile) else gpg_err_set_errno (EIO); #endif /*HAVE_W32CE_SYSTEM*/ - if( errno != ENOENT ) - log_fatal( _("can't access '%s': %s\n"), fname, strerror(errno) ); - - if (!create) - *r_nofile = 1; - else { - FILE *fp; - TRUSTREC rec; - int rc; - char *p = strrchr( fname, DIRSEP_C ); - mode_t oldmask; - int save_slash; + if (errno != ENOENT) + log_fatal ( _("can't access '%s': %s\n"), fname, strerror (errno)); + + if (!create) + *r_nofile = 1; + else + { + FILE *fp; + TRUSTREC rec; + int rc; + char *p = strrchr (fname, DIRSEP_C); + mode_t oldmask; + int save_slash; #if HAVE_W32_SYSTEM - { - /* Windows may either have a slash or a backslash. Take - care of it. */ - char *pp = strrchr (fname, '/'); - if (!p || pp > p) - p = pp; - } + { + /* Windows may either have a slash or a backslash. Take + care of it. */ + char *pp = strrchr (fname, '/'); + if (!p || pp > p) + p = pp; + } #endif /*HAVE_W32_SYSTEM*/ - assert (p); - save_slash = *p; - *p = 0; - if( access( fname, F_OK ) ) { - try_make_homedir( fname ); - if (access (fname, F_OK )) - log_fatal (_("%s: directory does not exist!\n"), fname); + assert (p); + save_slash = *p; + *p = 0; + if (access (fname, F_OK)) + { + try_make_homedir (fname); + if (access (fname, F_OK)) + log_fatal (_("%s: directory does not exist!\n"), fname); } - *p = save_slash; + *p = save_slash; - oldmask=umask(077); - if (is_secured_filename (fname)) { - fp = NULL; - gpg_err_set_errno (EPERM); + oldmask = umask (077); + if (is_secured_filename (fname)) + { + fp = NULL; + gpg_err_set_errno (EPERM); } - else - fp =fopen( fname, "wb" ); - umask(oldmask); - if( !fp ) - log_fatal (_("can't create '%s': %s\n"), - fname, strerror (errno)); - fclose(fp); - db_fd = open( db_name, O_RDWR | MY_O_BINARY ); - if( db_fd == -1 ) - log_fatal (_("can't open '%s': %s\n"), - db_name, strerror (errno)); - - rc = create_version_record (); - if( rc ) - log_fatal( _("%s: failed to create version record: %s"), - fname, gpg_strerror (rc)); - /* and read again to check that we are okay */ - if( tdbio_read_record( 0, &rec, RECTYPE_VER ) ) - log_fatal( _("%s: invalid trustdb created\n"), db_name ); - - if( !opt.quiet ) - log_info(_("%s: trustdb created\n"), db_name); + else + fp = fopen (fname, "wb"); + umask(oldmask); + if (!fp) + log_fatal (_("can't create '%s': %s\n"), fname, strerror (errno)); + fclose (fp); + + db_fd = open (db_name, O_RDWR | MY_O_BINARY); + if (db_fd == -1) + log_fatal (_("can't open '%s': %s\n"), db_name, strerror (errno)); + + rc = create_version_record (); + if (rc) + log_fatal (_("%s: failed to create version record: %s"), + fname, gpg_strerror (rc)); + + /* Read again to check that we are okay. */ + if (tdbio_read_record (0, &rec, RECTYPE_VER)) + log_fatal (_("%s: invalid trustdb created\n"), db_name); + + if (!opt.quiet) + log_info (_("%s: trustdb created\n"), db_name); } } - release_write_lock (); - return 0; + release_write_lock (); + return 0; } +/* + * Return the full name of the trustdb. + */ const char * -tdbio_get_dbname() +tdbio_get_dbname () { - return db_name; + return db_name; } - +/* + * Open the trustdb. This may only be called if it has not yet been + * opened and after a successful call to tdbio_set_dbname. On return + * the trustdb handle (DB_FD) is guaranteed to be open. + */ static void -open_db() +open_db () { TRUSTREC rec; @@ -653,58 +786,69 @@ open_db() } -/**************** - * Make a hashtable: type 0 = trust hash +/* + * Append a new empty hashtable to the trustdb. TYPE gives the type + * of the hash table. The only defined type is 0 for a trust hash. + * On return the hashtable has been created, written, the version + * record update, and the data flushed to the disk. On a fatal error + * the function terminates the process. */ static void create_hashtable( TRUSTREC *vr, int type ) { - TRUSTREC rec; - off_t offset; - ulong recnum; - int i, n, rc; - - offset = lseek( db_fd, 0, SEEK_END ); - if( offset == -1 ) - log_fatal("trustdb: lseek to end failed: %s\n", strerror(errno) ); - recnum = offset / TRUST_RECORD_LEN; - assert(recnum); /* this is will never be the first record */ - - if( !type ) - vr->r.ver.trusthashtbl = recnum; - - /* Now write the records */ - n = (256+ITEMS_PER_HTBL_RECORD-1) / ITEMS_PER_HTBL_RECORD; - for(i=0; i < n; i++, recnum++ ) { - memset( &rec, 0, sizeof rec ); - rec.rectype = RECTYPE_HTBL; - rec.recnum = recnum; - rc = tdbio_write_record( &rec ); - if( rc ) - log_fatal( _("%s: failed to create hashtable: %s\n"), - db_name, gpg_strerror (rc)); + TRUSTREC rec; + off_t offset; + ulong recnum; + int i, n, rc; + + offset = lseek (db_fd, 0, SEEK_END); + if (offset == -1) + log_fatal ("trustdb: lseek to end failed: %s\n", strerror(errno)); + recnum = offset / TRUST_RECORD_LEN; + assert (recnum); /* This is will never be the first record. */ + + if (!type) + vr->r.ver.trusthashtbl = recnum; + + /* Now write the records making up the hash table. */ + n = (256+ITEMS_PER_HTBL_RECORD-1) / ITEMS_PER_HTBL_RECORD; + for (i=0; i < n; i++, recnum++) + { + memset (&rec, 0, sizeof rec); + rec.rectype = RECTYPE_HTBL; + rec.recnum = recnum; + rc = tdbio_write_record (&rec); + if (rc) + log_fatal (_("%s: failed to create hashtable: %s\n"), + db_name, gpg_strerror (rc)); } - /* update the version record */ - rc = tdbio_write_record( vr ); - if( !rc ) - rc = tdbio_sync(); - if( rc ) - log_fatal( _("%s: error updating version record: %s\n"), - db_name, gpg_strerror (rc)); + /* Update the version record and flush. */ + rc = tdbio_write_record (vr); + if (!rc) + rc = tdbio_sync (); + if (rc) + log_fatal (_("%s: error updating version record: %s\n"), + db_name, gpg_strerror (rc)); } +/* + * Check whether open trustdb matches the global trust options given + * for this process. On a read problem the process is terminated. + * + * Return: 1 for yes, 0 for no. + */ int tdbio_db_matches_options() { static int yes_no = -1; - if( yes_no == -1 ) + if (yes_no == -1) { TRUSTREC vr; int rc; - rc = tdbio_read_record( 0, &vr, RECTYPE_VER ); + rc = tdbio_read_record (0, &vr, RECTYPE_VER); if( rc ) log_fatal( _("%s: error reading version record: %s\n"), db_name, gpg_strerror (rc) ); @@ -719,793 +863,933 @@ tdbio_db_matches_options() return yes_no; } + +/* + * Read and return the trust model identifier from the trustdb. On a + * read problem the process is terminated. + */ byte -tdbio_read_model(void) +tdbio_read_model (void) { TRUSTREC vr; int rc; - rc = tdbio_read_record( 0, &vr, RECTYPE_VER ); - if( rc ) - log_fatal( _("%s: error reading version record: %s\n"), + rc = tdbio_read_record (0, &vr, RECTYPE_VER ); + if (rc) + log_fatal (_("%s: error reading version record: %s\n"), db_name, gpg_strerror (rc) ); return vr.r.ver.trust_model; } -/**************** - * Return the nextstamp value. + +/* + * Read and return the nextstamp value from the trustdb. On a read + * problem the process is terminated. */ ulong tdbio_read_nextcheck () { - TRUSTREC vr; - int rc; + TRUSTREC vr; + int rc; - rc = tdbio_read_record( 0, &vr, RECTYPE_VER ); - if( rc ) - log_fatal( _("%s: error reading version record: %s\n"), - db_name, gpg_strerror (rc)); - return vr.r.ver.nextcheck; + rc = tdbio_read_record (0, &vr, RECTYPE_VER); + if (rc) + log_fatal (_("%s: error reading version record: %s\n"), + db_name, gpg_strerror (rc)); + return vr.r.ver.nextcheck; } -/* Return true when the stamp was actually changed. */ + +/* + * Write the STAMP nextstamp timestamp to the trustdb. On a read or + * write problem the process is terminated. + * + * Return: True if the stamp actually changed. + */ int tdbio_write_nextcheck (ulong stamp) { - TRUSTREC vr; - int rc; + TRUSTREC vr; + int rc; - rc = tdbio_read_record( 0, &vr, RECTYPE_VER ); - if( rc ) - log_fatal( _("%s: error reading version record: %s\n"), - db_name, gpg_strerror (rc) ); + rc = tdbio_read_record (0, &vr, RECTYPE_VER); + if (rc) + log_fatal (_("%s: error reading version record: %s\n"), + db_name, gpg_strerror (rc)); - if (vr.r.ver.nextcheck == stamp) - return 0; + if (vr.r.ver.nextcheck == stamp) + return 0; - vr.r.ver.nextcheck = stamp; - rc = tdbio_write_record( &vr ); - if( rc ) - log_fatal( _("%s: error writing version record: %s\n"), - db_name, gpg_strerror (rc) ); - return 1; + vr.r.ver.nextcheck = stamp; + rc = tdbio_write_record( &vr ); + if (rc) + log_fatal (_("%s: error writing version record: %s\n"), + db_name, gpg_strerror (rc)); + return 1; } -/**************** - * Return the record number of the trusthash tbl or create a new one. +/* + * Return the record number of the trusthash table or create one if it + * does not yet exist. On a read or write problem the process is + * terminated. + * + * Return: record number */ static ulong get_trusthashrec(void) { - static ulong trusthashtbl; /* record number of the trust hashtable */ + static ulong trusthashtbl; /* Record number of the trust hashtable. */ - if( !trusthashtbl ) { - TRUSTREC vr; - int rc; + if (!trusthashtbl) + { + TRUSTREC vr; + int rc; - rc = tdbio_read_record( 0, &vr, RECTYPE_VER ); - if( rc ) - log_fatal( _("%s: error reading version record: %s\n"), - db_name, gpg_strerror (rc) ); - if( !vr.r.ver.trusthashtbl ) - create_hashtable( &vr, 0 ); + rc = tdbio_read_record (0, &vr, RECTYPE_VER ); + if (rc) + log_fatal (_("%s: error reading version record: %s\n"), + db_name, gpg_strerror (rc) ); + if (!vr.r.ver.trusthashtbl) + create_hashtable (&vr, 0); - trusthashtbl = vr.r.ver.trusthashtbl; + trusthashtbl = vr.r.ver.trusthashtbl; } - return trusthashtbl; + + return trusthashtbl; } -/**************** - * Update a hashtable. - * table gives the start of the table, key and keylen is the key, - * newrecnum is the record number to insert. +/* + * Update a hashtable in the trustdb. TABLE gives the start of the + * table, KEY and KEYLEN are the key, NEWRECNUM is the record number + * to insert into the table. + * + * Return: 0 on success or an error code. */ static int -upd_hashtable( ulong table, byte *key, int keylen, ulong newrecnum ) +upd_hashtable (ulong table, byte *key, int keylen, ulong newrecnum) { - TRUSTREC lastrec, rec; - ulong hashrec, item; - int msb; - int level=0; - int rc, i; - - hashrec = table; - next_level: - msb = key[level]; - hashrec += msb / ITEMS_PER_HTBL_RECORD; - rc = tdbio_read_record( hashrec, &rec, RECTYPE_HTBL ); - if( rc ) { - log_error("upd_hashtable: read failed: %s\n", gpg_strerror (rc) ); - return rc; + TRUSTREC lastrec, rec; + ulong hashrec, item; + int msb; + int level = 0; + int rc, i; + + hashrec = table; + next_level: + msb = key[level]; + hashrec += msb / ITEMS_PER_HTBL_RECORD; + rc = tdbio_read_record (hashrec, &rec, RECTYPE_HTBL); + if (rc) + { + log_error ("upd_hashtable: read failed: %s\n", gpg_strerror (rc)); + return rc; } - item = rec.r.htbl.item[msb % ITEMS_PER_HTBL_RECORD]; - if( !item ) { /* insert a new item into the hash table */ - rec.r.htbl.item[msb % ITEMS_PER_HTBL_RECORD] = newrecnum; - rc = tdbio_write_record( &rec ); - if( rc ) { - log_error("upd_hashtable: write htbl failed: %s\n", - gpg_strerror (rc) ); - return rc; + item = rec.r.htbl.item[msb % ITEMS_PER_HTBL_RECORD]; + if (!item) /* Insert a new item into the hash table. */ + { + rec.r.htbl.item[msb % ITEMS_PER_HTBL_RECORD] = newrecnum; + rc = tdbio_write_record (&rec); + if (rc) + { + log_error ("upd_hashtable: write htbl failed: %s\n", + gpg_strerror (rc)); + return rc; } } - else if( item != newrecnum ) { /* must do an update */ - lastrec = rec; - rc = tdbio_read_record( item, &rec, 0 ); - if( rc ) { - log_error( "upd_hashtable: read item failed: %s\n", - gpg_strerror (rc) ); - return rc; + else if (item != newrecnum) /* Must do an update. */ + { + lastrec = rec; + rc = tdbio_read_record (item, &rec, 0); + if (rc) + { + log_error ("upd_hashtable: read item failed: %s\n", + gpg_strerror (rc)); + return rc; } - if( rec.rectype == RECTYPE_HTBL ) { - hashrec = item; - level++; - if( level >= keylen ) { - log_error( "hashtable has invalid indirections.\n"); - return GPG_ERR_TRUSTDB; + if (rec.rectype == RECTYPE_HTBL) + { + hashrec = item; + level++; + if (level >= keylen) + { + log_error ("hashtable has invalid indirections.\n"); + return GPG_ERR_TRUSTDB; } - goto next_level; + goto next_level; } - else if( rec.rectype == RECTYPE_HLST ) { /* extend list */ - /* see whether the key is already in this list */ - for(;;) { - for(i=0; i < ITEMS_PER_HLST_RECORD; i++ ) { - if( rec.r.hlst.rnum[i] == newrecnum ) { - return 0; /* okay, already in the list */ + else if (rec.rectype == RECTYPE_HLST) /* Extend the list. */ + { + /* Check whether the key is already in this list. */ + for (;;) + { + for (i=0; i < ITEMS_PER_HLST_RECORD; i++) + { + if (rec.r.hlst.rnum[i] == newrecnum) + { + return 0; /* Okay, already in the list. */ } } - if( rec.r.hlst.next ) { - rc = tdbio_read_record( rec.r.hlst.next, - &rec, RECTYPE_HLST); - if( rc ) { - log_error ("upd_hashtable: read hlst failed: %s\n", - gpg_strerror (rc) ); - return rc; + if (rec.r.hlst.next) + { + rc = tdbio_read_record (rec.r.hlst.next, &rec, RECTYPE_HLST); + if (rc) + { + log_error ("upd_hashtable: read hlst failed: %s\n", + gpg_strerror (rc) ); + return rc; } } - else - break; /* not there */ + else + break; /* key is not in the list */ } - /* find the next free entry and put it in */ - for(;;) { - for(i=0; i < ITEMS_PER_HLST_RECORD; i++ ) { - if( !rec.r.hlst.rnum[i] ) { - rec.r.hlst.rnum[i] = newrecnum; - rc = tdbio_write_record( &rec ); - if( rc ) - log_error ("upd_hashtable: write hlst failed: %s\n", - gpg_strerror (rc)); - return rc; /* done */ + + /* Find the next free entry and put it in. */ + for (;;) + { + for (i=0; i < ITEMS_PER_HLST_RECORD; i++) + { + if (!rec.r.hlst.rnum[i]) + { + /* Empty slot found. */ + rec.r.hlst.rnum[i] = newrecnum; + rc = tdbio_write_record (&rec); + if (rc) + log_error ("upd_hashtable: write hlst failed: %s\n", + gpg_strerror (rc)); + return rc; /* Done. */ } } - if( rec.r.hlst.next ) { - rc = tdbio_read_record( rec.r.hlst.next, - &rec, RECTYPE_HLST ); - if( rc ) { - log_error ("upd_hashtable: read hlst failed: %s\n", - gpg_strerror (rc)); - return rc; + + if (rec.r.hlst.next) + { + /* read the next reord of the list. */ + rc = tdbio_read_record (rec.r.hlst.next, &rec, RECTYPE_HLST); + if (rc) + { + log_error ("upd_hashtable: read hlst failed: %s\n", + gpg_strerror (rc)); + return rc; } } - else { /* add a new list record */ - rec.r.hlst.next = item = tdbio_new_recnum(); - rc = tdbio_write_record( &rec ); - if( rc ) { - log_error( "upd_hashtable: write hlst failed: %s\n", - gpg_strerror (rc) ); - return rc; + else + { + /* Append a new record to the list. */ + rec.r.hlst.next = item = tdbio_new_recnum (); + rc = tdbio_write_record (&rec); + if (rc) + { + log_error ("upd_hashtable: write hlst failed: %s\n", + gpg_strerror (rc)); + return rc; } - memset( &rec, 0, sizeof rec ); - rec.rectype = RECTYPE_HLST; - rec.recnum = item; - rec.r.hlst.rnum[0] = newrecnum; - rc = tdbio_write_record( &rec ); - if( rc ) - log_error( "upd_hashtable: write ext hlst failed: %s\n", - gpg_strerror (rc) ); - return rc; /* done */ + memset (&rec, 0, sizeof rec); + rec.rectype = RECTYPE_HLST; + rec.recnum = item; + rec.r.hlst.rnum[0] = newrecnum; + rc = tdbio_write_record (&rec); + if (rc) + log_error ("upd_hashtable: write ext hlst failed: %s\n", + gpg_strerror (rc)); + return rc; /* Done. */ } - } /* end loop over hlst slots */ - } - else if( rec.rectype == RECTYPE_TRUST ) { /* insert a list record */ - if( rec.recnum == newrecnum ) { - return 0; - } - item = rec.recnum; /* save number of key record */ - memset( &rec, 0, sizeof rec ); - rec.rectype = RECTYPE_HLST; - rec.recnum = tdbio_new_recnum(); - rec.r.hlst.rnum[0] = item; /* old keyrecord */ - rec.r.hlst.rnum[1] = newrecnum; /* and new one */ - rc = tdbio_write_record( &rec ); - if( rc ) { - log_error( "upd_hashtable: write new hlst failed: %s\n", - gpg_strerror (rc) ); - return rc; - } - /* update the hashtable record */ - lastrec.r.htbl.item[msb % ITEMS_PER_HTBL_RECORD] = rec.recnum; - rc = tdbio_write_record( &lastrec ); - if( rc ) - log_error ("upd_hashtable: update htbl failed: %s\n", - gpg_strerror (rc)); - return rc; /* ready */ + } /* end loop over list slots */ + } - else { - log_error( "hashtbl %lu: %lu/%d points to an invalid record %lu\n", - table, hashrec, (msb % ITEMS_PER_HTBL_RECORD), item); - list_trustdb(NULL); - return GPG_ERR_TRUSTDB; + else if (rec.rectype == RECTYPE_TRUST) /* Insert a list record. */ + { + if (rec.recnum == newrecnum) + { + return 0; + } + item = rec.recnum; /* Save number of key record. */ + memset (&rec, 0, sizeof rec); + rec.rectype = RECTYPE_HLST; + rec.recnum = tdbio_new_recnum (); + rec.r.hlst.rnum[0] = item; /* Old key record */ + rec.r.hlst.rnum[1] = newrecnum; /* and new key record */ + rc = tdbio_write_record (&rec); + if (rc) + { + log_error( "upd_hashtable: write new hlst failed: %s\n", + gpg_strerror (rc) ); + return rc; + } + /* Update the hashtable record. */ + lastrec.r.htbl.item[msb % ITEMS_PER_HTBL_RECORD] = rec.recnum; + rc = tdbio_write_record (&lastrec); + if (rc) + log_error ("upd_hashtable: update htbl failed: %s\n", + gpg_strerror (rc)); + return rc; /* Ready. */ + } + else + { + log_error ("hashtbl %lu: %lu/%d points to an invalid record %lu\n", + table, hashrec, (msb % ITEMS_PER_HTBL_RECORD), item); + list_trustdb (NULL); /*FIXME: Bad - prints to stdout!!! */ + return GPG_ERR_TRUSTDB; } } - return 0; + return 0; } -/**************** - * Drop an entry from a hashtable - * table gives the start of the table, key and keylen is the key, +/* + * Drop an entry from a hashtable. TABLE gives the start of the + * table, KEY and KEYLEN are the key. + * + * Return: 0 on success or an error code. */ static int -drop_from_hashtable( ulong table, byte *key, int keylen, ulong recnum ) +drop_from_hashtable (ulong table, byte *key, int keylen, ulong recnum) { - TRUSTREC rec; - ulong hashrec, item; - int msb; - int level=0; - int rc, i; - - hashrec = table; - next_level: - msb = key[level]; - hashrec += msb / ITEMS_PER_HTBL_RECORD; - rc = tdbio_read_record( hashrec, &rec, RECTYPE_HTBL ); - if( rc ) { - log_error("drop_from_hashtable: read failed: %s\n", - gpg_strerror (rc) ); - return rc; + TRUSTREC rec; + ulong hashrec, item; + int msb; + int level = 0; + int rc, i; + + hashrec = table; + next_level: + msb = key[level]; + hashrec += msb / ITEMS_PER_HTBL_RECORD; + rc = tdbio_read_record (hashrec, &rec, RECTYPE_HTBL ); + if (rc) + { + log_error ("drop_from_hashtable: read failed: %s\n", gpg_strerror (rc)); + return rc; } - item = rec.r.htbl.item[msb % ITEMS_PER_HTBL_RECORD]; - if( !item ) /* not found - forget about it */ - return 0; + item = rec.r.htbl.item[msb % ITEMS_PER_HTBL_RECORD]; + if (!item) + return 0; /* Not found - forget about it. */ - if( item == recnum ) { /* tables points direct to the record */ - rec.r.htbl.item[msb % ITEMS_PER_HTBL_RECORD] = 0; - rc = tdbio_write_record( &rec ); - if( rc ) - log_error("drop_from_hashtable: write htbl failed: %s\n", - gpg_strerror (rc) ); - return rc; + if (item == recnum) /* Table points direct to the record. */ + { + rec.r.htbl.item[msb % ITEMS_PER_HTBL_RECORD] = 0; + rc = tdbio_write_record( &rec ); + if (rc) + log_error ("drop_from_hashtable: write htbl failed: %s\n", + gpg_strerror (rc)); + return rc; } - rc = tdbio_read_record( item, &rec, 0 ); - if( rc ) { - log_error( "drop_from_hashtable: read item failed: %s\n", - gpg_strerror (rc) ); - return rc; + rc = tdbio_read_record (item, &rec, 0); + if (rc) + { + log_error ("drop_from_hashtable: read item failed: %s\n", + gpg_strerror (rc)); + return rc; } - if( rec.rectype == RECTYPE_HTBL ) { - hashrec = item; - level++; - if( level >= keylen ) { - log_error( "hashtable has invalid indirections.\n"); - return GPG_ERR_TRUSTDB; + if (rec.rectype == RECTYPE_HTBL) + { + hashrec = item; + level++; + if (level >= keylen) + { + log_error ("hashtable has invalid indirections.\n"); + return GPG_ERR_TRUSTDB; } - goto next_level; + goto next_level; } - if( rec.rectype == RECTYPE_HLST ) { - for(;;) { - for(i=0; i < ITEMS_PER_HLST_RECORD; i++ ) { - if( rec.r.hlst.rnum[i] == recnum ) { - rec.r.hlst.rnum[i] = 0; /* drop */ - rc = tdbio_write_record( &rec ); - if( rc ) - log_error("drop_from_hashtable: write htbl failed: %s\n", - gpg_strerror (rc)); - return rc; + if (rec.rectype == RECTYPE_HLST) + { + for (;;) + { + for (i=0; i < ITEMS_PER_HLST_RECORD; i++) + { + if (rec.r.hlst.rnum[i] == recnum) + { + rec.r.hlst.rnum[i] = 0; /* Mark as free. */ + rc = tdbio_write_record (&rec); + if (rc) + log_error("drop_from_hashtable: write htbl failed: %s\n", + gpg_strerror (rc)); + return rc; } } - if( rec.r.hlst.next ) { - rc = tdbio_read_record( rec.r.hlst.next, - &rec, RECTYPE_HLST); - if( rc ) { - log_error( "drop_from_hashtable: read hlst failed: %s\n", - gpg_strerror (rc) ); - return rc; + if (rec.r.hlst.next) + { + rc = tdbio_read_record (rec.r.hlst.next, &rec, RECTYPE_HLST); + if (rc) + { + log_error ("drop_from_hashtable: read hlst failed: %s\n", + gpg_strerror (rc)); + return rc; } } - else - return 0; /* key not in table */ + else + return 0; /* Key not in table. */ } } - log_error( "hashtbl %lu: %lu/%d points to wrong record %lu\n", - table, hashrec, (msb % ITEMS_PER_HTBL_RECORD), item); - return GPG_ERR_TRUSTDB; + log_error ("hashtbl %lu: %lu/%d points to wrong record %lu\n", + table, hashrec, (msb % ITEMS_PER_HTBL_RECORD), item); + return GPG_ERR_TRUSTDB; } -/**************** - * Lookup a record via the hashtable tablewith key/keylen and return the - * result in rec. cmp() should return if the record is the desired one. - * Returns -1 if not found, 0 if found or another errocode +/* + * Lookup a record via the hashtable TABLE by (KEY,KEYLEN) and return + * the result in REC. The return value of CMP() should be True if the + * record is the desired one. + * + * Return: -1 if not found, 0 if found or another error code. + * FIXME: Use GPG_ERR_NOT_FOUND instead of -1. */ static int -lookup_hashtable( ulong table, const byte *key, size_t keylen, +lookup_hashtable (ulong table, const byte *key, size_t keylen, int (*cmpfnc)(const void*, const TRUSTREC *), const void *cmpdata, TRUSTREC *rec ) { - int rc; - ulong hashrec, item; - int msb; - int level=0; - - hashrec = table; - next_level: - msb = key[level]; - hashrec += msb / ITEMS_PER_HTBL_RECORD; - rc = tdbio_read_record( hashrec, rec, RECTYPE_HTBL ); - if( rc ) { - log_error("lookup_hashtable failed: %s\n", gpg_strerror (rc) ); - return rc; + int rc; + ulong hashrec, item; + int msb; + int level = 0; + + hashrec = table; + next_level: + msb = key[level]; + hashrec += msb / ITEMS_PER_HTBL_RECORD; + rc = tdbio_read_record (hashrec, rec, RECTYPE_HTBL); + if (rc) + { + log_error("lookup_hashtable failed: %s\n", gpg_strerror (rc) ); + return rc; } - item = rec->r.htbl.item[msb % ITEMS_PER_HTBL_RECORD]; - if( !item ) - return -1; /* not found */ + item = rec->r.htbl.item[msb % ITEMS_PER_HTBL_RECORD]; + if (!item) + return -1; /* Not found. */ - rc = tdbio_read_record( item, rec, 0 ); - if( rc ) { - log_error( "hashtable read failed: %s\n", gpg_strerror (rc) ); - return rc; + rc = tdbio_read_record (item, rec, 0); + if (rc) + { + log_error( "hashtable read failed: %s\n", gpg_strerror (rc) ); + return rc; } - if( rec->rectype == RECTYPE_HTBL ) { - hashrec = item; - level++; - if( level >= keylen ) { - log_error("hashtable has invalid indirections\n"); - return GPG_ERR_TRUSTDB; + if (rec->rectype == RECTYPE_HTBL) + { + hashrec = item; + level++; + if (level >= keylen) + { + log_error ("hashtable has invalid indirections\n"); + return GPG_ERR_TRUSTDB; } - goto next_level; + goto next_level; } - else if( rec->rectype == RECTYPE_HLST ) { - for(;;) { - int i; - - for(i=0; i < ITEMS_PER_HLST_RECORD; i++ ) { - if( rec->r.hlst.rnum[i] ) { - TRUSTREC tmp; + else if (rec->rectype == RECTYPE_HLST) + { + for (;;) + { + int i; - rc = tdbio_read_record( rec->r.hlst.rnum[i], &tmp, 0 ); - if( rc ) { - log_error ("lookup_hashtable: read item failed: %s\n", - gpg_strerror (rc)); - return rc; + for (i=0; i < ITEMS_PER_HLST_RECORD; i++) + { + if (rec->r.hlst.rnum[i]) + { + TRUSTREC tmp; + + rc = tdbio_read_record (rec->r.hlst.rnum[i], &tmp, 0); + if (rc) + { + log_error ("lookup_hashtable: read item failed: %s\n", + gpg_strerror (rc)); + return rc; } - if( (*cmpfnc)( cmpdata, &tmp ) ) { - *rec = tmp; - return 0; + if ((*cmpfnc)(cmpdata, &tmp)) + { + *rec = tmp; + return 0; } } } - if( rec->r.hlst.next ) { - rc = tdbio_read_record( rec->r.hlst.next, rec, RECTYPE_HLST ); - if( rc ) { - log_error ("lookup_hashtable: read hlst failed: %s\n", - gpg_strerror (rc) ); - return rc; + if (rec->r.hlst.next) + { + rc = tdbio_read_record (rec->r.hlst.next, rec, RECTYPE_HLST); + if (rc) + { + log_error ("lookup_hashtable: read hlst failed: %s\n", + gpg_strerror (rc) ); + return rc; } } - else - return -1; /* not found */ + else + return -1; /* not found */ } } + if ((*cmpfnc)(cmpdata, rec)) + return 0; /* really found */ - if( (*cmpfnc)( cmpdata, rec ) ) - return 0; /* really found */ - - return -1; /* no: not found */ + return -1; /* no: not found */ } -/**************** - * Update the trust hashtbl or create the table if it does not exist +/* + * Update the trust hash table TR or create the table if it does not + * exist. + * + * Return: 0 on success or an error code. */ static int update_trusthashtbl( TRUSTREC *tr ) { - return upd_hashtable( get_trusthashrec(), - tr->r.trust.fingerprint, 20, tr->recnum ); + return upd_hashtable (get_trusthashrec(), + tr->r.trust.fingerprint, 20, tr->recnum); } - +/* + * Dump the trustdb record REC to stream FP. + */ void tdbio_dump_record (TRUSTREC *rec, estream_t fp) { - int i; - ulong rnum = rec->recnum; + int i; + ulong rnum = rec->recnum; + + es_fprintf (fp, "rec %5lu, ", rnum); - es_fprintf ( fp, "rec %5lu, ", rnum ); + switch (rec->rectype) + { + case 0: + es_fprintf (fp, "blank\n"); + break; - switch( rec->rectype ) { - case 0: - es_fprintf (fp, "blank\n"); - break; - case RECTYPE_VER: - es_fprintf (fp, + case RECTYPE_VER: + es_fprintf (fp, "version, td=%lu, f=%lu, m/c/d=%d/%d/%d tm=%d mcl=%d nc=%lu (%s)\n", - rec->r.ver.trusthashtbl, - rec->r.ver.firstfree, - rec->r.ver.marginals, - rec->r.ver.completes, - rec->r.ver.cert_depth, - rec->r.ver.trust_model, - rec->r.ver.min_cert_level, - rec->r.ver.nextcheck, - strtimestamp(rec->r.ver.nextcheck) - ); - break; - case RECTYPE_FREE: - es_fprintf (fp, "free, next=%lu\n", rec->r.free.next ); - break; - case RECTYPE_HTBL: - es_fprintf (fp, "htbl,"); - for(i=0; i < ITEMS_PER_HTBL_RECORD; i++ ) - es_fprintf (fp, " %lu", rec->r.htbl.item[i] ); - es_putc ('\n', fp); - break; - case RECTYPE_HLST: - es_fprintf (fp, "hlst, next=%lu,", rec->r.hlst.next ); - for(i=0; i < ITEMS_PER_HLST_RECORD; i++ ) - es_fprintf (fp, " %lu", rec->r.hlst.rnum[i] ); - es_putc ('\n', fp); - break; - case RECTYPE_TRUST: - es_fprintf (fp, "trust "); - for(i=0; i < 20; i++ ) - es_fprintf (fp, "%02X", rec->r.trust.fingerprint[i] ); - es_fprintf (fp, ", ot=%d, d=%d, vl=%lu\n", rec->r.trust.ownertrust, - rec->r.trust.depth, rec->r.trust.validlist); - break; - case RECTYPE_VALID: - es_fprintf (fp, "valid "); - for(i=0; i < 20; i++ ) - es_fprintf(fp, "%02X", rec->r.valid.namehash[i] ); - es_fprintf (fp, ", v=%d, next=%lu\n", rec->r.valid.validity, - rec->r.valid.next); - break; - default: - es_fprintf (fp, "unknown type %d\n", rec->rectype ); - break; + rec->r.ver.trusthashtbl, + rec->r.ver.firstfree, + rec->r.ver.marginals, + rec->r.ver.completes, + rec->r.ver.cert_depth, + rec->r.ver.trust_model, + rec->r.ver.min_cert_level, + rec->r.ver.nextcheck, + strtimestamp(rec->r.ver.nextcheck) + ); + break; + + case RECTYPE_FREE: + es_fprintf (fp, "free, next=%lu\n", rec->r.free.next); + break; + + case RECTYPE_HTBL: + es_fprintf (fp, "htbl,"); + for (i=0; i < ITEMS_PER_HTBL_RECORD; i++) + es_fprintf (fp, " %lu", rec->r.htbl.item[i]); + es_putc ('\n', fp); + break; + + case RECTYPE_HLST: + es_fprintf (fp, "hlst, next=%lu,", rec->r.hlst.next); + for (i=0; i < ITEMS_PER_HLST_RECORD; i++) + es_fprintf (fp, " %lu", rec->r.hlst.rnum[i]); + es_putc ('\n', fp); + break; + + case RECTYPE_TRUST: + es_fprintf (fp, "trust "); + for (i=0; i < 20; i++) + es_fprintf (fp, "%02X", rec->r.trust.fingerprint[i]); + es_fprintf (fp, ", ot=%d, d=%d, vl=%lu\n", rec->r.trust.ownertrust, + rec->r.trust.depth, rec->r.trust.validlist); + break; + + case RECTYPE_VALID: + es_fprintf (fp, "valid "); + for (i=0; i < 20; i++) + es_fprintf(fp, "%02X", rec->r.valid.namehash[i]); + es_fprintf (fp, ", v=%d, next=%lu\n", rec->r.valid.validity, + rec->r.valid.next); + break; + + default: + es_fprintf (fp, "unknown type %d\n", rec->rectype ); + break; } } -/**************** - * read the record with number recnum - * returns: -1 on error, 0 on success + +/* + * Read the record with number RECNUM into the structure REC. If + * EXPECTED is not 0 reading any other record type will return an + * error. + * + * Return: 0 on success, -1 on EOF, or an error code. */ int -tdbio_read_record( ulong recnum, TRUSTREC *rec, int expected ) +tdbio_read_record (ulong recnum, TRUSTREC *rec, int expected) { - byte readbuf[TRUST_RECORD_LEN]; - const byte *buf, *p; - gpg_error_t err = 0; - int n, i; + byte readbuf[TRUST_RECORD_LEN]; + const byte *buf, *p; + gpg_error_t err = 0; + int n, i; - if( db_fd == -1 ) - open_db(); - buf = get_record_from_cache( recnum ); - if( !buf ) { - if( lseek( db_fd, recnum * TRUST_RECORD_LEN, SEEK_SET ) == -1 ) { - err = gpg_error_from_syserror (); - log_error(_("trustdb: lseek failed: %s\n"), strerror(errno) ); - return err; + if (db_fd == -1) + open_db (); + + buf = get_record_from_cache( recnum ); + if (!buf) + { + if (lseek (db_fd, recnum * TRUST_RECORD_LEN, SEEK_SET) == -1) + { + err = gpg_error_from_syserror (); + log_error (_("trustdb: lseek failed: %s\n"), strerror (errno)); + return err; } - n = read( db_fd, readbuf, TRUST_RECORD_LEN); - if( !n ) { - return -1; /* eof */ + n = read (db_fd, readbuf, TRUST_RECORD_LEN); + if (!n) + { + return -1; /* eof */ } - else if( n != TRUST_RECORD_LEN ) { - err = gpg_error_from_syserror (); - log_error(_("trustdb: read failed (n=%d): %s\n"), n, - strerror(errno) ); - return err; + else if (n != TRUST_RECORD_LEN) + { + err = gpg_error_from_syserror (); + log_error (_("trustdb: read failed (n=%d): %s\n"), + n, strerror(errno)); + return err; } - buf = readbuf; + buf = readbuf; } - rec->recnum = recnum; - rec->dirty = 0; - p = buf; - rec->rectype = *p++; - if( expected && rec->rectype != expected ) { - log_error("%lu: read expected rec type %d, got %d\n", - recnum, expected, rec->rectype ); - return gpg_error (GPG_ERR_TRUSTDB); + rec->recnum = recnum; + rec->dirty = 0; + p = buf; + rec->rectype = *p++; + if (expected && rec->rectype != expected) + { + log_error ("%lu: read expected rec type %d, got %d\n", + recnum, expected, rec->rectype); + return gpg_error (GPG_ERR_TRUSTDB); } - p++; /* skip reserved byte */ - switch( rec->rectype ) { - case 0: /* unused (free) record */ - break; - case RECTYPE_VER: /* version record */ - if( memcmp(buf+1, GPGEXT_GPG, 3 ) ) { - log_error( _("%s: not a trustdb file\n"), db_name ); - err = gpg_error (GPG_ERR_TRUSTDB); - } - p += 2; /* skip "gpg" */ - rec->r.ver.version = *p++; - rec->r.ver.marginals = *p++; - rec->r.ver.completes = *p++; - rec->r.ver.cert_depth = *p++; - rec->r.ver.trust_model = *p++; - rec->r.ver.min_cert_level = *p++; - p += 2; - rec->r.ver.created = buf32_to_ulong(p); p += 4; - rec->r.ver.nextcheck = buf32_to_ulong(p); p += 4; - p += 4; - p += 4; - rec->r.ver.firstfree =buf32_to_ulong(p); p += 4; - p += 4; - rec->r.ver.trusthashtbl =buf32_to_ulong(p); p += 4; - if( recnum ) { - log_error( _("%s: version record with recnum %lu\n"), db_name, - (ulong)recnum ); - err = gpg_error (GPG_ERR_TRUSTDB); - } - else if( rec->r.ver.version != 3 ) { - log_error( _("%s: invalid file version %d\n"), db_name, - rec->r.ver.version ); - err = gpg_error (GPG_ERR_TRUSTDB); + p++; /* Skip reserved byte. */ + switch (rec->rectype) + { + case 0: /* unused (free) record */ + break; + + case RECTYPE_VER: /* version record */ + if (memcmp(buf+1, GPGEXT_GPG, 3)) + { + log_error (_("%s: not a trustdb file\n"), db_name ); + err = gpg_error (GPG_ERR_TRUSTDB); + /* FIXME ^ */ + } + p += 2; /* skip "gpg" */ + rec->r.ver.version = *p++; + rec->r.ver.marginals = *p++; + rec->r.ver.completes = *p++; + rec->r.ver.cert_depth = *p++; + rec->r.ver.trust_model = *p++; + rec->r.ver.min_cert_level = *p++; + p += 2; + rec->r.ver.created = buf32_to_ulong(p); p += 4; + rec->r.ver.nextcheck = buf32_to_ulong(p); p += 4; + p += 4; + p += 4; + rec->r.ver.firstfree =buf32_to_ulong(p); p += 4; + p += 4; + rec->r.ver.trusthashtbl =buf32_to_ulong(p); p += 4; + if (recnum) + { + log_error( _("%s: version record with recnum %lu\n"), db_name, + (ulong)recnum ); + err = gpg_error (GPG_ERR_TRUSTDB); } - break; - case RECTYPE_FREE: - rec->r.free.next = buf32_to_ulong(p); p += 4; - break; - case RECTYPE_HTBL: - for(i=0; i < ITEMS_PER_HTBL_RECORD; i++ ) { - rec->r.htbl.item[i] = buf32_to_ulong(p); p += 4; + else if (rec->r.ver.version != 3) + { + log_error( _("%s: invalid file version %d\n"), db_name, + rec->r.ver.version ); + err = gpg_error (GPG_ERR_TRUSTDB); + } + break; + + case RECTYPE_FREE: + rec->r.free.next = buf32_to_ulong(p); p += 4; + break; + + case RECTYPE_HTBL: + for (i=0; i < ITEMS_PER_HTBL_RECORD; i++) + { + rec->r.htbl.item[i] = buf32_to_ulong(p); p += 4; } - break; - case RECTYPE_HLST: - rec->r.hlst.next = buf32_to_ulong(p); p += 4; - for(i=0; i < ITEMS_PER_HLST_RECORD; i++ ) { - rec->r.hlst.rnum[i] = buf32_to_ulong(p); p += 4; + break; + + case RECTYPE_HLST: + rec->r.hlst.next = buf32_to_ulong(p); p += 4; + for (i=0; i < ITEMS_PER_HLST_RECORD; i++) + { + rec->r.hlst.rnum[i] = buf32_to_ulong(p); p += 4; } - break; - case RECTYPE_TRUST: - memcpy( rec->r.trust.fingerprint, p, 20); p+=20; - rec->r.trust.ownertrust = *p++; - rec->r.trust.depth = *p++; - rec->r.trust.min_ownertrust = *p++; - p++; - rec->r.trust.validlist = buf32_to_ulong(p); p += 4; - break; - case RECTYPE_VALID: - memcpy( rec->r.valid.namehash, p, 20); p+=20; - rec->r.valid.validity = *p++; - rec->r.valid.next = buf32_to_ulong(p); p += 4; - rec->r.valid.full_count = *p++; - rec->r.valid.marginal_count = *p++; - break; - default: - log_error( "%s: invalid record type %d at recnum %lu\n", - db_name, rec->rectype, (ulong)recnum ); - err = gpg_error (GPG_ERR_TRUSTDB); - break; + break; + + case RECTYPE_TRUST: + memcpy (rec->r.trust.fingerprint, p, 20); p+=20; + rec->r.trust.ownertrust = *p++; + rec->r.trust.depth = *p++; + rec->r.trust.min_ownertrust = *p++; + p++; + rec->r.trust.validlist = buf32_to_ulong(p); p += 4; + break; + + case RECTYPE_VALID: + memcpy (rec->r.valid.namehash, p, 20); p+=20; + rec->r.valid.validity = *p++; + rec->r.valid.next = buf32_to_ulong(p); p += 4; + rec->r.valid.full_count = *p++; + rec->r.valid.marginal_count = *p++; + break; + + default: + log_error ("%s: invalid record type %d at recnum %lu\n", + db_name, rec->rectype, (ulong)recnum); + err = gpg_error (GPG_ERR_TRUSTDB); + break; } - return err; + return err; } -/**************** - * Write the record at RECNUM + +/* + * Write the record from the struct REC. + * + * Return: 0 on success or an error code. */ int tdbio_write_record( TRUSTREC *rec ) { - byte buf[TRUST_RECORD_LEN], *p; - int rc = 0; - int i; - ulong recnum = rec->recnum; + byte buf[TRUST_RECORD_LEN]; + byte *p; + int rc = 0; + int i; + ulong recnum = rec->recnum; - if( db_fd == -1 ) - open_db(); + if (db_fd == -1) + open_db (); - memset(buf, 0, TRUST_RECORD_LEN); - p = buf; - *p++ = rec->rectype; p++; - switch( rec->rectype ) { - case 0: /* unused record */ - break; - case RECTYPE_VER: /* version record */ - if( recnum ) - BUG(); - memcpy(p-1, GPGEXT_GPG, 3 ); p += 2; - *p++ = rec->r.ver.version; - *p++ = rec->r.ver.marginals; - *p++ = rec->r.ver.completes; - *p++ = rec->r.ver.cert_depth; - *p++ = rec->r.ver.trust_model; - *p++ = rec->r.ver.min_cert_level; - p += 2; - ulongtobuf(p, rec->r.ver.created); p += 4; - ulongtobuf(p, rec->r.ver.nextcheck); p += 4; - p += 4; - p += 4; - ulongtobuf(p, rec->r.ver.firstfree ); p += 4; - p += 4; - ulongtobuf(p, rec->r.ver.trusthashtbl ); p += 4; - break; - - case RECTYPE_FREE: - ulongtobuf(p, rec->r.free.next); p += 4; - break; - - - case RECTYPE_HTBL: - for(i=0; i < ITEMS_PER_HTBL_RECORD; i++ ) { - ulongtobuf( p, rec->r.htbl.item[i]); p += 4; - } - break; + memset (buf, 0, TRUST_RECORD_LEN); + p = buf; + *p++ = rec->rectype; p++; - case RECTYPE_HLST: - ulongtobuf( p, rec->r.hlst.next); p += 4; - for(i=0; i < ITEMS_PER_HLST_RECORD; i++ ) { - ulongtobuf( p, rec->r.hlst.rnum[i]); p += 4; + switch (rec->rectype) + { + case 0: /* unused record */ + break; + + case RECTYPE_VER: /* version record */ + if (recnum) + BUG (); + memcpy(p-1, GPGEXT_GPG, 3 ); p += 2; + *p++ = rec->r.ver.version; + *p++ = rec->r.ver.marginals; + *p++ = rec->r.ver.completes; + *p++ = rec->r.ver.cert_depth; + *p++ = rec->r.ver.trust_model; + *p++ = rec->r.ver.min_cert_level; + p += 2; + ulongtobuf(p, rec->r.ver.created); p += 4; + ulongtobuf(p, rec->r.ver.nextcheck); p += 4; + p += 4; + p += 4; + ulongtobuf(p, rec->r.ver.firstfree ); p += 4; + p += 4; + ulongtobuf(p, rec->r.ver.trusthashtbl ); p += 4; + break; + + case RECTYPE_FREE: + ulongtobuf(p, rec->r.free.next); p += 4; + break; + + case RECTYPE_HTBL: + for (i=0; i < ITEMS_PER_HTBL_RECORD; i++) + { + ulongtobuf( p, rec->r.htbl.item[i]); p += 4; + } + break; + + case RECTYPE_HLST: + ulongtobuf( p, rec->r.hlst.next); p += 4; + for (i=0; i < ITEMS_PER_HLST_RECORD; i++ ) + { + ulongtobuf( p, rec->r.hlst.rnum[i]); p += 4; } - break; - - case RECTYPE_TRUST: - memcpy( p, rec->r.trust.fingerprint, 20); p += 20; - *p++ = rec->r.trust.ownertrust; - *p++ = rec->r.trust.depth; - *p++ = rec->r.trust.min_ownertrust; - p++; - ulongtobuf( p, rec->r.trust.validlist); p += 4; - break; - - case RECTYPE_VALID: - memcpy( p, rec->r.valid.namehash, 20); p += 20; - *p++ = rec->r.valid.validity; - ulongtobuf( p, rec->r.valid.next); p += 4; - *p++ = rec->r.valid.full_count; - *p++ = rec->r.valid.marginal_count; - break; - - default: - BUG(); + break; + + case RECTYPE_TRUST: + memcpy (p, rec->r.trust.fingerprint, 20); p += 20; + *p++ = rec->r.trust.ownertrust; + *p++ = rec->r.trust.depth; + *p++ = rec->r.trust.min_ownertrust; + p++; + ulongtobuf( p, rec->r.trust.validlist); p += 4; + break; + + case RECTYPE_VALID: + memcpy (p, rec->r.valid.namehash, 20); p += 20; + *p++ = rec->r.valid.validity; + ulongtobuf( p, rec->r.valid.next); p += 4; + *p++ = rec->r.valid.full_count; + *p++ = rec->r.valid.marginal_count; + break; + + default: + BUG(); } - rc = put_record_into_cache( recnum, buf ); - if( rc ) - ; - else if( rec->rectype == RECTYPE_TRUST ) - rc = update_trusthashtbl( rec ); + rc = put_record_into_cache (recnum, buf); + if (rc) + ; + else if (rec->rectype == RECTYPE_TRUST) + rc = update_trusthashtbl (rec); - return rc; + return rc; } + +/* + * Delete the record at record number RECNUm from the trustdb. + * + * Return: 0 on success or an error code. + */ int -tdbio_delete_record( ulong recnum ) +tdbio_delete_record (ulong recnum) { - TRUSTREC vr, rec; - int rc; - - /* Must read the record fist, so we can drop it from the hash tables */ - rc = tdbio_read_record( recnum, &rec, 0 ); - if( rc ) - ; - else if( rec.rectype == RECTYPE_TRUST ) { - rc = drop_from_hashtable( get_trusthashrec(), - rec.r.trust.fingerprint, 20, rec.recnum ); - } + TRUSTREC vr, rec; + int rc; - if( rc ) - return rc; + /* Must read the record fist, so we can drop it from the hash tables */ + rc = tdbio_read_record (recnum, &rec, 0); + if (rc) + ; + else if (rec.rectype == RECTYPE_TRUST) + { + rc = drop_from_hashtable (get_trusthashrec(), + rec.r.trust.fingerprint, 20, rec.recnum); + } - /* now we can chnage it to a free record */ - rc = tdbio_read_record( 0, &vr, RECTYPE_VER ); - if( rc ) - log_fatal( _("%s: error reading version record: %s\n"), - db_name, gpg_strerror (rc) ); - - rec.recnum = recnum; - rec.rectype = RECTYPE_FREE; - rec.r.free.next = vr.r.ver.firstfree; - vr.r.ver.firstfree = recnum; - rc = tdbio_write_record( &rec ); - if( !rc ) - rc = tdbio_write_record( &vr ); + if (rc) return rc; + + /* Now we can chnage it to a free record. */ + rc = tdbio_read_record (0, &vr, RECTYPE_VER); + if (rc) + log_fatal (_("%s: error reading version record: %s\n"), + db_name, gpg_strerror (rc)); + + rec.recnum = recnum; + rec.rectype = RECTYPE_FREE; + rec.r.free.next = vr.r.ver.firstfree; + vr.r.ver.firstfree = recnum; + rc = tdbio_write_record (&rec); + if (!rc) + rc = tdbio_write_record (&vr); + + return rc; } -/**************** - * create a new record and return its record number + +/* + * Create a new record and return its record number. */ ulong -tdbio_new_recnum() +tdbio_new_recnum () { - off_t offset; - ulong recnum; - TRUSTREC vr, rec; - int rc; - - /* look for unused records */ - rc = tdbio_read_record( 0, &vr, RECTYPE_VER ); - if( rc ) - log_fatal( _("%s: error reading version record: %s\n"), - db_name, gpg_strerror (rc) ); - if( vr.r.ver.firstfree ) { - recnum = vr.r.ver.firstfree; - rc = tdbio_read_record( recnum, &rec, RECTYPE_FREE ); - if( rc ) { - log_error( _("%s: error reading free record: %s\n"), - db_name, gpg_strerror (rc) ); - return rc; + off_t offset; + ulong recnum; + TRUSTREC vr, rec; + int rc; + + /* Look for unused records. */ + rc = tdbio_read_record (0, &vr, RECTYPE_VER); + if (rc) + log_fatal( _("%s: error reading version record: %s\n"), + db_name, gpg_strerror (rc)); + if (vr.r.ver.firstfree) + { + recnum = vr.r.ver.firstfree; + rc = tdbio_read_record (recnum, &rec, RECTYPE_FREE); + if (rc) + { + log_error (_("%s: error reading free record: %s\n"), + db_name, gpg_strerror (rc)); + return rc; } - /* update dir record */ - vr.r.ver.firstfree = rec.r.free.next; - rc = tdbio_write_record( &vr ); - if( rc ) { - log_error (_("%s: error writing dir record: %s\n"), - db_name, gpg_strerror (rc)); - return rc; + /* Update dir record. */ + vr.r.ver.firstfree = rec.r.free.next; + rc = tdbio_write_record (&vr); + if (rc) + { + log_error (_("%s: error writing dir record: %s\n"), + db_name, gpg_strerror (rc)); + return rc; } - /*zero out the new record */ - memset( &rec, 0, sizeof rec ); - rec.rectype = 0; /* unused record */ - rec.recnum = recnum; - rc = tdbio_write_record( &rec ); - if( rc ) - log_fatal(_("%s: failed to zero a record: %s\n"), - db_name, gpg_strerror (rc)); + /* Zero out the new record. */ + memset (&rec, 0, sizeof rec); + rec.rectype = 0; /* Mark as unused record (actually already done + my the memset). */ + rec.recnum = recnum; + rc = tdbio_write_record (&rec); + if (rc) + log_fatal (_("%s: failed to zero a record: %s\n"), + db_name, gpg_strerror (rc)); } - else { /* not found, append a new record */ - offset = lseek( db_fd, 0, SEEK_END ); - if( offset == -1 ) - log_fatal("trustdb: lseek to end failed: %s\n", strerror(errno) ); - recnum = offset / TRUST_RECORD_LEN; - assert(recnum); /* this is will never be the first record */ - /* we must write a record, so that the next call to this function - * returns another recnum */ - memset( &rec, 0, sizeof rec ); - rec.rectype = 0; /* unused record */ - rec.recnum = recnum; - rc = 0; - if( lseek( db_fd, recnum * TRUST_RECORD_LEN, SEEK_SET ) == -1 ) { - rc = gpg_error_from_syserror (); - log_error(_("trustdb rec %lu: lseek failed: %s\n"), - recnum, strerror(errno) ); + else /* Not found - append a new record. */ + { + offset = lseek (db_fd, 0, SEEK_END); + if (offset == (off_t)(-1)) + log_fatal ("trustdb: lseek to end failed: %s\n", strerror (errno)); + recnum = offset / TRUST_RECORD_LEN; + assert (recnum); /* this is will never be the first record */ + /* We must write a record, so that the next call to this + * function returns another recnum. */ + memset (&rec, 0, sizeof rec); + rec.rectype = 0; /* unused record */ + rec.recnum = recnum; + rc = 0; + if (lseek( db_fd, recnum * TRUST_RECORD_LEN, SEEK_SET) == -1) + { + rc = gpg_error_from_syserror (); + log_error (_("trustdb rec %lu: lseek failed: %s\n"), + recnum, strerror (errno)); } - else { - int n = write( db_fd, &rec, TRUST_RECORD_LEN); - if( n != TRUST_RECORD_LEN ) { - rc = gpg_error_from_syserror (); - log_error(_("trustdb rec %lu: write failed (n=%d): %s\n"), - recnum, n, strerror(errno) ); + else + { + int n; + + n = write (db_fd, &rec, TRUST_RECORD_LEN); + if (n != TRUST_RECORD_LEN) + { + rc = gpg_error_from_syserror (); + log_error (_("trustdb rec %lu: write failed (n=%d): %s\n"), + recnum, n, strerror (errno)); } } - if( rc ) - log_fatal(_("%s: failed to append a record: %s\n"), - db_name, gpg_strerror (rc)); + if (rc) + log_fatal (_("%s: failed to append a record: %s\n"), + db_name, gpg_strerror (rc)); } - return recnum ; + + return recnum ; } +/* Helper function for tdbio_search_trust_byfpr. */ static int cmp_trec_fpr ( const void *fpr, const TRUSTREC *rec ) { @@ -1514,32 +1798,50 @@ cmp_trec_fpr ( const void *fpr, const TRUSTREC *rec ) } +/* + * Given a 20 byte FINGERPRINT search its trust record and return + * that at REC. + * + * Return: -1 if not found, 0 if found or another error code. + * FIXME: Use GPG_ERR_NOT_FOUND instead of -1. + */ int -tdbio_search_trust_byfpr( const byte *fingerprint, TRUSTREC *rec ) +tdbio_search_trust_byfpr (const byte *fingerprint, TRUSTREC *rec) { - int rc; + int rc; - /* locate the trust record using the hash table */ - rc = lookup_hashtable( get_trusthashrec(), fingerprint, 20, - cmp_trec_fpr, fingerprint, rec ); - return rc; + /* Locate the trust record using the hash table */ + rc = lookup_hashtable (get_trusthashrec(), fingerprint, 20, + cmp_trec_fpr, fingerprint, rec ); + return rc; } + +/* + * Given a primary public key object PK search its trust record and + * return that at REC. + * + * Return: -1 if not found, 0 if found or another error code. + * FIXME: Use GPG_ERR_NOT_FOUND instead of -1. + */ int tdbio_search_trust_bypk (PKT_public_key *pk, TRUSTREC *rec) { - byte fingerprint[MAX_FINGERPRINT_LEN]; - size_t fingerlen; + byte fingerprint[MAX_FINGERPRINT_LEN]; + size_t fingerlen; - fingerprint_from_pk( pk, fingerprint, &fingerlen ); - for (; fingerlen < 20; fingerlen++ ) - fingerprint[fingerlen] = 0; - return tdbio_search_trust_byfpr (fingerprint, rec); + fingerprint_from_pk( pk, fingerprint, &fingerlen ); + for (; fingerlen < 20; fingerlen++) + fingerprint[fingerlen] = 0; + return tdbio_search_trust_byfpr (fingerprint, rec); } +/* + * Terminate the process with a message about a corrupted trustdb. + */ void -tdbio_invalid(void) +tdbio_invalid (void) { log_error (_("Error: The trustdb is corrupted.\n")); how_to_fix_the_trustdb (); ----------------------------------------------------------------------- Summary of changes: g10/gpg.c | 4 +- g10/tdbdump.c | 24 +- g10/tdbio.c | 2234 ++++++++++++++++++++++++++++++++------------------------- g10/tdbio.h | 4 +- g10/trustdb.c | 110 +-- g10/trustdb.h | 2 +- 6 files changed, 1344 insertions(+), 1034 deletions(-) hooks/post-receive -- The GNU Privacy Guard http://git.gnupg.org From cvs at cvs.gnupg.org Fri Jun 5 07:05:24 2015 From: cvs at cvs.gnupg.org (by NIIBE Yutaka) Date: Fri, 05 Jun 2015 07:05:24 +0200 Subject: [git] GnuPG - branch, master, updated. gnupg-2.1.4-16-gcf508a1 Message-ID: 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 cf508a1f7f4c8926dc554be68a2d46f5ce272ac0 (commit) from a4a15195c2a3729025a3ba3439ac8860083fceeb (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 cf508a1f7f4c8926dc554be68a2d46f5ce272ac0 Author: NIIBE Yutaka Date: Fri Jun 5 14:02:40 2015 +0900 scd: do_decipher change for OpenPGPcard v3.0. * scd/app-openpgp.c (do_decipher): Add a header for ECDH. diff --git a/scd/app-openpgp.c b/scd/app-openpgp.c index 8520231..0e751e0 100644 --- a/scd/app-openpgp.c +++ b/scd/app-openpgp.c @@ -4046,6 +4046,7 @@ do_decipher (app_t app, const char *keyidstr, int exmode, le_value; unsigned char *fixbuf = NULL; int padind = 0; + int fixuplen = 0; if (!keyidstr || !*keyidstr || !indatalen) return gpg_error (GPG_ERR_INV_VALUE); @@ -4092,8 +4093,6 @@ do_decipher (app_t app, const char *keyidstr, if (app->app_local->keyattr[1].key_type == KEY_TYPE_RSA) { - int fixuplen; - /* We might encounter a couple of leading zeroes in the cryptogram. Due to internal use of MPIs these leading zeroes are stripped. However the OpenPGP card expects exactly 128 @@ -4146,7 +4145,26 @@ do_decipher (app_t app, const char *keyidstr, } } else if (app->app_local->keyattr[1].key_type == KEY_TYPE_ECC) - padind = -1; + { + fixuplen = 7; + fixbuf = xtrymalloc (fixuplen + indatalen); + if (!fixbuf) + return gpg_error_from_syserror (); + + /* Build 'Cipher DO' */ + fixbuf[0] = '\xa6'; + fixbuf[1] = (char)(indatalen+5); + fixbuf[2] = '\x7f'; + fixbuf[3] = '\x49'; + fixbuf[4] = (char)(indatalen+2); + fixbuf[5] = '\x86'; + fixbuf[6] = (char)indatalen; + memcpy (fixbuf+fixuplen, indata, indatalen); + indata = fixbuf; + indatalen = fixuplen + indatalen; + + padind = -1; + } else return gpg_error (GPG_ERR_INV_VALUE); ----------------------------------------------------------------------- Summary of changes: scd/app-openpgp.c | 24 +++++++++++++++++++++--- 1 file changed, 21 insertions(+), 3 deletions(-) hooks/post-receive -- The GNU Privacy Guard http://git.gnupg.org From cvs at cvs.gnupg.org Fri Jun 5 14:28:26 2015 From: cvs at cvs.gnupg.org (by Werner Koch) Date: Fri, 05 Jun 2015 14:28:26 +0200 Subject: [git] GPGME - branch, master, updated. gpgme-1.5.4-2-g0d28a69 Message-ID: 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 "GnuPG Made Easy". The branch, master has been updated via 0d28a696163677d6b34a802b6beddecd805d0fc7 (commit) from 7dcb65428116e76cba9c5b171a653e791a5efaf1 (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 0d28a696163677d6b34a802b6beddecd805d0fc7 Author: Werner Koch Date: Fri Jun 5 14:25:59 2015 +0200 Fix segv for userids with a backslash. * src/engine-gpg.c (gpg_keylist_preprocess): Increment SRC for a backslash. -- This bug is not exploitable because this bug fills up .data with backslashes and thus causes the segv. Signed-off-by: Werner Koch diff --git a/src/engine-gpg.c b/src/engine-gpg.c index 57aea8b..e14fd8d 100644 --- a/src/engine-gpg.c +++ b/src/engine-gpg.c @@ -2194,6 +2194,7 @@ gpg_keylist_preprocess (char *line, char **r_line) { *dst++ = '\\'; *dst++ = '\\'; + src++; } else *(dst++) = *(src++); ----------------------------------------------------------------------- Summary of changes: src/engine-gpg.c | 1 + 1 file changed, 1 insertion(+) hooks/post-receive -- GnuPG Made Easy http://git.gnupg.org From cvs at cvs.gnupg.org Fri Jun 5 15:05:48 2015 From: cvs at cvs.gnupg.org (by Matthew Barnes) Date: Fri, 05 Jun 2015 15:05:48 +0200 Subject: [git] GPGME - branch, master, updated. gpgme-1.5.4-3-g87d713f Message-ID: 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 "GnuPG Made Easy". The branch, master has been updated via 87d713ff41454bd08a345c63605f6fc7ac854dd4 (commit) from 0d28a696163677d6b34a802b6beddecd805d0fc7 (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 87d713ff41454bd08a345c63605f6fc7ac854dd4 Author: Matthew Barnes Date: Wed Mar 18 17:20:55 2015 -0400 Set GPGME_SIGSUM_KEY_REVOKED also for gpg. * src/verify.c (calc_sig_summary): Handle GPG_ERR_CERT_REVOKED. -- parse_new_sig() handles a revoked key by setting sig->status to GPG_ERR_CERT_REVOKED, but then later calc_sig_summary() expects that code in sig->validity_reason. Additional comments added by wk. diff --git a/src/verify.c b/src/verify.c index 37b2bd4..84487ee 100644 --- a/src/verify.c +++ b/src/verify.c @@ -195,6 +195,10 @@ calc_sig_summary (gpgme_signature_t sig) sum |= GPGME_SIGSUM_KEY_MISSING; break; + case GPG_ERR_CERT_REVOKED: + sum |= GPGME_SIGSUM_KEY_REVOKED; + break; + case GPG_ERR_BAD_SIGNATURE: case GPG_ERR_NO_ERROR: break; @@ -213,6 +217,9 @@ calc_sig_summary (gpgme_signature_t sig) break; case GPG_ERR_CERT_REVOKED: + /* Note that this is a second way to set this flag. It may also + have been set due to a sig->status of STATUS_REVKEYSIG from + parse_new_sig. */ sum |= GPGME_SIGSUM_KEY_REVOKED; break; ----------------------------------------------------------------------- Summary of changes: src/verify.c | 7 +++++++ 1 file changed, 7 insertions(+) hooks/post-receive -- GnuPG Made Easy http://git.gnupg.org From cvs at cvs.gnupg.org Fri Jun 5 16:44:34 2015 From: cvs at cvs.gnupg.org (by Neal H. Walfield) Date: Fri, 05 Jun 2015 16:44:34 +0200 Subject: [git] Pinentry - branch, master, updated. pinentry-0.9.3-6-g554250b Message-ID: 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 standard pinentry collection". The branch, master has been updated via 554250b56ae00d590d05b1c5af7892314f0e72d8 (commit) from c29c5657fd77e212799715c23806a0cb6e1cfd47 (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 554250b56ae00d590d05b1c5af7892314f0e72d8 Author: Neal H. Walfield Date: Fri Jun 5 05:29:03 2015 +0200 secmem: When clearing memory, don't clear beyond the end of the buffer. * secmem/secmem.c (secmem_malloc): Only clear the user memory; don't clear beyond the end of the buffer. diff --git a/secmem/secmem.c b/secmem/secmem.c index 9a478cf..7a3bd4b 100644 --- a/secmem/secmem.c +++ b/secmem/secmem.c @@ -363,7 +363,8 @@ secmem_malloc( size_t size ) if( cur_blocks > max_blocks ) max_blocks = cur_blocks; - memset (&mb->u.aligned.c, 0, size); + memset (&mb->u.aligned.c, 0, + size - (size_t) &((struct memblock_struct *) 0)->u.aligned.c); return &mb->u.aligned.c; } ----------------------------------------------------------------------- Summary of changes: secmem/secmem.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) hooks/post-receive -- The standard pinentry collection http://git.gnupg.org From cvs at cvs.gnupg.org Fri Jun 5 20:48:29 2015 From: cvs at cvs.gnupg.org (by Werner Koch) Date: Fri, 05 Jun 2015 20:48:29 +0200 Subject: [git] Pinentry - branch, master, updated. pinentry-0.9.4-1-ge89d60c Message-ID: 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 standard pinentry collection". The branch, master has been updated via e89d60c4bbb0785deb5211f315eeba6e9ec297d7 (commit) via 29d7c5ffda648e61431b42964e773c13f77bf501 (commit) from 554250b56ae00d590d05b1c5af7892314f0e72d8 (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 e89d60c4bbb0785deb5211f315eeba6e9ec297d7 Author: Werner Koch Date: Fri Jun 5 20:46:52 2015 +0200 Post release updates. -- diff --git a/NEWS b/NEWS index 4727f9d..0d40cc2 100644 --- a/NEWS +++ b/NEWS @@ -1,3 +1,7 @@ +Noteworthy changes in version 0.9.5 (unreleased) +------------------------------------------------ + + Noteworthy changes in version 0.9.4 (2015-06-05) ------------------------------------------------ diff --git a/configure.ac b/configure.ac index c453e45..084a160 100644 --- a/configure.ac +++ b/configure.ac @@ -26,7 +26,7 @@ min_automake_version="1.14" # (git tag -s pinentry-n.m.k) and run "./autogen.sh --force". Please # bump the version number immediately after the release, do another # commit, and a push so that the git magic is able to work. -m4_define(mym4_version, [0.9.4]) +m4_define(mym4_version, [0.9.5]) # Below is m4 magic to extract and compute the git revision number, # the decimalized short revision number, a beta version string and a commit 29d7c5ffda648e61431b42964e773c13f77bf501 Author: Werner Koch Date: Fri Jun 5 20:40:28 2015 +0200 Release 0.9.4 diff --git a/NEWS b/NEWS index 95caa4c..4727f9d 100644 --- a/NEWS +++ b/NEWS @@ -1,6 +1,8 @@ -Noteworthy changes in version 0.9.4 (unreleased) +Noteworthy changes in version 0.9.4 (2015-06-05) ------------------------------------------------ + * Fix regression in GTK+ and curses pinentries. + Noteworthy changes in version 0.9.3 (2015-06-01) ------------------------------------------------ ----------------------------------------------------------------------- Summary of changes: NEWS | 8 +++++++- configure.ac | 2 +- 2 files changed, 8 insertions(+), 2 deletions(-) hooks/post-receive -- The standard pinentry collection http://git.gnupg.org From cvs at cvs.gnupg.org Fri Jun 5 20:55:52 2015 From: cvs at cvs.gnupg.org (by Werner Koch) Date: Fri, 05 Jun 2015 20:55:52 +0200 Subject: [git] gnupg-doc - branch, master, updated. b3cd437b5782c037fcacc80af78215ea8a274539 Message-ID: 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 GnuPG website and other docs". The branch, master has been updated via b3cd437b5782c037fcacc80af78215ea8a274539 (commit) via 5f6b5637f9532f963a2e730a7507b0e4d324f4cb (commit) from cd59bfb2169daa9199824a6bea214c2608535531 (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 b3cd437b5782c037fcacc80af78215ea8a274539 Author: Werner Koch Date: Fri Jun 5 20:49:54 2015 +0200 swdb: Release pinentry 0.9.4. diff --git a/web/download/index.org b/web/download/index.org index d4c01af..cc6268e 100644 --- a/web/download/index.org +++ b/web/download/index.org @@ -83,7 +83,7 @@ - /GPA/ is a graphical frontend to GnuPG. - - /Dirmngr/ is an optional tools for use with /GnuPG stable/ (2.0). + - /Dirmngr/ is an optional tool for use with /GnuPG stable/ (2.0). It is already included in /GnuPG modern/ (2.1) diff --git a/web/swdb.mac b/web/swdb.mac index 26ecb94..3d9e2e9 100644 --- a/web/swdb.mac +++ b/web/swdb.mac @@ -53,9 +53,9 @@ # # PINENTRY # -#+macro: pinentry_ver 0.9.3 -#+macro: pinentry_size 497k -#+macro: pinentry_sha1 5551fdb62dc268dee8861b50ff93f6741b8eec8a +#+macro: pinentry_ver 0.9.4 +#+macro: pinentry_size 498k +#+macro: pinentry_sha1 0c47f0ddea4631bcba01ebbeca8bffe0bf43e440 # commit 5f6b5637f9532f963a2e730a7507b0e4d324f4cb Author: Werner Koch Date: Tue Jun 2 15:27:22 2015 +0200 web: Release info for 2.0.28 diff --git a/web/index.org b/web/index.org index cd1f3d7..57ba974 100644 --- a/web/index.org +++ b/web/index.org @@ -65,6 +65,11 @@ The latest release news:\\ # point or paste the [[news.en.rss][RSS file]] into your aggregator. +** GnuPG 2.0.28 released (2015-06-02) + +GnuPG 2.0.28 is now available. This release fixes a couple of bugs; +users of GnuPG 2.0.x should update to this version. [[http://lists.gnupg.org/pipermail/gnupg-announce/2015q2/000367.html][{more}]] + ** GnuPG 2.1.4 released (2015-05-12) A new version of the /modern/ branch of GnuPG has been released. diff --git a/web/swdb.mac b/web/swdb.mac index b2d2560..26ecb94 100644 --- a/web/swdb.mac +++ b/web/swdb.mac @@ -7,12 +7,12 @@ #+macro: ftp_base ftp://ftp.gnupg.org/gcrypt # -# GnuPG-2 +# GnuPG # -#+macro: gnupg_ver 2.0.27 +#+macro: gnupg_ver 2.0.28 #+macro: gnupg_branch STABLE-BRANCH-2-0 -#+macro: gnupg_size 4321k -#+macro: gnupg_sha1 d065be185f5bac8ea07b210ab7756e79b83b63d4 +#+macro: gnupg_size 4332k +#+macro: gnupg_sha1 9a1050f72b6c9afe2b4a0a3f2e9dca2abba8e4ef # # GnuPG-2.1 @@ -53,9 +53,9 @@ # # PINENTRY # -#+macro: pinentry_ver 0.9.2 -#+macro: pinentry_size 484k -#+macro: pinentry_sha1 5179807a412056286c7ac98a1ea6727c74ea87d2 +#+macro: pinentry_ver 0.9.3 +#+macro: pinentry_size 497k +#+macro: pinentry_sha1 5551fdb62dc268dee8861b50ff93f6741b8eec8a # ----------------------------------------------------------------------- Summary of changes: web/download/index.org | 2 +- web/index.org | 5 +++++ web/swdb.mac | 14 +++++++------- 3 files changed, 13 insertions(+), 8 deletions(-) hooks/post-receive -- The GnuPG website and other docs http://git.gnupg.org From cvs at cvs.gnupg.org Sun Jun 7 11:27:17 2015 From: cvs at cvs.gnupg.org (by Neal H. Walfield) Date: Sun, 07 Jun 2015 11:27:17 +0200 Subject: [git] gnupg-doc - branch, master, updated. f0aeae6a7b2924be954f2ee8c802c44e54225357 Message-ID: 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 GnuPG website and other docs". The branch, master has been updated via f0aeae6a7b2924be954f2ee8c802c44e54225357 (commit) from b3cd437b5782c037fcacc80af78215ea8a274539 (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 f0aeae6a7b2924be954f2ee8c802c44e54225357 Author: Neal H. Walfield Date: Sun Jun 7 11:12:20 2015 +0200 blog: News for May diff --git a/misc/blog.gnupg.org/20150607-gnupg-in-may.org b/misc/blog.gnupg.org/20150607-gnupg-in-may.org new file mode 100644 index 0000000..ef5a794 --- /dev/null +++ b/misc/blog.gnupg.org/20150607-gnupg-in-may.org @@ -0,0 +1,115 @@ +# GnuPG News for May 2015 +#+STARTUP: showall +#+AUTHOR: Neal +#+DATE: June 7th, 2015 +#+Keywords: GNOME Python Emacs Pinentry Libassuan + +** GnuPG News for May 2015 + +A lot happened during May. + +My focus was on Pinentry. My primary goal was to fix the GNOME +Keyring issue, but along the way I also made various improvements and +closed a bunch of outstanding issues. + +The GNOME Keyring issue is that GNOME Keyring proxies all traffic to +GPG Agent so that it can cache any passphrases and display its own +pinentry dialogs, which have a GNOME3 aesthetic. Unfortunately, the +proxy's implementation of the GPG Agent protocol is not complete and +this breaks a lot of GnuPG's functionality. Working with Stef +Walters, the maintainer of GNOME Keyring, we came up with a plan to +resolve the situation. The basic idea is to add support for external +password managers to GnuPG, modify the pinentry programs to deal with +an external password manager and add a GNOME3 pinentry. The changes +for GnuPG have been added to the 2.1 branch and backported to the 2.0 +branch. The pinentry work is also done. The remaining bit of work is +to get distributions to disable the GNOME Keyring proxy and distribute +the new changes. (A summary of changes required by distributions can +be found [[https://lists.gnupg.org/pipermail/gnupg-devel/2015-May/029835.html][here]].) To this end, Werner released new version of GnuPG +stable (the 2.0 line), GnuPG modern (the 2.1 line) and Pinentry. +Distributions immediately began to integrate the changes. In +particular, Daniel Kahn Gillmor already uploaded packages to Debian +Unstable. This uncovered a few minor bugs, which we quickly fixed. + +Ben McGinnes [[https://lists.gnupg.org/pipermail/gnupg-devel/2015-May/029844.html][announced]] new Python 3 bindings for GPGME based on PyME +0.9.0. Ben noted that PyME is for Python 2 and will continue to be +maintained separately by Martin Albrecht. Ben has tested the library +on Mac OS X, but seeks more testers. + +Daniel Kahn Gillmore [[https://lists.gnupg.org/pipermail/gnupg-devel/2015-May/029786.html][announced]] initial Python 3 bindings for +libassuan, GnuPG's IPC library. The library is not yet complete and +Daniel is looking for feedback regarding the API as well as more +general contributions. + +Daiki Ueno sent [[https://lists.gnupg.org/pipermail/gnupg-devel/2015-May/029875.html][patches]] to add an emacs-based pinentry. This pinentry +talks to the running emacs using a communication mechanism similar to +emacsclient. Unlike the other pinentry's, this pinentry isn't +normally used by default. Instead, all of the pinentries have been +modified to (optionally) detect whether they are run from emacs (by +checking for the INSIDE_EMACS environment variable). If so, they use +the new pinentry functionality. Otherwise, they display their usual +frontend. + +NIIBE Yutaka and Werner spent time triaging a number of bugs. This +work is not very sexy, but this is what most improves the quality of +the code base. + +Daniel Kahn Gillmor also reported a number of bugs and did significant +work helping to triage them. + +Werner released GnuPG versions [[https://lists.gnupg.org/pipermail/gnupg-devel/2015-May/029817.html][2.1.4]] and [[https://lists.gnupg.org/pipermail/gnupg-devel/2015-June/029892.html][2.0.28]] and Pinentry version +0.9.3 and 0.9.4. + +Werner has also been actively improving the OpenPGP specificantion, +RFC4880. This effort is occuring within the context of the [[http://www.ietf.org/mail-archive/web/openpgp/][IETF]]. The +new specification is currently called RFC4880bis and a working group +is in the process of being chartered. The goal is to have a new +version of the specification by July 2016. + +In additional to the development, there were also several interesting +discussions on the mailing lists. + +On gnupg-devel, Daniel Kahn Gillmor [[https://lists.gnupg.org/pipermail/gnupg-devel/2015-April/029750.html][observed]] that GnuPG reads 300 +bytes from /dev/random when it generates a long-term key, which, he +observed, is a lot given /dev/random's limited entropy . Werner +explained that GnuPG has always done this. In particular, GnuPG +maintains a 600-byte persistent seed file and every time a key is +generated it stirs in an additional 300 bytes. Daniel pointed out an +interesting blog post by DJB explaining that a proper CSPRNG should +never need more than about 32 bytes of entropy. Peter Gutmann chimed +in and noted that a 2048-bit RSA key needs about about 103 bits of +entropy and a 4096-bit RSA key needs about 142 bits, but, in practice, +128-bits is enough. Based on this, Werner proposed a patch for +Libgcrypt that reduces the amount of seeding to just 128-bits. + +During this discussion, Werner also [[https://lists.gnupg.org/pipermail/gnupg-devel/2015-May/029782.html][noted]] that to avoid reusing +entropy and thereby weakening any derived keys, it is important to +never backup or restore GnuPG's random seed file +(~/.gnupg/random_seed). + +Werner proposed adding an option to the GTK+ pinentry to [[https://lists.gnupg.org/pipermail/gnupg-devel/2015-May/029790.html][show/hide]] the +passphrase. This is useful when entering very long passphrases (and +when the user knows that he or she is not being observed). + +On gnupg-users, there was an interesting [[https://lists.gnupg.org/pipermail/gnupg-users/2015-May/053676.html][discussion]] about using +external sources of entropy, such as the results of rolling dice. +Niibe replied that no person can beat the unbiasedness of modern +HWRNG, which are aggressively tested using modern empirical statistics +over gigabytes or terabytes of random data. The only real question is +whether the entropy source has been backdoored. + +The Facebook announcement for OpenPGP was also [[https://lists.gnupg.org/pipermail/gnupg-users/2015-June/053709.html][mentioned]]. The +reactions are mixed. Personally, I think this is a positive +development. It's true that Facebook is probably not working towards +end-to-end encryption, but if they encourage other big sites, such as +banks and e-commerce sites, to encrypt their email communication with +their users, we may have a meaningful increase in security. + + +** About this news posting + +We try to write a news posting each month. However, other work may +have a higher priority (e.g. security fixes) and thus there is no +promise for a fixed publication date. If you have an interesting +topic for a news posting, please send it to us. A regular summary of +the mailing list discussions would make a nice column on this news. diff --git a/misc/id/.gitignore b/misc/id/.gitignore index 37f0b11..1ba79b9 100644 --- a/misc/id/.gitignore +++ b/misc/id/.gitignore @@ -1 +1,4 @@ draft.txt +abstract.xml +back.xml +middle.xml ----------------------------------------------------------------------- Summary of changes: misc/blog.gnupg.org/20150607-gnupg-in-may.org | 115 ++++++++++++++++++++++++++ misc/id/.gitignore | 3 + 2 files changed, 118 insertions(+) create mode 100644 misc/blog.gnupg.org/20150607-gnupg-in-may.org hooks/post-receive -- The GnuPG website and other docs http://git.gnupg.org From cvs at cvs.gnupg.org Sun Jun 7 14:37:57 2015 From: cvs at cvs.gnupg.org (by Neal H. Walfield) Date: Sun, 07 Jun 2015 14:37:57 +0200 Subject: [git] Pinentry - branch, master, updated. pinentry-0.9.4-2-g4445985 Message-ID: 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 standard pinentry collection". The branch, master has been updated via 444598586d0abf70d5a27d2aafcd6c14989621db (commit) from e89d60c4bbb0785deb5211f315eeba6e9ec297d7 (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 444598586d0abf70d5a27d2aafcd6c14989621db Author: Neal H. Walfield Date: Sun Jun 7 14:36:39 2015 +0200 gnome3: Actually respect the user's choice of using a password manager. * gnome3/pinentry-gnome3.c (create_prompt) [HAVE_LIBSECRET]: Only show the libsecret prompt in this case. (gnome3_cmd_handler) [HAVE_LIBSECRET]: Set PE->MAY_CACHE_PASSWORD according to the user's choice. diff --git a/gnome3/pinentry-gnome3.c b/gnome3/pinentry-gnome3.c index 74ec89c..0fea8f0 100644 --- a/gnome3/pinentry-gnome3.c +++ b/gnome3/pinentry-gnome3.c @@ -145,6 +145,7 @@ create_prompt (pinentry_t pe, int confirm) /* XXX: gcr expects a string; we have a int. */ // gcr_prompt_set_caller_window (prompt, pe->parent_wid); +#ifdef HAVE_LIBSECRET if (! confirm && pe->allow_external_password_cache && pe->keyinfo) { if (pe->default_pwmngr) @@ -157,6 +158,7 @@ create_prompt (pinentry_t pe, int confirm) gcr_prompt_set_choice_label (prompt, "Automatically unlock this key, whenever I'm logged in"); } +#endif return prompt; } @@ -203,6 +205,11 @@ gnome3_cmd_handler (pinentry_t pe) if (pe->repeat_passphrase) pe->repeat_okay = 1; +#ifdef HAVE_LIBSECRET + if (pe->allow_external_password_cache && pe->keyinfo) + pe->may_cache_password = gcr_prompt_get_choice_chosen (prompt); +#endif + ret = 1; } } ----------------------------------------------------------------------- Summary of changes: gnome3/pinentry-gnome3.c | 7 +++++++ 1 file changed, 7 insertions(+) hooks/post-receive -- The standard pinentry collection http://git.gnupg.org From cvs at cvs.gnupg.org Mon Jun 8 10:45:15 2015 From: cvs at cvs.gnupg.org (by Werner Koch) Date: Mon, 08 Jun 2015 10:45:15 +0200 Subject: [git] GPGME - branch, master, updated. gpgme-1.5.4-4-ga5b040c Message-ID: 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 "GnuPG Made Easy". The branch, master has been updated via a5b040cc57c65b3d105666b90c7eb59ee6ff3882 (commit) from 87d713ff41454bd08a345c63605f6fc7ac854dd4 (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 a5b040cc57c65b3d105666b90c7eb59ee6ff3882 Author: Werner Koch Date: Mon Jun 8 10:43:29 2015 +0200 Fix test suite for GnuPG 2.1 which uses pubring.kbx. * tests/gpgsm/final.test: New. * tests/gpgsm/initial.test: New. * tests/gpg/start-stop-agent: Move to ../. * tests/gpgsm/Makefile.am (TESTS_ENVIRONMENT): Export top_srcdir. (TESTS): Add intial.test and final.test. (AM_LDFLAGS): Add -no-install. (clean-local): Use start-stop-agent (initial.test): Add dependency. * tests/gpg/Makefile.am (top_srcdir): Export top_srcdir. (AM_LDFLAGS): Add -no-install. (check-local): Depend on pubring-stamp instead of pubring.gpg. (initial.test): Depend on check-local. (./pubring-gpg): Replace by rule for ./pubring-stamp. -- There are also a couple of other changes which should make the tests a bit more robust and the gpg and gpgsm tests more similar. The -no-install avoids creating wrappers for test programs, which make debugging easier. The dependency on check-local guarantees that its rules are run before the first test. This is important because conf files are setup by this rule. Earlier automake versions seem to have run check-local always before the tests but today the order of execution is not defined. Signed-off-by: Werner Koch diff --git a/tests/Makefile.am b/tests/Makefile.am index 4b465d8..94eddac 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -23,7 +23,7 @@ TESTS_ENVIRONMENT = GNUPGHOME=$(abs_builddir) TESTS = t-version t-data t-engine-info -EXTRA_DIST = t-data-1.txt t-data-2.txt ChangeLog-2011 +EXTRA_DIST = start-stop-agent t-data-1.txt t-data-2.txt ChangeLog-2011 AM_CPPFLAGS = -I$(top_builddir)/src @GPG_ERROR_CFLAGS@ LDADD = ../src/libgpgme.la @GPG_ERROR_LIBS@ diff --git a/tests/gpg/Makefile.am b/tests/gpg/Makefile.am index 5f40dfe..107397b 100644 --- a/tests/gpg/Makefile.am +++ b/tests/gpg/Makefile.am @@ -22,7 +22,8 @@ GPG = gpg GPG_AGENT = gpg-agent -TESTS_ENVIRONMENT = GNUPGHOME=$(abs_builddir) LC_ALL=C GPG_AGENT_INFO= +TESTS_ENVIRONMENT = GNUPGHOME=$(abs_builddir) LC_ALL=C GPG_AGENT_INFO= \ + top_srcdir=$(top_srcdir) # The keylist tests must come after the import and the edit test. noinst_HEADERS = t-support.h @@ -43,7 +44,7 @@ TESTS = initial.test $(c_tests) final.test CLEANFILES = secring.gpg pubring.gpg pubring.kbx trustdb.gpg dirmngr.conf \ gpg-agent.conf pubring.kbx~ S.gpg-agent gpg.conf pubring.gpg~ \ - random_seed S.gpg-agent .gpg-v21-migrated + random_seed S.gpg-agent .gpg-v21-migrated pubring-stamp private_keys = \ 13CD0F3BDF24BE53FE192D62F18737256FF6E4FD \ @@ -53,11 +54,12 @@ private_keys = \ 7A030357C0F253A5BBCD282FFC4E521B37558F5C -EXTRA_DIST = start-stop-agent initial.test final.test \ +EXTRA_DIST = initial.test final.test \ pubdemo.asc secdemo.asc cipher-1.asc cipher-2.asc \ geheim.txt pubkey-1.asc seckey-1.asc pinentry $(private_keys) AM_CPPFLAGS = -I$(top_builddir)/src @GPG_ERROR_CFLAGS@ +AM_LDFLAGS = -no-install LDADD = ../../src/libgpgme.la t_thread1_LDADD = ../../src/libgpgme-pthread.la -lpthread @@ -65,12 +67,16 @@ t_thread1_LDADD = ../../src/libgpgme-pthread.la -lpthread noinst_PROGRAMS = $(c_tests) t-genkey clean-local: - -$(srcdir)/start-stop-agent --stop + -$(top_srcdir)/tests/start-stop-agent --stop -rm -fR private-keys-v1.d -check-local: ./gpg.conf ./gpg-agent.conf ./pubring.gpg \ +check-local: ./gpg.conf ./gpg-agent.conf ./pubring-stamp \ ./private-keys-v1.d/gpg-sample.stamp +# To guarantee that check-local is run before any tests we +# add this dependency: +initial.test : check-local + export GNUPGHOME := $(abs_builddir) export GPG_AGENT_INFO := @@ -82,11 +88,12 @@ export GPG_AGENT_INFO := done echo x > ./private-keys-v1.d/gpg-sample.stamp -./pubring.gpg: $(srcdir)/pubdemo.asc - -$(GPG) --no-permission-warning \ - --import $(srcdir)/pubdemo.asc +./pubring-stamp: $(srcdir)/pubdemo.asc + $(GPG) --no-permission-warning \ + --import $(srcdir)/pubdemo.asc -$(GPG) --no-permission-warning \ --import $(srcdir)/secdemo.asc + touch ./pubring-stamp ./gpg.conf: # This is required for t-sig-notations. diff --git a/tests/gpg/final.test b/tests/gpg/final.test index 5148a34..5289396 100755 --- a/tests/gpg/final.test +++ b/tests/gpg/final.test @@ -1,4 +1,4 @@ #!/bin/sh -${srcdir}/start-stop-agent --stop +${top_srcdir}/tests/start-stop-agent --stop exit 0 diff --git a/tests/gpg/initial.test b/tests/gpg/initial.test index 1981c99..93c8621 100755 --- a/tests/gpg/initial.test +++ b/tests/gpg/initial.test @@ -1,4 +1,4 @@ #!/bin/sh -${srcdir}/start-stop-agent --start +${top_srcdir}/tests/start-stop-agent --start exit 0 diff --git a/tests/gpgsm/Makefile.am b/tests/gpgsm/Makefile.am index bf616d3..41645b6 100644 --- a/tests/gpgsm/Makefile.am +++ b/tests/gpgsm/Makefile.am @@ -21,20 +21,26 @@ GPGSM = gpgsm -TESTS_ENVIRONMENT = GNUPGHOME=$(abs_builddir) GPG_AGENT_INFO= +TESTS_ENVIRONMENT = GNUPGHOME=$(abs_builddir) LC_ALL=C GPG_AGENT_INFO= \ + top_srcdir=$(top_srcdir) noinst_HEADERS = t-support.h -TESTS = t-import t-keylist t-encrypt t-verify t-decrypt t-sign t-export + +c_tests = t-import t-keylist t-encrypt t-verify t-decrypt t-sign t-export + + +TESTS = initial.test $(c_tests) final.test EXTRA_DIST = cert_dfn_pca01.der cert_dfn_pca15.der cert_g10code_test1.der \ - $(key_id) + $(key_id) initial.test final.test AM_CPPFLAGS = -I$(top_builddir)/src @GPG_ERROR_CFLAGS@ +AM_LDFLAGS = -no-install LDADD = ../../src/libgpgme.la # We don't run t-genkey in the test suite, because it takes too long # and needs a working pinentry. -noinst_PROGRAMS = $(TESTS) t-genkey cms-keylist cms-decrypt +noinst_PROGRAMS = $(c_tests) t-genkey cms-keylist cms-decrypt key_id = 32100C27173EF6E9C4E9A25D3D69F86D37A4F939 @@ -42,12 +48,16 @@ CLEANFILES = pubring.kbx pubring.kbx~ gpgsm.conf trustlist.txt \ random_seed S.gpg-agent clean-local: - -gpg-connect-agent KILLAGENT /bye + -$(top_srcdir)/tests/start-stop-agent --stop -rm -fR private-keys-v1.d check-local: ./pubring.kbx ./gpgsm.conf \ ./private-keys-v1.d/$(key_id).key ./trustlist.txt +# To guarantee that check-local is run before any tests we add this +# dependency: +initial.test : check-local + export GNUPGHOME := $(abs_builddir) export GPG_AGENT_INFO := diff --git a/tests/gpgsm/final.test b/tests/gpgsm/final.test new file mode 100755 index 0000000..d0567e3 --- /dev/null +++ b/tests/gpgsm/final.test @@ -0,0 +1,5 @@ +#!/bin/sh + +${top_srcdir}/tests/start-stop-agent --stop + +exit 0 diff --git a/tests/gpgsm/initial.test b/tests/gpgsm/initial.test new file mode 100755 index 0000000..93c8621 --- /dev/null +++ b/tests/gpgsm/initial.test @@ -0,0 +1,4 @@ +#!/bin/sh + +${top_srcdir}/tests/start-stop-agent --start +exit 0 diff --git a/tests/gpg/start-stop-agent b/tests/start-stop-agent similarity index 100% rename from tests/gpg/start-stop-agent rename to tests/start-stop-agent ----------------------------------------------------------------------- Summary of changes: tests/Makefile.am | 2 +- tests/gpg/Makefile.am | 23 +++++++++++++++-------- tests/gpg/final.test | 2 +- tests/gpg/initial.test | 2 +- tests/gpgsm/Makefile.am | 20 +++++++++++++++----- tests/gpgsm/final.test | 5 +++++ tests/gpgsm/initial.test | 4 ++++ tests/{gpg => }/start-stop-agent | 0 8 files changed, 42 insertions(+), 16 deletions(-) create mode 100755 tests/gpgsm/final.test create mode 100755 tests/gpgsm/initial.test rename tests/{gpg => }/start-stop-agent (100%) hooks/post-receive -- GnuPG Made Easy http://git.gnupg.org From cvs at cvs.gnupg.org Mon Jun 8 11:12:56 2015 From: cvs at cvs.gnupg.org (by Werner Koch) Date: Mon, 08 Jun 2015 11:12:56 +0200 Subject: [git] GPGME - branch, master, updated. gpgme-1.5.4-5-g8b9f848 Message-ID: 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 "GnuPG Made Easy". The branch, master has been updated via 8b9f84828cd04a7dab37e219123edc1905da8e6b (commit) from a5b040cc57c65b3d105666b90c7eb59ee6ff3882 (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 8b9f84828cd04a7dab37e219123edc1905da8e6b Author: Werner Koch Date: Mon Jun 8 11:08:08 2015 +0200 Fix compiler warnings about unused value in TRACE macros. * src/debug.h: Change macros to not have a literal 0 as last expression of the comma operator. * src/debug.c (_gpgme_debug_frame_end): Return 0. (_gpgme_debug): Return 0. -- Instead of using foo(), 0 for the trace macros we let foo() return 0 instead. Signed-off-by: Werner Koch diff --git a/src/debug.c b/src/debug.c index ca0bb21..292db55 100644 --- a/src/debug.c +++ b/src/debug.c @@ -80,11 +80,12 @@ _gpgme_debug_frame_begin (void) #endif } -void _gpgme_debug_frame_end (void) +int _gpgme_debug_frame_end (void) { #ifdef FRAME_NR frame_nr--; #endif + return 0; } @@ -223,8 +224,17 @@ _gpgme_debug_subsystem_init (void) -/* Log the formatted string FORMAT at debug level LEVEL or higher. */ -void +/* Log the formatted string FORMAT at debug level LEVEL or higher. + * + * Returns: 0 + * + * Note that we always return 0 because the old TRACE macro evaluated + * to 0 which issues a warning with newer gcc version about an unused + * values. By using a return value of this function this can be + * avoided. Fixme: It might be useful to check whether the return + * value from the TRACE macros are actually used somewhere. + */ +int _gpgme_debug (int level, const char *format, ...) { va_list arg_ptr; @@ -232,7 +242,7 @@ _gpgme_debug (int level, const char *format, ...) saved_errno = errno; if (debug_level < level) - return; + return 0; va_start (arg_ptr, format); LOCK (debug_lock); @@ -273,6 +283,7 @@ _gpgme_debug (int level, const char *format, ...) fflush (errfp); gpg_err_set_errno (saved_errno); + return 0; } diff --git a/src/debug.h b/src/debug.h index d0db573..6bde998 100644 --- a/src/debug.h +++ b/src/debug.h @@ -64,7 +64,7 @@ int _gpgme_debug_set_debug_envvar (const char *value); void _gpgme_debug_subsystem_init (void); /* Log the formatted string FORMAT at debug level LEVEL or higher. */ -void _gpgme_debug (int level, const char *format, ...); +int _gpgme_debug (int level, const char *format, ...); /* Start a new debug line in *LINE, logged at level LEVEL or higher, and starting with the formatted string FORMAT. */ @@ -82,7 +82,7 @@ void _gpgme_debug_buffer (int lvl, const char *const fmt, size_t len); void _gpgme_debug_frame_begin (void); -void _gpgme_debug_frame_end (void); +int _gpgme_debug_frame_end (void); static inline gpgme_error_t _gpgme_trace_gpgme_error (gpgme_error_t err, const char *file, int line) @@ -108,82 +108,80 @@ _gpgme_trace_gpgme_error (gpgme_error_t err, const char *file, int line) #define TRACE_BEG(lvl, name, tag) \ _TRACE (lvl, name, tag); \ _gpgme_debug (_gpgme_trace_level, "%s: enter: %s=%p\n", \ - _gpgme_trace_func, _gpgme_trace_tagname, _gpgme_trace_tag), 0 + _gpgme_trace_func, _gpgme_trace_tagname, _gpgme_trace_tag) #define TRACE_BEG0(lvl, name, tag, fmt) \ _TRACE (lvl, name, tag); \ _gpgme_debug (_gpgme_trace_level, "%s: enter: %s=%p, " fmt "\n", \ - _gpgme_trace_func, _gpgme_trace_tagname, _gpgme_trace_tag), 0 + _gpgme_trace_func, _gpgme_trace_tagname, _gpgme_trace_tag) #define TRACE_BEG1(lvl, name, tag, fmt, arg1) \ _TRACE (lvl, name, tag); \ _gpgme_debug (_gpgme_trace_level, "%s: enter: %s=%p, " fmt "\n", \ _gpgme_trace_func, _gpgme_trace_tagname, _gpgme_trace_tag, \ - arg1), 0 + arg1) #define TRACE_BEG2(lvl, name, tag, fmt, arg1, arg2) \ _TRACE (lvl, name, tag); \ _gpgme_debug (_gpgme_trace_level, "%s: enter: %s=%p, " fmt "\n", \ _gpgme_trace_func, _gpgme_trace_tagname, _gpgme_trace_tag, \ - arg1, arg2), 0 + arg1, arg2) #define TRACE_BEG3(lvl, name, tag, fmt, arg1, arg2, arg3) \ _TRACE (lvl, name, tag); \ _gpgme_debug (_gpgme_trace_level, "%s: enter: %s=%p, " fmt "\n", \ _gpgme_trace_func, _gpgme_trace_tagname, _gpgme_trace_tag, \ - arg1, arg2, arg3), 0 + arg1, arg2, arg3) #define TRACE_BEG4(lvl, name, tag, fmt, arg1, arg2, arg3, arg4) \ _TRACE (lvl, name, tag); \ _gpgme_debug (_gpgme_trace_level, "%s: enter: %s=%p, " fmt "\n", \ _gpgme_trace_func, _gpgme_trace_tagname, _gpgme_trace_tag, \ - arg1, arg2, arg3, arg4), 0 + arg1, arg2, arg3, arg4) #define TRACE_BEG5(lvl, name, tag, fmt, arg1, arg2, arg3, arg4, arg5) \ _TRACE (lvl, name, tag); \ _gpgme_debug (_gpgme_trace_level, "%s: enter: %s=%p, " fmt "\n", \ _gpgme_trace_func, _gpgme_trace_tagname, _gpgme_trace_tag, \ - arg1, arg2, arg3, arg4, arg5), 0 + arg1, arg2, arg3, arg4, arg5) #define TRACE_BEG7(lvl, name, tag, fmt, arg1, arg2, arg3, arg4, \ arg5, arg6, arg7) \ _TRACE (lvl, name, tag); \ _gpgme_debug (_gpgme_trace_level, "%s: enter: %s=%p, " fmt "\n", \ _gpgme_trace_func, _gpgme_trace_tagname, _gpgme_trace_tag, \ - arg1, arg2, arg3, arg4, arg5, \ - arg6, arg7), 0 + arg1, arg2, arg3, arg4, arg5, arg6, arg7) #define TRACE_BEG8(lvl, name, tag, fmt, arg1, arg2, arg3, arg4, \ arg5, arg6, arg7, arg8) \ _TRACE (lvl, name, tag); \ _gpgme_debug (_gpgme_trace_level, "%s: enter: %s=%p, " fmt "\n", \ _gpgme_trace_func, _gpgme_trace_tagname, _gpgme_trace_tag, \ - arg1, arg2, arg3, arg4, arg5, \ - arg6, arg7, arg8), 0 + arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8) #define TRACE(lvl, name, tag) \ _gpgme_debug_frame_begin (), \ _gpgme_debug (lvl, "%s: call: %s=%p\n", \ name, STRINGIFY (tag), (void *) (uintptr_t) tag), \ - _gpgme_debug_frame_end (), 0 + _gpgme_debug_frame_end () #define TRACE0(lvl, name, tag, fmt) \ _gpgme_debug_frame_begin (), \ _gpgme_debug (lvl, "%s: call: %s=%p, " fmt "\n", \ name, STRINGIFY (tag), (void *) (uintptr_t) tag), \ - _gpgme_debug_frame_end (), 0 + _gpgme_debug_frame_end () #define TRACE1(lvl, name, tag, fmt, arg1) \ _gpgme_debug_frame_begin (), \ _gpgme_debug (lvl, "%s: call: %s=%p, " fmt "\n", \ name, STRINGIFY (tag), (void *) (uintptr_t) tag, arg1), \ - _gpgme_debug_frame_end (), 0 + _gpgme_debug_frame_end () #define TRACE2(lvl, name, tag, fmt, arg1, arg2) \ _gpgme_debug_frame_begin (), \ _gpgme_debug (lvl, "%s: call: %s=%p, " fmt "\n", \ name, STRINGIFY (tag), (void *) (uintptr_t) tag, arg1, \ - arg2), _gpgme_debug_frame_end (), 0 + arg2), _gpgme_debug_frame_end () #define TRACE3(lvl, name, tag, fmt, arg1, arg2, arg3) \ _gpgme_debug_frame_begin (), \ _gpgme_debug (lvl, "%s: call: %s=%p, " fmt "\n", \ name, STRINGIFY (tag), (void *) (uintptr_t) tag, arg1, \ - arg2, arg3), _gpgme_debug_frame_end (), 0 + arg2, arg3), _gpgme_debug_frame_end () #define TRACE6(lvl, name, tag, fmt, arg1, arg2, arg3, arg4, arg5, arg6) \ _gpgme_debug_frame_begin (), \ _gpgme_debug (lvl, "%s: call: %s=%p, " fmt "\n", \ name, STRINGIFY (tag), (void *) (uintptr_t) tag, arg1, \ arg2, arg3, arg4, arg5, arg6), \ - _gpgme_debug_frame_end (), 0 + _gpgme_debug_frame_end () #define TRACE_ERR(err) \ err == 0 ? (TRACE_SUC ()) : \ @@ -203,53 +201,52 @@ _gpgme_trace_gpgme_error (gpgme_error_t err, const char *file, int line) #define TRACE_SUC() \ _gpgme_debug (_gpgme_trace_level, "%s: leave\n", \ - _gpgme_trace_func), _gpgme_debug_frame_end (), 0 + _gpgme_trace_func), _gpgme_debug_frame_end () #define TRACE_SUC0(fmt) \ _gpgme_debug (_gpgme_trace_level, "%s: leave: " fmt "\n", \ - _gpgme_trace_func), _gpgme_debug_frame_end (), 0 + _gpgme_trace_func), _gpgme_debug_frame_end () #define TRACE_SUC1(fmt, arg1) \ _gpgme_debug (_gpgme_trace_level, "%s: leave: " fmt "\n", \ - _gpgme_trace_func, arg1), _gpgme_debug_frame_end (), 0 + _gpgme_trace_func, arg1), _gpgme_debug_frame_end () #define TRACE_SUC2(fmt, arg1, arg2) \ _gpgme_debug (_gpgme_trace_level, "%s: leave: " fmt "\n", \ - _gpgme_trace_func, arg1, arg2), _gpgme_debug_frame_end (), 0 + _gpgme_trace_func, arg1, arg2), _gpgme_debug_frame_end () #define TRACE_SUC5(fmt, arg1, arg2, arg3, arg4, arg5) \ _gpgme_debug (_gpgme_trace_level, "%s: leave: " fmt "\n", \ _gpgme_trace_func, arg1, arg2, arg3, arg4, arg5), \ - _gpgme_debug_frame_end (), 0 + _gpgme_debug_frame_end () #define TRACE_SUC6(fmt, arg1, arg2, arg3, arg4, arg5, arg6) \ _gpgme_debug (_gpgme_trace_level, "%s: leave: " fmt "\n", \ _gpgme_trace_func, arg1, arg2, arg3, arg4, arg5, arg6), \ - _gpgme_debug_frame_end (), 0 + _gpgme_debug_frame_end () #define TRACE_LOG(fmt) \ _gpgme_debug (_gpgme_trace_level, "%s: check: %s=%p, " fmt "\n", \ - _gpgme_trace_func, _gpgme_trace_tagname, _gpgme_trace_tag), 0 + _gpgme_trace_func, _gpgme_trace_tagname, _gpgme_trace_tag) #define TRACE_LOG1(fmt, arg1) \ _gpgme_debug (_gpgme_trace_level, "%s: check: %s=%p, " fmt "\n", \ _gpgme_trace_func, _gpgme_trace_tagname, _gpgme_trace_tag, \ - arg1), 0 + arg1) #define TRACE_LOG2(fmt, arg1, arg2) \ _gpgme_debug (_gpgme_trace_level, "%s: check: %s=%p, " fmt "\n", \ _gpgme_trace_func, _gpgme_trace_tagname, _gpgme_trace_tag, \ - arg1, arg2), 0 + arg1, arg2) #define TRACE_LOG3(fmt, arg1, arg2, arg3) \ _gpgme_debug (_gpgme_trace_level, "%s: check: %s=%p, " fmt "\n", \ _gpgme_trace_func, _gpgme_trace_tagname, _gpgme_trace_tag, \ - arg1, arg2, arg3), 0 + arg1, arg2, arg3) #define TRACE_LOG4(fmt, arg1, arg2, arg3, arg4) \ _gpgme_debug (_gpgme_trace_level, "%s: check: %s=%p, " fmt "\n", \ _gpgme_trace_func, _gpgme_trace_tagname, _gpgme_trace_tag, \ - arg1, arg2, arg3, arg4), 0 + arg1, arg2, arg3, arg4) #define TRACE_LOG5(fmt, arg1, arg2, arg3, arg4, arg5) \ _gpgme_debug (_gpgme_trace_level, "%s: check: %s=%p, " fmt "\n", \ _gpgme_trace_func, _gpgme_trace_tagname, _gpgme_trace_tag, \ - arg1, arg2, arg3, arg4, arg5), 0 + arg1, arg2, arg3, arg4, arg5) #define TRACE_LOG6(fmt, arg1, arg2, arg3, arg4, arg5, arg6) \ _gpgme_debug (_gpgme_trace_level, "%s: check: %s=%p, " fmt "\n", \ _gpgme_trace_func, _gpgme_trace_tagname, _gpgme_trace_tag, \ - arg1, arg2, arg3, arg4, arg5, \ - arg6), 0 + arg1, arg2, arg3, arg4, arg5, arg6) #define TRACE_LOGBUF(buf, len) \ _gpgme_debug_buffer (_gpgme_trace_level, "%s: check: %s", \ ----------------------------------------------------------------------- Summary of changes: src/debug.c | 19 +++++++++++++++---- src/debug.h | 63 +++++++++++++++++++++++++++++-------------------------------- 2 files changed, 45 insertions(+), 37 deletions(-) hooks/post-receive -- GnuPG Made Easy http://git.gnupg.org From cvs at cvs.gnupg.org Mon Jun 8 12:56:49 2015 From: cvs at cvs.gnupg.org (by Werner Koch) Date: Mon, 08 Jun 2015 12:56:49 +0200 Subject: [git] GPGME - branch, master, updated. gpgme-1.5.4-7-gddbd54e Message-ID: 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 "GnuPG Made Easy". The branch, master has been updated via ddbd54ef881bd2c3481d62b89bef7241667b64ee (commit) via 7addffc0826e7f36afcc7f66268e9ee2a37e2042 (commit) from 8b9f84828cd04a7dab37e219123edc1905da8e6b (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 ddbd54ef881bd2c3481d62b89bef7241667b64ee Author: Werner Koch Date: Mon Jun 8 12:34:49 2015 +0200 Fix regression with gpgsm 2.0 due to "OPTION with-secret". * src/engine-gpgsm.c (gpgsm_assuan_simple_command): Do not terminate on a status lines. -- This bug has been with us since the support for gpgsm: If there is no status line handler but a status line is received anyway the command handling loop terminates and thus the command/answer order gets out of sync. In the case of the bug report this is triggered by sending an option which starts the agent and that starting emits a "PROGRESS" status line. The solution is not to stop reading after a status line but record a possible error code and return that only after OK or ERR. GnuPG-bug-id: 1795 Signed-off-by: Werner Koch diff --git a/src/engine-gpgsm.c b/src/engine-gpgsm.c index 3a83757..ac6c5fc 100644 --- a/src/engine-gpgsm.c +++ b/src/engine-gpgsm.c @@ -564,7 +564,7 @@ gpgsm_assuan_simple_command (assuan_context_t ctx, char *cmd, engine_status_handler_t status_fnc, void *status_fnc_value) { - gpg_error_t err; + gpg_error_t err, cb_err; char *line; size_t linelen; @@ -572,6 +572,7 @@ gpgsm_assuan_simple_command (assuan_context_t ctx, char *cmd, if (err) return err; + cb_err = 0; do { err = assuan_read_line (ctx, &line, &linelen); @@ -584,32 +585,45 @@ gpgsm_assuan_simple_command (assuan_context_t ctx, char *cmd, if (linelen >= 2 && line[0] == 'O' && line[1] == 'K' && (line[2] == '\0' || line[2] == ' ')) - return 0; + return cb_err; else if (linelen >= 4 && line[0] == 'E' && line[1] == 'R' && line[2] == 'R' && line[3] == ' ') - err = atoi (&line[4]); + { + /* We prefer a callback generated error because that one is + more related to gpgme and thus probably more important + than the error returned by the engine. */ + err = cb_err? cb_err : atoi (&line[4]); + } else if (linelen >= 2 && line[0] == 'S' && line[1] == ' ') { - char *rest; - gpgme_status_code_t r; + /* After an error from a status callback we skip all further + status lines. */ + if (!cb_err) + { + char *rest; + gpgme_status_code_t r; - rest = strchr (line + 2, ' '); - if (!rest) - rest = line + linelen; /* set to an empty string */ - else - *(rest++) = 0; + rest = strchr (line + 2, ' '); + if (!rest) + rest = line + linelen; /* set to an empty string */ + else + *(rest++) = 0; - r = _gpgme_parse_status (line + 2); + r = _gpgme_parse_status (line + 2); - if (r >= 0 && status_fnc) - err = status_fnc (status_fnc_value, r, rest); - else - err = gpg_error (GPG_ERR_GENERAL); + if (r >= 0 && status_fnc) + cb_err = status_fnc (status_fnc_value, r, rest); + } } else - err = gpg_error (GPG_ERR_GENERAL); + { + /* Invalid line or INQUIRY. We can't do anything else than + to stop. As with ERR we prefer a status callback + generated error code, though. */ + err = cb_err ? cb_err : gpg_error (GPG_ERR_GENERAL); + } } while (!err); commit 7addffc0826e7f36afcc7f66268e9ee2a37e2042 Author: Werner Koch Date: Mon Jun 8 12:30:11 2015 +0200 tests: Add option --secret to run-keylist. Signed-off-by: Werner Koch diff --git a/tests/run-keylist.c b/tests/run-keylist.c index c0c7202..07c6fa1 100644 --- a/tests/run-keylist.c +++ b/tests/run-keylist.c @@ -45,6 +45,7 @@ show_usage (int ex) " --verbose run in verbose mode\n" " --openpgp use the OpenPGP protocol (default)\n" " --cms use the CMS protocol\n" + " --secret list only secret keys\n" " --local use GPGME_KEYLIST_MODE_LOCAL\n" " --extern use GPGME_KEYLIST_MODE_EXTERN\n" " --sigs use GPGME_KEYLIST_MODE_SIGS\n" @@ -70,6 +71,7 @@ main (int argc, char **argv) gpgme_key_t keyarray[100]; int keyidx = 0; gpgme_protocol_t protocol = GPGME_PROTOCOL_OpenPGP; + int only_secret = 0; if (argc) { argc--; argv++; } @@ -99,6 +101,11 @@ main (int argc, char **argv) protocol = GPGME_PROTOCOL_CMS; argc--; argv++; } + else if (!strcmp (*argv, "--secret")) + { + only_secret = 1; + argc--; argv++; + } else if (!strcmp (*argv, "--local")) { mode |= GPGME_KEYLIST_MODE_LOCAL; @@ -150,7 +157,7 @@ main (int argc, char **argv) gpgme_set_keylist_mode (ctx, mode); - err = gpgme_op_keylist_start (ctx, argc? argv[0]:NULL, 0); + err = gpgme_op_keylist_start (ctx, argc? argv[0]:NULL, only_secret); fail_if_err (err); while (!(err = gpgme_op_keylist_next (ctx, &key))) ----------------------------------------------------------------------- Summary of changes: src/engine-gpgsm.c | 46 ++++++++++++++++++++++++++++++---------------- tests/run-keylist.c | 9 ++++++++- 2 files changed, 38 insertions(+), 17 deletions(-) hooks/post-receive -- GnuPG Made Easy http://git.gnupg.org From cvs at cvs.gnupg.org Mon Jun 8 15:20:36 2015 From: cvs at cvs.gnupg.org (by Werner Koch) Date: Mon, 08 Jun 2015 15:20:36 +0200 Subject: [git] GPGME - branch, master, updated. gpgme-1.5.5-1-ga5d9e01 Message-ID: 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 "GnuPG Made Easy". The branch, master has been updated via a5d9e018b8826e97c9fcc548c8e9e797bbc8d6db (commit) via 052a9e3c5671d1ab69551f7b0abd0bbf859d4aba (commit) from ddbd54ef881bd2c3481d62b89bef7241667b64ee (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 a5d9e018b8826e97c9fcc548c8e9e797bbc8d6db Author: Werner Koch Date: Mon Jun 8 15:18:56 2015 +0200 Post release updates -- diff --git a/NEWS b/NEWS index 8e9472a..0e1e500 100644 --- a/NEWS +++ b/NEWS @@ -1,3 +1,7 @@ +Noteworthy changes in version 1.6.0 (unreleased) [C24/A13/R_] +------------------------------------------------ + + Noteworthy changes in version 1.5.5 (2015-06-08) [C24/A13/R4] ------------------------------------------------ diff --git a/configure.ac b/configure.ac index 7f03170..be36a42 100644 --- a/configure.ac +++ b/configure.ac @@ -28,8 +28,8 @@ min_automake_version="1.14" # commit and push so that the git magic is able to work. See below # for the LT versions. m4_define(mym4_version_major, [1]) -m4_define(mym4_version_minor, [5]) -m4_define(mym4_version_micro, [5]) +m4_define(mym4_version_minor, [6]) +m4_define(mym4_version_micro, [0]) # Below is m4 magic to extract and compute the revision number, the # decimalized short revision number, a beta version string, and a flag commit 052a9e3c5671d1ab69551f7b0abd0bbf859d4aba Author: Werner Koch Date: Mon Jun 8 14:58:44 2015 +0200 Release 1.5.5 diff --git a/AUTHORS b/AUTHORS index 6197416..dd4b492 100644 --- a/AUTHORS +++ b/AUTHORS @@ -3,7 +3,7 @@ Homepage: http://www.gnupg.org/related_software/gpgme/ Download: ftp://ftp.gnupg.org/gcrypt/gpgme/ Repository: git://git.gnupg.org/gpgme.git Maintainer: Werner Koch -Bug reports: http://bugs.gnupg.org (use category "gpgme") +Bug reports: https://bugs.gnupg.org (use category "gpgme") Security related bug reports: security at gnupg.org License (software): LGPLv2.1+ License (manual+tools): GPLv3+ diff --git a/NEWS b/NEWS index 09cc930..8e9472a 100644 --- a/NEWS +++ b/NEWS @@ -1,6 +1,12 @@ -Noteworthy changes in version 1.6.0 (unreleased) [C__/A__/R_] +Noteworthy changes in version 1.5.5 (2015-06-08) [C24/A13/R4] ------------------------------------------------ + * Fixed crash in key listings for user ids with a backslash. + + * Fixed regression for GPGSM use with GnuPG < 2.1. + + * Properly set signature summary for revoked OpenPGP keys. + Noteworthy changes in version 1.5.4 (2015-04-13) [C24/A13/R3] ------------------------------------------------ diff --git a/configure.ac b/configure.ac index 2f47719..7f03170 100644 --- a/configure.ac +++ b/configure.ac @@ -28,8 +28,8 @@ min_automake_version="1.14" # commit and push so that the git magic is able to work. See below # for the LT versions. m4_define(mym4_version_major, [1]) -m4_define(mym4_version_minor, [6]) -m4_define(mym4_version_micro, [0]) +m4_define(mym4_version_minor, [5]) +m4_define(mym4_version_micro, [5]) # Below is m4 magic to extract and compute the revision number, the # decimalized short revision number, a beta version string, and a flag @@ -59,7 +59,7 @@ LIBGPGME_LT_CURRENT=24 # Subtract 2 from this value if you want to make the LFS transition an # ABI break. [Note to self: Remove this comment with the next regular break.] LIBGPGME_LT_AGE=13 -LIBGPGME_LT_REVISION=3 +LIBGPGME_LT_REVISION=4 # If the API is changed in an incompatible way: increment the next counter. GPGME_CONFIG_API_VERSION=1 ----------------------------------------------------------------------- Summary of changes: AUTHORS | 2 +- NEWS | 12 +++++++++++- configure.ac | 2 +- 3 files changed, 13 insertions(+), 3 deletions(-) hooks/post-receive -- GnuPG Made Easy http://git.gnupg.org From cvs at cvs.gnupg.org Mon Jun 8 15:38:33 2015 From: cvs at cvs.gnupg.org (by Werner Koch) Date: Mon, 08 Jun 2015 15:38:33 +0200 Subject: [git] gnupg-doc - branch, master, updated. 0a448e2d98b92cdfa942a65dd151f561b337ee73 Message-ID: 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 GnuPG website and other docs". The branch, master has been updated via 0a448e2d98b92cdfa942a65dd151f561b337ee73 (commit) from f0aeae6a7b2924be954f2ee8c802c44e54225357 (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 0a448e2d98b92cdfa942a65dd151f561b337ee73 Author: Werner Koch Date: Mon Jun 8 15:37:05 2015 +0200 swdb: Release gpgme 1.5.5 diff --git a/web/index.org b/web/index.org index 57ba974..a11216c 100644 --- a/web/index.org +++ b/web/index.org @@ -64,6 +64,12 @@ The latest release news:\\ # GnuPG's latest news are available as [[http://feedvalidator.org/check.cgi?url%3Dhttps://www.gnupg.org/news.en.rss][RSS 2.0 compliant]] feed. Just # point or paste the [[news.en.rss][RSS file]] into your aggregator. +** GPGME 1.5.5 released (2015-06-08) + +GPGME 1.5.5 is now available. This release fixes a crash due to +malformed user ids and a regression when gpgsm < 2.1 is used. See the +full [[http://lists.gnupg.org/pipermail/gnupg-announce/2015q2/000368.html][{announcement}]] mail. + ** GnuPG 2.0.28 released (2015-06-02) diff --git a/web/swdb.mac b/web/swdb.mac index 3d9e2e9..325d2ad 100644 --- a/web/swdb.mac +++ b/web/swdb.mac @@ -61,10 +61,10 @@ # # GPGME # -#+macro: gpgme_ver 1.5.4 +#+macro: gpgme_ver 1.5.5 #+macro: gpgme_branch master #+macro: gpgme_size 953k -#+macro: gpgme_sha1 8cf1bcce8603bd7d006065f08059cf85462828c4 +#+macro: gpgme_sha1 88476d72cb099e179de4040760502886f7a54926 # ----------------------------------------------------------------------- Summary of changes: web/index.org | 6 ++++++ web/swdb.mac | 4 ++-- 2 files changed, 8 insertions(+), 2 deletions(-) hooks/post-receive -- The GnuPG website and other docs http://git.gnupg.org From cvs at cvs.gnupg.org Mon Jun 8 19:02:42 2015 From: cvs at cvs.gnupg.org (by Werner Koch) Date: Mon, 08 Jun 2015 19:02:42 +0200 Subject: [git] GnuPG - branch, master, updated. gnupg-2.1.4-18-gc672572 Message-ID: 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 c672572bd50966187cc823585efed673b66ff942 (commit) via 8425db6a26bf66dad16dfbc26be9af7d272f31d3 (commit) from cf508a1f7f4c8926dc554be68a2d46f5ce272ac0 (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 c672572bd50966187cc823585efed673b66ff942 Author: Werner Koch Date: Mon Jun 8 18:58:27 2015 +0200 Convey envvar INSIDE_EMACS to the pinentry. * common/session-env.c (stdenvnames): Add it. Signed-off-by: Werner Koch diff --git a/common/session-env.c b/common/session-env.c index 8f78c10..c0500ea 100644 --- a/common/session-env.c +++ b/common/session-env.c @@ -56,7 +56,7 @@ struct session_environment_s }; -/* A list of environment vribales we pass from the actual user +/* A list of environment variables we pass from the actual user (e.g. gpgme) down to the pinentry. We do not handle the locale settings because they do not only depend on envvars. */ static struct @@ -74,6 +74,8 @@ static struct modules (eg "scim-bridge"). */ { "QT_IM_MODULE" }, /* Used by Qt to select qt input modules (eg "xim"). */ + { "INSIDE_EMACS" }, /* Set by Emacs before running a + process. */ { "PINENTRY_USER_DATA", "pinentry-user-data"} /* Used for communication with non-standard Pinentries. */ commit 8425db6a26bf66dad16dfbc26be9af7d272f31d3 Author: Werner Koch Date: Mon Jun 8 18:38:00 2015 +0200 agent: Add command "getinfo std_env_names". * agent/command.c (cmd_getinfo): Add new sub-command. -- The current output is: > getinfo std_env_names D GPG_TTY D TERM D DISPLAY D XAUTHORITY D XMODIFIERS D GTK_IM_MODULE D QT_IM_MODULE D PINENTRY_USER_DATA OK Note that there is an invisible \x00 at the end of each line. diff --git a/agent/command.c b/agent/command.c index f71325d..82d93e9 100644 --- a/agent/command.c +++ b/agent/command.c @@ -2756,6 +2756,7 @@ static const char hlp_getinfo[] = " ssh_socket_name - Return the name of the ssh socket.\n" " scd_running - Return OK if the SCdaemon is already running.\n" " s2k_count - Return the calibrated S2K count.\n" + " std_env_names - List the names of the standard environment.\n" " std_session_env - List the standard session environment.\n" " std_startup_env - List the standard startup environment.\n" " cmd_has_option\n" @@ -2849,6 +2850,21 @@ cmd_getinfo (assuan_context_t ctx, char *line) { rc = agent_scd_check_running ()? 0 : gpg_error (GPG_ERR_GENERAL); } + else if (!strcmp (line, "std_env_names")) + { + int iterator; + const char *name; + + iterator = 0; + while ((name = session_env_list_stdenvnames (&iterator, NULL))) + { + rc = assuan_send_data (ctx, name, strlen (name)+1); + if (!rc) + rc = assuan_send_data (ctx, NULL, 0); + if (rc) + break; + } + } else if (!strcmp (line, "std_session_env") || !strcmp (line, "std_startup_env")) { ----------------------------------------------------------------------- Summary of changes: agent/command.c | 16 ++++++++++++++++ common/session-env.c | 4 +++- 2 files changed, 19 insertions(+), 1 deletion(-) hooks/post-receive -- The GNU Privacy Guard http://git.gnupg.org From cvs at cvs.gnupg.org Mon Jun 8 19:28:49 2015 From: cvs at cvs.gnupg.org (by Werner Koch) Date: Mon, 08 Jun 2015 19:28:49 +0200 Subject: [git] GnuPG - branch, master, updated. gnupg-2.1.4-19-gabbefdd Message-ID: 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 abbefdd04d7ee30218506caeae1fd858569c9f0a (commit) from c672572bd50966187cc823585efed673b66ff942 (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 abbefdd04d7ee30218506caeae1fd858569c9f0a Author: Werner Koch Date: Mon Jun 8 19:27:08 2015 +0200 doc: Change the manual source to be only for GnuPG 2.1 Signed-off-by: Werner Koch diff --git a/doc/Makefile.am b/doc/Makefile.am index 240bcf3..6d66679 100644 --- a/doc/Makefile.am +++ b/doc/Makefile.am @@ -57,9 +57,9 @@ gnupg_TEXINFOS = \ DVIPS = TEXINPUTS="$(srcdir)$(PATH_SEPARATOR)$$TEXINPUTS" dvips -AM_MAKEINFOFLAGS = -I $(srcdir) --css-ref=/share/site.css -D gpgtwoone +AM_MAKEINFOFLAGS = -I $(srcdir) --css-ref=/share/site.css -YAT2M_OPTIONS = -I $(srcdir) -D gpgtwoone \ +YAT2M_OPTIONS = -I $(srcdir) \ --release "GnuPG @PACKAGE_VERSION@" --source "GNU Privacy Guard 2.1" myman_sources = gnupg7.texi gpg.texi gpgsm.texi gpg-agent.texi \ diff --git a/doc/debugging.texi b/doc/debugging.texi index f26d1aa..35cb699 100644 --- a/doc/debugging.texi +++ b/doc/debugging.texi @@ -103,7 +103,6 @@ used. Using the keyserver debug option as in is thus often helpful. Note that the actual output depends on the backend and may change from release to release. - at ifset gpgtwoone @item Logging on WindowsCE For development, the best logging method on WindowsCE is the use of @@ -113,7 +112,6 @@ on the given port. (@pxref{option watchgnupg --tcp}). For in the field tests it is better to make use of the logging facility provided by the @command{gpgcedev} driver (part of libassuan); this is enabled by using a log file name of @file{GPG2:}. (@pxref{option --log-file}). - at end ifset @end itemize diff --git a/doc/gnupg.texi b/doc/gnupg.texi index b095230..2517a50 100644 --- a/doc/gnupg.texi +++ b/doc/gnupg.texi @@ -52,10 +52,8 @@ section entitled ``Copying''. * gpg2: (gnupg). OpenPGP encryption and signing tool. * gpgsm: (gnupg). S/MIME encryption and signing tool. * gpg-agent: (gnupg). The secret key daemon. - at ifset gpgtwoone * dirmngr: (gnupg). X.509 CRL and OCSP server. * dirmngr-client: (gnupg). X.509 CRL and OCSP client. - at end ifset @end direntry @@ -127,9 +125,7 @@ the administration and the architecture. * Installation:: A short installation guide. * Invoking GPG-AGENT:: How to launch the secret key daemon. - at ifset gpgtwoone * Invoking DIRMNGR:: How to launch the CRL and OCSP daemon. - at end ifset * Invoking GPG:: Using the OpenPGP protocol. * Invoking GPGSM:: Using the S/MIME protocol. * Invoking SCDAEMON:: How to handle Smartcards. @@ -161,9 +157,7 @@ the administration and the architecture. @include instguide.texi @include gpg-agent.texi - at ifset gpgtwoone @include dirmngr.texi - at end ifset @include gpg.texi @include gpgsm.texi @include scdaemon.texi diff --git a/doc/gpg-agent.texi b/doc/gpg-agent.texi index eb02c9c..3078392 100644 --- a/doc/gpg-agent.texi +++ b/doc/gpg-agent.texi @@ -2,10 +2,6 @@ @c This is part of the GnuPG manual. @c For copying conditions, see the file gnupg.texi. - at c Note that we use this texinfo file for all versions of GnuPG: - at c 2.0 and 2.1. The macro "gpgtwoone" controls parts which are only - at c valid for GnuPG 2.1 and later. - @node Invoking GPG-AGENT @chapter Invoking GPG-AGENT @@ -52,7 +48,6 @@ independently from any protocol. It is used as a backend for @command{gpg} and @command{gpgsm} as well as for a couple of other utilities. - at ifset gpgtwoone The agent is automatically started on demand by @command{gpg}, @command{gpgsm}, @command{gpgconf}, or @command{gpg-connect-agent}. Thus there is no reason to start it manually. In case you want to use @@ -61,51 +56,6 @@ the included Secure Shell Agent you may start the agent using: @example gpg-connect-agent /bye @end example - at end ifset - - at ifclear gpgtwoone - at noindent -The usual way to run the agent is from the @code{~/.xsession} file: - - at example -eval $(gpg-agent --daemon) - at end example - at noindent -If you don't use an X server, you can also put this into your regular -startup file @code{~/.profile} or @code{.bash_profile}. It is best not -to run multiple instance of the @command{gpg-agent}, so you should make -sure that only one is running: @command{gpg-agent} uses an environment -variable to inform clients about the communication parameters. You can -write the content of this environment variable to a file so that you can -test for a running agent. Here is an example using Bourne shell syntax: - - at smallexample -gpg-agent --daemon --enable-ssh-support \ - --write-env-file "$@{HOME@}/.gpg-agent-info" - at end smallexample - -This code should only be run once per user session to initially fire up -the agent. In the example the optional support for the included Secure -Shell agent is enabled and the information about the agent is written to -a file in the HOME directory. Note that by running gpg-agent without -arguments you may test whether an agent is already running; however such -a test may lead to a race condition, thus it is not suggested. - - at noindent -The second script needs to be run for each interactive session: - - at smallexample -if [ -f "$@{HOME@}/.gpg-agent-info" ]; then - . "$@{HOME@}/.gpg-agent-info" - export GPG_AGENT_INFO - export SSH_AUTH_SOCK -fi - at end smallexample - - at noindent -It reads the data out of the file and exports the variables. If you -don't use Secure Shell, you don't need the last two export statements. - at end ifclear @noindent You should always add the following lines to your @code{.bashrc} or @@ -175,17 +125,11 @@ default mode is to create a socket and listen for commands there. @opindex daemon Start the gpg-agent as a daemon; that is, detach it from the console and run it in the background. - at ifclear gpgtwoone -Because @command{gpg-agent} prints out -important information required for further use, a common way of -invoking gpg-agent is: @code{eval $(gpg-agent --daemon)} to setup the -environment variables. The option @option{--write-env-file} is -another way commonly used to do this. - at end ifclear -Yet another way is creating -a new process as a child of gpg-agent: @code{gpg-agent --daemon -/bin/sh}. This way you get a new shell with the environment setup -properly; if you exit from this shell, gpg-agent terminates as well. + +As an alternative you may create a new process as a child of +gpg-agent: @code{gpg-agent --daemon /bin/sh}. This way you get a new +shell with the environment setup properly; after you exit from this +shell, gpg-agent terminates within a few seconds. @end table @mansect options @@ -323,23 +267,6 @@ shell or the C-shell respectively. The default is to guess it based on the environment variable @code{SHELL} which is correct in almost all cases. - at ifclear gpgtwoone - at item --write-env-file @var{file} - at opindex write-env-file -Often it is required to connect to the agent from a process not being an -inferior of @command{gpg-agent} and thus the environment variable with -the socket name is not available. To help setting up those variables in -other sessions, this option may be used to write the information into - at var{file}. If @var{file} is not specified the default name - at file{$@{HOME@}/.gpg-agent-info} will be used. The format is suitable -to be evaluated by a Bourne shell like in this simple example: - - at example -eval $(cat @var{file}) -eval $(cut -d= -f 1 < @var{file} | xargs echo export) - at end example - at end ifclear - @item --no-grab @opindex no-grab @@ -369,15 +296,12 @@ accept Root-CA keys. This option allows the use of @command{gpg-preset-passphrase} to seed the internal cache of @command{gpg-agent} with passphrases. - at ifset gpgtwoone @anchor{option --allow-loopback-pinentry} @item --allow-loopback-pinentry @opindex allow-loopback-pinentry Allow clients to use the loopback pinentry features; see the option @option{pinentry-mode} for details. - at end ifset - at ifset gpgtwoone @item --no-allow-external-cache @opindex no-allow-external-cache Tell Pinentry not to enable features which use an external cache for @@ -388,7 +312,6 @@ credentials with one master password and may have installed a Pinentry which employs an additional external cache to implement such a policy. By using this option the Pinentry is advised not to make use of such a cache and instead always ask the user for the requested passphrase. - at end ifset @item --ignore-cache-for-signing @opindex ignore-cache-for-signing @@ -492,7 +415,6 @@ Do not make use of the scdaemon tool. This option has the effect of disabling the ability to do smartcard operations. Note, that enabling this option at runtime does not kill an already forked scdaemon. - at ifset gpgtwoone @item --disable-check-own-socket @opindex disable-check-own-socket @command{gpg-agent} employs a periodic self-test to detect a stolen @@ -500,7 +422,6 @@ socket. This usually means a second instance of @command{gpg-agent} has taken over the socket and @command{gpg-agent} will then terminate itself. This option may be used to disable this self-test for debugging purposes. - at end ifset @item --use-standard-socket @itemx --no-use-standard-socket @@ -508,30 +429,9 @@ debugging purposes. @opindex use-standard-socket @opindex no-use-standard-socket @opindex use-standard-socket-p - at ifset gpgtwoone Since GnuPG 2.1 the standard socket is always used. These options have no more effect. The command @code{gpg-agent --use-standard-socket-p} will thus always return success. - at end ifset - at ifclear gpgtwoone -By enabling this option @command{gpg-agent} will listen on the socket -named @file{S.gpg-agent}, located in the home directory, and not create -a random socket below a temporary directory. Tools connecting to - at command{gpg-agent} should first try to connect to the socket given in -environment variable @var{GPG_AGENT_INFO} and then fall back to this -socket. This option may not be used if the home directory is mounted on -a remote file system which does not support special files like fifos or -sockets. - -Note, that @option{--use-standard-socket} is the default on -Windows systems. - -The default may be changed at build time. It is -possible to test at runtime whether the agent has been configured for -use with the standard socket by issuing the command @command{gpg-agent ---use-standard-socket-p} which returns success if the standard socket -option has been enabled. - at end ifclear @item --display @var{string} @itemx --ttyname @var{string} @@ -810,7 +710,6 @@ This signal is used for internal purposes. @node Agent Examples @section Examples - at ifset gpgtwoone It is important to set the GPG_TTY environment variable in your login shell, for example in the @file{~/.bashrc} init script: @@ -831,45 +730,7 @@ if [ "$@{gnupg_SSH_AUTH_SOCK_by:-0@}" -ne $$ ]; then fi @end example @end cartouche - at end ifset - - at ifclear gpgtwoone -The usual way to invoke @command{gpg-agent} is - - at example -$ eval $(gpg-agent --daemon) - at end example - -An alternative way is by replacing @command{ssh-agent} with - at command{gpg-agent}. If for example @command{ssh-agent} is started as -part of the Xsession initialization, you may simply replace - at command{ssh-agent} by a script like: - - at cartouche - at example -#!/bin/sh - -exec /usr/local/bin/gpg-agent --enable-ssh-support --daemon \ - --write-env-file $@{HOME@}/.gpg-agent-info "$@@" - at end example - at end cartouche - at noindent -and add something like (for Bourne shells) - - at cartouche - at example - if [ -f "$@{HOME@}/.gpg-agent-info" ]; then - . "$@{HOME@}/.gpg-agent-info" - export GPG_AGENT_INFO - export SSH_AUTH_SOCK - fi - at end example - at end cartouche - - at noindent -to your shell initialization file (e.g. @file{~/.bashrc}). - at end ifclear @c @c Assuan Protocol @@ -881,21 +742,8 @@ to your shell initialization file (e.g. @file{~/.bashrc}). Note: this section does only document the protocol, which is used by GnuPG components; it does not deal with the ssh-agent protocol. - at ifset gpgtwoone The @command{gpg-agent} daemon is started on demand by the GnuPG components. - at end ifset - at ifclear gpgtwoone -The @command{gpg-agent} should be started by the login shell and set an -environment variable to tell clients about the socket to be used. -Clients should deny to access an agent with a socket name which does -not match its own configuration. An application may choose to start -an instance of the gpg-agent if it does not figure that any has been -started; it should not do this if a gpg-agent is running but not -usable. Because @command{gpg-agent} can only be used in background mode, no -special command line option is required to activate the use of the -protocol. - at end ifclear To identify a key we use a thing called keygrip which is the SHA-1 hash of an canonical encoded S-Expression of the public key as used in @@ -905,13 +753,11 @@ certificate is that it will be possible to use the same keypair for different protocols, thereby saving space on the token used to keep the secret keys. - at ifset gpgtwoone The @command{gpg-agent} may send status messages during a command or when returning from a command to inform a client about the progress or result of an operation. For example, the @var{INQUIRE_MAXLEN} status message may be sent during a server inquire to inform the client of the maximum usable length of the inquired data (which should not be exceeded). - at end ifset @menu * Agent PKDECRYPT:: Decrypting a session key @@ -922,9 +768,7 @@ the inquired data (which should not be exceeded). * Agent ISTRUSTED:: Importing a Root Certificate * Agent GET_PASSPHRASE:: Ask for a passphrase * Agent CLEAR_PASSPHRASE:: Expire a cached passphrase - at ifset gpgtwoone * Agent PRESET_PASSPHRASE:: Set a passphrase for a keygrip - at end ifset * Agent GET_CONFIRMATION:: Ask for confirmation * Agent HAVEKEY:: Check whether a key is available * Agent LEARN:: Register a smartcard @@ -1104,12 +948,7 @@ option allows to choose the storage location. To get the secret key out of the PSE, a special export tool has to be used. @example - at ifset gpgtwoone GENKEY [--no-protection] [--preset] [] - at end ifset - at ifclear gpgtwoone - GENKEY - at end ifclear @end example Invokes the key generation process and the server will then inquire @@ -1155,7 +994,6 @@ Here is an example session: @end smallexample @end cartouche - at ifset gpgtwoone The @option{--no-protection} option may be used to prevent prompting for a passphrase to protect the secret key while leaving the secret key unprotected. The @option{--preset} option may be used to add the passphrase to the cache @@ -1167,7 +1005,6 @@ keyword @code{NEWPASSWD} to retrieve that passphrase. This option takes precedence over @option{--no-protection}; however if the client sends a empty (zero-length) passphrase, this is identical to @option{--no-protection}. - at end ifset @node Agent IMPORT @subsection Importing a Secret Key @@ -1334,22 +1171,13 @@ function returns with OK even when there is no cached passphrase. Use this command to remove a cached passphrase. @example - at ifset gpgtwoone CLEAR_PASSPHRASE [--mode=normal] - at end ifset - at ifclear gpgtwoone - CLEAR_PASSPHRASE - at end ifclear @end example - at ifset gpgtwoone The @option{--mode=normal} option can be used to clear a @var{cache_id} that was set by gpg-agent. - at end ifset - - at ifset gpgtwoone @node Agent PRESET_PASSPHRASE @subsection Set a passphrase for a keygrip @@ -1368,9 +1196,6 @@ The @var{timeout} parameter keeps the passphrase cached for the specified number of seconds. A value of @code{-1} means infinate while @code{0} means the default (currently only a timeout of -1 is allowed, which means to never expire it). - at end ifset - - @node Agent GET_CONFIRMATION @@ -1425,21 +1250,13 @@ option given the certificates are send back. @subsection Change a Passphrase @example - at ifset gpgtwoone PASSWD [--cache-nonce=] [--passwd-nonce=] [--preset] @var{keygrip} - at end ifset - at ifclear gpgtwoone - PASSWD @var{keygrip} - at end ifclear @end example This command is used to interactively change the passphrase of the key -identified by the hex string @var{keygrip}. - - at ifset gpgtwoone -The @option{--preset} option may be used to add the new passphrase to the -cache using the default cache parameters. - at end ifset +identified by the hex string @var{keygrip}. The @option{--preset} +option may be used to add the new passphrase to the cache using the +default cache parameters. @node Agent UPDATESTARTUPTTY @@ -1540,7 +1357,6 @@ See Assuan command @code{PKSIGN}. This does not need any value. It is used to enable the PINENTRY_LAUNCHED inquiry. - at ifset gpgtwoone @item pinentry-mode This option is used to change the operation mode of the pinentry. The following values are defined: @@ -1564,16 +1380,12 @@ following values are defined: Use the @xref{option --allow-loopback-pinentry}. @end table - at end ifset - at ifset gpgtwoone @item cache-ttl-opt-preset This option sets the cache TTL for new entries created by GENKEY and PASSWD commands when using the @option{--preset} option. It it is not used a default value is used. - at end ifset - at ifset gpgtwoone @item s2k-count Instead of using the standard S2K count (which is computed on the fly), the given S2K count is used for new keys or when changing the @@ -1581,7 +1393,6 @@ passphrase of a key. Values below 65536 are considered to be 0. This option is valid for the entire session or until reset to 0. This option is useful if the key is later used on boxes which are either much slower or faster than the actual box. - at end ifset @end table diff --git a/doc/gpg.texi b/doc/gpg.texi index 0d855c9..77072bd 100644 --- a/doc/gpg.texi +++ b/doc/gpg.texi @@ -3,10 +3,6 @@ @c This is part of the GnuPG manual. @c For copying conditions, see the file gnupg.texi. - at c Note that we use this texinfo file for all GnuPG-2 branches. - at c The macro "gpgtwoone" controls parts which are only - at c valid for GnuPG 2.1 and later. - @node Invoking GPG @chapter Invoking GPG @cindex GPG command options @@ -15,13 +11,7 @@ @c Begin algorithm defaults - at ifclear gpgtwoone - at set DEFSYMENCALGO CAST5 - at end ifclear - - at ifset gpgtwoone @set DEFSYMENCALGO AES128 - at end ifset @c End algorithm defaults @@ -407,15 +397,9 @@ an additional signing subkey on a dedicated machine and then using this command to export the key without the primary key to the main machine. - at ifset gpgtwoone GnuPG may ask you to enter the passphrase for the key. This is required because the internal protection method of the secret key is different from the one specified by the OpenPGP protocol. - at end ifset - at ifclear gpgtwoone -See the option @option{--simple-sk-checksum} if you want to import an -exported secret key into ancient OpenPGP implementations. - at end ifclear @item --import @itemx --fast-import @@ -565,7 +549,6 @@ This section explains the main commands for key management @table @gnupgtabopt - at ifset gpgtwoone @item --quick-gen-key @code{user-id} @opindex quick-gen-key This is a simple command to generate a standard key with one user id. @@ -586,20 +569,17 @@ the passphrase options (@option{--passphrase}, supplied passphrase is used for the new key and the agent does not ask for it. To create a key without any protection @code{--passphrase ''} may be used. - at end ifset @item --gen-key @opindex gen-key Generate a new key pair using teh current default parameters. This is the standard command to create a new key. - at ifset gpgtwoone @item --full-gen-key @opindex gen-key Generate a new key pair with dialogs for all options. This is an extended version of @option{--gen-key}. - at end ifset There is also a feature which allows you to create keys in batch mode. See the the manual section ``Unattended key generation'' on how to use this. @@ -925,7 +905,6 @@ Signs a public key with your secret key but marks it as non-exportable. This is a shortcut version of the subcommand "lsign" from @option{--edit-key}. - at ifset gpgtwoone @item --quick-sign-key @code{fpr} [@code{names}] @itemx --quick-lsign-key @code{fpr} [@code{names}] @opindex quick-sign-key @@ -943,9 +922,7 @@ This command uses reasonable defaults and thus does not provide the full flexibility of the "sign" subcommand from @option{--edit-key}. Its intended use is to help unattended key signing by utilizing a list of verified fingerprints. - at end ifset - at ifset gpgtwoone @item --quick-adduid @var{user-id} @var{new-user-id} @opindex quick-adduid This command adds a new user id to an existing key. In contrast to @@ -953,7 +930,6 @@ the interactive sub-command @code{adduid} of @option{--edit-key} the @var{new-user-id} is added verbatim with only leading and trailing white space removed, it is expected to be UTF-8 encoded, and no checks on its form are applied. - at end ifset @item --passwd @var{user_id} @opindex passwd @@ -1271,13 +1247,8 @@ use the specified keyring alone, use @option{--keyring} along with @item --secret-keyring @code{file} @opindex secret-keyring - at ifset gpgtwoone This is an obsolete option and ignored. All secret keys are stored in the @file{private-keys-v1.d} directory below the GnuPG home directory. - at end ifset - at ifclear gpgtwoone -Same as @option{--keyring} but for the secret keyrings. - at end ifclear @item --primary-keyring @code{file} @opindex primary-keyring @@ -1610,21 +1581,6 @@ are available for all keyserver types, some common options are: this option is not used with HKP keyservers, as they do not support retrieving keys by subkey id. - at ifclear gpgtwoone - @item use-temp-files - On most Unix-like platforms, GnuPG communicates with the keyserver - helper program via pipes, which is the most efficient method. This - option forces GnuPG to use temporary files to communicate. On some - platforms (such as Win32 and RISC OS), this option is always enabled. - at end ifclear - - at ifclear gpgtwoone - @item keep-temp-files - If using `use-temp-files', do not delete the temp files after using - them. This option is useful to learn the keyserver communication - protocol by reading the temporary files. - at end ifclear - @item timeout Tell the keyserver helper program how long (in seconds) to try and perform a keyserver action before giving up. Note that performing @@ -1635,64 +1591,23 @@ are available for all keyserver types, some common options are: @item http-proxy=@code{value} Set the proxy to use for HTTP and HKP keyservers. - at ifset gpgtwoone -This overrides any proxy defined in @file{dirmngr.conf}. - at end ifset - at ifclear gpgtwoone -This overrides the "http_proxy" environment variable, if any. - at end ifclear - - at ifclear gpgtwoone - @item max-cert-size - When retrieving a key via DNS CERT, only accept keys up to this size. - Defaults to 16384 bytes. - at end ifclear + This overrides any proxy defined in @file{dirmngr.conf}. @item verbose - at ifset gpgtwoone -This option has no more function since GnuPG 2.1. Use the - at code{dirmngr} configuration options instead. - at end ifset - at ifclear gpgtwoone -Tell the keyserver helper program to be more verbose. This option can -be repeated multiple times to increase the verbosity level. - at end ifclear + This option has no more function since GnuPG 2.1. Use the + @code{dirmngr} configuration options instead. @item debug - at ifset gpgtwoone -This option has no more function since GnuPG 2.1. Use the - at code{dirmngr} configuration options instead. - at end ifset - at ifclear gpgtwoone -Turn on debug output in the keyserver helper program. Note that the -details of debug output depends on which keyserver helper program is -being used, and in turn, on any libraries that the keyserver helper -program uses internally (libcurl, openldap, etc). - at end ifclear + This option has no more function since GnuPG 2.1. Use the + @code{dirmngr} configuration options instead. @item check-cert - at ifset gpgtwoone -This option has no more function since GnuPG 2.1. Use the - at code{dirmngr} configuration options instead. - at end ifset - at ifclear gpgtwoone -Enable certificate checking if the keyserver presents one (for hkps or -ldaps). Defaults to on. - at end ifclear + This option has no more function since GnuPG 2.1. Use the + @code{dirmngr} configuration options instead. @item ca-cert-file - at ifset gpgtwoone -This option has no more function since GnuPG 2.1. Use the - at code{dirmngr} configuration options instead. - at end ifset - at ifclear gpgtwoone - Provide a certificate store to override the system default. Only - necessary if check-cert is enabled, and the keyserver is using a - certificate that is not present in a system default certificate list. - - Note that depending on the SSL library that the keyserver helper is - built with, this may actually be a directory or a file. - at end ifclear + This option has no more function since GnuPG 2.1. Use the + @code{dirmngr} configuration options instead. @end table @@ -1710,20 +1625,6 @@ key signer (defaults to 3) @opindex max-cert-depth Maximum depth of a certification chain (default is 5). - at ifclear gpgtwoone - at item --simple-sk-checksum - at opindex simple-sk-checksum -Secret keys are integrity protected by using a SHA-1 checksum. This -method is part of the upcoming enhanced OpenPGP specification but -GnuPG already uses it as a countermeasure against certain attacks. -Old applications don't understand this new format, so this option may -be used to switch back to the old behaviour. Using this option bears -a security risk. Note that using this option only takes effect when -the secret key is encrypted - the simplest way to make this happen is -to change the passphrase on the key (even changing it to the same -value is acceptable). - at end ifclear - @item --no-sig-cache @opindex no-sig-cache Do not cache the verification status of key signatures. @@ -1767,20 +1668,13 @@ default value is determined by running @command{gpgconf} with the option @option{--list-dirs}. Note that the pipe symbol (@code{|}) is used for a regression test suite hack and may thus not be used in the file name. - at ifclear gpgtwoone -This is only used -as a fallback when the environment variable @code{GPG_AGENT_INFO} is not -set or a running agent cannot be connected. - at end ifclear - at ifset gpgtwoone @item --dirmngr-program @var{file} @opindex dirmngr-program Specify a dirmngr program to be used for keyserver access. The default value is @file{/usr/sbin/dirmngr}. This is only used as a fallback when the environment variable @code{DIRMNGR_INFO} is not set or a running dirmngr cannot be connected. - at end ifset @item --no-autostart @opindex no-autostart @@ -1969,7 +1863,6 @@ Remove all entries from the @option{--group} list. Use @var{name} as the key to sign with. Note that this option overrides @option{--default-key}. - at ifset gpgtwoone @item --try-secret-key @var{name} @opindex try-secret-key For hidden recipients GPG needs to know the keys to use for trial @@ -1981,7 +1874,6 @@ the long keyid to avoid ambiguities. Note that gpg-agent might pop up a pinentry for a lot keys to do the trial decryption. If you want to stop all further trial decryption you may use close-window button instead of the cancel button. - at end ifset @item --try-all-secrets @opindex try-all-secrets @@ -2112,15 +2004,13 @@ opposite meaning. The options are: @c Since GnuPG 2.1 gpg-agent manages the secret key and thus the @c export-reset-subkey-passwd hack is not anymore justified. Such use - @c cases need to be implemented using a specialized secret key export + @c cases may be implemented using a specialized secret key export @c tool. - at ifclear gpgtwoone - @item export-reset-subkey-passwd - When using the @option{--export-secret-subkeys} command, this option resets - the passphrases for all exported subkeys to empty. This is useful - when the exported subkey is to be used on an unattended machine where - a passphrase doesn't necessarily make sense. Defaults to no. - at end ifclear + @c @item export-reset-subkey-passwd + @c When using the @option{--export-secret-subkeys} command, this option resets + @c the passphrases for all exported subkeys to empty. This is useful + @c when the exported subkey is to be used on an unattended machine where + @c a passphrase doesn't necessarily make sense. Defaults to no. @item export-clean Compact (remove all signatures from) user IDs on the key being @@ -2161,22 +2051,18 @@ listing mode and print all timestamps as seconds since 1970-01-01. Since GnuPG 2.0.10, this mode is always used and thus this option is obsolete; it does not harm to use it though. - at ifset gpgtwoone @item --legacy-list-mode @opindex legacy-list-mode Revert to the pre-2.1 public key list mode. This only affects the human readable output and not the machine interface (i.e. @code{--with-colons}). Note that the legacy format does not allow to convey suitable information for elliptic curves. - at end ifset @item --with-fingerprint @opindex with-fingerprint Same as the command @option{--fingerprint} but changes only the format of the output and may be used together with another command. - at ifset gpgtwoone - @item --with-icao-spelling @opindex with-icao-spelling Print the ICAO spelling of the fingerprint in addition to the hex digits. @@ -2190,8 +2076,6 @@ Include the keygrip in the key listings. Include info about the presence of a secret key in public key listings done with @code{--with-colons}. - at end ifset - @end table @c ******************************************* @@ -2214,34 +2098,11 @@ platforms that have different line ending conventions (UNIX-like to Mac, Mac to Windows, etc). @option{--no-textmode} disables this option, and is the default. - at ifclear gpgtwoone - at item --force-v3-sigs - at itemx --no-force-v3-sigs - at opindex force-v3-sigs -OpenPGP states that an implementation should generate v4 signatures -but PGP versions 5 through 7 only recognize v4 signatures on key -material. This option forces v3 signatures for signatures on data. -Note that this option implies @option{--no-ask-sig-expire}, and unsets - at option{--sig-policy-url}, @option{--sig-notation}, and - at option{--sig-keyserver-url}, as these features cannot be used with v3 -signatures. @option{--no-force-v3-sigs} disables this option. -Defaults to no. - - at item --force-v4-certs - at itemx --no-force-v4-certs - at opindex force-v4-certs -Always use v4 key signatures even on v3 keys. This option also -changes the default hash algorithm for v3 RSA keys from MD5 to SHA-1. - at option{--no-force-v4-certs} disables this option. - at end ifclear - - at ifset gpgtwoone @item --force-v3-sigs @itemx --no-force-v3-sigs @item --force-v4-certs @itemx --no-force-v4-certs These options are obsolete and have no effect since GnuPG 2.1. - at end ifset @item --force-mdc @opindex force-mdc @@ -2397,12 +2258,7 @@ compression algorithms none and ZIP. This also disables --throw-keyids, and making signatures with signing subkeys as PGP 6 does not understand signatures made by signing subkeys. - at ifclear gpgtwoone -This option implies @option{--disable-mdc --escape-from-lines --force-v3-sigs}. - at end ifclear - at ifset gpgtwoone This option implies @option{--disable-mdc --escape-from-lines}. - at end ifset @item --pgp7 @opindex pgp7 @@ -2761,7 +2617,6 @@ avoid it. Note that this passphrase is only used if the option @option{--batch} has also been given. This is different from GnuPG version 1.x. - at ifset gpgtwoone @item --pinentry-mode @code{mode} @opindex pinentry-mode Set the pinentry mode to @code{mode}. Allowed values for @code{mode} @@ -2779,7 +2634,6 @@ are: Redirect Pinentry queries to the caller. Note that in contrast to Pinentry the user is not prompted again if he enters a bad password. @end table - at end ifset @item --command-fd @code{n} @opindex command-fd @@ -3102,26 +2956,19 @@ files; They all live in in the current home directory (@pxref{option @item ~/.gnupg/pubring.gpg.lock The lock file for the public keyring. - at ifset gpgtwoone @item ~/.gnupg/pubring.kbx The public keyring using a different format. This file is sharred with @command{gpgsm}. You should backup this file. @item ~/.gnupg/pubring.kbx.lock The lock file for @file{pubring.kbx}. - at end ifset @item ~/.gnupg/secring.gpg - at ifclear gpgtwoone - The secret keyring. You should backup this file. - at end ifclear - at ifset gpgtwoone A secret keyring as used by GnuPG versions before 2.1. It is not used by GnuPG 2.1 and later. @item ~/.gnupg/.gpg-v21-migrated - File indicating that a migration to GnuPG 2.1 has taken place. - at end ifset + File indicating that a migration to GnuPG 2.1 has been done. @item ~/.gnupg/trustdb.gpg The trust database. There is no need to backup this file; it is better @@ -3166,18 +3013,7 @@ Operation is further controlled by a few environment variables: If set directory used instead of "~/.gnupg". @item GPG_AGENT_INFO - at ifset gpgtwoone This variable was used by GnuPG versions before 2.1 - at end ifset - at ifclear gpgtwoone - Used to locate the gpg-agent. - - The value consists of 3 colon delimited fields: The first is the path - to the Unix Domain Socket, the second the PID of the gpg-agent and the - protocol version which should be set to 1. When starting the gpg-agent - as described in its documentation, this variable is set to the correct - value. The option @option{--gpg-agent-info} can be used to override it. - at end ifclear @item PINENTRY_USER_DATA This value is passed via gpg-agent to pinentry. It is useful to convey @@ -3409,17 +3245,7 @@ control statements must be given. For GnuPG 2.1 and later @item %ask-passphrase @itemx %no-ask-passphrase - at ifclear gpgtwoone -Enable (or disable) a mode where the command @option{passphrase} is -ignored and instead the usual passphrase dialog is used. This does -not make sense for batch key generation; however the unattended key -generation feature is also used by GUIs and this feature relinquishes -the GUI from implementing its own passphrase entry code. These are -global control statements and affect all future key generations. - at end ifclear - at ifset gpgtwoone This option is a no-op for GnuPG 2.1 and later. - at end ifset @item %no-protection Using this option allows the creation of keys without any passphrase diff --git a/doc/gpgsm.texi b/doc/gpgsm.texi index 9f16f82..1b57d1a 100644 --- a/doc/gpgsm.texi +++ b/doc/gpgsm.texi @@ -165,20 +165,12 @@ use @samp{--help} to get a list of supported operations. @table @gnupgtabopt @item --gen-key @opindex gen-key - at ifclear gpgtwoone --This command allows the creation of a certificate signing request. It --is commonly used along with the @option{--output} option to save the --created CSR into a file. If used with the @option{--batch} a parameter --file is used to create the CSR. - at end ifclear - at ifset gpgtwoone This command allows the creation of a certificate signing request or a self-signed certificate. It is commonly used along with the @option{--output} option to save the created CSR or certificate into a file. If used with the @option{--batch} a parameter file is used to create the CSR or certificate and it is further possible to create non-self-signed certificates. - at end ifset @item --list-keys @itemx -k @@ -266,7 +258,6 @@ informational lines are prepended to the output. Note, that the PKCS#12 format is not very secure and this command is only provided if there is no other way to exchange the private key. (@pxref{option --p12-charset}) - at ifset gpgtwoone @item --export-secret-key-p8 @var{key-id} @itemx --export-secret-key-raw @var{key-id} @opindex export-secret-key-p8 @@ -277,7 +268,6 @@ PKCS#1 format; the @code{...-p8} command exports in PKCS#8 format. When used with the @code{--armor} option a few informational lines are prepended to the output. These commands are useful to prepare a key for use on a TLS server. - at end ifset @item --import [@var{files}] @opindex import @@ -361,11 +351,6 @@ Specify an agent program to be used for secret key operations. The default value is determined by running the command @command{gpgconf}. Note that the pipe symbol (@code{|}) is used for a regression test suite hack and may thus not be used in the file name. - at ifclear gpgtwoone -This is only used -as a fallback when the environment variable @code{GPG_AGENT_INFO} is not -set or a running agent cannot be connected. - at end ifclear @item --dirmngr-program @var{file} @opindex dirmngr-program @@ -594,12 +579,10 @@ certificate. Include the keygrip in standard key listings. Note that the keygrip is always listed in --with-colons mode. - at ifset gpgtwoone @item --with-secret @opindex with-secret Include info about the presence of a secret key in public key listings done with @code{--with-colons}. - at end ifset @end table @@ -906,10 +889,6 @@ other programs of this software too. @item S.gpg-agent @cindex S.gpg-agent If this file exists - at ifclear gpgtwoone -and the environment variable @env{GPG_AGENT_INFO} is -not set, - at end ifclear @command{gpgsm} will first try to connect to this socket for accessing @command{gpg-agent} before starting a new @command{gpg-agent} instance. Under Windows this socket (which in reality be a plain file @@ -1000,12 +979,6 @@ this is a missing certificate. @node CSR and certificate creation @subsection CSR and certificate creation - at ifclear gpgtwoone - at strong{Please notice}: The immediate creation of certificates is only -supported by GnuPG version 2.1 or later. With a 2.0 version you may -only create a CSR. - at end ifclear - The command @option{--gen-key} may be used along with the option @option{--batch} to either create a certificate signing request (CSR) or an X.509 certificate. This is controlled by a parameter file; the diff --git a/doc/tools.texi b/doc/tools.texi index fadbcb1..7bf5066 100644 --- a/doc/tools.texi +++ b/doc/tools.texi @@ -16,9 +16,7 @@ GnuPG comes with a couple of smaller tools: * gpgsm-gencert.sh:: Generate an X.509 certificate request. * gpg-preset-passphrase:: Put a passphrase into the cache. * gpg-connect-agent:: Communicate with a running agent. - at ifset gpgtwoone * dirmngr-client:: How to use the Dirmngr client tool. - at end ifset * gpgparsemail:: Parse a mail message into an annotated format * symcryptrun:: Call a simple symmetric encryption tool. * gpg-zip:: Encrypt or sign files into an archive. @@ -305,7 +303,6 @@ Reload all or the given component. This is basically the same as sending a SIGHUP to the component. Components which don't support reloading are ignored. - at ifset gpgtwoone @item --launch [@var{component}] @opindex launch If the @var{component} is not already running, start it. @@ -320,7 +317,6 @@ Kill the given component. Components which support killing are gpg-agent and scdaemon. Components which don't support reloading are ignored. Note that as of now reload and kill have the same effect for scdaemon. - at end ifset @end table @@ -1210,7 +1206,6 @@ option @option{--list-dirs}. Note that the pipe symbol (@code{|}) is used for a regression test suite hack and may thus not be used in the file name. - at ifset gpgtwoone @item --dirmngr-program @var{file} @opindex dirmngr-program Specify the directory manager (keyserver client) program to be started @@ -1221,7 +1216,6 @@ option @option{--dirmngr}. @opindex dirmngr Connect to a running directory manager (keyserver client) instead of to the gpg-agent. If a dirmngr is not running, start it. - at end ifset @item -S @itemx --raw-socket @var{name} @@ -1487,7 +1481,6 @@ Print a list of available control commands. @include see-also-note.texi @end ifset - at ifset gpgtwoone @c @c DIRMNGR-CLIENT @c @@ -1648,7 +1641,7 @@ Squid's @option{external_acl_type} option. @command{gpgsm}(1) @include see-also-note.texi @end ifset - at end ifset + @c @c GPGPARSEMAIL ----------------------------------------------------------------------- Summary of changes: doc/Makefile.am | 4 +- doc/debugging.texi | 2 - doc/gnupg.texi | 6 -- doc/gpg-agent.texi | 205 +++------------------------------------------------- doc/gpg.texi | 206 +++++------------------------------------------------ doc/gpgsm.texi | 27 ------- doc/tools.texi | 9 +-- 7 files changed, 27 insertions(+), 432 deletions(-) hooks/post-receive -- The GNU Privacy Guard http://git.gnupg.org From cvs at cvs.gnupg.org Tue Jun 9 11:33:06 2015 From: cvs at cvs.gnupg.org (by Werner Koch) Date: Tue, 09 Jun 2015 11:33:06 +0200 Subject: [git] GnuPG - branch, master, updated. gnupg-2.1.4-20-g255dadd Message-ID: 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 255dadd76d5a2101d2c5450741326b67253fa9ea (commit) from abbefdd04d7ee30218506caeae1fd858569c9f0a (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 255dadd76d5a2101d2c5450741326b67253fa9ea Author: Werner Koch Date: Tue Jun 9 11:31:06 2015 +0200 dirmngr: Avoid crash due to an empty crls.d/DIR.txt. * dirmngr/crlcache.c (check_dir_version): Avoid segv. -- GnuPG-bug-id: 1842 Debian-bug-id: 776611 diff --git a/dirmngr/crlcache.c b/dirmngr/crlcache.c index d10e3ca..d4c3dcb 100644 --- a/dirmngr/crlcache.c +++ b/dirmngr/crlcache.c @@ -479,7 +479,9 @@ check_dir_version (estream_t *fpadr, const char *fname, if (lineerr) return lineerr; - if (strtol (line+2, NULL, 10) != DBDIRVERSION) + /* The !line catches the case of an empty DIR file. We handle this + the same as a non-matching version. */ + if (!line || strtol (line+2, NULL, 10) != DBDIRVERSION) { if (!created && cleanup_on_mismatch) { ----------------------------------------------------------------------- Summary of changes: dirmngr/crlcache.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) hooks/post-receive -- The GNU Privacy Guard http://git.gnupg.org From cvs at cvs.gnupg.org Tue Jun 9 21:31:42 2015 From: cvs at cvs.gnupg.org (by Werner Koch) Date: Tue, 09 Jun 2015 21:31:42 +0200 Subject: [git] GnuPG - branch, master, updated. gnupg-2.1.4-21-g25331bb Message-ID: 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 25331bba5554a39d226d32433add7784b2e170b8 (commit) from 255dadd76d5a2101d2c5450741326b67253fa9ea (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 25331bba5554a39d226d32433add7784b2e170b8 Author: Werner Koch Date: Tue Jun 9 21:29:15 2015 +0200 doc: Do not used fixed file names in the manuals. * doc/mkdefsinc.c: New. * doc/Makefile.am: Include cmacros.am. (EXTRA_DIST): Add mkdefsinc.c defsincdate. (BUILT_SOURCES): Add defsincdate (CLEANFILES): Add mkdefsinc and defs.inc. (mkdefsinc): New rule. (yat2m-stamp): Depend on defs.inc. ($(myman_pages) gnupg.7): Ditto. (gnupg.texi): Remove rule to touch itself. (dist-hook): New. (defsincdate): New. (defs.inc): New. * doc/gnupg.texi: Remove inclusion of version.texi. Include defs.inc. Also include defs.inc in all files used to build man files. Change fixed directory names to those from defs.inc. -- GnuPG-bug-id: 1661 Signed-off-by: Werner Koch diff --git a/am/cmacros.am b/am/cmacros.am index 4b48560..8bd839c 100644 --- a/am/cmacros.am +++ b/am/cmacros.am @@ -18,6 +18,8 @@ localedir = $(datadir)/locale +# NB: AM_CFLAGS may also be used by tools running on the build +# platform to create source files. AM_CPPFLAGS += -DLOCALEDIR=\"$(localedir)\" if ! HAVE_DOSISH_SYSTEM diff --git a/doc/Makefile.am b/doc/Makefile.am index 6d66679..ee8bca2 100644 --- a/doc/Makefile.am +++ b/doc/Makefile.am @@ -17,6 +17,10 @@ ## Process this file with automake to produce Makefile.in +AM_CPPFLAGS = + +include $(top_srcdir)/am/cmacros.am + examples = examples/README examples/scd-event examples/trustlist.txt \ examples/gpgconf.conf examples/pwpattern.list @@ -32,12 +36,12 @@ EXTRA_DIST = samplekeys.asc mksamplekeys \ gnupg-logo.eps gnupg-logo.pdf gnupg-logo.png gnupg-logo-tr.png\ gnupg-card-architecture.eps gnupg-card-architecture.png \ gnupg-card-architecture.pdf \ - FAQ gnupg7.texi \ + FAQ gnupg7.texi mkdefsinc.c defsincdate \ opt-homedir.texi see-also-note.texi specify-user-id.texi \ gpgv.texi yat2m.c ChangeLog-2011 whats-new-in-2.1.txt BUILT_SOURCES = gnupg-card-architecture.eps gnupg-card-architecture.png \ - gnupg-card-architecture.pdf + gnupg-card-architecture.pdf defsincdate info_TEXINFOS = gnupg.texi @@ -75,7 +79,7 @@ man_MANS = $(myman_pages) gnupg.7 watchgnupg_SOURCE = gnupg.texi -CLEANFILES = yat2m +CLEANFILES = yat2m mkdefsinc defs.inc DISTCLEANFILES = gnupg.tmp gnupg.ops yat2m-stamp.tmp yat2m-stamp \ $(myman_pages) gnupg.7 @@ -83,6 +87,10 @@ DISTCLEANFILES = gnupg.tmp gnupg.ops yat2m-stamp.tmp yat2m-stamp \ yat2m: yat2m.c $(CC_FOR_BUILD) -o $@ $(srcdir)/yat2m.c +mkdefsinc: mkdefsinc.c Makefile ../config.h + $(CC_FOR_BUILD) -I. -I.. -I$(srcdir) $(AM_CPPFLAGS) \ + -o $@ $(srcdir)/mkdefsinc.c + .fig.png: fig2dev -L png `test -f '$<' || echo '$(srcdir)/'`$< $@ @@ -97,7 +105,7 @@ yat2m: yat2m.c fig2dev -L pdf `test -f '$<' || echo '$(srcdir)/'`$< $@ -yat2m-stamp: $(myman_sources) +yat2m-stamp: $(myman_sources) defs.inc @rm -f yat2m-stamp.tmp @touch yat2m-stamp.tmp for file in $(myman_sources) ; do \ @@ -107,7 +115,7 @@ yat2m-stamp: $(myman_sources) yat2m-stamp: yat2m -$(myman_pages) gnupg.7 : yat2m-stamp +$(myman_pages) gnupg.7 : yat2m-stamp defs.inc @if test -f $@; then :; else \ trap 'rm -rf yat2m-stamp yat2m-lock' 1 2 13 15; \ if mkdir yat2m-lock 2>/dev/null; then \ @@ -120,11 +128,20 @@ $(myman_pages) gnupg.7 : yat2m-stamp fi; \ fi -# Make sure that gnupg.texi is touched if any other source file has -# been modified. This is required so that the version.texi magic -# updates the release date. -gnupg.texi : $(gnupg_TEXINFOS) - touch $(srcdir)/gnupg.texi +dist-hook: defsincdate + +defsincdate: $(gnupg_TEXINFOS) + : >defsincdate ; \ + if test -d $(top_srcdir)/.git; then \ + (cd $(srcdir) && git log -1 --format='%ct' \ + -- $(gnupg_TEXINFOS) 2>/dev/null) >>defsincdate; \ + fi + +defs.inc : defsincdate Makefile mkdefsinc + incd="`test -f defsincdate || echo '$(srcdir)/'`defsincdate"; \ + ./mkdefsinc -C $(srcdir) --date "`cat $$incd 2>/dev/null`" \ + $(gnupg_TEXINFOS) >$@ + online: gnupg.html gnupg.pdf set -e; \ diff --git a/doc/debugging.texi b/doc/debugging.texi index 35cb699..7965dbc 100644 --- a/doc/debugging.texi +++ b/doc/debugging.texi @@ -178,7 +178,7 @@ Pick the key which best matches the creation time and run the command @cartouche @smallexample - /usr/local/libexec/gpg-protect-tool --p12-export \ + @value{LIBEXECDIR}/gpg-protect-tool --p12-export \ ~/.gnupg/private-keys-v1.d/@var{foo} >@var{foo}.p12 @end smallexample @end cartouche @@ -193,7 +193,7 @@ To import the created file on the machine you use this command: @cartouche @smallexample - /usr/local/libexec/gpg-protect-tool --p12-import --store @var{foo}.p12 + @value{LIBEXECDIR}/gpg-protect-tool --p12-import --store @var{foo}.p12 @end smallexample @end cartouche diff --git a/doc/dirmngr.texi b/doc/dirmngr.texi index cf35c47..d62e2d5 100644 --- a/doc/dirmngr.texi +++ b/doc/dirmngr.texi @@ -3,6 +3,8 @@ @c This is part of the GnuPG manual. @c For copying conditions, see the file gnupg.texi. + at include defs.inc + @node Invoking DIRMNGR @chapter Invoking DIRMNGR @cindex DIRMNGR command options @@ -143,8 +145,8 @@ running mode: @table @asis @item With @code{--daemon} given on the commandline -the directory named @file{/etc/gnupg} is used for configuration files -and @file{/var/cache/gnupg} for cached CRLs. +the directory named @file{@value{SYSCONFDIR}} is used for configuration files +and @file{@value{LOCALCACHEDIR}} for cached CRLs. @item Without @code{--daemon} given on the commandline the directory named @file{.gnupg} directly below the home directory @@ -456,7 +458,7 @@ These certificates are first tried before going out to the net to look for them. These certificates must also be @acronym{DER} encoded and suffixed with @file{.crt} or @file{.der}. - at item /var/run/gnupg + at item @value{LOCALRUNDIR} This directory is only used in the deprecated system daemon mode. It keeps the socket file for accessing @command{dirmngr} services. The name of the socket file will be @file{S.dirmngr}. Make sure that this @@ -465,7 +467,7 @@ the socket file and that eligible users may read and write to that socket. @item ~/.gnupg/crls.d - at itemx /var/cache/gnupg/crls.d + at itemx @value{LOCALCACHEDIR}/crls.d The first directory is used to store cached CRLs. The @file{crls.d} part will be created by dirmngr if it does not exists but you need to make sure that the upper directory exists. The second directory is diff --git a/doc/gnupg.texi b/doc/gnupg.texi index 2517a50..1fddeb0 100644 --- a/doc/gnupg.texi +++ b/doc/gnupg.texi @@ -1,7 +1,7 @@ \input texinfo @c -*-texinfo-*- @c %**start of header @setfilename gnupg.info - at include version.texi + at include defs.inc @settitle Using the GNU Privacy Guard @c A couple of macros with no effect on texinfo diff --git a/doc/gpg-agent.texi b/doc/gpg-agent.texi index 3078392..e570144 100644 --- a/doc/gpg-agent.texi +++ b/doc/gpg-agent.texi @@ -2,6 +2,7 @@ @c This is part of the GnuPG manual. @c For copying conditions, see the file gnupg.texi. + at include defs.inc @node Invoking GPG-AGENT @chapter Invoking GPG-AGENT @@ -75,8 +76,8 @@ Please make sure that a proper pinentry program has been installed under the default filename (which is system dependent) or use the option @option{pinentry-program} to specify the full name of that program. It is often useful to install a symbolic link from the actual used -pinentry (e.g. @file{/usr/bin/pinentry-gtk}) to the expected -one (e.g. @file{/usr/bin/pinentry}). +pinentry (e.g. @file{@value{BINDIR}/pinentry-gtk}) to the expected +one (e.g. @file{@value{BINDIR}/pinentry}). @manpause @noindent @@ -580,7 +581,7 @@ It might even be advisable to change the permissions to read-only so that this file can't be changed inadvertently. As a special feature a line @code{include-default} will include a global -list of trusted certificates (e.g. @file{/etc/gnupg/trustlist.txt}). +list of trusted certificates (e.g. @file{@value{SYSCONFDIR}/trustlist.txt}). This global list is also used if the local list is not available. It is possible to add further flags after the @code{S} for use by the @@ -647,7 +648,7 @@ implicitly added to this list; i.e. there is no need to list them. @end table Note that on larger installations, it is useful to put predefined -files into the directory @file{/etc/skel/.gnupg/} so that newly created +files into the directory @file{@value{SYSCONFSKELDIR}} so that newly created users start up with a working configuration. For existing users the a small helper script is provided to create these files (@pxref{addgnupghome}). diff --git a/doc/gpg.texi b/doc/gpg.texi index 77072bd..6fcfe58 100644 --- a/doc/gpg.texi +++ b/doc/gpg.texi @@ -3,19 +3,14 @@ @c This is part of the GnuPG manual. @c For copying conditions, see the file gnupg.texi. + at include defs.inc + @node Invoking GPG @chapter Invoking GPG @cindex GPG command options @cindex command options @cindex options, GPG command - at c Begin algorithm defaults - - at set DEFSYMENCALGO AES128 - - at c End algorithm defaults - - @macro gpgname gpg2 @end macro @@ -180,7 +175,7 @@ decrypted via a secret key or a passphrase). @itemx -c @opindex symmetric Encrypt with a symmetric cipher using a passphrase. The default -symmetric cipher used is @value{DEFSYMENCALGO}, but may be chosen with the +symmetric cipher used is @value{GPGSYMENCALGO}, but may be chosen with the @option{--cipher-algo} option. This option may be combined with @option{--sign} (for a signed and symmetrically encrypted message), @option{--encrypt} (for a message that may be decrypted via a secret key @@ -1672,7 +1667,7 @@ file name. @item --dirmngr-program @var{file} @opindex dirmngr-program Specify a dirmngr program to be used for keyserver access. The -default value is @file{/usr/sbin/dirmngr}. This is only used as a +default value is @file{@value{BINDIR}/dirmngr}. This is only used as a fallback when the environment variable @code{DIRMNGR_INFO} is not set or a running dirmngr cannot be connected. @@ -2152,7 +2147,7 @@ to consider (e.g. @option{--symmetric}). @item --s2k-cipher-algo @code{name} @opindex s2k-cipher-algo Use @code{name} as the cipher algorithm used to protect secret keys. -The default cipher is @value{DEFSYMENCALGO}. This cipher is also used +The default cipher is @value{GPGSYMENCALGO}. This cipher is also used for symmetric encryption with a passphrase if @option{--personal-cipher-preferences} and @option{--cipher-algo} is not given. @@ -2939,8 +2934,8 @@ current home directory (@pxref{option --homedir}). @c man:.RE Note that on larger installations, it is useful to put predefined files -into the directory @file{/etc/skel/.gnupg/} so that newly created users -start up with a working configuration. +into the directory @file{@value{SYSCONFSKELDIR}} so that +newly created users start up with a working configuration. For existing users a small helper script is provided to create these files (@pxref{addgnupghome}). @@ -2993,10 +2988,10 @@ files; They all live in in the current home directory (@pxref{option You should backup all files in this directory and take care to keep this backup closed away. - @item /usr[/local]/share/gnupg/options.skel + @item @value{DATADIR}/options.skel The skeleton options file. - @item /usr[/local]/lib/gnupg/ + @item @value{LIBDIR}/ Default location for extensions. @end table diff --git a/doc/gpgsm.texi b/doc/gpgsm.texi index 1b57d1a..21e9372 100644 --- a/doc/gpgsm.texi +++ b/doc/gpgsm.texi @@ -2,6 +2,8 @@ @c This is part of the GnuPG manual. @c For copying conditions, see the file gnupg.texi. + at include defs.inc + @node Invoking GPGSM @chapter Invoking GPGSM @cindex GPGSM command options @@ -355,7 +357,7 @@ suite hack and may thus not be used in the file name. @item --dirmngr-program @var{file} @opindex dirmngr-program Specify a dirmngr program to be used for @acronym{CRL} checks. The -default value is @file{/usr/sbin/dirmngr}. This is only used as a +default value is @file{@value{BINDIR}/dirmngr}. This is only used as a fallback when the environment variable @code{DIRMNGR_INFO} is not set or a running dirmngr cannot be connected. @@ -819,7 +821,7 @@ mean that the certificate is trusted; in general the certificates listed in this file need to be listed also in @file{trustlist.txt}. This is a global file an installed in the data directory -(e.g. @file{/usr/share/gnupg/qualified.txt}). GnuPG installs a suitable +(e.g. @file{@value{DATADIR}/qualified.txt}). GnuPG installs a suitable file with root certificates as used in Germany. As new Root-CA certificates may be issued over time, these entries may need to be updated; new distributions of this software should come with an updated @@ -844,9 +846,9 @@ This is plain text file with a few help entries used with @command{gpg} and @command{gpgsm}. The standard file has English help texts; to install localized versions use filenames like @file{help.LL.txt} with LL denoting the locale. GnuPG comes with a set of predefined help -files in the data directory (e.g. @file{/usr/share/gnupg/help.de.txt}) +files in the data directory (e.g. @file{@value{DATADIR}/gnupg/help.de.txt}) and allows overriding of any help item by help files stored in the -system configuration directory (e.g. @file{/etc/gnupg/help.de.txt}). +system configuration directory (e.g. @file{@value{SYSCONFDIR}/help.de.txt}). For a reference of the help file's syntax, please see the installed @file{help.txt} file. @@ -857,7 +859,7 @@ This file is a collection of common certificates used to populated a newly created @file{pubring.kbx}. An administrator may replace this file with a custom one. The format is a concatenation of PEM encoded X.509 certificates. This global file is installed in the data directory -(e.g. @file{/usr/share/gnupg/com-certs.pem}). +(e.g. @file{@value{DATADIR}/com-certs.pem}). @end table diff --git a/doc/gpgv.texi b/doc/gpgv.texi index 0cb2360..8d7164a 100644 --- a/doc/gpgv.texi +++ b/doc/gpgv.texi @@ -6,6 +6,8 @@ @c This is included by tools.texi. @c + at include defs.inc + @c Begin GnuPG 1.x specific stuff @ifset gpgone @macro gpgvname diff --git a/doc/instguide.texi b/doc/instguide.texi index aff3955..76d8de1 100644 --- a/doc/instguide.texi +++ b/doc/instguide.texi @@ -29,7 +29,7 @@ configured @command{gnupg} using: @end example This is to make sure that system wide configuration files are searched -in the directory @file{/etc/gnupg} and variable data below @file{/var}; +in the directory @file{/etc} and variable data below @file{/var}; the default would be to also install them below @file{/usr/local} where the binaries get installed. If you selected to use the @option{--prefix=/} you obviously don't need those option as they are diff --git a/doc/mkdefsinc.c b/doc/mkdefsinc.c new file mode 100644 index 0000000..c4f776f --- /dev/null +++ b/doc/mkdefsinc.c @@ -0,0 +1,306 @@ +/* mkdefsinc.c - Tool to create defs.inc + * Copyright (C) 2015 g10 Code GmbH + * + * This file is free software; as a special exception the author gives + * unlimited permission to copy and/or distribute it, with or without + * modifications, as long as this notice is preserved. + * + * This file is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY, to the extent permitted by law; without even the + * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + */ + +/* This tool needs to be build with command line supplied -D options + for the various directory variables. See ../am/cmacros.am. It is + easier to do this in build file than to use fragile make rules and + a template file. */ + + +#include +#include +#include +#include +#include +#include +#include +#include + +#define PGM "mkdefsinc" + +/* We include config.h after all include files because the config.h + values are not valid for the build platform but we need some values + nevertheless. */ +#include "config.h" + + +static int verbose; + + +/* The usual free wrapper. */ +static void +xfree (void *a) +{ + if (a) + free (a); +} + + +static char * +xmalloc (size_t n) +{ + char *p; + + p = malloc (n); + if (!p) + { + fputs (PGM ": out of core\n", stderr); + exit (1); + } + return p; +} + + +static char * +xstrdup (const char *string) +{ + char *p; + + p = xmalloc (strlen (string)+1); + strcpy (p, string); + return p; +} + + +/* Return a malloced string with the last modification date of the + FILES. Returns NULL on error. */ +static char * +get_date_from_files (char **files) +{ + const char *file; + const char *usedfile = NULL; + struct stat sb; + struct tm *tp; + int errors = 0; + time_t stamp = 0; + char *result; + + for (; (file = *files); files++) + { + if (!*file || !strcmp (file, ".") || !strcmp (file, "..")) + continue; + if (stat (file, &sb)) + { + fprintf (stderr, PGM ": stat failed for '%s': %s\n", + file, strerror (errno)); + errors = 1; + continue; + } + if (sb.st_mtime > stamp) + { + stamp = sb.st_mtime; + usedfile = file; + } + } + if (errors) + exit (1); + + if (usedfile) + fprintf (stderr, PGM ": taking date from '%s'\n", usedfile); + + tp = gmtime (&stamp); + if (!tp) + return NULL; + result = xmalloc (4+1+2+1+2+1); + snprintf (result, 4+1+2+1+2+1, "%04d-%02d-%02d", + tp->tm_year + 1900, tp->tm_mon+1, tp->tm_mday); + return result; +} + + + +int +main (int argc, char **argv) +{ + int last_argc = -1; + char *opt_date = NULL; + int monthoff; + char *p, *pend; + size_t n; + + /* Option parsing. */ + if (argc) + { + argc--; argv++; + } + while (argc && last_argc != argc ) + { + last_argc = argc; + if (!strcmp (*argv, "--")) + { + argc--; argv++; + break; + } + else if (!strcmp (*argv, "--help")) + { + fputs ("Usage: " PGM " [OPTION] [FILES]\n" + "Create defs.inc file.\nOptions:\n" + " -C DIR Change to DIR before doing anything\n" + " --date STRING Take publication date from STRING\n" + " --verbose Enable extra informational output\n" + " --help Display this help and exit\n" + , stdout); + exit (0); + } + else if (!strcmp (*argv, "--verbose")) + { + verbose = 1; + argc--; argv++; + } + else if (!strcmp (*argv, "-C")) + { + argc--; argv++; + if (argc) + { + if (chdir (*argv)) + { + fprintf (stderr, PGM ": chdir to '%s' failed: %s\n", + *argv, strerror (errno)); + exit (1); + } + argc--; argv++; + } + } + else if (!strcmp (*argv, "--date")) + { + argc--; argv++; + if (argc) + { + opt_date = xstrdup (*argv); + argc--; argv++; + } + } + else if (!strncmp (*argv, "--", 2)) + { + fprintf (stderr, PGM ": unknown option '%s'\n", *argv); + exit (1); + } + } + + if (opt_date && *opt_date) + { + time_t stamp; + struct tm *tp; + + if (*opt_date == '2' && strlen (opt_date) >= 10 + && opt_date[4] == '-' && opt_date[7] == '-') + { + opt_date[10] = 0; + } + else if ((stamp = strtoul (opt_date, NULL, 10)) > 0 + && (tp = gmtime (&stamp))) + { + p = xmalloc (4+1+2+1+2+1); + snprintf (p, 4+1+2+1+2+1, "%04d-%02d-%02d", + tp->tm_year + 1900, tp->tm_mon+1, tp->tm_mday); + xfree (opt_date); + opt_date = p; + } + else + { + fprintf (stderr, PGM ": bad date '%s'\n", opt_date); + exit (1); + } + } + else + { + xfree (opt_date); + opt_date = argc? get_date_from_files (argv) : NULL; + } + if (!opt_date) + { + opt_date = xstrdup ("unknown"); + monthoff = 0; + } + else + { + const char *month = "?"; + + switch (atoi (opt_date+5)) + { + case 1: month = "January"; break; + case 2: month = "February"; break; + case 3: month = "March"; break; + case 4: month = "April"; break; + case 5: month = "May"; break; + case 6: month = "June"; break; + case 7: month = "July"; break; + case 8: month = "August"; break; + case 9: month = "September"; break; + case 10: month = "October"; break; + case 11: month = "November"; break; + case 12: month = "December"; break; + } + n = strlen (opt_date) + strlen (month) + 2 + 1; + p = xmalloc (n); + snprintf (p, n, "%d %n%s %d", + atoi (opt_date+8), &monthoff, month, atoi (opt_date)); + xfree (opt_date); + opt_date = p; + } + + + fputs ("@c defs.inc -*- texinfo -*-\n" + "@c Common and build specific constants for the manuals.\n" + "@c This file has been created by " PGM ".\n", stdout); + + fputs ("\n at c Directories\n\n", stdout); + + fputs ("@set BINDIR " GNUPG_BINDIR "\n" + "@set LIBEXECDIR " GNUPG_LIBEXECDIR "\n" + "@set LIBDIR " GNUPG_LIBDIR "\n" + "@set DATADIR " GNUPG_DATADIR "\n" + "@set SYSCONFDIR " GNUPG_SYSCONFDIR "\n" + "@set LOCALSTATEDIR " GNUPG_LOCALSTATEDIR "\n" + "@set LOCALCACHEDIR " GNUPG_LOCALSTATEDIR + /* */ "/cache/" PACKAGE_NAME "\n" + "@set LOCALRUNDIR " GNUPG_LOCALSTATEDIR + /* */ "/run/" PACKAGE_NAME "\n" + , stdout); + + p = xstrdup (GNUPG_SYSCONFDIR); + pend = strrchr (p, '/'); + fputs ("@set SYSCONFSKELDIR ", stdout); + if (pend) + { + *pend = 0; + fputs (p, stdout); + } + fputs ("/skel/." PACKAGE_NAME "\n", stdout); + xfree (p); + + fputs ("\n at c Version information a la version.texi\n\n", stdout); + + printf ("@set UPDATED %s\n", opt_date); + printf ("@set UPDATED-MONTH %s\n", opt_date + monthoff); + printf ("@set EDITION %s\n", PACKAGE_VERSION); + printf ("@set VERSION %s\n", PACKAGE_VERSION); + + fputs ("\n at c Algorithm defaults\n\n", stdout); + + /* Fixme: Use a config.h macro here: */ + fputs ("@set GPGSYMENCALGO AES-128\n", stdout); + + + fputs ("\n" + "@c Loc" "al Variables:\n" + "@c buffer-read-only: t\n" + "@c End:\n", stdout); + + if (ferror (stdout)) + { + fprintf (stderr, PGM ": error writing to stdout: %s\n", strerror (errno)); + return 1; + } + + return 0; +} diff --git a/doc/opt-homedir.texi b/doc/opt-homedir.texi index 033a901..7bcce46 100644 --- a/doc/opt-homedir.texi +++ b/doc/opt-homedir.texi @@ -18,5 +18,5 @@ empty file name @file{gpgconf.ctl} in the same directory as the tool directory; or, if @file{gpgconf.exe} has been installed directly below a directory named @file{bin}, its parent directory. You also need to make sure that the following directories exist and are writable: - at file{ROOT/home} for the GnuPG home and @file{ROOT/var/cache/gnupg} + at file{ROOT/home} for the GnuPG home and @file{ROOT at value{LOCALCACHEDIR}} for internal cache files. diff --git a/doc/scdaemon.texi b/doc/scdaemon.texi index 79a5fcc..7f1058b 100644 --- a/doc/scdaemon.texi +++ b/doc/scdaemon.texi @@ -2,6 +2,8 @@ @c This is part of the GnuPG manual. @c For copying conditions, see the file gnupg.texi. + at include defs.inc + @node Invoking SCDAEMON @chapter Invoking the SCDAEMON @cindex SCDAEMON command options @@ -469,8 +471,8 @@ make much sense expect for system services, but in this case no regular user accounts are hosted on the machine. A client connects to the SC-Daemon by connecting to the socket named - at file{/var/run/scdaemon/socket}, configuration information is read from - at var{/etc/scdaemon.conf} + at file{@value{LOCALRUNDIR}/scdaemon/socket}, configuration information +is read from @var{@value{SYSCONFDIR}/scdaemon.conf} Each connection acts as one session, SC-Daemon takes care of synchronizing access to a token between sessions. diff --git a/doc/tools.texi b/doc/tools.texi index 7bf5066..a067eb6 100644 --- a/doc/tools.texi +++ b/doc/tools.texi @@ -2,6 +2,8 @@ @c This is part of the GnuPG manual. @c For copying conditions, see the file GnuPG.texi. + at include defs.inc + @node Helper Tools @chapter Helper Tools diff --git a/doc/yat2m.c b/doc/yat2m.c index 86c3c70..e2ab86e 100644 --- a/doc/yat2m.c +++ b/doc/yat2m.c @@ -1367,7 +1367,7 @@ parse_file (const char *fname, FILE *fp, char **section_name, int in_pause) } if (!incfp) - err ("can't open include file '%s':%s", + err ("can't open include file '%s': %s", incname, strerror (errno)); else { ----------------------------------------------------------------------- Summary of changes: am/cmacros.am | 2 + doc/Makefile.am | 37 +++++-- doc/debugging.texi | 4 +- doc/dirmngr.texi | 10 +- doc/gnupg.texi | 2 +- doc/gpg-agent.texi | 9 +- doc/gpg.texi | 23 ++-- doc/gpgsm.texi | 12 +- doc/gpgv.texi | 2 + doc/instguide.texi | 2 +- doc/mkdefsinc.c | 306 +++++++++++++++++++++++++++++++++++++++++++++++++++ doc/opt-homedir.texi | 2 +- doc/scdaemon.texi | 6 +- doc/tools.texi | 2 + doc/yat2m.c | 2 +- 15 files changed, 376 insertions(+), 45 deletions(-) create mode 100644 doc/mkdefsinc.c hooks/post-receive -- The GNU Privacy Guard http://git.gnupg.org From cvs at cvs.gnupg.org Wed Jun 10 16:49:41 2015 From: cvs at cvs.gnupg.org (by Daiki Ueno) Date: Wed, 10 Jun 2015 16:49:41 +0200 Subject: [git] GnuPG - branch, master, updated. gnupg-2.1.4-22-g691dae2 Message-ID: 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 691dae270b3b741178912599724d69adabdb48b9 (commit) from 25331bba5554a39d226d32433add7784b2e170b8 (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 691dae270b3b741178912599724d69adabdb48b9 Author: Daiki Ueno Date: Tue Jun 9 21:07:00 2015 +0900 agent: Add option --allow-emacs-pinentry * agent/agent.h (opt): Add field allow_emacs_pinentry. * agent/call-pinentry.c (start_pinentry): Act upon new var. * agent/gpg-agent.c (oAllowEmacsPinentry): New. (opts): Add option --allow-emacs-pinentry. (parse_rereadable_options): Set this option. * tools/gpgconf-comp.c (gc_options_gpg_agent): Add new option. -- gpgconf-comp and manual entry added by wk. Signed-off-by: Werner Koch diff --git a/agent/agent.h b/agent/agent.h index dbbf689..ab8dc9f 100644 --- a/agent/agent.h +++ b/agent/agent.h @@ -133,6 +133,10 @@ struct to allow it to enable such a cache. */ int allow_external_cache; + /* If this global option is true, the Assuan option of Pinentry + allow-emacs-prompt is allowed. */ + int allow_emacs_pinentry; + int keep_tty; /* Don't switch the TTY (for pinentry) on request */ int keep_display; /* Don't switch the DISPLAY (for pinentry) on request */ diff --git a/agent/call-pinentry.c b/agent/call-pinentry.c index 018a609..ba40f4d 100644 --- a/agent/call-pinentry.c +++ b/agent/call-pinentry.c @@ -423,6 +423,16 @@ start_pinentry (ctrl_t ctrl) return unlock_pinentry (rc); } + if (opt.allow_emacs_pinentry) + { + /* Indicate to the pinentry that it may read passphrase through + Emacs minibuffer, if possible. */ + rc = assuan_transact (entry_ctx, "OPTION allow-emacs-prompt", + NULL, NULL, NULL, NULL, NULL, NULL); + if (rc && gpg_err_code (rc) != GPG_ERR_UNKNOWN_OPTION) + return unlock_pinentry (rc); + } + { /* Provide a few default strings for use by the pinentries. This diff --git a/agent/gpg-agent.c b/agent/gpg-agent.c index 659aa2c..2acb650 100644 --- a/agent/gpg-agent.c +++ b/agent/gpg-agent.c @@ -120,6 +120,7 @@ enum cmd_and_opt_values oAllowPresetPassphrase, oAllowLoopbackPinentry, oNoAllowExternalCache, + oAllowEmacsPinentry, oKeepTTY, oKeepDISPLAY, oSSHSupport, @@ -214,6 +215,8 @@ static ARGPARSE_OPTS opts[] = { /* */ N_("allow presetting passphrase")), ARGPARSE_s_n (oAllowLoopbackPinentry, "allow-loopback-pinentry", N_("allow caller to override the pinentry")), + ARGPARSE_s_n (oAllowEmacsPinentry, "allow-emacs-pinentry", + /* */ N_("allow passphrase to be prompted through Emacs")), ARGPARSE_s_n (oSSHSupport, "enable-ssh-support", N_("enable ssh support")), ARGPARSE_s_n (oPuttySupport, "enable-putty-support", @@ -565,6 +568,7 @@ parse_rereadable_options (ARGPARSE_ARGS *pargs, int reread) opt.ignore_cache_for_signing = 0; opt.allow_mark_trusted = 1; opt.allow_external_cache = 1; + opt.allow_emacs_pinentry = 0; opt.disable_scdaemon = 0; disable_check_own_socket = 0; return 1; @@ -634,6 +638,9 @@ parse_rereadable_options (ARGPARSE_ARGS *pargs, int reread) case oNoAllowExternalCache: opt.allow_external_cache = 0; break; + case oAllowEmacsPinentry: opt.allow_emacs_pinentry = 1; + break; + default: return 0; /* not handled */ } @@ -1080,6 +1087,8 @@ main (int argc, char **argv ) #endif es_printf ("allow-loopback-pinentry:%lu:\n", GC_OPT_FLAG_NONE|GC_OPT_FLAG_RUNTIME); + es_printf ("allow-emacs-pinentry:%lu:\n", + GC_OPT_FLAG_NONE|GC_OPT_FLAG_RUNTIME); agent_exit (0); } diff --git a/doc/gpg-agent.texi b/doc/gpg-agent.texi index e570144..737b51b 100644 --- a/doc/gpg-agent.texi +++ b/doc/gpg-agent.texi @@ -314,6 +314,12 @@ which employs an additional external cache to implement such a policy. By using this option the Pinentry is advised not to make use of such a cache and instead always ask the user for the requested passphrase. + at item --allow-emacs-pinentry + at opindex allow-emacs-pinentry +Tell Pinentry to allow features to divert the passphrase entry to a +running Emacs instance. How this is exactly handled depends on the +version of the used Pinentry. + @item --ignore-cache-for-signing @opindex ignore-cache-for-signing This option will let @command{gpg-agent} bypass the passphrase cache for all @@ -676,7 +682,7 @@ again. Only certain options are honored: @code{quiet}, @code{debug-pinentry}, @code{no-grab}, @code{pinentry-program}, @code{default-cache-ttl}, @code{max-cache-ttl}, @code{ignore-cache-for-signing}, - at code{no-allow-external-cache}, + at code{no-allow-external-cache}, @code{allow-emacs-pinentry}, @code{no-allow-mark-trusted}, @code{disable-scdaemon}, and @code{disable-check-own-socket}. @code{scdaemon-program} is also supported but due to the current implementation, which calls the diff --git a/tools/gpgconf-comp.c b/tools/gpgconf-comp.c index cf2d188..cb83088 100644 --- a/tools/gpgconf-comp.c +++ b/tools/gpgconf-comp.c @@ -538,6 +538,10 @@ static gc_option_t gc_options_gpg_agent[] = { "ignore-cache-for-signing", GC_OPT_FLAG_RUNTIME, GC_LEVEL_BASIC, "gnupg", "do not use the PIN cache when signing", GC_ARG_TYPE_NONE, GC_BACKEND_GPG_AGENT }, + { "allow-emacs-pinentry", GC_OPT_FLAG_RUNTIME, + GC_LEVEL_ADVANCED, + "gnupg", "allow passphrase to be prompted through Emacs", + GC_ARG_TYPE_NONE, GC_BACKEND_GPG_AGENT }, { "no-allow-external-cache", GC_OPT_FLAG_RUNTIME, GC_LEVEL_BASIC, "gnupg", "disallow the use of an external password cache", GC_ARG_TYPE_NONE, GC_BACKEND_GPG_AGENT }, ----------------------------------------------------------------------- Summary of changes: agent/agent.h | 4 ++++ agent/call-pinentry.c | 10 ++++++++++ agent/gpg-agent.c | 9 +++++++++ doc/gpg-agent.texi | 8 +++++++- tools/gpgconf-comp.c | 4 ++++ 5 files changed, 34 insertions(+), 1 deletion(-) hooks/post-receive -- The GNU Privacy Guard http://git.gnupg.org From cvs at cvs.gnupg.org Thu Jun 11 09:28:24 2015 From: cvs at cvs.gnupg.org (by NIIBE Yutaka) Date: Thu, 11 Jun 2015 09:28:24 +0200 Subject: [git] GCRYPT - branch, master, updated. libgcrypt-1.6.0-230-ga36ee75 Message-ID: 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 crypto library". The branch, master has been updated via a36ee7501f68ad7ebcfe31f9659430b9d2c3ddd1 (commit) from 2bddd947fd1c11b4ec461576db65a5e34fea1b07 (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 a36ee7501f68ad7ebcfe31f9659430b9d2c3ddd1 Author: NIIBE Yutaka Date: Thu Jun 11 16:19:49 2015 +0900 mpi: Support FreeBSD 10 or later. * mpi/config.links: Include FreeBSD 10 to 29. -- Thanks to Yuta SATOH. GnuPG-bug-id: 1936, 1974 diff --git a/mpi/config.links b/mpi/config.links index 2fb5e8a..3ead4f0 100644 --- a/mpi/config.links +++ b/mpi/config.links @@ -50,11 +50,12 @@ case "${host}" in path="" mpi_cpu_arch="x86" ;; - i[3467]86*-*-openbsd* | \ - i[3467]86*-*-freebsd*-elf | \ - i[3467]86*-*-freebsd[3-9]* | \ - i[3467]86*-*-freebsdelf* | \ - i[3467]86*-*-netbsd* | \ + i[3467]86*-*-openbsd* | \ + i[3467]86*-*-freebsd*-elf | \ + i[3467]86*-*-freebsd[3-9]* | \ + i[3467]86*-*-freebsd[12][0-9]*| \ + i[3467]86*-*-freebsdelf* | \ + i[3467]86*-*-netbsd* | \ i[3467]86*-*-k*bsd*) echo '#define ELF_SYNTAX' >>./mpi/asm-syntax.h cat $srcdir/mpi/i386/syntax.h >>./mpi/asm-syntax.h @@ -64,6 +65,7 @@ case "${host}" in i586*-*-openbsd* | \ i586*-*-freebsd*-elf | \ i586*-*-freebsd[3-9]* | \ + i586*-*-freebsd[12][0-9]*| \ i586*-*-freebsdelf* | \ i586*-*-netbsd* | \ i586*-*-k*bsd* | \ ----------------------------------------------------------------------- Summary of changes: mpi/config.links | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) hooks/post-receive -- The GNU crypto library http://git.gnupg.org From cvs at cvs.gnupg.org Thu Jun 11 09:30:51 2015 From: cvs at cvs.gnupg.org (by NIIBE Yutaka) Date: Thu, 11 Jun 2015 09:30:51 +0200 Subject: [git] GCRYPT - branch, LIBGCRYPT-1-6-BRANCH, updated. libgcrypt-1.6.3-6-g842535b Message-ID: 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 crypto library". The branch, LIBGCRYPT-1-6-BRANCH has been updated via 842535b7ea0a9811405e0feae0e9ffb349ee5360 (commit) from 5ffa73d10594a2c335b149a2bc83ab70775c3567 (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 842535b7ea0a9811405e0feae0e9ffb349ee5360 Author: NIIBE Yutaka Date: Thu Jun 11 16:19:49 2015 +0900 mpi: Support FreeBSD 10 or later. * mpi/config.links: Include FreeBSD 10 to 29. -- (backported from master commit 54489bb2a7f4a044e8cc28ea8777009c4767939d) Thanks to Yuta SATOH. GnuPG-bug-id: 1936, 1974 diff --git a/mpi/config.links b/mpi/config.links index f44299d..9500f08 100644 --- a/mpi/config.links +++ b/mpi/config.links @@ -50,11 +50,12 @@ case "${host}" in path="" mpi_cpu_arch="x86" ;; - i[3467]86*-*-openbsd* | \ - i[3467]86*-*-freebsd*-elf | \ - i[3467]86*-*-freebsd[3-9]* | \ - i[3467]86*-*-freebsdelf* | \ - i[3467]86*-*-netbsd* | \ + i[3467]86*-*-openbsd* | \ + i[3467]86*-*-freebsd*-elf | \ + i[3467]86*-*-freebsd[3-9]* | \ + i[3467]86*-*-freebsd[12][0-9]*| \ + i[3467]86*-*-freebsdelf* | \ + i[3467]86*-*-netbsd* | \ i[3467]86*-*-k*bsd*) echo '#define ELF_SYNTAX' >>./mpi/asm-syntax.h cat $srcdir/mpi/i386/syntax.h >>./mpi/asm-syntax.h @@ -64,6 +65,7 @@ case "${host}" in i586*-*-openbsd* | \ i586*-*-freebsd*-elf | \ i586*-*-freebsd[3-9]* | \ + i586*-*-freebsd[12][0-9]*| \ i586*-*-freebsdelf* | \ i586*-*-netbsd* | \ i586*-*-k*bsd* | \ ----------------------------------------------------------------------- Summary of changes: mpi/config.links | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) hooks/post-receive -- The GNU crypto library http://git.gnupg.org From cvs at cvs.gnupg.org Thu Jun 11 09:30:53 2015 From: cvs at cvs.gnupg.org (by NIIBE Yutaka) Date: Thu, 11 Jun 2015 09:30:53 +0200 Subject: [git] GCRYPT - branch, gniibe-curve25519, created. libgcrypt-1.6.0-107-ga879203 Message-ID: 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 crypto library". The branch, gniibe-curve25519 has been created at a879203e07dc2b3e31a22be3e1649b231f49fc95 (commit) - Log ----------------------------------------------------------------- commit a879203e07dc2b3e31a22be3e1649b231f49fc95 Author: NIIBE Yutaka Date: Fri Jul 4 12:26:30 2014 +0900 Add FIXME marks. diff --git a/.gitignore b/.gitignore index 3929e4d..87934c7 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,5 @@ +build-aux/test-driver +test-driver *.lo *.o .deps/ diff --git a/cipher/ecc-curves.c b/cipher/ecc-curves.c index e7dbc17..76dd1d8 100644 --- a/cipher/ecc-curves.c +++ b/cipher/ecc-curves.c @@ -1160,6 +1160,7 @@ _gcry_ecc_get_mpi (const char *name, mpi_ec_t ec, int copy) &encpk, &encpklen)) return mpi_set_opaque (NULL, encpk, encpklen*8); } + // FIXME Montgomery } return NULL; diff --git a/cipher/ecc-misc.c b/cipher/ecc-misc.c index 3f284fe..12776f2 100644 --- a/cipher/ecc-misc.c +++ b/cipher/ecc-misc.c @@ -280,6 +280,7 @@ _gcry_ecc_compute_public (mpi_point_t Q, mpi_ec_t ec, if (!Q) Q = mpi_point_new (0); if (Q) + // FIXME _gcry_mpi_ec_mul_point (Q, d, G, ec); } diff --git a/cipher/ecc.c b/cipher/ecc.c index 676cc79..99b0880 100644 --- a/cipher/ecc.c +++ b/cipher/ecc.c @@ -134,8 +134,7 @@ nist_generate_key (ECC_secret_key *sk, elliptic_curve_t *E, mpi_ec_t ctx, * Currently, we distinguish the two curves by ECC_DIALECT_ED25519 * and MPI_EC_MONTGOMERY, which works, but is not that correct. */ - if (ctx->dialect == ECC_DIALECT_ED25519 - || E->model == MPI_EC_MONTGOMERY) + if (ctx->dialect == ECC_DIALECT_ED25519 || E->model == MPI_EC_MONTGOMERY) { char *rndbuf; @@ -152,6 +151,7 @@ nist_generate_key (ECC_secret_key *sk, elliptic_curve_t *E, mpi_ec_t ctx, /* Compute Q. */ + // FIXME _gcry_mpi_ec_mul_point (&Q, sk->d, &E->G, ctx); /* Copy the stuff to the key structures. */ @@ -569,6 +569,8 @@ ecc_generate (const gcry_sexp_t genparms, gcry_sexp_t *r_skey) log_fatal ("ecgen: Failed to get affine coordinates for %s\n", "Q"); public = _gcry_ecc_ec2os (x, y, sk.E.p); } + // FIXME Montgomery + secret = sk.d; sk.d = NULL; if (E.name) { @@ -1261,6 +1263,7 @@ ecc_encrypt_raw (gcry_sexp_t *r_ciph, gcry_sexp_t s_data, gcry_sexp_t keyparms) point_init (&R); /* R = kQ <=> R = kdG */ + // FIXME _gcry_mpi_ec_mul_point (&R, data, &pk.Q, ec); if (_gcry_mpi_ec_get_affine (x, y, &R, ec)) @@ -1268,6 +1271,7 @@ ecc_encrypt_raw (gcry_sexp_t *r_ciph, gcry_sexp_t s_data, gcry_sexp_t keyparms) mpi_s = _gcry_ecc_ec2os (x, y, pk.E.p); /* R = kG */ + // FIXME _gcry_mpi_ec_mul_point (&R, data, &pk.E.G, ec); if (_gcry_mpi_ec_get_affine (x, y, &R, ec)) @@ -1419,6 +1423,7 @@ ecc_decrypt_raw (gcry_sexp_t *r_plain, gcry_sexp_t s_data, gcry_sexp_t keyparms) sk.E.p, sk.E.a, sk.E.b); /* R = dkG */ + // FIXME _gcry_mpi_ec_mul_point (&R, sk.d, &kG, ec); /* The following is false: assert( mpi_cmp_ui( R.x, 1 )==0 );, so: */ @@ -1733,6 +1738,8 @@ _gcry_pk_ecc_get_sexp (gcry_sexp_t *r_sexp, int mode, mpi_ec_t ec) { mpi_Q = _gcry_mpi_ec_ec2os (ec->Q, ec); } + // FIXME Montgomery + if (!mpi_Q) { rc = GPG_ERR_BROKEN_PUBKEY; commit 79caa02472081c9fb7f22659b84be5b21d215f1e Author: NIIBE Yutaka Date: Fri Jun 20 12:14:24 2014 +0900 fix mpi_swap_conditional and update mpi_ec_mul_point. diff --git a/mpi/ec.c b/mpi/ec.c index 49084f9..8071994 100644 --- a/mpi/ec.c +++ b/mpi/ec.c @@ -1181,7 +1181,9 @@ _gcry_mpi_ec_mul_point (mpi_point_t result, unsigned int nbits; int j; mpi_point_struct p1_, p2_; + mpi_point_t q1, q2, prd, sum; unsigned long sw; + size_t nlimbs; /* FIXME: it's just for Curve25519 */ mpi_clear_bit (scalar, 255); @@ -1200,24 +1202,33 @@ _gcry_mpi_ec_mul_point (mpi_point_t result, p2.x = mpi_copy (point->x); mpi_set_ui (p2.z, 1); + nlimbs = 2*(nbits+BITS_PER_MPI_LIMB-1)/BITS_PER_MPI_LIMB+1; + mpi_resize (p1.x, nlimbs); + mpi_resize (p1.z, nlimbs); + mpi_resize (p2.x, nlimbs); + mpi_resize (p2.z, nlimbs); + mpi_resize (p1_.x, nlimbs); + mpi_resize (p1_.z, nlimbs); + mpi_resize (p2_.x, nlimbs); + mpi_resize (p2_.z, nlimbs); + + q1 = &p1; + q2 = &p2; + prd = &p1_; + sum = &p2_; for (j=nbits-1; j >= 0; j--) { - sw = mpi_test_bit (scalar, j); - mpi_swap_conditional (p1.x, p2.x, sw); - mpi_swap_conditional (p1.z, p2.z, sw); - dup_and_add_montgomery (&p1_, &p2_, &p1, &p2, point->x, ctx); - mpi_swap_conditional (p1_.x, p2_.x, sw); - mpi_swap_conditional (p1_.z, p2_.z, sw); - - if (--j < 0) - break; - - sw = mpi_test_bit (scalar, j); - mpi_swap_conditional (p1_.x, p2_.x, sw); - mpi_swap_conditional (p1_.z, p2_.z, sw); - dup_and_add_montgomery (&p1, &p2, &p1_, &p2_, point->x, ctx); - mpi_swap_conditional (p1.x, p2.x, sw); - mpi_swap_conditional (p1.z, p2.z, sw); + mpi_point_t t; + + sw = mpi_test_bit (scalar, j); + mpi_swap_conditional (q1->x, q2->x, sw); + mpi_swap_conditional (q1->z, q2->z, sw); + dup_and_add_montgomery (prd, sum, q1, q2, point->x, ctx); + mpi_swap_conditional (prd->x, sum->x, sw); + mpi_swap_conditional (prd->z, sum->z, sw); + + t = q1; q1 = prd; prd = t; + t = q2; q2 = sum; sum = t; } mpi_clear (result->y); @@ -1226,18 +1237,18 @@ _gcry_mpi_ec_mul_point (mpi_point_t result, mpi_swap_conditional (p1.z, p1_.z, sw); if (p1.z->nlimbs == 0) - { - mpi_set_ui (result->x, 1); - mpi_set_ui (result->z, 0); - } + { + mpi_set_ui (result->x, 1); + mpi_set_ui (result->z, 0); + } else - { - z1 = mpi_new (0); - ec_invm (z1, p1.z, ctx); - ec_mulm (result->x, p1.x, z1, ctx); - mpi_set_ui (result->z, 1); - mpi_free (z1); - } + { + z1 = mpi_new (0); + ec_invm (z1, p1.z, ctx); + ec_mulm (result->x, p1.x, z1, ctx); + mpi_set_ui (result->z, 1); + mpi_free (z1); + } point_free (&p1); point_free (&p2); diff --git a/mpi/mpiutil.c b/mpi/mpiutil.c index df37542..5e77e12 100644 --- a/mpi/mpiutil.c +++ b/mpi/mpiutil.c @@ -544,35 +544,13 @@ _gcry_mpi_swap (gcry_mpi_t a, gcry_mpi_t b) void _gcry_mpi_swap_conditional (gcry_mpi_t a, gcry_mpi_t b, unsigned long swap) { -#if 1 - if (swap) - _gcry_mpi_swap (a, b); -#else size_t i; - size_t nlimbs = a->nlimbs; - unsigned long mask = -(long)swap; + size_t nlimbs = a->alloced; + unsigned long mask = 0UL - !!swap; unsigned long x; - if (b->alloced < a->nlimbs) - { - mpi_resize (b, a->nlimbs); - nlimbs = a->nlimbs; - } - else if (a->alloced < b->nlimbs) - { - mpi_resize (a, b->nlimbs); - nlimbs = b->nlimbs; - } - else if (b->nlimbs < a->nlimbs) - { - mpi_resize (b, a->nlimbs); - nlimbs = b->nlimbs = a->nlimbs; - } - else if (a->nlimbs < b->nlimbs) - { - mpi_resize (a, b->nlimbs); - nlimbs = a->nlimbs = b->nlimbs; - } + if (a->alloced != b->alloced) + log_bug ("mpi_swap_conditional: different sizes\n"); for (i = 0; i < nlimbs; i++) { @@ -581,10 +559,13 @@ _gcry_mpi_swap_conditional (gcry_mpi_t a, gcry_mpi_t b, unsigned long swap) b->d[i] = b->d[i] ^ x; } + x = mask & (a->nlimbs ^ b->nlimbs); + a->nlimbs = a->nlimbs ^ x; + b->nlimbs = b->nlimbs ^ x; + x = mask & (a->sign ^ b->sign); a->sign = a->sign ^ x; b->sign = b->sign ^ x; -#endif } commit bd3c93a68c0e8f4c88059736438714be4f42e45c Author: NIIBE Yutaka Date: Fri Jun 20 09:47:46 2014 +0900 Don't support special x-only format by os2ec. diff --git a/cipher/ecc-misc.c b/cipher/ecc-misc.c index 595aa0c..3f284fe 100644 --- a/cipher/ecc-misc.c +++ b/cipher/ecc-misc.c @@ -202,13 +202,8 @@ _gcry_ecc_os2ec (mpi_point_t result, gcry_mpi_t value) } if (*buf != 4) { - /* x-coordinate only */ - mpi_set (result->x, value); - mpi_clear (result->y); - mpi_set_ui (result->z, 1); - xfree (buf_memory); - return 0; + return GPG_ERR_NOT_IMPLEMENTED; /* No support for point compression. */ } if ( ((n-1)%2) ) { commit fcc2bb325a2edd1ae3b2a33add17fea5921cd050 Author: NIIBE Yutaka Date: Fri Jun 20 09:08:37 2014 +0900 This works. diff --git a/cipher/ecc.c b/cipher/ecc.c index 6a60785..676cc79 100644 --- a/cipher/ecc.c +++ b/cipher/ecc.c @@ -371,7 +371,7 @@ check_secret_key (ECC_secret_key *sk, mpi_ec_t ec, int flags) } /* Check order of curve. */ - if (sk->E.dialect != ECC_DIALECT_ED25519) + if (sk->E.dialect != ECC_DIALECT_ED25519 && sk->E.model != MPI_EC_MONTGOMERY) { _gcry_mpi_ec_mul_point (&Q, sk->E.n, &sk->E.G, ec); if (mpi_cmp_ui (Q.z, 0)) diff --git a/mpi/mpiutil.c b/mpi/mpiutil.c index ed14cdb..df37542 100644 --- a/mpi/mpiutil.c +++ b/mpi/mpiutil.c @@ -544,6 +544,10 @@ _gcry_mpi_swap (gcry_mpi_t a, gcry_mpi_t b) void _gcry_mpi_swap_conditional (gcry_mpi_t a, gcry_mpi_t b, unsigned long swap) { +#if 1 + if (swap) + _gcry_mpi_swap (a, b); +#else size_t i; size_t nlimbs = a->nlimbs; unsigned long mask = -(long)swap; @@ -580,6 +584,7 @@ _gcry_mpi_swap_conditional (gcry_mpi_t a, gcry_mpi_t b, unsigned long swap) x = mask & (a->sign ^ b->sign); a->sign = a->sign ^ x; b->sign = b->sign ^ x; +#endif } commit 2272df06225f0b42cc480d32b17214a1b70cd0b3 Author: NIIBE Yutaka Date: Thu Jun 19 17:51:10 2014 +0900 scalar handling. diff --git a/mpi/ec.c b/mpi/ec.c index 3476957..49084f9 100644 --- a/mpi/ec.c +++ b/mpi/ec.c @@ -1183,6 +1183,13 @@ _gcry_mpi_ec_mul_point (mpi_point_t result, mpi_point_struct p1_, p2_; unsigned long sw; + /* FIXME: it's just for Curve25519 */ + mpi_clear_bit (scalar, 255); + mpi_set_bit (scalar, 254); + mpi_clear_bit (scalar, 2); + mpi_clear_bit (scalar, 1); + mpi_clear_bit (scalar, 0); + nbits = mpi_get_nbits (scalar); point_init (&p1); point_init (&p2); @@ -1213,7 +1220,6 @@ _gcry_mpi_ec_mul_point (mpi_point_t result, mpi_swap_conditional (p1.z, p2.z, sw); } - z1 = mpi_new (0); mpi_clear (result->y); sw = (nbits & 1); mpi_swap_conditional (p1.x, p1_.x, sw); @@ -1226,12 +1232,13 @@ _gcry_mpi_ec_mul_point (mpi_point_t result, } else { + z1 = mpi_new (0); ec_invm (z1, p1.z, ctx); ec_mulm (result->x, p1.x, z1, ctx); mpi_set_ui (result->z, 1); + mpi_free (z1); } - mpi_free (z1); point_free (&p1); point_free (&p2); point_free (&p1_); diff --git a/mpi/mpiutil.c b/mpi/mpiutil.c index e0afec0..ed14cdb 100644 --- a/mpi/mpiutil.c +++ b/mpi/mpiutil.c @@ -547,6 +547,7 @@ _gcry_mpi_swap_conditional (gcry_mpi_t a, gcry_mpi_t b, unsigned long swap) size_t i; size_t nlimbs = a->nlimbs; unsigned long mask = -(long)swap; + unsigned long x; if (b->alloced < a->nlimbs) { @@ -571,10 +572,14 @@ _gcry_mpi_swap_conditional (gcry_mpi_t a, gcry_mpi_t b, unsigned long swap) for (i = 0; i < nlimbs; i++) { - unsigned long x = mask & (a->d[i] ^ b->d[i]); + x = mask & (a->d[i] ^ b->d[i]); a->d[i] = a->d[i] ^ x; b->d[i] = b->d[i] ^ x; } + + x = mask & (a->sign ^ b->sign); + a->sign = a->sign ^ x; + b->sign = b->sign ^ x; } commit 57693973f73f22e24e909fc0782e00479e12aa44 Author: NIIBE Yutaka Date: Thu Jun 19 17:48:50 2014 +0900 simplify diff --git a/mpi/ec.c b/mpi/ec.c index f2dd0f0..3476957 100644 --- a/mpi/ec.c +++ b/mpi/ec.c @@ -1195,31 +1195,21 @@ _gcry_mpi_ec_mul_point (mpi_point_t result, for (j=nbits-1; j >= 0; j--) { - mpi_point_t q1, q2; - sw = mpi_test_bit (scalar, j); - q1 = &p1; - q2 = &p2; - mpi_swap_conditional (q1->x, q2->x, sw); - mpi_swap_conditional (q1->y, q2->y, sw); - mpi_swap_conditional (q1->z, q2->z, sw); - dup_and_add_montgomery (&p1_, &p2_, q1, q2, point->x, ctx); + mpi_swap_conditional (p1.x, p2.x, sw); + mpi_swap_conditional (p1.z, p2.z, sw); + dup_and_add_montgomery (&p1_, &p2_, &p1, &p2, point->x, ctx); mpi_swap_conditional (p1_.x, p2_.x, sw); - mpi_swap_conditional (p1_.y, p2_.y, sw); mpi_swap_conditional (p1_.z, p2_.z, sw); if (--j < 0) break; sw = mpi_test_bit (scalar, j); - q1 = &p1_; - q2 = &p2_; - mpi_swap_conditional (q1->x, q2->x, sw); - mpi_swap_conditional (q1->y, q2->y, sw); - mpi_swap_conditional (q1->z, q2->z, sw); - dup_and_add_montgomery (&p1, &p2, q1, q2, point->x, ctx); + mpi_swap_conditional (p1_.x, p2_.x, sw); + mpi_swap_conditional (p1_.z, p2_.z, sw); + dup_and_add_montgomery (&p1, &p2, &p1_, &p2_, point->x, ctx); mpi_swap_conditional (p1.x, p2.x, sw); - mpi_swap_conditional (p1.y, p2.y, sw); mpi_swap_conditional (p1.z, p2.z, sw); } @@ -1227,7 +1217,6 @@ _gcry_mpi_ec_mul_point (mpi_point_t result, mpi_clear (result->y); sw = (nbits & 1); mpi_swap_conditional (p1.x, p1_.x, sw); - mpi_swap_conditional (p1.y, p1_.y, sw); mpi_swap_conditional (p1.z, p1_.z, sw); if (p1.z->nlimbs == 0) commit 7eba36282d648a74bbc22826e5ed2156278186cf Author: NIIBE Yutaka Date: Thu Jun 19 14:46:09 2014 +0900 use mpi_swap_conditional diff --git a/mpi/ec.c b/mpi/ec.c index b312f53..f2dd0f0 100644 --- a/mpi/ec.c +++ b/mpi/ec.c @@ -1181,6 +1181,7 @@ _gcry_mpi_ec_mul_point (mpi_point_t result, unsigned int nbits; int j; mpi_point_struct p1_, p2_; + unsigned long sw; nbits = mpi_get_nbits (scalar); point_init (&p1); @@ -1195,75 +1196,51 @@ _gcry_mpi_ec_mul_point (mpi_point_t result, for (j=nbits-1; j >= 0; j--) { mpi_point_t q1, q2; - mpi_point_t sum_n, prd_n; - if (mpi_test_bit (scalar, j)) - { - q1 = &p2; - q2 = &p1; - sum_n = &p1_; - prd_n = &p2_; - } - else - { - q1 = &p1; - q2 = &p2; - sum_n = &p2_; - prd_n = &p1_; - } - dup_and_add_montgomery (prd_n, sum_n, q1, q2, point->x, ctx); + sw = mpi_test_bit (scalar, j); + q1 = &p1; + q2 = &p2; + mpi_swap_conditional (q1->x, q2->x, sw); + mpi_swap_conditional (q1->y, q2->y, sw); + mpi_swap_conditional (q1->z, q2->z, sw); + dup_and_add_montgomery (&p1_, &p2_, q1, q2, point->x, ctx); + mpi_swap_conditional (p1_.x, p2_.x, sw); + mpi_swap_conditional (p1_.y, p2_.y, sw); + mpi_swap_conditional (p1_.z, p2_.z, sw); if (--j < 0) break; - if (mpi_test_bit (scalar, j)) - { - q1 = &p2_; - q2 = &p1_; - sum_n = &p1; - prd_n = &p2; - } - else - { - q1 = &p1_; - q2 = &p2_; - sum_n = &p2; - prd_n = &p1; - } - - dup_and_add_montgomery (prd_n, sum_n, q1, q2, point->x, ctx); + sw = mpi_test_bit (scalar, j); + q1 = &p1_; + q2 = &p2_; + mpi_swap_conditional (q1->x, q2->x, sw); + mpi_swap_conditional (q1->y, q2->y, sw); + mpi_swap_conditional (q1->z, q2->z, sw); + dup_and_add_montgomery (&p1, &p2, q1, q2, point->x, ctx); + mpi_swap_conditional (p1.x, p2.x, sw); + mpi_swap_conditional (p1.y, p2.y, sw); + mpi_swap_conditional (p1.z, p2.z, sw); } z1 = mpi_new (0); mpi_clear (result->y); - if ((nbits & 1)) - { - if (p1_.z->nlimbs == 0) - { - mpi_set_ui (result->x, 1); - mpi_set_ui (result->z, 0); - } - else - { - ec_invm (z1, p1_.z, ctx); - ec_mulm (result->x, p1_.x, z1, ctx); - mpi_set_ui (result->z, 1); - } - } + sw = (nbits & 1); + mpi_swap_conditional (p1.x, p1_.x, sw); + mpi_swap_conditional (p1.y, p1_.y, sw); + mpi_swap_conditional (p1.z, p1_.z, sw); + + if (p1.z->nlimbs == 0) + { + mpi_set_ui (result->x, 1); + mpi_set_ui (result->z, 0); + } else - { - if (p1.z->nlimbs == 0) - { - mpi_set_ui (result->x, 1); - mpi_set_ui (result->z, 0); - } - else - { - ec_invm (z1, p1.z, ctx); - ec_mulm (result->x, p1.x, z1, ctx); - mpi_set_ui (result->z, 1); - } - } + { + ec_invm (z1, p1.z, ctx); + ec_mulm (result->x, p1.x, z1, ctx); + mpi_set_ui (result->z, 1); + } mpi_free (z1); point_free (&p1); commit 8823785c0285354425051d881a9446ecbbec329d Author: NIIBE Yutaka Date: Thu Jun 19 14:45:51 2014 +0900 mpi_swap_conditional diff --git a/doc/gcrypt.texi b/doc/gcrypt.texi index d59c095..91d9d8f 100644 --- a/doc/gcrypt.texi +++ b/doc/gcrypt.texi @@ -4341,6 +4341,11 @@ small values (usually up to the word size of the CPU). Swap the values of @var{a} and @var{b}. @end deftypefun + at deftypefun void gcry_mpi_swap_conditional (@w{gcry_mpi_t @var{a}}, @w{gcry_mpi_t @var{b}}, @w{unsigned long @var{sw}}) + +Swap the values of @var{a} and @var{b}, when @var{sw} is 1. + at end deftypefun + @deftypefun void gcry_mpi_snatch (@w{gcry_mpi_t @var{w}}, @ @w{const gcry_mpi_t @var{u}}) diff --git a/mpi/mpiutil.c b/mpi/mpiutil.c index fdce578..e0afec0 100644 --- a/mpi/mpiutil.c +++ b/mpi/mpiutil.c @@ -541,6 +541,43 @@ _gcry_mpi_swap (gcry_mpi_t a, gcry_mpi_t b) tmp = *a; *a = *b; *b = tmp; } +void +_gcry_mpi_swap_conditional (gcry_mpi_t a, gcry_mpi_t b, unsigned long swap) +{ + size_t i; + size_t nlimbs = a->nlimbs; + unsigned long mask = -(long)swap; + + if (b->alloced < a->nlimbs) + { + mpi_resize (b, a->nlimbs); + nlimbs = a->nlimbs; + } + else if (a->alloced < b->nlimbs) + { + mpi_resize (a, b->nlimbs); + nlimbs = b->nlimbs; + } + else if (b->nlimbs < a->nlimbs) + { + mpi_resize (b, a->nlimbs); + nlimbs = b->nlimbs = a->nlimbs; + } + else if (a->nlimbs < b->nlimbs) + { + mpi_resize (a, b->nlimbs); + nlimbs = a->nlimbs = b->nlimbs; + } + + for (i = 0; i < nlimbs; i++) + { + unsigned long x = mask & (a->d[i] ^ b->d[i]); + a->d[i] = a->d[i] ^ x; + b->d[i] = b->d[i] ^ x; + } +} + + gcry_mpi_t _gcry_mpi_new (unsigned int nbits) diff --git a/src/gcrypt-int.h b/src/gcrypt-int.h index 8a6df84..42b72d6 100644 --- a/src/gcrypt-int.h +++ b/src/gcrypt-int.h @@ -371,6 +371,7 @@ gcry_mpi_t _gcry_mpi_set (gcry_mpi_t w, const gcry_mpi_t u); gcry_mpi_t _gcry_mpi_set_ui (gcry_mpi_t w, unsigned long u); gcry_err_code_t _gcry_mpi_get_ui (gcry_mpi_t w, ulong *u); void _gcry_mpi_swap (gcry_mpi_t a, gcry_mpi_t b); +void _gcry_mpi_swap_conditional (gcry_mpi_t a, gcry_mpi_t b, unsigned long sw); int _gcry_mpi_is_neg (gcry_mpi_t a); void _gcry_mpi_neg (gcry_mpi_t w, gcry_mpi_t u); void _gcry_mpi_abs (gcry_mpi_t w); @@ -475,6 +476,7 @@ int _gcry_mpi_get_flag (gcry_mpi_t a, enum gcry_mpi_flag flag); #define mpi_set_ui( w, u) _gcry_mpi_set_ui( (w), (u) ) #define mpi_get_ui(a,b) _gcry_mpi_get_ui( (a), (b) ) #define mpi_swap(a,b) _gcry_mpi_swap ((a),(b)) +#define mpi_swap_conditional(a,b,sw) _gcry_mpi_swap_conditional ((a),(b),(sw)) #define mpi_abs( w ) _gcry_mpi_abs( (w) ) #define mpi_neg( w, u) _gcry_mpi_neg( (w), (u) ) #define mpi_cmp( u, v ) _gcry_mpi_cmp( (u), (v) ) diff --git a/src/gcrypt.h.in b/src/gcrypt.h.in index a5f8350..f9bd166 100644 --- a/src/gcrypt.h.in +++ b/src/gcrypt.h.in @@ -545,6 +545,9 @@ gcry_mpi_t gcry_mpi_set_ui (gcry_mpi_t w, unsigned long u); /* Swap the values of A and B. */ void gcry_mpi_swap (gcry_mpi_t a, gcry_mpi_t b); +/* Swap the values of A and B if SW is 1. */ +void gcry_mpi_swap_conditional (gcry_mpi_t a, gcry_mpi_t b, unsigned long sw); + /* Return 1 if A is negative; 0 if zero or positive. */ int gcry_mpi_is_neg (gcry_mpi_t a); diff --git a/src/libgcrypt.def b/src/libgcrypt.def index 57ed490..aee85ac 100644 --- a/src/libgcrypt.def +++ b/src/libgcrypt.def @@ -276,5 +276,6 @@ EXPORTS gcry_mac_ctl @242 gcry_mac_get_algo @243 + gcry_mpi_swap_conditional @244 ;; end of file with public symbols for Windows. diff --git a/src/libgcrypt.vers b/src/libgcrypt.vers index 7ee0541..0540850 100644 --- a/src/libgcrypt.vers +++ b/src/libgcrypt.vers @@ -96,7 +96,7 @@ GCRYPT_1.6 { gcry_mpi_set_flag; gcry_mpi_set_highbit; gcry_mpi_set_opaque; gcry_mpi_set_opaque_copy; gcry_mpi_set_ui; gcry_mpi_snew; gcry_mpi_sub; gcry_mpi_sub_ui; - gcry_mpi_subm; gcry_mpi_swap; gcry_mpi_test_bit; + gcry_mpi_subm; gcry_mpi_swap; gcry_mpi_swap_conditional; gcry_mpi_test_bit; gcry_mpi_lshift; gcry_mpi_snatch; gcry_mpi_point_new; gcry_mpi_point_release; gcry_mpi_point_get; gcry_mpi_point_snatch_get; diff --git a/src/mpi.h b/src/mpi.h index eb0730e..7859dec 100644 --- a/src/mpi.h +++ b/src/mpi.h @@ -125,6 +125,7 @@ gcry_mpi_t _gcry_mpi_alloc_like( gcry_mpi_t a ); gcry_mpi_t _gcry_mpi_alloc_set_ui( unsigned long u); void _gcry_mpi_m_check( gcry_mpi_t a ); void _gcry_mpi_swap( gcry_mpi_t a, gcry_mpi_t b); +void _gcry_mpi_swap_conditional(gcry_mpi_t a, gcry_mpi_t b, unsigned long sw); gcry_mpi_t _gcry_mpi_new (unsigned int nbits); gcry_mpi_t _gcry_mpi_snew (unsigned int nbits); gcry_mpi_t _gcry_mpi_set_opaque_copy (gcry_mpi_t a, diff --git a/src/visibility.c b/src/visibility.c index 6ed57ca..ec3b644 100644 --- a/src/visibility.c +++ b/src/visibility.c @@ -319,6 +319,12 @@ gcry_mpi_swap (gcry_mpi_t a, gcry_mpi_t b) _gcry_mpi_swap (a, b); } +void +gcry_mpi_swap_conditional (gcry_mpi_t a, gcry_mpi_t b, unsigned long sw) +{ + _gcry_mpi_swap_conditional (a, b, sw); +} + int gcry_mpi_is_neg (gcry_mpi_t a) { diff --git a/src/visibility.h b/src/visibility.h index 96b5235..54767e3 100644 --- a/src/visibility.h +++ b/src/visibility.h @@ -266,6 +266,7 @@ MARK_VISIBLEX (gcry_mpi_sub) MARK_VISIBLEX (gcry_mpi_sub_ui) MARK_VISIBLEX (gcry_mpi_subm) MARK_VISIBLEX (gcry_mpi_swap) +MARK_VISIBLEX (gcry_mpi_swap_conditional) MARK_VISIBLEX (gcry_mpi_test_bit) MARK_VISIBLEX (gcry_ctx_release) @@ -482,6 +483,7 @@ MARK_VISIBLEX (_gcry_mpi_get_const) #define gcry_mpi_sub_ui _gcry_USE_THE_UNDERSCORED_FUNCTION #define gcry_mpi_subm _gcry_USE_THE_UNDERSCORED_FUNCTION #define gcry_mpi_swap _gcry_USE_THE_UNDERSCORED_FUNCTION +#define gcry_mpi_swap_conditional _gcry_USE_THE_UNDERSCORED_FUNCTION #define gcry_mpi_test_bit _gcry_USE_THE_UNDERSCORED_FUNCTION #define gcry_mpi_abs _gcry_USE_THE_UNDERSCORED_FUNCTION commit f88f67e08cccb60e2645743b3510ccde5f469818 Author: NIIBE Yutaka Date: Fri Jun 13 15:49:22 2014 +0900 Handle O in _gcry_mpi_ec_mul_point for MPI_EC_MONTGOMERY. diff --git a/mpi/ec.c b/mpi/ec.c index ae2d6fa..b312f53 100644 --- a/mpi/ec.c +++ b/mpi/ec.c @@ -1236,17 +1236,33 @@ _gcry_mpi_ec_mul_point (mpi_point_t result, z1 = mpi_new (0); mpi_clear (result->y); - mpi_set_ui (result->z, 1); if ((nbits & 1)) { - ec_invm (z1, p1_.z, ctx); - ec_mulm (result->x, p1_.x, z1, ctx); - mpi_clear (result->y); + if (p1_.z->nlimbs == 0) + { + mpi_set_ui (result->x, 1); + mpi_set_ui (result->z, 0); + } + else + { + ec_invm (z1, p1_.z, ctx); + ec_mulm (result->x, p1_.x, z1, ctx); + mpi_set_ui (result->z, 1); + } } else { - ec_invm (z1, p1.z, ctx); - ec_mulm (result->x, p1.x, z1, ctx); + if (p1.z->nlimbs == 0) + { + mpi_set_ui (result->x, 1); + mpi_set_ui (result->z, 0); + } + else + { + ec_invm (z1, p1.z, ctx); + ec_mulm (result->x, p1.x, z1, ctx); + mpi_set_ui (result->z, 1); + } } mpi_free (z1); @@ -1378,8 +1394,12 @@ _gcry_mpi_ec_curve_point (gcry_mpi_point_t point, mpi_ec_t ctx) } break; case MPI_EC_MONTGOMERY: +#if 0 log_fatal ("%s: %s not yet supported\n", "_gcry_mpi_ec_curve_point", "Montgomery"); +#else + res = 1; +#endif break; case MPI_EC_EDWARDS: { diff --git a/tests/curves.c b/tests/curves.c index 5dc9d6d..ae699d4 100644 --- a/tests/curves.c +++ b/tests/curves.c @@ -103,6 +103,42 @@ die (const char *format, ...) } +static gcry_mpi_t +hex2mpi (const char *string) +{ + gpg_error_t err; + gcry_mpi_t val; + + err = gcry_mpi_scan (&val, GCRYMPI_FMT_HEX, string, 0, NULL); + if (err) + die ("hex2mpi '%s' failed: %s\n", string, gpg_strerror (err)); + return val; +} + + +/* Print an MPI S-expression. */ +static void +print_mpi (const char *name, gcry_mpi_t a) +{ + gcry_error_t err; + unsigned char *buf; + int writerr = 0; + + err = gcry_mpi_aprint (GCRYMPI_FMT_HEX, &buf, NULL, a); + if (err) + die ("gcry_mpi_aprint failed: %s\n", gcry_strerror (err)); + + printf (" (%s #%s#)\n", name, buf); + if (ferror (stdout)) + writerr++; + if (!writerr && fflush (stdout) == EOF) + writerr++; + if (writerr) + die ("writing output failed\n"); + gcry_free (buf); +} + + static void list_curves (void) { commit 9fc9a91b9746cc0617fc73bd3146cf7be1e7c1b5 Author: NIIBE Yutaka Date: Fri Apr 25 09:04:24 2014 +0900 for macos diff --git a/mpi/config.links b/mpi/config.links index 0217d35..4f35ea2 100644 --- a/mpi/config.links +++ b/mpi/config.links @@ -127,6 +127,12 @@ case "${host}" in path="i586 i386" mpi_cpu_arch="x86" ;; + x86_64-apple-darwin*) + echo '#define BSD_SYNTAX' >>./mpi/asm-syntax.h + cat $srcdir/mpi/i386/syntax.h >>./mpi/asm-syntax.h + path="amd64" + mpi_cpu_arch="x86" + ;; x86_64-*-*) echo '#define ELF_SYNTAX' >>./mpi/asm-syntax.h cat $srcdir/mpi/i386/syntax.h >>./mpi/asm-syntax.h commit 8669cebc8f67e80d614e5e520bbac0f60a88d85c Author: NIIBE Yutaka Date: Fri Apr 25 09:04:10 2014 +0900 more montgomery diff --git a/cipher/ecc-curves.c b/cipher/ecc-curves.c index f4945e5..e7dbc17 100644 --- a/cipher/ecc-curves.c +++ b/cipher/ecc-curves.c @@ -135,7 +135,7 @@ static const ecc_domain_parms_t domain_parms[] = "0x01DB41", "0x01", "0x1000000000000000000000000000000014DEF9DEA2F79CD65812631A5CF5D3ED", - "0x09", + "0x0000000000000000000000000000000000000000000000000000000000000009", "0x20AE19A1B8A086B4E01EDD2C7748D14C923D4D7E6D7C61B229E9C5A27ECED3D9" }, #if 0 /* No real specs yet found. */ diff --git a/cipher/ecc-misc.c b/cipher/ecc-misc.c index 3f284fe..595aa0c 100644 --- a/cipher/ecc-misc.c +++ b/cipher/ecc-misc.c @@ -202,8 +202,13 @@ _gcry_ecc_os2ec (mpi_point_t result, gcry_mpi_t value) } if (*buf != 4) { + /* x-coordinate only */ + mpi_set (result->x, value); + mpi_clear (result->y); + mpi_set_ui (result->z, 1); + xfree (buf_memory); - return GPG_ERR_NOT_IMPLEMENTED; /* No support for point compression. */ + return 0; } if ( ((n-1)%2) ) { diff --git a/cipher/ecc.c b/cipher/ecc.c index e0be2d4..6a60785 100644 --- a/cipher/ecc.c +++ b/cipher/ecc.c @@ -117,7 +117,25 @@ nist_generate_key (ECC_secret_key *sk, elliptic_curve_t *E, mpi_ec_t ctx, point_init (&Q); /* Generate a secret. */ - if (ctx->dialect == ECC_DIALECT_ED25519) + /* + * FIXME. It should be something like this: + * + * When the co-factor of the curve is not 1, we guarantee that + * scalar value k is multiple of its co-factor to avoid sub-group + * attack. Also, we make sure that the most significant bit of k + * is 1. + * + * It works for now as we only have two curves which have co-factor!=1; + * Ed25519 and Curve25519. + * Note that we need some a way to get number of bits of the curve to + * set MSB of k. Currently, E.nbits is not precise for this purpuse. + * We also need a way to get co-factor of a curve. + * + * Currently, we distinguish the two curves by ECC_DIALECT_ED25519 + * and MPI_EC_MONTGOMERY, which works, but is not that correct. + */ + if (ctx->dialect == ECC_DIALECT_ED25519 + || E->model == MPI_EC_MONTGOMERY) { char *rndbuf; @@ -156,7 +174,7 @@ nist_generate_key (ECC_secret_key *sk, elliptic_curve_t *E, mpi_ec_t ctx, * possibilities without any loss of security. Note that we don't * do that for Ed25519 so that we do not violate the special * construction of the secret key. */ - if (E->dialect == ECC_DIALECT_ED25519) + if (E->dialect == ECC_DIALECT_ED25519 || E->model == MPI_EC_MONTGOMERY) point_set (&sk->Q, &Q); else { @@ -227,12 +245,8 @@ static void test_keys (ECC_secret_key *sk, unsigned int nbits) { ECC_public_key pk; - gcry_mpi_t test = mpi_new (nbits); + gcry_mpi_t test; mpi_point_struct R_; - gcry_mpi_t c = mpi_new (nbits); - gcry_mpi_t out = mpi_new (nbits); - gcry_mpi_t r = mpi_new (nbits); - gcry_mpi_t s = mpi_new (nbits); if (DBG_CIPHER) log_debug ("Testing key.\n"); @@ -243,27 +257,82 @@ test_keys (ECC_secret_key *sk, unsigned int nbits) point_init (&pk.Q); point_set (&pk.Q, &sk->Q); - _gcry_mpi_randomize (test, nbits, GCRY_WEAK_RANDOM); + if (sk->E.model == MPI_EC_MONTGOMERY) + /* It's ECDH only. */ + /* FIXME: see the FIXME comment of nist_generate_key. + * Here, we generate ephemeral key, same handling is needed for secret. + */ + { + char *rndbuf; + gcry_mpi_t x0, x1; + mpi_ec_t ec; + + test = mpi_new (256); + rndbuf = _gcry_random_bytes (32, GCRY_WEAK_RANDOM); + rndbuf[0] &= 0x7f; /* Clear bit 255. */ + rndbuf[0] |= 0x40; /* Set bit 254. */ + rndbuf[31] &= 0xf8; /* Clear bits 2..0 so that d mod 8 == 0 */ + _gcry_mpi_set_buffer (test, rndbuf, 32, 0); + xfree (rndbuf); + + ec = _gcry_mpi_ec_p_internal_new (pk.E.model, pk.E.dialect, 0, + pk.E.p, pk.E.a, pk.E.b); + x0 = mpi_new (0); + x1 = mpi_new (0); - if (_gcry_ecc_ecdsa_sign (test, sk, r, s, 0, 0) ) - log_fatal ("ECDSA operation: sign failed\n"); + /* R_ = kQ <=> R_ = kdG */ + _gcry_mpi_ec_mul_point (&R_, test, &pk.Q, ec); + if (_gcry_mpi_ec_get_affine (x0, NULL, &R_, ec)) + log_fatal ("ecdh: Failed to get affine coordinates for kQ\n"); - if (_gcry_ecc_ecdsa_verify (test, &pk, r, s)) - { - log_fatal ("ECDSA operation: sign, verify failed\n"); + /* R_ = kG */ + _gcry_mpi_ec_mul_point (&R_, test, &pk.E.G, ec); + /* R_ = dkG */ + _gcry_mpi_ec_mul_point (&R_, sk->d, &R_, ec); + + if (_gcry_mpi_ec_get_affine (x1, NULL, &R_, ec)) + log_fatal ("ecdh: Failed to get affine coordinates for dkG\n"); + + if (mpi_cmp (x0, x1)) + { + log_fatal ("ECDH test failed.\n"); + } + + mpi_free (x0); + mpi_free (x1); + _gcry_mpi_ec_free (ec); } + else + { + gcry_mpi_t c = mpi_new (nbits); + gcry_mpi_t out = mpi_new (nbits); + gcry_mpi_t r = mpi_new (nbits); + gcry_mpi_t s = mpi_new (nbits); - if (DBG_CIPHER) - log_debug ("ECDSA operation: sign, verify ok.\n"); + test = mpi_new (nbits); + _gcry_mpi_randomize (test, nbits, GCRY_WEAK_RANDOM); + + if (_gcry_ecc_ecdsa_sign (test, sk, r, s, 0, 0) ) + log_fatal ("ECDSA operation: sign failed\n"); + + if (_gcry_ecc_ecdsa_verify (test, &pk, r, s)) + { + log_fatal ("ECDSA operation: sign, verify failed\n"); + } + + if (DBG_CIPHER) + log_debug ("ECDSA operation: sign, verify ok.\n"); + + mpi_free (s); + mpi_free (r); + mpi_free (out); + mpi_free (c); + } point_free (&pk.Q); _gcry_ecc_curve_free (&pk.E); point_free (&R_); - mpi_free (s); - mpi_free (r); - mpi_free (out); - mpi_free (c); mpi_free (test); } diff --git a/mpi/ec.c b/mpi/ec.c index 1257bbe..ae2d6fa 100644 --- a/mpi/ec.c +++ b/mpi/ec.c @@ -600,15 +600,11 @@ _gcry_mpi_ec_get_affine (gcry_mpi_t x, gcry_mpi_t y, mpi_point_t point, case MPI_EC_MONTGOMERY: { - gcry_mpi_t z1; - - z1 = mpi_new (0); - ec_invm (z1, point->z, ctx); /* z1 = z^(-1) mod p */ - if (x) - ec_mulm (x, point->x, z1, ctx); + mpi_set (x, point->x); - mpi_free (z1); + if (y) + mpi_set (y, point->y); } return 0; @@ -1238,19 +1234,22 @@ _gcry_mpi_ec_mul_point (mpi_point_t result, dup_and_add_montgomery (prd_n, sum_n, q1, q2, point->x, ctx); } + z1 = mpi_new (0); + mpi_clear (result->y); + mpi_set_ui (result->z, 1); if ((nbits & 1)) { - mpi_snatch (result->x, p1_.x); - mpi_snatch (result->z, p1_.z); - p1_.x = p1_.z = NULL; + ec_invm (z1, p1_.z, ctx); + ec_mulm (result->x, p1_.x, z1, ctx); + mpi_clear (result->y); } else { - mpi_snatch (result->x, p1.x); - mpi_snatch (result->z, p1.z); - p1.x = p1.z = NULL; + ec_invm (z1, p1.z, ctx); + ec_mulm (result->x, p1.x, z1, ctx); } + mpi_free (z1); point_free (&p1); point_free (&p2); point_free (&p1_); diff --git a/tests/curves.c b/tests/curves.c index 29654f3..5dc9d6d 100644 --- a/tests/curves.c +++ b/tests/curves.c @@ -205,6 +205,11 @@ check_montgomery (void) const char *name; unsigned int nbits; + gcry_ctx_t ctx; + gcry_mpi_point_t G, Q; + gcry_mpi_t d; + gcry_mpi_t x, y, z; + err = gcry_sexp_new (&key, sample_key_3, 0, 1); if (err) die ("parsing s-expression string failed: %s\n", gpg_strerror (err)); @@ -219,6 +224,56 @@ check_montgomery (void) sample_key_3_nbits, nbits); gcry_sexp_release (key); + + Q = gcry_mpi_point_new (0); + + err = gcry_mpi_ec_new (&ctx, NULL, "Curve25519"); + if (err) + fail ("can't create ec context: %s\n", gpg_strerror (err)); + +#if 0 + d = hex2mpi ("40000000000000000000000000000000" + "00000000000000000000000000000000"); + G = gcry_mpi_ec_get_point ("g", ctx, 1); + if (!G) + fail ("can't get basepoint of the curve: %s\n", gpg_strerror (err)); +#else + d = hex2mpi ("7d74fb61db3100e11e4d4ae171daf820688f3bcfa631565272a998b8f4e8c290"); + { + gcry_mpi_t gx; + gx = hex2mpi ("3dc16d73d4222d12eb54623c85f3fb5ebdab33c1bd5865780654f1b0ed696ddf"); + + G = gcry_mpi_point_new (0); + gcry_mpi_point_snatch_set (G, gx, NULL, NULL); + } +#endif + + gcry_mpi_ec_mul (Q, d, G, ctx); + + x = gcry_mpi_new (0); + y = gcry_mpi_new (0); + z = gcry_mpi_new (0); + + gcry_mpi_point_get (x, y, z, Q); + + print_mpi ("Q.x", x); + print_mpi ("Q.y", y); + print_mpi ("Q.z", z); + + if (gcry_mpi_ec_get_affine (x, NULL, Q, ctx)) + fail ("failed to get affine coordinates\n"); + + print_mpi ("q.x", x); + /* 16B53A046DEEDD81ED6B0D470CE46DD9B5FAC6124F3D22358AA7CD2911FCFABC */ + + gcry_mpi_release (z); + gcry_mpi_release (y); + gcry_mpi_release (x); + + gcry_mpi_point_release (Q); + gcry_mpi_release (d); + gcry_mpi_point_release (G); + gcry_ctx_release (ctx); } int diff --git a/tests/keygen.c b/tests/keygen.c index 4aff9c9..c53246c 100644 --- a/tests/keygen.c +++ b/tests/keygen.c @@ -365,7 +365,7 @@ static void check_ecc_keys (void) { const char *curves[] = { "NIST P-521", "NIST P-384", "NIST P-256", - "Ed25519", NULL }; + "Ed25519", "Curve25519", NULL }; int testno; gcry_sexp_t keyparm, key; int rc; commit 9f2da5436af53e913cdccd01e83523ab3cc38475 Author: NIIBE Yutaka Date: Tue Apr 22 15:31:24 2014 +0900 support ec_get_affine diff --git a/cipher/ecc-curves.c b/cipher/ecc-curves.c index 6a90eaf..f4945e5 100644 --- a/cipher/ecc-curves.c +++ b/cipher/ecc-curves.c @@ -132,10 +132,10 @@ static const ecc_domain_parms_t domain_parms[] = "Curve25519", 256, 0, MPI_EC_MONTGOMERY, ECC_DIALECT_STANDARD, "0x7FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFED", - "0X1DB41", - "0x1", + "0x01DB41", + "0x01", "0x1000000000000000000000000000000014DEF9DEA2F79CD65812631A5CF5D3ED", - "0x9", + "0x09", "0x20AE19A1B8A086B4E01EDD2C7748D14C923D4D7E6D7C61B229E9C5A27ECED3D9" }, #if 0 /* No real specs yet found. */ @@ -518,9 +518,8 @@ _gcry_ecc_fill_in_curve (unsigned int nbits, const char *name, { case MPI_EC_WEIERSTRASS: case MPI_EC_EDWARDS: - break; case MPI_EC_MONTGOMERY: - return GPG_ERR_NOT_SUPPORTED; + break; default: return GPG_ERR_BUG; } diff --git a/mpi/ec.c b/mpi/ec.c index c4ac819..1257bbe 100644 --- a/mpi/ec.c +++ b/mpi/ec.c @@ -600,10 +600,17 @@ _gcry_mpi_ec_get_affine (gcry_mpi_t x, gcry_mpi_t y, mpi_point_t point, case MPI_EC_MONTGOMERY: { - log_fatal ("%s: %s not yet supported\n", - "_gcry_mpi_ec_get_affine", "Montgomery"); + gcry_mpi_t z1; + + z1 = mpi_new (0); + ec_invm (z1, point->z, ctx); /* z1 = z^(-1) mod p */ + + if (x) + ec_mulm (x, point->x, z1, ctx); + + mpi_free (z1); } - return -1; + return 0; case MPI_EC_EDWARDS: { @@ -1095,7 +1102,7 @@ dup_and_add_montgomery (mpi_point_t prd, mpi_point_t sum, ec_subm (p1->z, p1->x, p1->z, ctx); ec_pow2 (sum->x, sum->x, ctx); ec_pow2 (sum->z, p2->z, ctx); - ec_mulm (prd->z, p1->z, ctx->a, ctx); /* ctx->a: (A-2)/4 */ + ec_mulm (prd->z, p1->z, ctx->a, ctx); /* ctx->a: (A-2)/4 */ ec_mulm (sum->z, sum->z, dif_x, ctx); ec_addm (prd->z, p1->x, prd->z, ctx); ec_mulm (prd->z, prd->z, p1->z, ctx); @@ -1181,65 +1188,68 @@ _gcry_mpi_ec_mul_point (mpi_point_t result, nbits = mpi_get_nbits (scalar); point_init (&p1); - mpi_set_ui (p1.x, 1); - p2.x = mpi_copy (scalar); - p2.y = mpi_new (0); - p2.z = mpi_new (1); + point_init (&p2); point_init (&p1_); point_init (&p2_); + mpi_set_ui (p1.x, 1); + mpi_free (p2.x); + p2.x = mpi_copy (point->x); + mpi_set_ui (p2.z, 1); for (j=nbits-1; j >= 0; j--) - { - mpi_point_t q1, q2; - mpi_point_t sum_n, prd_n; - - if (mpi_test_bit (scalar, j)) - { - q1 = &p2; - q2 = &p1; - sum_n = &p1_; - prd_n = &p2_; - } - else - { - q1 = &p1; - q2 = &p2; - sum_n = &p2_; - prd_n = &p1_; - } - dup_and_add_montgomery (prd_n, sum_n, q1, q2, point->x, ctx); - - if (--j < 0) - break; - - if (mpi_test_bit (scalar, j)) - { - q1 = &p2_; - q2 = &p1_; - sum_n = &p1; - prd_n = &p2; - } - else - { - q1 = &p1_; - q2 = &p2_; - sum_n = &p2; - prd_n = &p1; - } - - dup_and_add_montgomery (prd_n, sum_n, q1, q2, point->x, ctx); - } + { + mpi_point_t q1, q2; + mpi_point_t sum_n, prd_n; + + if (mpi_test_bit (scalar, j)) + { + q1 = &p2; + q2 = &p1; + sum_n = &p1_; + prd_n = &p2_; + } + else + { + q1 = &p1; + q2 = &p2; + sum_n = &p2_; + prd_n = &p1_; + } + dup_and_add_montgomery (prd_n, sum_n, q1, q2, point->x, ctx); + + if (--j < 0) + break; + + if (mpi_test_bit (scalar, j)) + { + q1 = &p2_; + q2 = &p1_; + sum_n = &p1; + prd_n = &p2; + } + else + { + q1 = &p1_; + q2 = &p2_; + sum_n = &p2; + prd_n = &p1; + } + + dup_and_add_montgomery (prd_n, sum_n, q1, q2, point->x, ctx); + } if ((nbits & 1)) - { - ec_invm (result->x, p1_.z, ctx); - ec_mulm (result->x, result->x, p1_.x, ctx); - } + { + mpi_snatch (result->x, p1_.x); + mpi_snatch (result->z, p1_.z); + p1_.x = p1_.z = NULL; + } else - { - ec_invm (result->x, p1.z, ctx); - ec_mulm (result->x, result->x, p1.x, ctx); - } + { + mpi_snatch (result->x, p1.x); + mpi_snatch (result->z, p1.z); + p1.x = p1.z = NULL; + } point_free (&p1); point_free (&p2); commit a2b17d3639b7abb55decb67afbf8561a544c1cd7 Author: NIIBE Yutaka Date: Fri Apr 18 18:38:15 2014 +0900 Add Curve25519 diff --git a/cipher/ecc-curves.c b/cipher/ecc-curves.c index 0f622f7..6a90eaf 100644 --- a/cipher/ecc-curves.c +++ b/cipher/ecc-curves.c @@ -40,7 +40,7 @@ static const struct const char *other; /* Other name. */ } curve_aliases[] = { - /*{ "Curve25519", "1.3.6.1.4.1.3029.1.5.1" },*/ + { "Curve25519", "1.3.6.1.4.1.3029.1.5.1" }, { "Ed25519", "1.3.6.1.4.1.11591.15.1" }, { "NIST P-192", "1.2.840.10045.3.1.1" }, /* X9.62 OID */ @@ -127,6 +127,17 @@ static const ecc_domain_parms_t domain_parms[] = "0x216936D3CD6E53FEC0A4E231FDD6DC5C692CC7609525A7B2C9562D608F25D51A", "0x6666666666666666666666666666666666666666666666666666666666666658" }, + { + /* (y^2 = x^3 + 486662*x^2 + x) */ + "Curve25519", 256, 0, + MPI_EC_MONTGOMERY, ECC_DIALECT_STANDARD, + "0x7FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFED", + "0X1DB41", + "0x1", + "0x1000000000000000000000000000000014DEF9DEA2F79CD65812631A5CF5D3ED", + "0x9", + "0x20AE19A1B8A086B4E01EDD2C7748D14C923D4D7E6D7C61B229E9C5A27ECED3D9" + }, #if 0 /* No real specs yet found. */ { /* x^2 + y^2 = 1 + 3617x^2y^2 mod 2^414 - 17 */ diff --git a/mpi/ec.c b/mpi/ec.c index 4f35de0..c4ac819 100644 --- a/mpi/ec.c +++ b/mpi/ec.c @@ -1073,6 +1073,35 @@ add_points_edwards (mpi_point_t result, } +/* PRD = 2 * P1. + SUM = P1 + P2. + P1 - P2 = DIF */ +static void +dup_and_add_montgomery (mpi_point_t prd, mpi_point_t sum, + mpi_point_t p1, mpi_point_t p2, gcry_mpi_t dif_x, + mpi_ec_t ctx) +{ + ec_addm (sum->x, p2->x, p2->z, ctx); + ec_subm (p2->z, p2->x, p2->z, ctx); + ec_addm (prd->x, p1->x, p1->z, ctx); + ec_subm (p1->z, p1->x, p1->z, ctx); + ec_mulm (p2->x, p1->z, sum->x, ctx); + ec_mulm (p2->z, prd->x, p2->z, ctx); + ec_pow2 (p1->x, prd->x, ctx); + ec_pow2 (p1->z, p1->z, ctx); + ec_addm (sum->x, p2->x, p2->z, ctx); + ec_subm (p2->z, p2->x, p2->z, ctx); + ec_mulm (prd->x, p1->x, p1->z, ctx); + ec_subm (p1->z, p1->x, p1->z, ctx); + ec_pow2 (sum->x, sum->x, ctx); + ec_pow2 (sum->z, p2->z, ctx); + ec_mulm (prd->z, p1->z, ctx->a, ctx); /* ctx->a: (A-2)/4 */ + ec_mulm (sum->z, sum->z, dif_x, ctx); + ec_addm (prd->z, p1->x, prd->z, ctx); + ec_mulm (prd->z, prd->z, p1->z, ctx); +} + + /* RESULT = P1 + P2 */ void _gcry_mpi_ec_add_points (mpi_point_t result, @@ -1144,6 +1173,80 @@ _gcry_mpi_ec_mul_point (mpi_point_t result, } return; } + else if (ctx->model == MPI_EC_MONTGOMERY) + { + unsigned int nbits; + int j; + mpi_point_struct p1_, p2_; + + nbits = mpi_get_nbits (scalar); + point_init (&p1); + mpi_set_ui (p1.x, 1); + p2.x = mpi_copy (scalar); + p2.y = mpi_new (0); + p2.z = mpi_new (1); + point_init (&p1_); + point_init (&p2_); + + for (j=nbits-1; j >= 0; j--) + { + mpi_point_t q1, q2; + mpi_point_t sum_n, prd_n; + + if (mpi_test_bit (scalar, j)) + { + q1 = &p2; + q2 = &p1; + sum_n = &p1_; + prd_n = &p2_; + } + else + { + q1 = &p1; + q2 = &p2; + sum_n = &p2_; + prd_n = &p1_; + } + dup_and_add_montgomery (prd_n, sum_n, q1, q2, point->x, ctx); + + if (--j < 0) + break; + + if (mpi_test_bit (scalar, j)) + { + q1 = &p2_; + q2 = &p1_; + sum_n = &p1; + prd_n = &p2; + } + else + { + q1 = &p1_; + q2 = &p2_; + sum_n = &p2; + prd_n = &p1; + } + + dup_and_add_montgomery (prd_n, sum_n, q1, q2, point->x, ctx); + } + + if ((nbits & 1)) + { + ec_invm (result->x, p1_.z, ctx); + ec_mulm (result->x, result->x, p1_.x, ctx); + } + else + { + ec_invm (result->x, p1.z, ctx); + ec_mulm (result->x, result->x, p1.x, ctx); + } + + point_free (&p1); + point_free (&p2); + point_free (&p1_); + point_free (&p2_); + return; + } x1 = mpi_alloc_like (ctx->p); y1 = mpi_alloc_like (ctx->p); diff --git a/tests/curves.c b/tests/curves.c index 0581452..29654f3 100644 --- a/tests/curves.c +++ b/tests/curves.c @@ -29,7 +29,7 @@ #include "../src/gcrypt-int.h" /* Number of curves defined in ../cipger/ecc.c */ -#define N_CURVES 21 +#define N_CURVES 22 /* A real world sample public key. */ static char const sample_key_1[] = @@ -64,6 +64,18 @@ static char const sample_key_2_curve[] = "brainpoolP160r1"; static unsigned int sample_key_2_nbits = 160; +/* Another sample public key. */ +static char const sample_key_3[] = +"(public-key\n" +" (ecdh\n" +" (curve Curve25519)\n" +" (q #040000000000000000000000000000000000000000000000000000000000000000" +" 0000000000000000000000000000000000000000000000000000000000000000#)\n" +" ))"; +static char const sample_key_3_curve[] = "Curve25519"; +static unsigned int sample_key_3_nbits = 256; + + /* Program option flags. */ static int verbose; static int error_count; @@ -185,6 +197,30 @@ check_get_params (void) } +static void +check_montgomery (void) +{ + gpg_error_t err; + gcry_sexp_t key; + const char *name; + unsigned int nbits; + + err = gcry_sexp_new (&key, sample_key_3, 0, 1); + if (err) + die ("parsing s-expression string failed: %s\n", gpg_strerror (err)); + name = gcry_pk_get_curve (key, 0, &nbits); + if (!name) + fail ("curve name not found for sample_key_3\n"); + else if (strcmp (name, sample_key_3_curve)) + fail ("expected curve name %s but got %s for sample_key_3\n", + sample_key_3_curve, name); + else if (nbits != sample_key_3_nbits) + fail ("expected curve size %u but got %u for sample_key_3\n", + sample_key_3_nbits, nbits); + + gcry_sexp_release (key); +} + int main (int argc, char **argv) { @@ -205,6 +241,7 @@ main (int argc, char **argv) list_curves (); check_matching (); check_get_params (); + check_montgomery (); return error_count ? 1 : 0; } ----------------------------------------------------------------------- hooks/post-receive -- The GNU crypto library http://git.gnupg.org From cvs at cvs.gnupg.org Thu Jun 11 09:48:04 2015 From: cvs at cvs.gnupg.org (by Werner Koch) Date: Thu, 11 Jun 2015 09:48:04 +0200 Subject: [git] GnuPG - branch, master, updated. gnupg-2.1.4-24-g985918a Message-ID: 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 985918aab025cf0ac9db411b88a47c4b985e5e95 (commit) via 008435b95cbca19adc217178dc9d793eca584345 (commit) from 691dae270b3b741178912599724d69adabdb48b9 (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 985918aab025cf0ac9db411b88a47c4b985e5e95 Author: Werner Koch Date: Thu Jun 11 09:43:32 2015 +0200 agent: Fix --extra-socket on Windows. * agent/gpg-agent.c (start_connection_thread): Rename to ... (do_start_connection_thread): this. Factor nonce checking out to ... (start_connection_thread_std): this, (start_connection_thread_extra): this, (start_connection_thread_browser): and this. -- Although not tested, the code did not worked on Windows becuase we were checning the wrong nonce. Signed-off-by: Werner Koch diff --git a/agent/gpg-agent.c b/agent/gpg-agent.c index 18beca9..e721d8a 100644 --- a/agent/gpg-agent.c +++ b/agent/gpg-agent.c @@ -2166,15 +2166,8 @@ putty_message_thread (void *arg) static void * -start_connection_thread (ctrl_t ctrl) +do_start_connection_thread (ctrl_t ctrl) { - if (check_nonce (ctrl, &socket_nonce)) - { - log_error ("handler 0x%lx nonce check FAILED\n", - (unsigned long) npth_self()); - return NULL; - } - agent_init_default_ctrl (ctrl); if (opt.verbose) log_info (_("handler 0x%lx for fd %d started\n"), @@ -2197,7 +2190,14 @@ start_connection_thread_std (void *arg) { ctrl_t ctrl = arg; - return start_connection_thread (ctrl); + if (check_nonce (ctrl, &socket_nonce)) + { + log_error ("handler 0x%lx nonce check FAILED\n", + (unsigned long) npth_self()); + return NULL; + } + + return do_start_connection_thread (ctrl); } @@ -2207,8 +2207,15 @@ start_connection_thread_extra (void *arg) { ctrl_t ctrl = arg; + if (check_nonce (ctrl, &socket_nonce_extra)) + { + log_error ("handler 0x%lx nonce check FAILED\n", + (unsigned long) npth_self()); + return NULL; + } + ctrl->restricted = 1; - return start_connection_thread (ctrl); + return do_start_connection_thread (ctrl); } @@ -2218,8 +2225,15 @@ start_connection_thread_browser (void *arg) { ctrl_t ctrl = arg; + if (check_nonce (ctrl, &socket_nonce_browser)) + { + log_error ("handler 0x%lx nonce check FAILED\n", + (unsigned long) npth_self()); + return NULL; + } + ctrl->restricted = 2; - return start_connection_thread (ctrl); + return do_start_connection_thread (ctrl); } commit 008435b95cbca19adc217178dc9d793eca584345 Author: Werner Koch Date: Thu Jun 11 09:36:27 2015 +0200 agent: Add experimental option --browser-socket. * agent/agent.h (opt): Add field "browser_socket". * agent/command.c (cmd_setkeydesc): Use a different message for restricted==2. * agent/gpg-agent.c (oBrowserSocket): New. (opts): Add --browser-socket. (socket_name_browser, redir_socket_name_browser): New. (socket_nonce_browser): New. (cleanup): Cleanup browser socket. (main): Implement option. (start_connection_thread_browser): New. (handle_connections): Add arg listen_fd_browser and use it. -- This is very similar to --extra-socket but intended to be used by a web browser session. AS of now it only displays a different "Note: in the Pinentry than --extra-socket but it may eventually be tweaked for the use by browser extensions making use of gpg-agent. It is marked experimental and and thus may be removed in later versions. To better support the different "client classes", it would be useful to add corresponsing cache classes so that each class has its own cache. Signed-off-by: Werner Koch diff --git a/agent/agent.h b/agent/agent.h index ab8dc9f..cabb821 100644 --- a/agent/agent.h +++ b/agent/agent.h @@ -147,6 +147,12 @@ struct that we use a hack for cleanup handling in gpg-agent.c: If the value is less than 2 the name has not yet been malloced. */ int extra_socket; + + /* This global options indicates the use of an extra socket for web + browsers. Note that we use a hack for cleanup handling in + gpg-agent.c: If the value is less than 2 the name has not yet + been malloced. */ + int browser_socket; } opt; @@ -188,7 +194,9 @@ struct server_control_s gnupg_fd_t fd; } thread_startup; - /* Flag indicating the connection is run in restricted mode. */ + /* Flag indicating the connection is run in restricted mode. + A value of 1 if used for --extra-socket, + a value of 2 is used for --browser-socket. */ int restricted; /* Private data of the server (command.c). */ diff --git a/agent/command.c b/agent/command.c index 82d93e9..ccd5106 100644 --- a/agent/command.c +++ b/agent/command.c @@ -730,8 +730,12 @@ cmd_setkeydesc (assuan_context_t ctx, char *line) xfree (ctrl->server_local->keydesc); if (ctrl->restricted) - ctrl->server_local->keydesc = strconcat - (_("Note: Request from a remote site."), "%0A%0A", desc, NULL); + { + ctrl->server_local->keydesc = strconcat + ((ctrl->restricted == 2 + ? _("Note: Request from the web browser.") + : _("Note: Request from a remote site.") ), "%0A%0A", desc, NULL); + } else ctrl->server_local->keydesc = xtrystrdup (desc); if (!ctrl->server_local->keydesc) diff --git a/agent/gpg-agent.c b/agent/gpg-agent.c index 2acb650..18beca9 100644 --- a/agent/gpg-agent.c +++ b/agent/gpg-agent.c @@ -112,6 +112,7 @@ enum cmd_and_opt_values oUseStandardSocket, oNoUseStandardSocket, oExtraSocket, + oBrowserSocket, oFakedSystemTime, oIgnoreCacheForSigning, @@ -174,6 +175,8 @@ static ARGPARSE_OPTS opts[] = { ARGPARSE_s_s (oExtraSocket, "extra-socket", /* */ N_("|NAME|accept some commands via NAME")), + ARGPARSE_s_s (oBrowserSocket, "browser-socket", "@"), + ARGPARSE_s_s (oFakedSystemTime, "faked-system-time", "@"), ARGPARSE_s_n (oBatch, "batch", "@"), @@ -304,6 +307,10 @@ static char *redir_socket_name; static char *socket_name_extra; static char *redir_socket_name_extra; +/* Name of the optional browser socket used for native gpg-agent requests. */ +static char *socket_name_browser; +static char *redir_socket_name_browser; + /* Name of the communication socket used for ssh-agent-emulation. */ static char *socket_name_ssh; static char *redir_socket_name_ssh; @@ -312,6 +319,7 @@ static char *redir_socket_name_ssh; POSIX systems). */ static assuan_sock_nonce_t socket_nonce; static assuan_sock_nonce_t socket_nonce_extra; +static assuan_sock_nonce_t socket_nonce_browser; static assuan_sock_nonce_t socket_nonce_ssh; @@ -357,6 +365,7 @@ static void agent_deinit_default_ctrl (ctrl_t ctrl); static void handle_connections (gnupg_fd_t listen_fd, gnupg_fd_t listen_fd_extra, + gnupg_fd_t listen_fd_browser, gnupg_fd_t listen_fd_ssh); static void check_own_socket (void); static int check_for_running_agent (int silent); @@ -532,6 +541,8 @@ cleanup (void) remove_socket (socket_name, redir_socket_name); if (opt.extra_socket > 1) remove_socket (socket_name_extra, redir_socket_name_extra); + if (opt.browser_socket > 1) + remove_socket (socket_name_browser, redir_socket_name_browser); remove_socket (socket_name_ssh, redir_socket_name_ssh); } @@ -925,6 +936,11 @@ main (int argc, char **argv ) socket_name_extra = pargs.r.ret_str; break; + case oBrowserSocket: + opt.browser_socket = 1; /* (1 = points into argv) */ + socket_name_browser = pargs.r.ret_str; + break; + case oDebugQuickRandom: /* Only used by the first stage command line parser. */ break; @@ -1141,6 +1157,7 @@ main (int argc, char **argv ) { /* Regular server mode */ gnupg_fd_t fd; gnupg_fd_t fd_extra = GNUPG_INVALID_FD; + gnupg_fd_t fd_browser = GNUPG_INVALID_FD; gnupg_fd_t fd_ssh = GNUPG_INVALID_FD; pid_t pid; @@ -1169,6 +1186,15 @@ main (int argc, char **argv ) &socket_nonce_extra); } + if (opt.browser_socket) + { + socket_name_browser = create_socket_name (socket_name_browser, 0); + opt.browser_socket = 2; /* Indicate that it has been malloced. */ + fd_browser = create_server_socket (socket_name_browser, 0, + &redir_socket_name_browser, + &socket_nonce_browser); + } + if (opt.ssh_support) { socket_name_ssh = create_socket_name (GPG_AGENT_SSH_SOCK_NAME, 1); @@ -1240,6 +1266,8 @@ main (int argc, char **argv ) the child should do this from now on */ if (opt.extra_socket) *socket_name_extra = 0; + if (opt.browser_socket) + *socket_name_browser = 0; if (opt.ssh_support) *socket_name_ssh = 0; @@ -1350,7 +1378,7 @@ main (int argc, char **argv ) #endif /*!HAVE_W32_SYSTEM*/ log_info ("%s %s started\n", strusage(11), strusage(13) ); - handle_connections (fd, fd_extra, fd_ssh); + handle_connections (fd, fd_extra, fd_browser, fd_ssh); assuan_sock_close (fd); } @@ -2184,6 +2212,17 @@ start_connection_thread_extra (void *arg) } +/* This is the browser socket connection thread's main function. */ +static void * +start_connection_thread_browser (void *arg) +{ + ctrl_t ctrl = arg; + + ctrl->restricted = 2; + return start_connection_thread (ctrl); +} + + /* This is the ssh connection thread's main function. */ static void * start_connection_thread_ssh (void *arg) @@ -2214,6 +2253,7 @@ start_connection_thread_ssh (void *arg) static void handle_connections (gnupg_fd_t listen_fd, gnupg_fd_t listen_fd_extra, + gnupg_fd_t listen_fd_browser, gnupg_fd_t listen_fd_ssh) { npth_attr_t tattr; @@ -2236,9 +2276,10 @@ handle_connections (gnupg_fd_t listen_fd, void *(*func) (void *arg); gnupg_fd_t l_fd; } listentbl[] = { - { "std", start_connection_thread_std }, - { "extra",start_connection_thread_extra }, - { "ssh", start_connection_thread_ssh } + { "std", start_connection_thread_std }, + { "extra", start_connection_thread_extra }, + { "browser", start_connection_thread_browser }, + { "ssh", start_connection_thread_ssh } }; @@ -2296,6 +2337,12 @@ handle_connections (gnupg_fd_t listen_fd, if (FD2INT (listen_fd_extra) > nfd) nfd = FD2INT (listen_fd_extra); } + if (listen_fd_browser != GNUPG_INVALID_FD) + { + FD_SET ( FD2INT(listen_fd_browser), &fdset); + if (FD2INT (listen_fd_browser) > nfd) + nfd = FD2INT (listen_fd_browser); + } if (listen_fd_ssh != GNUPG_INVALID_FD) { FD_SET ( FD2INT(listen_fd_ssh), &fdset); @@ -2305,7 +2352,8 @@ handle_connections (gnupg_fd_t listen_fd, listentbl[0].l_fd = listen_fd; listentbl[1].l_fd = listen_fd_extra; - listentbl[2].l_fd = listen_fd_ssh; + listentbl[2].l_fd = listen_fd_browser; + listentbl[3].l_fd = listen_fd_ssh; npth_clock_gettime (&abstime); abstime.tv_sec += TIMERTICK_INTERVAL; ----------------------------------------------------------------------- Summary of changes: agent/agent.h | 10 +++++- agent/command.c | 8 +++-- agent/gpg-agent.c | 92 ++++++++++++++++++++++++++++++++++++++++++++++--------- 3 files changed, 92 insertions(+), 18 deletions(-) hooks/post-receive -- The GNU Privacy Guard http://git.gnupg.org From cvs at cvs.gnupg.org Thu Jun 11 15:40:02 2015 From: cvs at cvs.gnupg.org (by Werner Koch) Date: Thu, 11 Jun 2015 15:40:02 +0200 Subject: [git] GnuPG - branch, master, updated. gnupg-2.1.5-1-gee438d6 Message-ID: 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 ee438d677560d3350a76286b2ef294323210f486 (commit) via 9b7bdfae82f74a147a5dbf0fac0f78cde77a207b (commit) via 0cbd394ebbbd39d159e681f8e0f3dfd5204efd70 (commit) via 41a62a57a42bf6dd17c51ec7d976d62d7c2facdc (commit) via 6ac0042cffc8cb67ebd8fc2098b278f62126bdc0 (commit) via 82eaa9074dd1756e9d210592db4edd7f30a3de22 (commit) from 985918aab025cf0ac9db411b88a47c4b985e5e95 (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 ee438d677560d3350a76286b2ef294323210f486 Author: Werner Koch Date: Thu Jun 11 15:37:50 2015 +0200 Post release updates. -- diff --git a/NEWS b/NEWS index 4f4f2f6..b760eb0 100644 --- a/NEWS +++ b/NEWS @@ -1,3 +1,7 @@ +Noteworthy changes in version 2.1.6 (unreleased) +------------------------------------------------ + + Noteworthy changes in version 2.1.5 (2015-06-11) ------------------------------------------------ diff --git a/configure.ac b/configure.ac index 2e7125d..cf49647 100644 --- a/configure.ac +++ b/configure.ac @@ -28,7 +28,7 @@ min_automake_version="1.14" m4_define([mym4_package],[gnupg]) m4_define([mym4_major], [2]) m4_define([mym4_minor], [1]) -m4_define([mym4_micro], [5]) +m4_define([mym4_micro], [6]) # To start a new development series, i.e a new major or minor number # you need to mark an arbitrary commit before the first beta release commit 9b7bdfae82f74a147a5dbf0fac0f78cde77a207b Author: Werner Koch Date: Thu Jun 11 14:43:57 2015 +0200 Release 2.1.5 diff --git a/NEWS b/NEWS index b59be51..4f4f2f6 100644 --- a/NEWS +++ b/NEWS @@ -1,6 +1,16 @@ -Noteworthy changes in version 2.1.5 (unreleased) +Noteworthy changes in version 2.1.5 (2015-06-11) ------------------------------------------------ + * Support for an external passphrase cache. + + * Support for the forthcoming version 3 OpenPGP smartcard. + + * Manuals now show the actual used file names. + + * Prepared for improved integration with Emacs. + + * Code cleanups and minor bug fixes. + Noteworthy changes in version 2.1.4 (2015-05-12) ------------------------------------------------ commit 0cbd394ebbbd39d159e681f8e0f3dfd5204efd70 Author: Werner Koch Date: Thu Jun 11 14:43:38 2015 +0200 w32: Adjust mkdefsinc.c for Windows -- Under Windows the file names are determined at runtime. To have somewhat useful names in the manuals, we provide replacements using the strings "INSTDIR" and "APPDATA" for the installation directory and the user specific application data. diff --git a/doc/mkdefsinc.c b/doc/mkdefsinc.c index c4f776f..9e17332 100644 --- a/doc/mkdefsinc.c +++ b/doc/mkdefsinc.c @@ -31,6 +31,16 @@ values are not valid for the build platform but we need some values nevertheless. */ #include "config.h" +/* When building for Windows some -D macros are not available. We + provide replacements here. */ +#ifdef HAVE_W32_SYSTEM +# define GNUPG_BINDIR "INSTDIR/bin" +# define GNUPG_LIBEXECDIR "INSTDIR/bin" +# define GNUPG_LIBDIR "INSTDIR/lib/" PACKAGE_NAME +# define GNUPG_DATADIR "INSTDIR/share/" PACKAGE_NAME +# define GNUPG_SYSCONFDIR "APPDATA/GNU/etc/" PACKAGE_NAME +# define GNUPG_LOCALSTATEDIR "APPDATA/GNU" +#endif /*HAVE_W32_SYSTEM*/ static int verbose; commit 41a62a57a42bf6dd17c51ec7d976d62d7c2facdc Author: Werner Koch Date: Thu Jun 11 13:05:53 2015 +0200 po: Auto-update -- diff --git a/po/ca.po b/po/ca.po index d5d6847..86b6e52 100644 --- a/po/ca.po +++ b/po/ca.po @@ -404,6 +404,9 @@ msgstr "error en la creaci?? de la contrasenya: %s\n" msgid "allow caller to override the pinentry" msgstr "" +msgid "allow passphrase to be prompted through Emacs" +msgstr "" + # G??nere? Nombre? ivb # Werner FIXME: please add translator comment saying *what* is # uncompressed so we know the gender. jm @@ -5517,6 +5520,14 @@ msgstr "error de lectura: %s\n" msgid "trustdb: sync failed: %s\n" msgstr "base de dades de confian??a: no s'ha pogut sincronitzar: %s\n" +#, fuzzy, c-format +msgid "can't create lock for '%s'\n" +msgstr "no es pot crear el directori ??%s??: %s\n" + +#, fuzzy, c-format +msgid "can't lock '%s'\n" +msgstr "no s'ha pogut obrir ??%s??\n" + #, c-format msgid "trustdb rec %lu: lseek failed: %s\n" msgstr "reg de la base de dades de confian??a %lu: ha fallat lseek: %s\n" @@ -5539,14 +5550,6 @@ msgstr "no s'ha pogut tancar ??%s??: %s\n" msgid "%s: directory does not exist!\n" msgstr "%s: el directori no existeix!\n" -#, fuzzy, c-format -msgid "can't create lock for '%s'\n" -msgstr "no es pot crear el directori ??%s??: %s\n" - -#, fuzzy, c-format -msgid "can't lock '%s'\n" -msgstr "no s'ha pogut obrir ??%s??\n" - #, c-format msgid "%s: failed to create version record: %s" msgstr "%s: no s'ha pogut crear un registre de versi??: %s" diff --git a/po/cs.po b/po/cs.po index 368925c..b9e31bd 100644 --- a/po/cs.po +++ b/po/cs.po @@ -402,6 +402,9 @@ msgstr "umo??nit p??ednastaven?? hesla" msgid "allow caller to override the pinentry" msgstr "" +msgid "allow passphrase to be prompted through Emacs" +msgstr "" + msgid "enable ssh support" msgstr "zapnout podporu pro OpenSSH" @@ -5110,6 +5113,14 @@ msgid "trustdb: sync failed: %s\n" msgstr "datab??ze d??v??ry: synchronizace selhala %s\n" #, c-format +msgid "can't create lock for '%s'\n" +msgstr "pro ???%s??? nelze vytvo??it z??mek\n" + +#, c-format +msgid "can't lock '%s'\n" +msgstr "???%s??? nelze zamknout\n" + +#, c-format msgid "trustdb rec %lu: lseek failed: %s\n" msgstr "z??znam v datab??zi d??v??ry %lu: lseek() se nepoda??il: %s\n" @@ -5129,14 +5140,6 @@ msgid "%s: directory does not exist!\n" msgstr "%s: adres???? neexistuje!\n" #, c-format -msgid "can't create lock for '%s'\n" -msgstr "pro ???%s??? nelze vytvo??it z??mek\n" - -#, c-format -msgid "can't lock '%s'\n" -msgstr "???%s??? nelze zamknout\n" - -#, c-format msgid "%s: failed to create version record: %s" msgstr "%s: nepoda??ilo se vytvo??it z??znam verze: %s" diff --git a/po/da.po b/po/da.po index c54590e..90effe0 100644 --- a/po/da.po +++ b/po/da.po @@ -413,6 +413,9 @@ msgstr "tillad forh??ndsindstilling af adgangsfrase" msgid "allow caller to override the pinentry" msgstr "" +msgid "allow passphrase to be prompted through Emacs" +msgstr "" + #, fuzzy #| msgid "enable ssh-agent emulation" msgid "enable ssh support" @@ -5347,6 +5350,16 @@ msgstr "l??sefejl i ??%s??: %s\n" msgid "trustdb: sync failed: %s\n" msgstr "trustdb: synkronisering mislykkedes: %s\n" +#, fuzzy, c-format +#| msgid "can't create lock for `%s'\n" +msgid "can't create lock for '%s'\n" +msgstr "kan ikke oprette l??s for ??%s??\n" + +#, fuzzy, c-format +#| msgid "can't lock `%s'\n" +msgid "can't lock '%s'\n" +msgstr "kan ikke l??se ??%s??\n" + #, c-format msgid "trustdb rec %lu: lseek failed: %s\n" msgstr "trustdb rec %lu: lseek mislykkedes: %s\n" @@ -5367,16 +5380,6 @@ msgstr "kan ikke tilg?? ??%s??: %s\n" msgid "%s: directory does not exist!\n" msgstr "%s: mappe findes ikke!\n" -#, fuzzy, c-format -#| msgid "can't create lock for `%s'\n" -msgid "can't create lock for '%s'\n" -msgstr "kan ikke oprette l??s for ??%s??\n" - -#, fuzzy, c-format -#| msgid "can't lock `%s'\n" -msgid "can't lock '%s'\n" -msgstr "kan ikke l??se ??%s??\n" - #, c-format msgid "%s: failed to create version record: %s" msgstr "%s: kunne ikke oprette versionspost: %s" diff --git a/po/el.po b/po/el.po index 04c912f..8e5f2c4 100644 --- a/po/el.po +++ b/po/el.po @@ -380,6 +380,9 @@ msgstr " msgid "allow caller to override the pinentry" msgstr "" +msgid "allow passphrase to be prompted through Emacs" +msgstr "" + #, fuzzy #| msgid "not supported" msgid "enable ssh support" @@ -5390,6 +5393,14 @@ msgstr " msgid "trustdb: sync failed: %s\n" msgstr "trustdb: sync ???????: %s\n" +#, fuzzy, c-format +msgid "can't create lock for '%s'\n" +msgstr "???????? ??????????? ??? `%s': %s\n" + +#, fuzzy, c-format +msgid "can't lock '%s'\n" +msgstr "???????? ????????? ??? `%s'\n" + #, c-format msgid "trustdb rec %lu: lseek failed: %s\n" msgstr "trustdb rec %lu: ???????? lseek: %s\n" @@ -5409,14 +5420,6 @@ msgstr " msgid "%s: directory does not exist!\n" msgstr "%s: ? ??????? ??? ???????!\n" -#, fuzzy, c-format -msgid "can't create lock for '%s'\n" -msgstr "???????? ??????????? ??? `%s': %s\n" - -#, fuzzy, c-format -msgid "can't lock '%s'\n" -msgstr "???????? ????????? ??? `%s'\n" - #, c-format msgid "%s: failed to create version record: %s" msgstr "%s: ???????? ??????????? ???? ???????? ???????: %s" diff --git a/po/eo.po b/po/eo.po index dbaf326..3e9e0e0 100644 --- a/po/eo.po +++ b/po/eo.po @@ -382,6 +382,9 @@ msgstr "eraro dum kreado de pasfrazo: %s\n" msgid "allow caller to override the pinentry" msgstr "" +msgid "allow passphrase to be prompted through Emacs" +msgstr "" + #, fuzzy #| msgid "not supported" msgid "enable ssh support" @@ -5345,6 +5348,14 @@ msgstr "kiraso: %s\n" msgid "trustdb: sync failed: %s\n" msgstr "fido-datenaro: sync malsukcesis: %s\n" +#, fuzzy, c-format +msgid "can't create lock for '%s'\n" +msgstr "ne povas krei '%s': %s\n" + +#, fuzzy, c-format +msgid "can't lock '%s'\n" +msgstr "ne povas malfermi '%s'\n" + #, c-format msgid "trustdb rec %lu: lseek failed: %s\n" msgstr "fido-datenaro loko %lu: lseek malsukcesis: %s\n" @@ -5364,14 +5375,6 @@ msgstr "ne povas fermi '%s': %s\n" msgid "%s: directory does not exist!\n" msgstr "%s: dosierujo ne ekzistas!\n" -#, fuzzy, c-format -msgid "can't create lock for '%s'\n" -msgstr "ne povas krei '%s': %s\n" - -#, fuzzy, c-format -msgid "can't lock '%s'\n" -msgstr "ne povas malfermi '%s'\n" - #, c-format msgid "%s: failed to create version record: %s" msgstr "%s: malsukcesis krei versiregistron: %s" diff --git a/po/es.po b/po/es.po index 0111dbd..0abc622 100644 --- a/po/es.po +++ b/po/es.po @@ -427,6 +427,9 @@ msgstr "permitir preestablecer frase contrase msgid "allow caller to override the pinentry" msgstr "" +msgid "allow passphrase to be prompted through Emacs" +msgstr "" + #, fuzzy #| msgid "enable ssh-agent emulation" msgid "enable ssh support" @@ -5355,6 +5358,16 @@ msgstr "error de lectura `%s': %s\n" msgid "trustdb: sync failed: %s\n" msgstr "base de datos de confianza: fallo sincronizaci?n: %s\n" +#, fuzzy, c-format +#| msgid "can't create lock for `%s'\n" +msgid "can't create lock for '%s'\n" +msgstr "no se puede crear el bloqueo para `%s'\n" + +#, fuzzy, c-format +#| msgid "can't lock `%s'\n" +msgid "can't lock '%s'\n" +msgstr "no se puede bloquear `%s'\n" + #, c-format msgid "trustdb rec %lu: lseek failed: %s\n" msgstr "registro base de datos de confianza %lu: lseek fallido: %s\n" @@ -5376,16 +5389,6 @@ msgstr "no se puede acceder a `%s': %s\n" msgid "%s: directory does not exist!\n" msgstr "%s: ?el directorio no existe!\n" -#, fuzzy, c-format -#| msgid "can't create lock for `%s'\n" -msgid "can't create lock for '%s'\n" -msgstr "no se puede crear el bloqueo para `%s'\n" - -#, fuzzy, c-format -#| msgid "can't lock `%s'\n" -msgid "can't lock '%s'\n" -msgstr "no se puede bloquear `%s'\n" - #, c-format msgid "%s: failed to create version record: %s" msgstr "%s: fallo en la creaci?n del registro de versi?n: %s" diff --git a/po/et.po b/po/et.po index 5f0a400..fdf5462 100644 --- a/po/et.po +++ b/po/et.po @@ -378,6 +378,9 @@ msgstr "viga parooli loomisel: %s\n" msgid "allow caller to override the pinentry" msgstr "" +msgid "allow passphrase to be prompted through Emacs" +msgstr "" + #, fuzzy #| msgid "not supported" msgid "enable ssh support" @@ -5322,6 +5325,14 @@ msgstr "viga lugemisel: %s\n" msgid "trustdb: sync failed: %s\n" msgstr "trustdb: sync eba?nnestus: %s\n" +#, fuzzy, c-format +msgid "can't create lock for '%s'\n" +msgstr "`%s' ei ?nnestu luua: %s\n" + +#, fuzzy, c-format +msgid "can't lock '%s'\n" +msgstr "`%s' ei ?nnestu avada\n" + #, c-format msgid "trustdb rec %lu: lseek failed: %s\n" msgstr "trustdb kirje %lu: lseek eba?nnestus: %s\n" @@ -5341,14 +5352,6 @@ msgstr "`%s' ei msgid "%s: directory does not exist!\n" msgstr "%s: kataloogi ei ole!\n" -#, fuzzy, c-format -msgid "can't create lock for '%s'\n" -msgstr "`%s' ei ?nnestu luua: %s\n" - -#, fuzzy, c-format -msgid "can't lock '%s'\n" -msgstr "`%s' ei ?nnestu avada\n" - #, c-format msgid "%s: failed to create version record: %s" msgstr "%s: versioonikirje loomine ei ?nnestu: %s" diff --git a/po/fi.po b/po/fi.po index 9ae7699..47bbe27 100644 --- a/po/fi.po +++ b/po/fi.po @@ -394,6 +394,9 @@ msgstr "virhe luotaessa salasanaa: %s\n" msgid "allow caller to override the pinentry" msgstr "" +msgid "allow passphrase to be prompted through Emacs" +msgstr "" + #, fuzzy #| msgid "not supported" msgid "enable ssh support" @@ -5376,6 +5379,14 @@ msgstr "lukuvirhe: %s\n" msgid "trustdb: sync failed: %s\n" msgstr "trustdb: synkronointi ep??onnistui: %s\n" +#, fuzzy, c-format +msgid "can't create lock for '%s'\n" +msgstr "tiedostoa \"%s\" ei voi luoda: %s\n" + +#, fuzzy, c-format +msgid "can't lock '%s'\n" +msgstr "tiedostoa \"%s\" ei voi avata\n" + #, c-format msgid "trustdb rec %lu: lseek failed: %s\n" msgstr "trustdb rec %lu: lseek ep??onnistui: %s\n" @@ -5395,14 +5406,6 @@ msgstr "tiedostoa \"%s\" ei voi sulkea: %s\n" msgid "%s: directory does not exist!\n" msgstr "%s: hakemistoa ei ole olemassa!\n" -#, fuzzy, c-format -msgid "can't create lock for '%s'\n" -msgstr "tiedostoa \"%s\" ei voi luoda: %s\n" - -#, fuzzy, c-format -msgid "can't lock '%s'\n" -msgstr "tiedostoa \"%s\" ei voi avata\n" - #, c-format msgid "%s: failed to create version record: %s" msgstr "%s: versiotietueen luonti ep??onnistui: %s" diff --git a/po/fr.po b/po/fr.po index 101b6e4..d9f2c48 100644 --- a/po/fr.po +++ b/po/fr.po @@ -384,6 +384,9 @@ msgstr "permettre de pr??configurer la phrase secr??te" msgid "allow caller to override the pinentry" msgstr "" +msgid "allow passphrase to be prompted through Emacs" +msgstr "" + msgid "enable ssh support" msgstr "activer la prise en charge de SSH" @@ -5226,6 +5229,14 @@ msgid "trustdb: sync failed: %s\n" msgstr "base de confiance??: ??chec de synchronisation??: %s\n" #, c-format +msgid "can't create lock for '%s'\n" +msgstr "impossible de cr??er un verrou pour ????%s????\n" + +#, c-format +msgid "can't lock '%s'\n" +msgstr "impossible de verrouiller ????%s????\n" + +#, c-format msgid "trustdb rec %lu: lseek failed: %s\n" msgstr "enregistrement de base de confiance %lu??: ??chec de lseek??: %s\n" @@ -5246,14 +5257,6 @@ msgid "%s: directory does not exist!\n" msgstr "%s??: le r??pertoire n'existe pas.\n" #, c-format -msgid "can't create lock for '%s'\n" -msgstr "impossible de cr??er un verrou pour ????%s????\n" - -#, c-format -msgid "can't lock '%s'\n" -msgstr "impossible de verrouiller ????%s????\n" - -#, c-format msgid "%s: failed to create version record: %s" msgstr "%s??: impossible de cr??er un enregistrement de version??: %s" diff --git a/po/gl.po b/po/gl.po index 0e3eadf..f1abe61 100644 --- a/po/gl.po +++ b/po/gl.po @@ -380,6 +380,9 @@ msgstr "erro ao crea-lo contrasinal: %s\n" msgid "allow caller to override the pinentry" msgstr "" +msgid "allow passphrase to be prompted through Emacs" +msgstr "" + #, fuzzy #| msgid "not supported" msgid "enable ssh support" @@ -5380,6 +5383,14 @@ msgstr "erro de lectura: %s\n" msgid "trustdb: sync failed: %s\n" msgstr "base de datos de confianza: fallou a sincronizaci?n: %s\n" +#, fuzzy, c-format +msgid "can't create lock for '%s'\n" +msgstr "non se pode crear `%s': %s\n" + +#, fuzzy, c-format +msgid "can't lock '%s'\n" +msgstr "non se puido abrir `%s'\n" + #, c-format msgid "trustdb rec %lu: lseek failed: %s\n" msgstr "rexistro da base de datos de confianza %lu: lseek fallou: %s\n" @@ -5400,14 +5411,6 @@ msgstr "non se pode pechar `%s': %s\n" msgid "%s: directory does not exist!\n" msgstr "%s: ?o directorio non existe!\n" -#, fuzzy, c-format -msgid "can't create lock for '%s'\n" -msgstr "non se pode crear `%s': %s\n" - -#, fuzzy, c-format -msgid "can't lock '%s'\n" -msgstr "non se puido abrir `%s'\n" - #, c-format msgid "%s: failed to create version record: %s" msgstr "%s: non se puido crea-lo rexistro de versi?n: %s" diff --git a/po/hu.po b/po/hu.po index 1154cc5..7d7ee89 100644 --- a/po/hu.po +++ b/po/hu.po @@ -378,6 +378,9 @@ msgstr "Hiba a jelsz msgid "allow caller to override the pinentry" msgstr "" +msgid "allow passphrase to be prompted through Emacs" +msgstr "" + #, fuzzy #| msgid "not supported" msgid "enable ssh support" @@ -5352,6 +5355,14 @@ msgstr "Olvas msgid "trustdb: sync failed: %s\n" msgstr "Bizalmi adatb?zis: szinkroniz?ci? sikertelen: %s.\n" +#, fuzzy, c-format +msgid "can't create lock for '%s'\n" +msgstr "Nem tudom l?trehozni a(z) \"%s\" ?llom?nyt: %s.\n" + +#, fuzzy, c-format +msgid "can't lock '%s'\n" +msgstr "Nem tudom megnyitni %s-t!\n" + #, c-format msgid "trustdb rec %lu: lseek failed: %s\n" msgstr "Bizalmi adatb?zis %lu. rekord: lseek sikertelen: %s.\n" @@ -5371,14 +5382,6 @@ msgstr "Nem tudom bez msgid "%s: directory does not exist!\n" msgstr "%s: K?nyvt?r nem l?tezik!\n" -#, fuzzy, c-format -msgid "can't create lock for '%s'\n" -msgstr "Nem tudom l?trehozni a(z) \"%s\" ?llom?nyt: %s.\n" - -#, fuzzy, c-format -msgid "can't lock '%s'\n" -msgstr "Nem tudom megnyitni %s-t!\n" - #, c-format msgid "%s: failed to create version record: %s" msgstr "%s: Nem siker?lt verzi?rekordot l?trehoznom: %s" diff --git a/po/id.po b/po/id.po index 6683b6d..9327b9d 100644 --- a/po/id.po +++ b/po/id.po @@ -383,6 +383,9 @@ msgstr "kesalahan penciptaan passphrase: %s\n" msgid "allow caller to override the pinentry" msgstr "" +msgid "allow passphrase to be prompted through Emacs" +msgstr "" + #, fuzzy #| msgid "not supported" msgid "enable ssh support" @@ -5342,6 +5345,14 @@ msgstr "kesalahan pembacaan: %s\n" msgid "trustdb: sync failed: %s\n" msgstr "trustdb: gagal sync: %s\n" +#, fuzzy, c-format +msgid "can't create lock for '%s'\n" +msgstr "tidak dapat membuat %s: %s\n" + +#, fuzzy, c-format +msgid "can't lock '%s'\n" +msgstr "tidak dapat membuka `%s'\n" + #, c-format msgid "trustdb rec %lu: lseek failed: %s\n" msgstr "trustdb rec %lu: lseek gagal: %s\n" @@ -5361,14 +5372,6 @@ msgstr "tidak dapat menutup `%s': %s\n" msgid "%s: directory does not exist!\n" msgstr "%s: direktori tidak ada!\n" -#, fuzzy, c-format -msgid "can't create lock for '%s'\n" -msgstr "tidak dapat membuat %s: %s\n" - -#, fuzzy, c-format -msgid "can't lock '%s'\n" -msgstr "tidak dapat membuka `%s'\n" - #, c-format msgid "%s: failed to create version record: %s" msgstr "%s: gagal membuat catatan versi: %s" diff --git a/po/it.po b/po/it.po index 522e24f..4a08f01 100644 --- a/po/it.po +++ b/po/it.po @@ -378,6 +378,9 @@ msgstr "errore nella creazione della passhprase: %s\n" msgid "allow caller to override the pinentry" msgstr "" +msgid "allow passphrase to be prompted through Emacs" +msgstr "" + #, fuzzy #| msgid "not supported" msgid "enable ssh support" @@ -5380,6 +5383,14 @@ msgstr "errore di lettura: %s\n" msgid "trustdb: sync failed: %s\n" msgstr "trustdb: sync fallita: %s\n" +#, fuzzy, c-format +msgid "can't create lock for '%s'\n" +msgstr "impossibile creare `%s': %s\n" + +#, fuzzy, c-format +msgid "can't lock '%s'\n" +msgstr "impossibile aprire `%s'\n" + #, c-format msgid "trustdb rec %lu: lseek failed: %s\n" msgstr "trustdb rec %lu: lseek fallita: %s\n" @@ -5399,14 +5410,6 @@ msgstr "impossibile chiudere `%s': %s\n" msgid "%s: directory does not exist!\n" msgstr "%s: la directory non esiste!\n" -#, fuzzy, c-format -msgid "can't create lock for '%s'\n" -msgstr "impossibile creare `%s': %s\n" - -#, fuzzy, c-format -msgid "can't lock '%s'\n" -msgstr "impossibile aprire `%s'\n" - #, c-format msgid "%s: failed to create version record: %s" msgstr "%s: creazione del record della versione fallita: %s" diff --git a/po/ja.po b/po/ja.po index d3df2e2..7737c70 100644 --- a/po/ja.po +++ b/po/ja.po @@ -374,6 +374,9 @@ msgstr "?????????????????????????????????????????????" msgid "allow caller to override the pinentry" msgstr "pinentry??????????????????????????????????????????????????????" +msgid "allow passphrase to be prompted through Emacs" +msgstr "" + msgid "enable ssh support" msgstr "ssh??????????????????????????????" @@ -5000,6 +5003,14 @@ msgid "trustdb: sync failed: %s\n" msgstr "????????????????????????: ???????????????????????????: %s\n" #, c-format +msgid "can't create lock for '%s'\n" +msgstr "'%s'????????????????????????????????????\n" + +#, c-format +msgid "can't lock '%s'\n" +msgstr "'%s'???????????????????????????\n" + +#, c-format msgid "trustdb rec %lu: lseek failed: %s\n" msgstr "???????????????????????? ????????????%lu: ??????????????????????????????: %s\n" @@ -5019,14 +5030,6 @@ msgid "%s: directory does not exist!\n" msgstr "%s: ????????????????????????????????????!\n" #, c-format -msgid "can't create lock for '%s'\n" -msgstr "'%s'????????????????????????????????????\n" - -#, c-format -msgid "can't lock '%s'\n" -msgstr "'%s'???????????????????????????\n" - -#, c-format msgid "%s: failed to create version record: %s" msgstr "%s: ????????????????????????????????????????????????????????????: %s" diff --git a/po/nb.po b/po/nb.po index 63f410d..9e5f207 100644 --- a/po/nb.po +++ b/po/nb.po @@ -390,6 +390,9 @@ msgstr "feil ved opprettelse av passfrase: %s\n" msgid "allow caller to override the pinentry" msgstr "" +msgid "allow passphrase to be prompted through Emacs" +msgstr "" + msgid "enable ssh support" msgstr "" @@ -5203,6 +5206,16 @@ msgstr "lesefeil ved msgid "trustdb: sync failed: %s\n" msgstr "" +#, fuzzy, c-format +#| msgid "can't create lock for `%s'\n" +msgid "can't create lock for '%s'\n" +msgstr "kan ikke opprette l?s for ?%s?\n" + +#, fuzzy, c-format +#| msgid "can't lock `%s'\n" +msgid "can't lock '%s'\n" +msgstr "kan ikke l?se ?%s?\n" + #, c-format msgid "trustdb rec %lu: lseek failed: %s\n" msgstr "" @@ -5223,16 +5236,6 @@ msgstr "kan ikke aksere msgid "%s: directory does not exist!\n" msgstr "" -#, fuzzy, c-format -#| msgid "can't create lock for `%s'\n" -msgid "can't create lock for '%s'\n" -msgstr "kan ikke opprette l?s for ?%s?\n" - -#, fuzzy, c-format -#| msgid "can't lock `%s'\n" -msgid "can't lock '%s'\n" -msgstr "kan ikke l?se ?%s?\n" - #, c-format msgid "%s: failed to create version record: %s" msgstr "" diff --git a/po/pl.po b/po/pl.po index 68a035a..cf0c727 100644 --- a/po/pl.po +++ b/po/pl.po @@ -404,6 +404,9 @@ msgstr "zezwolenie na predefiniowane has msgid "allow caller to override the pinentry" msgstr "" +msgid "allow passphrase to be prompted through Emacs" +msgstr "" + msgid "enable ssh support" msgstr "" @@ -5374,6 +5377,16 @@ msgstr "b msgid "trustdb: sync failed: %s\n" msgstr "baza zaufania: synchronizacja nie powiod?a si? %s\n" +#, fuzzy, c-format +#| msgid "can't create lock for `%s'\n" +msgid "can't create lock for '%s'\n" +msgstr "nie mo?na utworzy? blokady dla ,,%s''\n" + +#, fuzzy, c-format +#| msgid "can't lock `%s'\n" +msgid "can't lock '%s'\n" +msgstr "nie mo?na zablokowa? ,,%s''\n" + #, c-format msgid "trustdb rec %lu: lseek failed: %s\n" msgstr "baza zaufania, wpis %lu: funkcja lseek() nie powiod?a si?: %s\n" @@ -5394,16 +5407,6 @@ msgstr "nie mo msgid "%s: directory does not exist!\n" msgstr "%s: katalog nie istnieje!\n" -#, fuzzy, c-format -#| msgid "can't create lock for `%s'\n" -msgid "can't create lock for '%s'\n" -msgstr "nie mo?na utworzy? blokady dla ,,%s''\n" - -#, fuzzy, c-format -#| msgid "can't lock `%s'\n" -msgid "can't lock '%s'\n" -msgstr "nie mo?na zablokowa? ,,%s''\n" - #, c-format msgid "%s: failed to create version record: %s" msgstr "%s: stworzenie zapisu o wersji nie powiod?o si?: %s" diff --git a/po/pt.po b/po/pt.po index 1e4166b..3962b42 100644 --- a/po/pt.po +++ b/po/pt.po @@ -383,6 +383,9 @@ msgstr "erro na cria msgid "allow caller to override the pinentry" msgstr "" +msgid "allow passphrase to be prompted through Emacs" +msgstr "" + #, fuzzy #| msgid "not supported" msgid "enable ssh support" @@ -5352,6 +5355,14 @@ msgstr "armadura: %s\n" msgid "trustdb: sync failed: %s\n" msgstr "base de dados de confian?a: sincroniza??o falhou: %s\n" +#, fuzzy, c-format +msgid "can't create lock for '%s'\n" +msgstr "imposs?vel criar `%s': %s\n" + +#, fuzzy, c-format +msgid "can't lock '%s'\n" +msgstr "imposs?vel abrir `%s'\n" + #, c-format msgid "trustdb rec %lu: lseek failed: %s\n" msgstr "base de dados de confian?a rec %lu: lseek falhou: %s\n" @@ -5371,14 +5382,6 @@ msgstr "imposs msgid "%s: directory does not exist!\n" msgstr "%s: diretoria inexistente!\n" -#, fuzzy, c-format -msgid "can't create lock for '%s'\n" -msgstr "imposs?vel criar `%s': %s\n" - -#, fuzzy, c-format -msgid "can't lock '%s'\n" -msgstr "imposs?vel abrir `%s'\n" - #, c-format msgid "%s: failed to create version record: %s" msgstr "%s: falha ao criar registo de vers?o: %s" diff --git a/po/ro.po b/po/ro.po index 830ef04..d71286c 100644 --- a/po/ro.po +++ b/po/ro.po @@ -393,6 +393,9 @@ msgstr "eroare la crearea frazei-parol msgid "allow caller to override the pinentry" msgstr "" +msgid "allow passphrase to be prompted through Emacs" +msgstr "" + #, fuzzy #| msgid "not supported" msgid "enable ssh support" @@ -5339,6 +5342,16 @@ msgstr "eroare citire msgid "trustdb: sync failed: %s\n" msgstr "trustdb: sincronizarea a e?uat: %s\n" +#, fuzzy, c-format +#| msgid "can't create lock for `%s'\n" +msgid "can't create lock for '%s'\n" +msgstr "nu pot crea ?ncuietoare (lock) pentru `%s'\n" + +#, fuzzy, c-format +#| msgid "can't lock `%s'\n" +msgid "can't lock '%s'\n" +msgstr "nu pot ?ncuia (lock) `%s'\n" + #, c-format msgid "trustdb rec %lu: lseek failed: %s\n" msgstr "trustdb rec %lu: lseek a e?uat: %s\n" @@ -5359,16 +5372,6 @@ msgstr "nu pot accesa `%s': %s\n" msgid "%s: directory does not exist!\n" msgstr "%s: directorul nu exist?!\n" -#, fuzzy, c-format -#| msgid "can't create lock for `%s'\n" -msgid "can't create lock for '%s'\n" -msgstr "nu pot crea ?ncuietoare (lock) pentru `%s'\n" - -#, fuzzy, c-format -#| msgid "can't lock `%s'\n" -msgid "can't lock '%s'\n" -msgstr "nu pot ?ncuia (lock) `%s'\n" - #, c-format msgid "%s: failed to create version record: %s" msgstr "%s: am e?uat s? creez ?nregistrare versiune: %s" diff --git a/po/ru.po b/po/ru.po index 5475d54..5a27736 100644 --- a/po/ru.po +++ b/po/ru.po @@ -36,7 +36,6 @@ msgstr "|pinentry-label|_OK" msgid "|pinentry-label|_Cancel" msgstr "|pinentry-label|???????????? (_C)" -#| msgid "|pinentry-label|_OK" msgid "|pinentry-label|_Yes" msgstr "|pinentry-label|???? (_Y)" @@ -46,7 +45,6 @@ msgstr "|pinentry-label|?????? (_N)" msgid "|pinentry-label|PIN:" msgstr "|pinentry-label|PIN:" -#| msgid "|pinentry-label|_Cancel" msgid "|pinentry-label|_Save in password manager" msgstr "|pinentry-label|?????????????????? ?? ???????????????????? ?????????????? (_S)" @@ -374,6 +372,9 @@ msgstr "?????????????????? ?????????????????????????????????? ??????????-?????? msgid "allow caller to override the pinentry" msgstr "?????????????????? ???????????????? ???????????????? ?????????? pinentry" +msgid "allow passphrase to be prompted through Emacs" +msgstr "" + msgid "enable ssh support" msgstr "???????????????? ?????????????????? ssh" @@ -5052,6 +5053,14 @@ msgid "trustdb: sync failed: %s\n" msgstr "?????????????? ??????????????: ???????? ??????????????????????????: %s\n" #, c-format +msgid "can't create lock for '%s'\n" +msgstr "???????????????????? ?????????????? ???????????????????? ?????? '%s'\n" + +#, c-format +msgid "can't lock '%s'\n" +msgstr "???????????????????? ?????????????????????????? '%s'\n" + +#, c-format msgid "trustdb rec %lu: lseek failed: %s\n" msgstr "?????????????? ??????????????, ???????????? %lu: ???????? lseek: %s\n" @@ -5071,14 +5080,6 @@ msgid "%s: directory does not exist!\n" msgstr "%s: ?????????????? ???? ????????????????????!\n" #, c-format -msgid "can't create lock for '%s'\n" -msgstr "???????????????????? ?????????????? ???????????????????? ?????? '%s'\n" - -#, c-format -msgid "can't lock '%s'\n" -msgstr "???????????????????? ?????????????????????????? '%s'\n" - -#, c-format msgid "%s: failed to create version record: %s" msgstr "%s: ???????? ???????????????? ???????????? ?? ????????????: %s" diff --git a/po/sk.po b/po/sk.po index e00fb22..1d34221 100644 --- a/po/sk.po +++ b/po/sk.po @@ -381,6 +381,9 @@ msgstr "chyba pri vytv msgid "allow caller to override the pinentry" msgstr "" +msgid "allow passphrase to be prompted through Emacs" +msgstr "" + #, fuzzy #| msgid "not supported" msgid "enable ssh support" @@ -5366,6 +5369,14 @@ msgstr "chyba pri msgid "trustdb: sync failed: %s\n" msgstr "datab?za d?very: synchroniz?cia zlyhala %s\n" +#, fuzzy, c-format +msgid "can't create lock for '%s'\n" +msgstr "nem??em vytvori? `%s': %s\n" + +#, fuzzy, c-format +msgid "can't lock '%s'\n" +msgstr "nemo?no otvori? `%s'\n" + #, c-format msgid "trustdb rec %lu: lseek failed: %s\n" msgstr "z?znam v datab?ze d?very %lu: lseek() sa nepodaril: %s\n" @@ -5385,14 +5396,6 @@ msgstr "nem msgid "%s: directory does not exist!\n" msgstr "%s: adres?r neexistuje!\n" -#, fuzzy, c-format -msgid "can't create lock for '%s'\n" -msgstr "nem??em vytvori? `%s': %s\n" - -#, fuzzy, c-format -msgid "can't lock '%s'\n" -msgstr "nemo?no otvori? `%s'\n" - #, c-format msgid "%s: failed to create version record: %s" msgstr "%s: nepodarilo sa vytvori? z?znam verzie: %s" diff --git a/po/sv.po b/po/sv.po index 87717ae..aae01e8 100644 --- a/po/sv.po +++ b/po/sv.po @@ -427,6 +427,9 @@ msgstr "till??t f??rinst??llning av l??senfras" msgid "allow caller to override the pinentry" msgstr "" +msgid "allow passphrase to be prompted through Emacs" +msgstr "" + #, fuzzy #| msgid "enable ssh-agent emulation" msgid "enable ssh support" @@ -5446,6 +5449,17 @@ msgstr "l??sfel i \"%s\": %s\n" msgid "trustdb: sync failed: %s\n" msgstr "tillitsdatabas: synkronisering misslyckades: %s\n" +#, fuzzy, c-format +#| msgid "can't create lock for `%s'\n" +msgid "can't create lock for '%s'\n" +msgstr "kan inte skapa l??s f??r \"%s\"\n" + +# se f??rra kommentaren +#, fuzzy, c-format +#| msgid "can't lock `%s'\n" +msgid "can't lock '%s'\n" +msgstr "kan inte l??sa \"%s\"\n" + #, c-format msgid "trustdb rec %lu: lseek failed: %s\n" msgstr "tillitsdatabasposten %lu: lseek misslyckades: %s\n" @@ -5466,17 +5480,6 @@ msgstr "kan inte komma ??t \"%s\": %s\n" msgid "%s: directory does not exist!\n" msgstr "%s: katalogen finns inte!\n" -#, fuzzy, c-format -#| msgid "can't create lock for `%s'\n" -msgid "can't create lock for '%s'\n" -msgstr "kan inte skapa l??s f??r \"%s\"\n" - -# se f??rra kommentaren -#, fuzzy, c-format -#| msgid "can't lock `%s'\n" -msgid "can't lock '%s'\n" -msgstr "kan inte l??sa \"%s\"\n" - #, c-format msgid "%s: failed to create version record: %s" msgstr "%s: misslyckades med att skapa versionspost: %s" diff --git a/po/tr.po b/po/tr.po index e1b3124..c47a67d 100644 --- a/po/tr.po +++ b/po/tr.po @@ -396,6 +396,9 @@ msgstr "anahtar parolas??n??n ??nceden atanmas??na izin verilir" msgid "allow caller to override the pinentry" msgstr "" +msgid "allow passphrase to be prompted through Emacs" +msgstr "" + #, fuzzy #| msgid "enable ssh-agent emulation" msgid "enable ssh support" @@ -5382,6 +5385,16 @@ msgstr "`%s' i??in okuma hatas??: %s\n" msgid "trustdb: sync failed: %s\n" msgstr "g??vence veritaban??: e??zamanlama ba??ar??s??z: %s\n" +#, fuzzy, c-format +#| msgid "can't create lock for `%s'\n" +msgid "can't create lock for '%s'\n" +msgstr "`%s' i??in kilit olu??turulam??yor\n" + +#, fuzzy, c-format +#| msgid "can't lock `%s'\n" +msgid "can't lock '%s'\n" +msgstr "`%s' kiltlenemedi\n" + #, c-format msgid "trustdb rec %lu: lseek failed: %s\n" msgstr "g??vence veritaban?? %lu kayd??: eri??im ba??ar??s??z: %s\n" @@ -5402,16 +5415,6 @@ msgstr "'%s' eri??ilemiyor: %s\n" msgid "%s: directory does not exist!\n" msgstr "%s: dizin yok!\n" -#, fuzzy, c-format -#| msgid "can't create lock for `%s'\n" -msgid "can't create lock for '%s'\n" -msgstr "`%s' i??in kilit olu??turulam??yor\n" - -#, fuzzy, c-format -#| msgid "can't lock `%s'\n" -msgid "can't lock '%s'\n" -msgstr "`%s' kiltlenemedi\n" - #, c-format msgid "%s: failed to create version record: %s" msgstr "%s: s??r??m kayd?? olu??turmada ba??ar??s??z: %s" diff --git a/po/uk.po b/po/uk.po index 1bab67c..21911c7 100644 --- a/po/uk.po +++ b/po/uk.po @@ -379,6 +379,9 @@ msgstr "?????????????????? ?????????????????? ???????????????????????? ???????? msgid "allow caller to override the pinentry" msgstr "?????????????????? ?????????????? ?????????????? ?????????????????????????? pinentry" +msgid "allow passphrase to be prompted through Emacs" +msgstr "" + msgid "enable ssh support" msgstr "?????????????????? ?????????????????? ssh" @@ -5153,6 +5156,14 @@ msgid "trustdb: sync failed: %s\n" msgstr "trustdb: ?????????????? ??????????????????????????: %s\n" #, c-format +msgid "can't create lock for '%s'\n" +msgstr "???? ?????????????? ???????????????? ???????????????????? ?????? ??%s??\n" + +#, c-format +msgid "can't lock '%s'\n" +msgstr "???? ?????????????? ?????????????????????? ??%s??\n" + +#, c-format msgid "trustdb rec %lu: lseek failed: %s\n" msgstr "?????????? trustdb %lu: ?????????????? lseek: %s\n" @@ -5172,14 +5183,6 @@ msgid "%s: directory does not exist!\n" msgstr "%s: ???????????????? ???? ??????????!\n" #, c-format -msgid "can't create lock for '%s'\n" -msgstr "???? ?????????????? ???????????????? ???????????????????? ?????? ??%s??\n" - -#, c-format -msgid "can't lock '%s'\n" -msgstr "???? ?????????????? ?????????????????????? ??%s??\n" - -#, c-format msgid "%s: failed to create version record: %s" msgstr "%s: ???? ?????????????? ???????????????? ?????????? ???????? ????????????: %s" diff --git a/po/zh_CN.po b/po/zh_CN.po index 26ff559..301c432 100644 --- a/po/zh_CN.po +++ b/po/zh_CN.po @@ -390,6 +390,9 @@ msgstr "????????????????????????????????????%s\n" msgid "allow caller to override the pinentry" msgstr "" +msgid "allow passphrase to be prompted through Emacs" +msgstr "" + #, fuzzy #| msgid "not supported" msgid "enable ssh support" @@ -5199,6 +5202,16 @@ msgstr "?????????%s????????????%s\n" msgid "trustdb: sync failed: %s\n" msgstr "????????????????????????????????????%s\n" +#, fuzzy, c-format +#| msgid "can't create lock for `%s'\n" +msgid "can't create lock for '%s'\n" +msgstr "????????????%s???????????????\n" + +#, fuzzy, c-format +#| msgid "can't lock `%s'\n" +msgid "can't lock '%s'\n" +msgstr "???????????????%s???\n" + #, c-format msgid "trustdb rec %lu: lseek failed: %s\n" msgstr "???????????????????????? %lu???lseek ?????????%s\n" @@ -5219,16 +5232,6 @@ msgstr "???????????????%s??????%s\n" msgid "%s: directory does not exist!\n" msgstr "%s?????????????????????\n" -#, fuzzy, c-format -#| msgid "can't create lock for `%s'\n" -msgid "can't create lock for '%s'\n" -msgstr "????????????%s???????????????\n" - -#, fuzzy, c-format -#| msgid "can't lock `%s'\n" -msgid "can't lock '%s'\n" -msgstr "???????????????%s???\n" - #, c-format msgid "%s: failed to create version record: %s" msgstr "%s??????????????????????????????%s" diff --git a/po/zh_TW.po b/po/zh_TW.po index f355074..53a18c6 100644 --- a/po/zh_TW.po +++ b/po/zh_TW.po @@ -368,6 +368,9 @@ msgstr "????????????????????????" msgid "allow caller to override the pinentry" msgstr "" +msgid "allow passphrase to be prompted through Emacs" +msgstr "" + msgid "enable ssh support" msgstr "?????? ssh ??????" @@ -4969,6 +4972,14 @@ msgid "trustdb: sync failed: %s\n" msgstr "???????????????: ???????????????: %s\n" #, c-format +msgid "can't create lock for '%s'\n" +msgstr "????????? '%s' ????????????\n" + +#, c-format +msgid "can't lock '%s'\n" +msgstr "???????????? '%s'\n" + +#, c-format msgid "trustdb rec %lu: lseek failed: %s\n" msgstr "????????????????????? %lu: ??????????????????: %s\n" @@ -4988,14 +4999,6 @@ msgid "%s: directory does not exist!\n" msgstr "%s: ???????????????!\n" #, c-format -msgid "can't create lock for '%s'\n" -msgstr "????????? '%s' ????????????\n" - -#, c-format -msgid "can't lock '%s'\n" -msgstr "???????????? '%s'\n" - -#, c-format msgid "%s: failed to create version record: %s" msgstr "%s: ????????????????????????: %s" commit 6ac0042cffc8cb67ebd8fc2098b278f62126bdc0 Author: Werner Koch Date: Thu Jun 11 13:04:31 2015 +0200 po: Update German translation -- diff --git a/po/de.po b/po/de.po index 1789dc2..80586f0 100644 --- a/po/de.po +++ b/po/de.po @@ -9,7 +9,7 @@ msgid "" msgstr "" "Project-Id-Version: gnupg-2.1.0\n" "Report-Msgid-Bugs-To: translations at gnupg.org\n" -"PO-Revision-Date: 2015-05-12 13:19+0200\n" +"PO-Revision-Date: 2015-06-11 13:03+0200\n" "Last-Translator: Werner Koch \n" "Language-Team: German \n" "Language: de\n" @@ -377,6 +377,9 @@ msgstr "Erlaube ein \"preset\" von Passphrases" msgid "allow caller to override the pinentry" msgstr "Aufrufer darf das Pinentry ersetzen" +msgid "allow passphrase to be prompted through Emacs" +msgstr "Erlaube die Eingabe einer Passphrase ??ber Emacs" + msgid "enable ssh support" msgstr "SSH Unterst??tzung einschalten" @@ -5183,6 +5186,14 @@ msgid "trustdb: sync failed: %s\n" msgstr "\"Trust-DB\": sync fehlgeschlagen: %s\n" #, c-format +msgid "can't create lock for '%s'\n" +msgstr "Datei `%s' konnte nicht gesperrt werden\n" + +#, c-format +msgid "can't lock '%s'\n" +msgstr "'%s' kann nicht gesperrt werden\n" + +#, c-format msgid "trustdb rec %lu: lseek failed: %s\n" msgstr "trustdb Satz %lu: lseek fehlgeschlagen: %s\n" @@ -5202,14 +5213,6 @@ msgid "%s: directory does not exist!\n" msgstr "%s: Verzeichnis existiert nicht!\n" #, c-format -msgid "can't create lock for '%s'\n" -msgstr "Datei `%s' konnte nicht gesperrt werden\n" - -#, c-format -msgid "can't lock '%s'\n" -msgstr "'%s' kann nicht gesperrt werden\n" - -#, c-format msgid "%s: failed to create version record: %s" msgstr "%s: Fehler beim Erzeugen des Versionsatzes: %s" commit 82eaa9074dd1756e9d210592db4edd7f30a3de22 Author: Ineiev Date: Thu Jun 11 13:01:17 2015 +0200 po: Update Russian translation -- diff --git a/po/ru.po b/po/ru.po index c5e5db2..5475d54 100644 --- a/po/ru.po +++ b/po/ru.po @@ -11,7 +11,7 @@ msgid "" msgstr "" "Project-Id-Version: GnuPG 2.1.0\n" "Report-Msgid-Bugs-To: translations at gnupg.org\n" -"PO-Revision-Date: 2015-02-12 17:17+0000\n" +"PO-Revision-Date: 2015-05-23 17:17+0000\n" "Last-Translator: Ineiev \n" "Language-Team: Russian \n" "Language: ru\n" @@ -36,36 +36,28 @@ msgstr "|pinentry-label|_OK" msgid "|pinentry-label|_Cancel" msgstr "|pinentry-label|???????????? (_C)" -#, fuzzy #| msgid "|pinentry-label|_OK" msgid "|pinentry-label|_Yes" -msgstr "|pinentry-label|_OK" +msgstr "|pinentry-label|???? (_Y)" -#, fuzzy -#| msgid "|pinentry-label|_OK" msgid "|pinentry-label|_No" -msgstr "|pinentry-label|_OK" +msgstr "|pinentry-label|?????? (_N)" msgid "|pinentry-label|PIN:" msgstr "|pinentry-label|PIN:" -#, fuzzy #| msgid "|pinentry-label|_Cancel" msgid "|pinentry-label|_Save in password manager" -msgstr "|pinentry-label|???????????? (_C)" +msgstr "|pinentry-label|?????????????????? ?? ???????????????????? ?????????????? (_S)" -#, fuzzy -#| msgid "Do you really want to permanently delete the OpenPGP secret key:" msgid "Do you really want to make your passphrase visible on the screen?" -msgstr "???? ?????????????????????????? ???????????? ???????????????? ?????????????? ???????????????? ???????? OpenPGP:" +msgstr "???? ?????????????????????????? ????????????, ?????????? ??????????-???????????? ???????? ?????????? ???? ?????????????" msgid "|pinentry-tt|Make passphrase visible" -msgstr "" +msgstr "|pinentry-tt|???????????????????? ??????????-????????????" -#, fuzzy -#| msgid "Enter new passphrase" msgid "|pinentry-tt|Hide passphrase" -msgstr "?????????????? ?????????? ??????????-????????????" +msgstr "pinentry-tt|???????????????? ??????????-????????????" #. TRANSLATORS: This string is displayed by Pinentry as the label #. for the quality bar. @@ -355,10 +347,8 @@ msgstr "|PGM|???????????????????????? ?????????????????? PGM ?????? ?????????? msgid "do not use the SCdaemon" msgstr "???? ???????????????????????? ?????????? ?????????????????????????????????? ????????" -#, fuzzy -#| msgid "|NAME|connect to host NAME" msgid "|NAME|accept some commands via NAME" -msgstr "|NAME|???????????????????????? ?? ?????????? NAME" +msgstr "|NAME|?????????????????? ?????????????????? ?????????????? ???? NAME" msgid "ignore requests to change the TTY" msgstr "???????????????????????? ?????????????? ?????????? ??????????????????" @@ -372,10 +362,8 @@ msgstr "|N|???????????????????? ?????????????????????? PIN ?????????? N ???????? msgid "do not use the PIN cache when signing" msgstr "???? ???????????????????????? ?????????????????????? PIN ?????? ????????????????????????" -#, fuzzy -#| msgid "do not allow the reuse of old passphrases" msgid "disallow the use of an external password cache" -msgstr "???? ?????????????????? ?????????????????? ?????????????????????????? ???????????? ????????-??????????????" +msgstr "???? ?????????????????? ???????????????????????? ?????????????? ?????????????? ??????????????" msgid "disallow clients to mark keys as \"trusted\"" msgstr "???? ?????????????????? ???????????????? ???????????????? ?????????? ?????? \"????????????????????\"" @@ -1708,10 +1696,8 @@ msgstr "?????????????? ?????????? ???????? ????????????" msgid "quickly generate a new key pair" msgstr "???????????? ?????????????? ?????????? ???????? ????????????" -#, fuzzy -#| msgid "quickly generate a new key pair" msgid "quickly add a new user-id" -msgstr "???????????? ?????????????? ?????????? ???????? ????????????" +msgstr "???????????? ???????????????? ?????????? ID ????????????????????????" msgid "full featured key pair generation" msgstr "???????????????? ?????????????????????? ???????? ????????????" @@ -4019,7 +4005,7 @@ msgid "%s: keyring created\n" msgstr "%s: ?????????????? ???????????? ??????????????\n" msgid "override proxy options set for dirmngr" -msgstr "" +msgstr "?????????????????????????? ?????????????????? ???????????????????????????? ?????????????? ?????? dirmngr" msgid "include revoked keys in search results" msgstr "???????????????? ?? ???????????????????? ???????????? ???????????????????? ??????????" @@ -4028,7 +4014,7 @@ msgid "include subkeys when searching by key ID" msgstr "???????????? ???? ID ??????????, ?????????????? ????????????????" msgid "override timeout options set for dirmngr" -msgstr "" +msgstr "?????????????????????????? ?????????????????? ?????????????? ???????????????? ?????? dirmngr" msgid "automatically retrieve keys when verifying signatures" msgstr "?????????????????????????? ???????????????? ?????????? ?????? ???????????????? ????????????????" ----------------------------------------------------------------------- Summary of changes: NEWS | 16 +++++++++++++++- configure.ac | 2 +- doc/mkdefsinc.c | 10 ++++++++++ po/ca.po | 19 +++++++++++-------- po/cs.po | 19 +++++++++++-------- po/da.po | 23 ++++++++++++---------- po/de.po | 21 +++++++++++--------- po/el.po | 19 +++++++++++-------- po/eo.po | 19 +++++++++++-------- po/es.po | 23 ++++++++++++---------- po/et.po | 19 +++++++++++-------- po/fi.po | 19 +++++++++++-------- po/fr.po | 19 +++++++++++-------- po/gl.po | 19 +++++++++++-------- po/hu.po | 19 +++++++++++-------- po/id.po | 19 +++++++++++-------- po/it.po | 19 +++++++++++-------- po/ja.po | 19 +++++++++++-------- po/nb.po | 23 ++++++++++++---------- po/pl.po | 23 ++++++++++++---------- po/pt.po | 19 +++++++++++-------- po/ro.po | 23 ++++++++++++---------- po/ru.po | 59 ++++++++++++++++++++++----------------------------------- po/sk.po | 19 +++++++++++-------- po/sv.po | 25 +++++++++++++----------- po/tr.po | 23 ++++++++++++---------- po/uk.po | 19 +++++++++++-------- po/zh_CN.po | 23 ++++++++++++---------- po/zh_TW.po | 19 +++++++++++-------- 29 files changed, 342 insertions(+), 256 deletions(-) hooks/post-receive -- The GNU Privacy Guard http://git.gnupg.org From cvs at cvs.gnupg.org Thu Jun 11 16:09:14 2015 From: cvs at cvs.gnupg.org (by Werner Koch) Date: Thu, 11 Jun 2015 16:09:14 +0200 Subject: [git] gnupg-doc - branch, master, updated. 7140aea155040cb7b41ce952b43a8e822b118e94 Message-ID: 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 GnuPG website and other docs". The branch, master has been updated via 7140aea155040cb7b41ce952b43a8e822b118e94 (commit) from 0a448e2d98b92cdfa942a65dd151f561b337ee73 (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 7140aea155040cb7b41ce952b43a8e822b118e94 Author: Werner Koch Date: Thu Jun 11 16:03:22 2015 +0200 swdb: GnuPG 2.1.5 released. diff --git a/web/index.org b/web/index.org index a11216c..bf7bceb 100644 --- a/web/index.org +++ b/web/index.org @@ -64,6 +64,12 @@ The latest release news:\\ # GnuPG's latest news are available as [[http://feedvalidator.org/check.cgi?url%3Dhttps://www.gnupg.org/news.en.rss][RSS 2.0 compliant]] feed. Just # point or paste the [[news.en.rss][RSS file]] into your aggregator. +** GnuPG 2.1.5 released (2015-06-11) + +A new version of the /modern/ branch of GnuPG has been released. +Read the full [[https://lists.gnupg.org/pipermail/gnupg-announce/2015q2/000369.html][anouncement mail]] for details. + + ** GPGME 1.5.5 released (2015-06-08) GPGME 1.5.5 is now available. This release fixes a crash due to diff --git a/web/swdb.mac b/web/swdb.mac index 325d2ad..3f28686 100644 --- a/web/swdb.mac +++ b/web/swdb.mac @@ -17,14 +17,14 @@ # # GnuPG-2.1 # -#+macro: gnupg21_ver 2.1.4 +#+macro: gnupg21_ver 2.1.5 #+macro: gnupg21_branch master -#+macro: gnupg21_size 4771k -#+macro: gnupg21_sha1 ad68d65c54698e3c781e17864ab5918442df155a +#+macro: gnupg21_size 4791k +#+macro: gnupg21_sha1 02bbe32e1ef3b06b3ae3c60c955fb767a1aa0f2f # -#+macro: gnupg21_w32_ver 2.1.4_20150512 -#+macro: gnupg21_w32_size 2566k -#+macro: gnupg21_w32_sha1 d8f4a326c36578d05af5751abea668a15ea0aae1 +#+macro: gnupg21_w32_ver 2.1.5_20150611 +#+macro: gnupg21_w32_size 2567k +#+macro: gnupg21_w32_sha1 f705fb6ae7612428b33cc51e23e006cdbf958e5d # ----------------------------------------------------------------------- Summary of changes: web/index.org | 6 ++++++ web/swdb.mac | 12 ++++++------ 2 files changed, 12 insertions(+), 6 deletions(-) hooks/post-receive -- The GnuPG website and other docs http://git.gnupg.org From cvs at cvs.gnupg.org Mon Jun 15 07:35:01 2015 From: cvs at cvs.gnupg.org (by NIIBE Yutaka) Date: Mon, 15 Jun 2015 07:35:01 +0200 Subject: [git] GnuPG - branch, STABLE-BRANCH-2-0, updated. gnupg-2.0.28-7-g2371553 Message-ID: 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, STABLE-BRANCH-2-0 has been updated via 2371553af156b5f8d6282e42cb8891f0c986d3d3 (commit) via c30bcdeac0112680a61819c52ab90beb69fdc6c0 (commit) from 0de9aedf3eb73608eb4d1197b80e8cae6a0736a6 (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 2371553af156b5f8d6282e42cb8891f0c986d3d3 Author: NIIBE Yutaka Date: Thu May 28 17:08:37 2015 +0900 g10: Fix a race condition initially creating trustdb. * g10/tdbio.c (take_write_lock, release_write_lock): New. (put_record_into_cache, tdbio_sync, tdbio_end_transaction): Use new lock functions. (tdbio_set_dbname): Fix the race. (open_db): Don't call create_dotlock. -- (backported from commit fe5c6edaed78839303d67e01e141cfc6b5de9aec) GnuPG-bug-id: 1675 diff --git a/g10/tdbio.c b/g10/tdbio.c index 6e26108..84a0ba6 100644 --- a/g10/tdbio.c +++ b/g10/tdbio.c @@ -93,7 +93,33 @@ static int in_transaction; static void open_db(void); +static int +take_write_lock (void) +{ + if (!lockhandle) + lockhandle = create_dotlock (db_name); + if (!lockhandle) + log_fatal ( _("can't create lock for `%s'\n"), db_name ); + + if (!is_locked) + { + if (make_dotlock (lockhandle, -1) ) + log_fatal ( _("can't lock `%s'\n"), db_name ); + else + is_locked = 1; + return 0; + } + else + return 1; +} +static void +release_write_lock (void) +{ + if (!opt.lock_once) + if (!release_dotlock (lockhandle)) + is_locked = 0; +} /************************************* ************* record cache ********** @@ -249,12 +275,7 @@ put_record_into_cache( ulong recno, const char *data ) int n = dirty_count / 5; /* discard some dirty entries */ if( !n ) n = 1; - if( !is_locked ) { - if( make_dotlock( lockhandle, -1 ) ) - log_fatal("can't acquire lock - giving up\n"); - else - is_locked = 1; - } + take_write_lock (); for( unused = NULL, r = cache_list; r; r = r->next ) { if( r->flags.used && r->flags.dirty ) { int rc = write_cache_item( r ); @@ -268,10 +289,7 @@ put_record_into_cache( ulong recno, const char *data ) break; } } - if( !opt.lock_once ) { - if( !release_dotlock( lockhandle ) ) - is_locked = 0; - } + release_write_lock (); assert( unused ); r = unused; r->flags.used = 1; @@ -310,13 +328,9 @@ tdbio_sync() if( !cache_is_dirty ) return 0; - if( !is_locked ) { - if( make_dotlock( lockhandle, -1 ) ) - log_fatal("can't acquire lock - giving up\n"); - else - is_locked = 1; - did_lock = 1; - } + if (!take_write_lock ()) + did_lock = 1; + for( r = cache_list; r; r = r->next ) { if( r->flags.used && r->flags.dirty ) { int rc = write_cache_item( r ); @@ -325,10 +339,8 @@ tdbio_sync() } } cache_is_dirty = 0; - if( did_lock && !opt.lock_once ) { - if( !release_dotlock( lockhandle ) ) - is_locked = 0; - } + if (did_lock) + release_write_lock (); return 0; } @@ -365,20 +377,12 @@ tdbio_end_transaction() if( !in_transaction ) log_bug("tdbio: no active transaction\n"); - if( !is_locked ) { - if( make_dotlock( lockhandle, -1 ) ) - log_fatal("can't acquire lock - giving up\n"); - else - is_locked = 1; - } + take_write_lock (); block_all_signals(); in_transaction = 0; rc = tdbio_sync(); unblock_all_signals(); - if( !opt.lock_once ) { - if( !release_dotlock( lockhandle ) ) - is_locked = 0; - } + release_write_lock (); return rc; } @@ -476,6 +480,7 @@ int tdbio_set_dbname( const char *new_dbname, int create, int *r_nofile) { char *fname; + struct stat statbuf; static int initialized = 0; if( !initialized ) { @@ -497,12 +502,25 @@ tdbio_set_dbname( const char *new_dbname, int create, int *r_nofile) else fname = xstrdup (new_dbname); + xfree (db_name); + db_name = fname; + + /* + * Quick check for (likely) case where there is trustdb.gpg + * already. This check is not required in theory, but it helps in + * practice, avoiding costly operations of preparing and taking + * the lock. + */ + if (stat (fname, &statbuf) == 0 && statbuf.st_size > 0) + /* OK, we have the valid trustdb.gpg already. */ + return 0; + + take_write_lock (); + if( access( fname, R_OK ) ) { - if( errno != ENOENT ) { - log_error( _("can't access `%s': %s\n"), fname, strerror(errno) ); - xfree(fname); - return G10ERR_TRUSTDB; - } + if( errno != ENOENT ) + log_fatal( _("can't access `%s': %s\n"), fname, strerror(errno) ); + if (!create) *r_nofile = 1; else { @@ -532,16 +550,6 @@ tdbio_set_dbname( const char *new_dbname, int create, int *r_nofile) } *p = save_slash; - xfree(db_name); - db_name = fname; -#ifdef __riscos__ - if( !lockhandle ) - lockhandle = create_dotlock( db_name ); - if( !lockhandle ) - log_fatal( _("can't create lock for `%s'\n"), db_name ); - if( make_dotlock( lockhandle, -1 ) ) - log_fatal( _("can't lock `%s'\n"), db_name ); -#endif /* __riscos__ */ oldmask=umask(077); if (is_secured_filename (fname)) { fp = NULL; @@ -557,13 +565,6 @@ tdbio_set_dbname( const char *new_dbname, int create, int *r_nofile) if( db_fd == -1 ) log_fatal( _("can't open `%s': %s\n"), db_name, strerror(errno) ); -#ifndef __riscos__ - if( !lockhandle ) - lockhandle = create_dotlock( db_name ); - if( !lockhandle ) - log_fatal( _("can't create lock for `%s'\n"), db_name ); -#endif /* !__riscos__ */ - rc = create_version_record (); if( rc ) log_fatal( _("%s: failed to create version record: %s"), @@ -574,12 +575,10 @@ tdbio_set_dbname( const char *new_dbname, int create, int *r_nofile) if( !opt.quiet ) log_info(_("%s: trustdb created\n"), db_name); - - return 0; } } - xfree(db_name); - db_name = fname; + + release_write_lock (); return 0; } @@ -599,14 +598,6 @@ open_db() assert( db_fd == -1 ); - if (!lockhandle ) - lockhandle = create_dotlock( db_name ); - if (!lockhandle ) - log_fatal( _("can't create lock for `%s'\n"), db_name ); -#ifdef __riscos__ - if (make_dotlock( lockhandle, -1 ) ) - log_fatal( _("can't lock `%s'\n"), db_name ); -#endif /* __riscos__ */ db_fd = open (db_name, O_RDWR | MY_O_BINARY ); if (db_fd == -1 && (errno == EACCES #ifdef EROFS commit c30bcdeac0112680a61819c52ab90beb69fdc6c0 Author: NIIBE Yutaka Date: Mon Jun 15 13:58:07 2015 +0900 po:Update Japanese translation. diff --git a/po/ja.po b/po/ja.po index ad88b43..5ad7bc4 100644 --- a/po/ja.po +++ b/po/ja.po @@ -7,7 +7,7 @@ # msgid "" msgstr "" -"Project-Id-Version: GNU gnupg 2.0.27\n" +"Project-Id-Version: GNU gnupg 2.0.28\n" "Report-Msgid-Bugs-To: translations at gnupg.org\n" "PO-Revision-Date: 2015-06-02 13:05+0200\n" "Last-Translator: NIIBE Yutaka \n" @@ -33,41 +33,31 @@ msgstr "|pinentry-label|_OK" msgid "|pinentry-label|_Cancel" msgstr "|pinentry-label|_?????" -#, fuzzy -#| msgid "|pinentry-label|_OK" msgid "|pinentry-label|_Yes" -msgstr "|pinentry-label|_OK" +msgstr "|pinentry-label|_Yes" -#, fuzzy -#| msgid "|pinentry-label|_OK" msgid "|pinentry-label|_No" -msgstr "|pinentry-label|_OK" +msgstr "|pinentry-label|_No" msgid "|pinentry-label|PIN:" msgstr "|pinentry-label|PIN:" -#, fuzzy -#| msgid "|pinentry-label|_Cancel" msgid "|pinentry-label|_Save in password manager" -msgstr "|pinentry-label|_?????" +msgstr "|pinentry-label|_???????????????" -#, fuzzy -#| msgid "Do you really want to revoke the selected subkeys? (y/N) " msgid "Do you really want to make your passphrase visible on the screen?" -msgstr "????????????????? (y/N) " +msgstr "????????????????????????" msgid "|pinentry-tt|Make passphrase visible" -msgstr "" +msgstr "|pinentry-tt|???????????????" -#, fuzzy -#| msgid "Enter new passphrase" msgid "|pinentry-tt|Hide passphrase" -msgstr "??????????????????" +msgstr "|pinentry-tt|?????????" #. TRANSLATORS: This string is displayed by Pinentry as the label #. for the quality bar. msgid "Quality:" -msgstr "??: %s" +msgstr "??:" #. TRANSLATORS: This string is a tooltip, shown by pinentry when #. hovering over the quality bar. Please use an appropriate @@ -376,10 +366,8 @@ msgstr "ssh??????????" msgid "enable putty support" msgstr "putty??????????" -#, fuzzy -#| msgid "do not allow the reuse of old passphrases" msgid "disallow the use of an external password cache" -msgstr "?????????????????????" +msgstr "?????????????????????" msgid "|FILE|write environment settings also to FILE" msgstr "|FILE|FILE?????????????" @@ -5178,12 +5166,10 @@ msgid "keyword too long" msgstr "???????????" msgid "missing argument" -msgstr "???????" +msgstr "????????" -#, fuzzy -#| msgid "invalid value\n" msgid "invalid argument" -msgstr "????\n" +msgstr "?????\n" msgid "invalid command" msgstr "???????" @@ -5201,10 +5187,9 @@ msgstr "????????" msgid "missing argument for option \"%.50s\"\n" msgstr "?????\"%.50s\"?????????\n" -#, fuzzy, c-format -#| msgid "missing argument for option \"%.50s\"\n" +#, c-format msgid "invalid argument for option \"%.50s\"\n" -msgstr "?????\"%.50s\"?????????\n" +msgstr "?????\"%.50s\"????????\n" #, c-format msgid "option \"%.50s\" does not expect an argument\n" ----------------------------------------------------------------------- Summary of changes: g10/tdbio.c | 121 ++++++++++++++++++++++++++++-------------------------------- po/ja.po | 41 +++++++------------- 2 files changed, 69 insertions(+), 93 deletions(-) hooks/post-receive -- The GNU Privacy Guard http://git.gnupg.org From cvs at cvs.gnupg.org Mon Jun 15 07:42:34 2015 From: cvs at cvs.gnupg.org (by NIIBE Yutaka) Date: Mon, 15 Jun 2015 07:42:34 +0200 Subject: [git] GnuPG - branch, STABLE-BRANCH-1-4, updated. gnupg-1.4.19-7-g6f992d9 Message-ID: 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, STABLE-BRANCH-1-4 has been updated via 6f992d94ea708535b2f3a3de22b429401d59fac9 (commit) from f3b00d88efa25e23f70b757cf99302af77d3d7ae (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 6f992d94ea708535b2f3a3de22b429401d59fac9 Author: NIIBE Yutaka Date: Mon Jun 15 14:38:05 2015 +0900 g10: Fix a race condition initially creating trustdb. * g10/tdbio.c (take_write_lock, release_write_lock): New. (put_record_into_cache, tdbio_sync, tdbio_end_transaction): Use new lock functions. (tdbio_set_dbname): Fix the race. (open_db): Don't call dotlock_create. -- (backported from 2.1 commit fe5c6edaed78839303d67e01e141cfc6b5de9aec) GnuPG-bug-id: 1675 diff --git a/g10/tdbio.c b/g10/tdbio.c index 403b608..579db63 100644 --- a/g10/tdbio.c +++ b/g10/tdbio.c @@ -94,7 +94,33 @@ static int in_transaction; static void open_db(void); static void migrate_from_v2 (void); +static int +take_write_lock (void) +{ + if (!lockhandle) + lockhandle = dotlock_create (db_name, 0); + if (!lockhandle) + log_fatal ( _("can't create lock for '%s'\n"), db_name ); + if (!is_locked) + { + if (dotlock_take (lockhandle, -1) ) + log_fatal ( _("can't lock '%s'\n"), db_name ); + else + is_locked = 1; + return 0; + } + else + return 1; +} + +static void +release_write_lock (void) +{ + if (!opt.lock_once) + if (!dotlock_release (lockhandle)) + is_locked = 0; +} /************************************* ************* record cache ********** @@ -247,12 +273,7 @@ put_record_into_cache( ulong recno, const char *data ) int n = dirty_count / 5; /* discard some dirty entries */ if( !n ) n = 1; - if( !is_locked ) { - if (dotlock_take (lockhandle, -1)) - log_fatal("can't acquire lock - giving up\n"); - else - is_locked = 1; - } + take_write_lock (); for( unused = NULL, r = cache_list; r; r = r->next ) { if( r->flags.used && r->flags.dirty ) { int rc = write_cache_item( r ); @@ -266,10 +287,7 @@ put_record_into_cache( ulong recno, const char *data ) break; } } - if( !opt.lock_once ) { - if (!dotlock_release (lockhandle)) - is_locked = 0; - } + release_write_lock (); assert( unused ); r = unused; r->flags.used = 1; @@ -308,13 +326,9 @@ tdbio_sync() if( !cache_is_dirty ) return 0; - if( !is_locked ) { - if (dotlock_take (lockhandle, -1)) - log_fatal("can't acquire lock - giving up\n"); - else - is_locked = 1; - did_lock = 1; - } + if (!take_write_lock ()) + did_lock = 1; + for( r = cache_list; r; r = r->next ) { if( r->flags.used && r->flags.dirty ) { int rc = write_cache_item( r ); @@ -323,10 +337,8 @@ tdbio_sync() } } cache_is_dirty = 0; - if( did_lock && !opt.lock_once ) { - if (!dotlock_release (lockhandle)) - is_locked = 0; - } + if (did_lock) + release_write_lock (); return 0; } @@ -363,20 +375,12 @@ tdbio_end_transaction() if( !in_transaction ) log_bug("tdbio: no active transaction\n"); - if( !is_locked ) { - if (dotlock_take (lockhandle, -1)) - log_fatal("can't acquire lock - giving up\n"); - else - is_locked = 1; - } + take_write_lock (); block_all_signals(); in_transaction = 0; rc = tdbio_sync(); unblock_all_signals(); - if( !opt.lock_once ) { - if (!dotlock_release (lockhandle)) - is_locked = 0; - } + release_write_lock (); return rc; } @@ -474,6 +478,7 @@ int tdbio_set_dbname( const char *new_dbname, int create, int *r_nofile) { char *fname; + struct stat statbuf; static int initialized = 0; if( !initialized ) { @@ -495,12 +500,25 @@ tdbio_set_dbname( const char *new_dbname, int create, int *r_nofile) else fname = xstrdup (new_dbname); + xfree (db_name); + db_name = fname; + + /* + * Quick check for (likely) case where there is trustdb.gpg + * already. This check is not required in theory, but it helps in + * practice, avoiding costly operations of preparing and taking + * the lock. + */ + if (stat (fname, &statbuf) == 0 && statbuf.st_size > 0) + /* OK, we have the valid trustdb.gpg already. */ + return 0; + + take_write_lock (); + if( access( fname, R_OK ) ) { - if( errno != ENOENT ) { - log_error( _("can't access `%s': %s\n"), fname, strerror(errno) ); - xfree(fname); - return G10ERR_TRUSTDB; - } + if( errno != ENOENT ) + log_fatal( _("can't access '%s': %s\n"), fname, strerror(errno) ); + if (!create) *r_nofile = 1; else { @@ -519,16 +537,6 @@ tdbio_set_dbname( const char *new_dbname, int create, int *r_nofile) } *p = DIRSEP_C; - xfree(db_name); - db_name = fname; -#ifdef __riscos__ - if( !lockhandle ) - lockhandle = dotlock_create (db_name, 0); - if( !lockhandle ) - log_fatal( _("can't create lock for `%s'\n"), db_name ); - if (dotlock_take (lockhandle, -1)) - log_fatal( _("can't lock `%s'\n"), db_name ); -#endif /* __riscos__ */ oldmask=umask(077); if (is_secured_filename (fname)) { fp = NULL; @@ -544,13 +552,6 @@ tdbio_set_dbname( const char *new_dbname, int create, int *r_nofile) if( db_fd == -1 ) log_fatal( _("can't open `%s': %s\n"), db_name, strerror(errno) ); -#ifndef __riscos__ - if( !lockhandle ) - lockhandle = dotlock_create (db_name, 0); - if( !lockhandle ) - log_fatal( _("can't create lock for `%s'\n"), db_name ); -#endif /* !__riscos__ */ - rc = create_version_record (); if( rc ) log_fatal( _("%s: failed to create version record: %s"), @@ -561,12 +562,10 @@ tdbio_set_dbname( const char *new_dbname, int create, int *r_nofile) if( !opt.quiet ) log_info(_("%s: trustdb created\n"), db_name); - - return 0; } } - xfree(db_name); - db_name = fname; + + release_write_lock (); return 0; } @@ -588,14 +587,6 @@ open_db() assert( db_fd == -1 ); - if (!lockhandle ) - lockhandle = dotlock_create (db_name, 0); - if (!lockhandle ) - log_fatal( _("can't create lock for `%s'\n"), db_name ); -#ifdef __riscos__ - if (dotlock_take (lockhandle, -1)) - log_fatal( _("can't lock `%s'\n"), db_name ); -#endif /* __riscos__ */ db_fd = open (db_name, O_RDWR | MY_O_BINARY ); if (db_fd == -1 && (errno == EACCES #ifdef EROFS ----------------------------------------------------------------------- Summary of changes: g10/tdbio.c | 121 ++++++++++++++++++++++++++++-------------------------------- 1 file changed, 56 insertions(+), 65 deletions(-) hooks/post-receive -- The GNU Privacy Guard http://git.gnupg.org From cvs at cvs.gnupg.org Mon Jun 15 10:35:32 2015 From: cvs at cvs.gnupg.org (by Werner Koch) Date: Mon, 15 Jun 2015 10:35:32 +0200 Subject: [git] GPG-ERROR - branch, master, updated. libgpg-error-1.19-3-g13918d0 Message-ID: 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 "Error codes used by GnuPG et al.". The branch, master has been updated via 13918d05a333255d22aa6718dd467fcb8eaf80c8 (commit) from 4171d61a97d9628532db84b590a9c135f360fa90 (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 13918d05a333255d22aa6718dd467fcb8eaf80c8 Author: Werner Koch Date: Mon Jun 15 10:32:11 2015 +0200 Allow building with --disable-threads. * src/posix-lock-obj.h (LOCK_ABI_NOT_AVAILABLE): New. (LOCK_ABI_VERSION): Define depending on USE_POSIX_THREADS. (_gpgrt_lock_t) [!USE_POSIX_THREADS]: Do not define the union. * src/gen-posix-lock-obj.c: Take care of USE_POSIX_THREADS. * src/posix-lock.c (_gpgrt_lock_init, _gpgrt_lock_lock) (_gpgrt_lock_trylock, _gpgrt_lock_unlock) (_gpgrt_lock_destroy): Return success for a no-threads version. * tests/t-lock.c: Disable tests if threads are not available. * src/mkheader.c (main): Add NO-THREADS to the printed comment. * configure.ac: Show NO-TRHEADS in the final summary. -- Warning: Using --disable-threads creates a different ABI which we can't encode in the the cpu-vendor-os triplet. The run time checks should detect this and abort the process. Signed-off-by: Werner Koch diff --git a/configure.ac b/configure.ac index b6ca5fb..2f49bd1 100644 --- a/configure.ac +++ b/configure.ac @@ -532,11 +532,17 @@ AC_CONFIG_FILES([src/gpg-error-config], [chmod +x src/gpg-error-config]) AC_OUTPUT +tmp= +if test "$have_w32_system" != yes; then + if test x"$gl_use_threads" = xno; then + tmp=" NO-THREADS" + fi +fi echo " $PACKAGE_NAME-$PACKAGE_VERSION prepared for make Revision: mym4_revision (mym4_revision_dec) - Platform: $host + Platform: $host$tmp " if test "$gcry_cv_gcc_attribute_aligned" != "yes" ; then cat <vers == LOCK_ABI_NOT_AVAILABLE? 0 : GPG_ERR_NOT_IMPLEMENTED; #endif /* Unknown thread system. */ return rc; @@ -178,7 +178,7 @@ _gpgrt_lock_lock (gpgrt_lock_t *lockhd) else rc = 0; /* Threads are not used. */ #else /* Unknown thread system. */ - rc = GPG_ERR_NOT_IMPLEMENTED; + rc = lock->vers == LOCK_ABI_NOT_AVAILABLE? 0 : GPG_ERR_NOT_IMPLEMENTED; #endif /* Unknown thread system. */ return rc; @@ -201,7 +201,7 @@ _gpgrt_lock_trylock (gpgrt_lock_t *lockhd) else rc = 0; /* Threads are not used. */ #else /* Unknown thread system. */ - rc = GPG_ERR_NOT_IMPLEMENTED; + rc = lock->vers == LOCK_ABI_NOT_AVAILABLE? 0 : GPG_ERR_NOT_IMPLEMENTED; #endif /* Unknown thread system. */ return rc; @@ -224,7 +224,7 @@ _gpgrt_lock_unlock (gpgrt_lock_t *lockhd) else rc = 0; /* Threads are not used. */ #else /* Unknown thread system. */ - rc = GPG_ERR_NOT_IMPLEMENTED; + rc = lock->vers == LOCK_ABI_NOT_AVAILABLE? 0 : GPG_ERR_NOT_IMPLEMENTED; #endif /* Unknown thread system. */ return rc; @@ -255,7 +255,7 @@ _gpgrt_lock_destroy (gpgrt_lock_t *lockhd) else rc = 0; /* Threads are not used. */ #else /* Unknown thread system. */ - rc = GPG_ERR_NOT_IMPLEMENTED; + rc = lock->vers == LOCK_ABI_NOT_AVAILABLE? 0 : GPG_ERR_NOT_IMPLEMENTED; #endif /* Unknown thread system. */ return rc; diff --git a/tests/t-lock.c b/tests/t-lock.c index fd645eb..831e224 100644 --- a/tests/t-lock.c +++ b/tests/t-lock.c @@ -1,5 +1,5 @@ /* t-lock.c - Check the lock functions - * Copyright (C) 2013 g10 Code GmbH + * Copyright (C) 2013, 2015 g10 Code GmbH * * This file is part of libgpg-error. * @@ -105,6 +105,7 @@ print_accounts (void) } +#if defined(_WIN32) || defined(USE_POSIX_THREADS) /* Get a a random integer value in the range 0 to HIGH. */ static unsigned int get_rand (int high) @@ -190,6 +191,7 @@ accountant_thread (void *arg) } return THREAD_RET_VALUE; } +#endif /*_WIN32||USE_POSIX_THREADS*/ static void @@ -234,6 +236,7 @@ run_test (void) CloseHandle (rthread); #else /*!_WIN32*/ +# ifdef USE_POSIX_THREADS pthread_t rthread; pthread_t athreads[N_ACCOUNTANTS]; int i; @@ -253,7 +256,11 @@ run_test (void) stop_revision_thread = 1; pthread_join (rthread, NULL); show ("revision thread has terminated"); - +# else /*!USE_POSIX_THREADS*/ + verbose++; + show ("no thread support - skipping test\n", PGM); + verbose--; +# endif /*!USE_POSIX_THREADS*/ #endif /*!_WIN32*/ gpgrt_lock_destroy (&accounts_lock); ----------------------------------------------------------------------- Summary of changes: configure.ac | 8 ++++++- src/gen-posix-lock-obj.c | 60 +++++++++++++++++++++++++++++++++++++----------- src/mkheader.c | 5 ++++ src/posix-lock-obj.h | 9 +++++++- src/posix-lock.c | 10 ++++---- tests/t-lock.c | 11 +++++++-- 6 files changed, 80 insertions(+), 23 deletions(-) hooks/post-receive -- Error codes used by GnuPG et al. http://git.gnupg.org From cvs at cvs.gnupg.org Mon Jun 15 14:15:34 2015 From: cvs at cvs.gnupg.org (by Werner Koch) Date: Mon, 15 Jun 2015 14:15:34 +0200 Subject: [git] GnuPG - branch, master, updated. gnupg-2.1.5-2-gb89a592 Message-ID: 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 b89a592a2e85e3db381cdc5022f5dcd9c07a6745 (commit) from ee438d677560d3350a76286b2ef294323210f486 (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 b89a592a2e85e3db381cdc5022f5dcd9c07a6745 Author: Werner Koch Date: Mon Jun 15 14:12:43 2015 +0200 Added release date of older versions to NEWS. -- diff --git a/ChangeLog-2011 b/ChangeLog-2011 index cfba8f4..01601fa 100644 --- a/ChangeLog-2011 +++ b/ChangeLog-2011 @@ -1183,13 +1183,13 @@ 2002-10-19 Werner Koch - * configure.ac: Bumped version number to 1.9.0-cvs. + * configure.ac: Bumped version number to GnuPG 1.9.0-cvs. NewPG (Aegypten project) to GnuPG merge. 2002-09-20 Werner Koch - Released 0.9.2. + Released NewPG 0.9.2. 2002-09-05 Neal H. Walfield @@ -1203,14 +1203,14 @@ 2002-08-23 Werner Koch - Released 0.9.1. + Released NewPG 0.9.1. * acinclude.m4 (AM_PATH_LIBGCRYPT): Updated from Libgcrypt. (AM_PATH_OPENSC): Strip non-digits from the micro version. 2002-08-21 Werner Koch - Released 0.9.0. + Released NewPG 0.9.0. * configure.ac: Changed the default homedir to .gnupg. * README-alpha: Removed. @@ -1226,7 +1226,7 @@ 2002-08-10 Werner Koch - Released 0.3.10. + Released NewPG 0.3.10. * configure.ac (NEED_LIBKSBA_VERSION): Require 0.4.4. Add support for gettext. @@ -1237,7 +1237,7 @@ 2002-07-01 Werner Koch - Released 0.3.9. + Released NewPG 0.3.9. * README: Short note on how to export in pkcs-12 format. @@ -1254,7 +1254,7 @@ 2002-06-25 Werner Koch - Released 0.3.8. + Released NewPG 0.3.8. * configure.ac (NEED_LIBGCRYPT_VERSION): Set to 1.1.8. @@ -1264,7 +1264,7 @@ 2002-06-04 Werner Koch - Released 0.3.7. + Released NewPG 0.3.7. 2002-05-21 Werner Koch @@ -1277,7 +1277,7 @@ 2002-05-03 Werner Koch - Released 0.3.6. + Released NewPG 0.3.6. 2002-04-25 Werner Koch @@ -1289,7 +1289,7 @@ 2002-04-15 Werner Koch - Released 0.3.5. + Released NewPG 0.3.5. * NEWS: Started to describe release notes. @@ -1297,11 +1297,11 @@ 2002-04-01 Werner Koch - Released 0.3.4. + Released NewPG 0.3.4. 2002-03-18 Werner Koch - Released 0.3.3. + Released NewPG 0.3.3. 2002-03-08 Werner Koch @@ -1309,11 +1309,11 @@ 2002-03-06 Werner Koch - Released 0.3.2. + Released NewPG 0.3.2. 2002-03-04 Werner Koch - Released 0.3.1. + Released NewPG 0.3.1. * README: Explained some options and files. @@ -1335,7 +1335,7 @@ 2002-02-07 Werner Koch - Released 0.3.0. + Released NewPG 0.3.0. * configure.ac: Require libgcrypt 1.1.6. @@ -1361,7 +1361,7 @@ 2001-12-18 Werner Koch - Released 0.0.0. + Released NewPG 0.0.0. 2001-12-17 Werner Koch diff --git a/NEWS b/NEWS index b760eb0..a3d1e56 100644 --- a/NEWS +++ b/NEWS @@ -480,6 +480,23 @@ Noteworthy changes in version 2.1.0 (2014-11-06) debug-level keywords. +Version 2.0.28 (2015-06-02) +Version 2.0.27 (2015-02-18) +Version 2.0.26 (2014-08-12) +Version 2.0.25 (2014-06-30) +Version 2.0.24 (2014-06-24) +Version 2.0.23 (2014-06-03) +Version 2.0.22 (2013-10-04) +Version 2.0.21 (2013-08-19) +Version 2.0.20 (2013-05-10) +Version 2.0.19 (2012-03-27) +Version 2.0.18 (2011-08-04) +Version 2.0.17 (2011-01-13) +Version 2.0.16 (2010-07-19) +Version 2.0.15 (2010-03-09) +Version 2.0.14 (2009-12-21) + + Noteworthy changes in version 2.0.13 (2009-09-04) ------------------------------------------------- @@ -1199,8 +1216,1485 @@ Noteworthy changes in version 1.9.0 (2003-08-05) development branch. - Copyright 2002, 2003, 2004, 2005, 2006, 2007, - 2008, 2009, 2010, 2011 Free Software Foundation, Inc. +Version 1.4.19 (2015-02-27) +Version 1.4.18 (2014-06-30) +Version 1.4.17 (2014-06-23) +Version 1.4.16 (2013-12-18) +Version 1.4.15 (2013-10-04) +Version 1.4.14 (2013-07-25) +Version 1.4.13 (2012-12-20) +Version 1.4.12 (2012-01-30) +Version 1.4.11 (2010-10-18) +Version 1.4.10 (2009-09-02) +Version 1.4.9 (2008-03-26) +Version 1.4.8 (2007-12-20) +Version 1.4.7 (2007-03-05) +Version 1.4.6 (2006-12-06) +Version 1.4.5 (2006-08-01) +Version 1.4.4 (2006-06-25) +Version 1.4.3 (2006-04-03) +Version 1.4.2 (2005-07-26) +Version 1.4.1 (2005-03-15) +Version 1.4.0 (2004-12-16) + + +Noteworthy changes in version 1.3.2 (2003-05-27) +------------------------------------------------ + + * New "--gnupg" option (set by default) that disables --openpgp, + and the various --pgpX emulation options. This replaces + --no-openpgp, and --no-pgpX, and also means that GnuPG has + finally grown a --gnupg option to make GnuPG act like GnuPG. + + * A bug in key validation has been fixed. This bug only affects + keys with more than one user ID (photo IDs do not count here), + and results in all user IDs on a given key being treated with + the validity of the most-valid user ID on that key. + + * Notation names that do not contain a '@' are no longer allowed + unless --expert is set. This is to help prevent pollution of + the (as yet unused) IETF notation namespace. + + * Multiple trust models are now supported via the --trust-model + option. The options are "pgp" (web-of-trust plus trust + signatures), "classic" (web-of-trust only), and "always" + (identical to the --always-trust option). + + * The --personal-{cipher|digest|compression}-preferences are now + consulted to get default algorithms before resorting to the + last-ditch defaults of --s2k-cipher-algo, SHA1, and ZIP + respectively. This allows a user to set algorithms to use in a + safe manner so they are used when legal to do so, without + forcing them on for all messages. + + * New --primary-keyring option to designate the keyring that the + user wants new keys imported into. + + * --s2k-digest-algo is now used for all password mangling. + Earlier versions used both --s2k-digest-algo and --digest-algo + for passphrase mangling. + + * Handling of --hidden-recipient or --throw-keyid messages is now + easier - the user only needs to give their passphrase once, and + GnuPG will try it against all of the available secret keys. + + * Care is taken to prevent compiler optimization from removing + memory wiping code. + + * New option --no-mangle-dos-filenames so that filenames are not + truncated in the W32 version. + + * A "convert-from-106" script has been added. This is a simple + script that automates the conversion from a 1.0.6 or earlier + version of GnuPG to a 1.0.7 or later version. + + * Disabled keys are now skipped when selecting keys for + encryption. If you are using the --with-colons key listings to + detect disabled keys, please see doc/DETAILS for a minor format + change in this release. + + * Minor trustdb changes to make the trust calculations match + common usage. + + * New command "revuid" in the --edit-key menu to revoke a user ID. + This is a simpler interface to the old method (which still + works) of revoking the user ID self-signature. + + * Status VALIDSIG does now also print the primary key's + fingerprint, as well as the signature version, pubkey algorithm, + hash algorithm, and signature class. + + * Add read-only support for the SHA-256 hash, and optional + read-only support for the SHA-384 and SHA-512 hashes. + + * New option --enable-progress-filter for use with frontends. + + * DNS SRV records are used in HKP keyserver lookups to allow + administrators to load balance and select keyserver ports + automatically. This is as specified in + draft-shaw-openpgp-hkp-00.txt. + + * When using the "keyid!" syntax during a key export, only that + specified key is exported. If the key in question is a subkey, + the primary key plus only that subkey is exported. + + * configure --disable-xxx options to disable individual algorithms + at build time. This can be used to build a smaller gpg binary + for embedded uses where space is tight. See the README file for + the algorithms that can be used with this option, or use + --enable-minimal to build the smallest gpg possible (disables + all optional algorithms, disables keyserver access, and disables + photo IDs). + + * The keyserver no-modify flag on a key can now be displayed and + modified. + + * Note that the TIGER/192 digest algorithm is in the process of + being dropped from the OpenPGP standard. While this release of + GnuPG still contains it, it is disabled by default. To ensure + you will still be able to use your messages with future versions + of GnuPG and other OpenPGP programs, please do not use this + algorithm. + + +Noteworthy changes in version 1.3.1 (2002-11-12) +------------------------------------------------ + + * Trust signature support. This is based on the Maurer trust + model where a user can specify the trust level along with the + signature with multiple levels so users can delegate + certification ability to other users, possibly restricted by a + regular expression on the user ID. Note that full trust + signature support requires a regular expression parsing library. + The regexp code from glibc 2.3.1 is included for those platforms + that don't have working regexp functions available. The + configure option --disable-regex may be used to disable any + regular expression code, which will make GnuPG ignore any trust + signature with a regular expression included. + + * Two new commands --hidden-recipient (-R) and --hidden-encrypt-to + encrypt to a user, but hide the identity of that user. This is + the same functionality as --throw-keyid, but can be used on a + per-user basis. + + * Full algorithm names (e.g. "3DES", "SHA1", "ZIP") can now be + used interchangeably with the short algorithm names (e.g. "S2", + "H2", "Z1") anywhere algorithm names are used in GnuPG. + + +Noteworthy changes in version 1.3.0 (2002-10-18) +------------------------------------------------ + + * The last piece of internal keyserver support has been removed, + and now all keyserver access is done via the keyserver plugins. + There is also a newer keyserver protocol used between GnuPG and + the plugins, so plugins from earlier versions of GnuPG may not + work properly. + + * The HKP keyserver plugin supports the new machine-readable key + listing format for those keyservers that provide it. + + * When using a HKP keyserver with multiple DNS records (such as + wwwkeys.pgp.net which has the addresses of multiple servers + around the world), try all records until one succeeds. Note + that it depends on the LDAP library used whether the LDAP + keyserver plugin does this as well. + + * The library dependencies for OpenLDAP seem to change fairly + frequently, and GnuPG's configure script cannot guess all the + combinations. Use ./configure LDAPLIBS="-L libdir -l libs" to + override the script and use the libraries selected. + + * Secret keys generated with --export-secret-subkeys are now + indicated in key listings with a '#' after the "sec", and in + --with-colons listings by showing no capabilities (no lowercase + characters). + + * --trusted-key has been un-obsoleted, as it is useful for adding + ultimately trusted keys from the config file. It is identical + to using --edit and "trust" to change a key to ultimately + trusted. + + * Translations other than de are no longer distributed with the + development branch. This is due to the frequent text changes + during development, which cause the translations to rapidly go + out of date. + + +Version 1.2.8 (2006-12-07) +Version 1.2.7 (2004-12-27) +Version 1.2.6 (2004-08-25) +Version 1.2.5 (2004-07-26) +Version 1.2.4 (2003-12-23) +Version 1.2.3 (2003-08-21) +Version 1.2.2 (2003-05-01) +Version 1.2.1 (2002-10-25) +Version 1.2.0 (2002-09-21) + + +Noteworthy changes in version 1.1.92 (2002-09-11) +------------------------------------------------- + + * [IMPORTANT] The default configuration file is now + ~/.gnupg/gpg.conf. If an old ~/.gnupg/options is found it will + still be used. This change is required to have a more + consistent naming scheme with forthcoming tools. + + * The use of MDCs have increased. A MDC will be used if the + recipients directly request it, if the recipients have AES, + AES192, AES256, or TWOFISH in their cipher preferences, or if + the chosen cipher has a blocksize not equal to 64 bits + (currently this is also AES, AES192, AES256, and TWOFISH). + + * GnuPG will no longer automatically disable compression when + processing an already-compressed file unless a MDC is being + used. This is to give the message a certain amount of + resistance to the chosen-ciphertext attack while communicating + with other programs (most commonly PGP earlier than version 7.x) + that do not support MDCs. + + * The option --interactive now has the desired effect when + importing keys. + + * The file permission and ownership checks on files have been + clarified. Specifically, the homedir (usually ~/.gnupg) is + checked to protect everything within it. If the user specifies + keyrings outside this homedir, they are presumed to be shared + keyrings and therefore *not* checked. Configuration files + specified with the --options option and the IDEA cipher + extension specified with --load-extension are checked, along + with their enclosing directories. + + * The configure option --with-static-rnd=auto allows to build gpg + with all available entropy gathering modules included. At + runtime the best usable one will be selected from the list + linux, egd, unix. This is also the default for systems lacking + a /dev/random device. + + * The default character set is now taken from the current locale; + it can still be overridden by the --charset option. Using the + option -vvv shows the used character set. + + * [REMOVED] --emulate-checksum-bug and --emulate-3des-s2k-bug have + been removed. + + +Noteworthy changes in version 1.1.91 (2002-08-04) +------------------------------------------------- + + * All modules are now linked statically; the --load-extension + option is in general not useful anymore. The only exception is + to specify the deprecated idea cipher. + + * The IDEA plugin has changed. Previous versions of the IDEA + plugin will no longer work with GnuPG. However, the current + version of the plugin will work with earlier GnuPG versions. + + * When using --batch with one of the --delete-key commands, the + key must be specified by fingerprint. See the man page for + details. + + * There are now various ways to restrict the ability GnuPG has to + exec external programs (for the keyserver helpers or photo ID + viewers). Read the README file for the complete list. + + * New export option to leave off attribute packets (photo IDs) + during export. This is useful when exporting to HKP keyservers + which do not understand attribute packets. + + * New import option to repair during import the HKP keyserver + mangling multiple subkeys bug. Note that this cannot completely + repair the damaged key as some crucial data is removed by the + keyserver, but it does at least give you back one subkey. This + is on by default for keyserver --recv-keys, and off by default + for regular --import. + + * The keyserver helper programs now live in + /usr/[local/]libexec/gnupg by default. If you are upgrading + from 1.0.7, you might want to delete your old copies in + /usr/[local/]bin. If you use an OS that does not use libexec + for whatever reason, use configure --libexecdir=/usr/local/lib + to place the keyserver helpers there. + + * The LDAP keyserver handler now works properly with very old + (version 1) LDAP keyservers. + + +Noteworthy changes in version 1.1.90 (2002-07-01) +------------------------------------------------- + + * New commands: --personal-cipher-preferences, + --personal-digest-preferences, and + --personal-compress-preferences allow the user to specify which + algorithms are to be preferred. Note that this does not permit + using an algorithm that is not present in the recipient's + preferences (which would violate the OpenPGP standard). This + just allows sorting the preferences differently. + + * New "group" command to refer to several keys with one name. + + * A warning is issued if the user forces the use of an algorithm + that is not listed in the recipient's preferences. + + * Full revocation key (aka "designated revoker") support. + + * The preferred hash algorithms on a key are consulted when + encrypting a signed message to that key. Note that this is + disabled by default by a SHA1 preference in + --personal-digest-preferences. + + * --cert-digest-algo allows the user to specify the hash algorithm + to use when signing a key rather than the default SHA1 (or MD5 + for PGP2 keys). Do not use this feature unless you fully + understand the implications of this. + + * --pgp7 mode automatically sets all necessary options to ensure + that the resulting message will be usable by a user of PGP 7.x. + + * New --attribute-fd command for frontends and scripts to get the + contents of attribute packets (i.e. photos) + + * In expert mode, the user can now re-sign a v3 key with a v4 + self-signature. This does not change the v3 key into a v4 key, + but it does allow the user to use preferences, primary ID flags, + etc. + + * Significantly improved photo ID support on non-unixlike + platforms. + + * The version number has jumped ahead to 1.1.90 to skip over the + old version 1.1 and to get ready for the upcoming 1.2. + + * ElGamal sign and encrypt is not anymore allowed in the key + generation dialog unless in expert mode. RSA sign and encrypt + has been added with the same restrictions. + + * [W32] Keyserver access does work with Windows NT. + + +Noteworthy changes in version 1.0.7 (2002-04-29) +------------------------------------------------ + + * Secret keys are now stored and exported in a new format which + uses SHA-1 for integrity checks. This format renders the + Rosa/Klima attack useless. Other OpenPGP implementations might + not yet support this, so the option --simple-sk-checksum creates + the old vulnerable format. + + * The default cipher algorithm for encryption is now CAST5, + default hash algorithm is SHA-1. This will give us better + interoperability with other OpenPGP implementations. + + * Symmetric encrypted messages now use a fixed file size if + possible. This is a tradeoff: it breaks PGP 5, but fixes PGP 2, + 6, and 7. Note this was only an issue with RFC-1991 style + symmetric messages. + + * Photographic user ID support. This uses an external program to + view the images. + + * Enhanced keyserver support via keyserver "plugins". GnuPG comes + with plugins for the NAI LDAP keyserver as well as the HKP email + keyserver. It retains internal support for the HKP HTTP + keyserver. + + * Nonrevocable signatures are now supported. If a user signs a + key nonrevocably, this signature cannot be taken back so be + careful! + + * Multiple signature classes are usable when signing a key to + specify how carefully the key information (fingerprint, photo + ID, etc) was checked. + + * --pgp2 mode automatically sets all necessary options to ensure + that the resulting message will be usable by a user of PGP 2.x. + + * --pgp6 mode automatically sets all necessary options to ensure + that the resulting message will be usable by a user of PGP 6.x. + + * Signatures may now be given an expiration date. When signing a + key with an expiration date, the user is prompted whether they + want their signature to expire at the same time. + + * Revocation keys (designated revokers) are now supported if + present. There is currently no way to designate new keys as + designated revokers. + + * Permissions on the .gnupg directory and its files are checked + for safety. + + * --expert mode enables certain silly things such as signing a + revoked user id, expired key, or revoked key. + + * Some fixes to build cleanly under Cygwin32. + + * New tool gpgsplit to split OpenPGP data formats into packets. + + * New option --preserve-permissions. + + * Subkeys created in the future are not used for encryption or + signing unless the new option --ignore-valid-from is used. + + * Revoked user-IDs are not listed unless signatures are listed too + or we are in verbose mode. + + * There is no default comment string with ascii armors anymore + except for revocation certificates and --enarmor mode. + + * The command "primary" in the edit menu can be used to change the + primary UID, "setpref" and "updpref" can be used to change the + preferences. + + * Fixed the preference handling; since 1.0.5 they were erroneously + matched against against the latest user ID and not the given one. + + * RSA key generation. + + * Merged Stefan's patches for RISC OS in. See comments in + scripts/build-riscos. + + * It is now possible to sign and conventional encrypt a message (-cs). + + * The MDC feature flag is supported and can be set by using + the "updpref" edit command. + + * The status messages GOODSIG and BADSIG are now returning the primary + UID, encoded using %XX escaping (but with spaces left as spaces, + so that it should not break too much) + + * Support for GDBM based keyrings has been removed. + + * The entire keyring management has been revamped. + + * The way signature stati are store has changed so that v3 + signatures can be supported. To increase the speed of many + operations for existing keyrings you can use the new + --rebuild-keydb-caches command. + + * The entire key validation process (trustdb) has been revamped. + See the man page entries for --update-trustdb, --check-trustdb + and --no-auto-check-trustdb. + + * --trusted-keys is again obsolete, --edit can be used to set the + ownertrust of any key to ultimately trusted. + + * A subkey is never used to sign keys. + + * Read only keyrings are now handled as expected. + + +Noteworthy changes in version 1.0.6 (2001-05-29) +------------------------------------------------ + + * Security fix for a format string bug in the tty code. + + * Fixed format string bugs in all PO files. + + * Removed Russian translation due to too many bugs. The FTP + server has an unofficial but better translation in the contrib + directory. + + * Fixed expire time calculation and keyserver access. + + * The usual set of minor bug fixes and enhancements. + + * non-writable keyrings are now correctly handled. + + +Noteworthy changes in version 1.0.5 (2001-04-29) +------------------------------------------------ + + * WARNING: The semantics of --verify have changed to address a + problem with detached signature detection. --verify now ignores + signed material given on stdin unless this is requested by using + a "-" as the name for the file with the signed material. Please + check all your detached signature handling applications and make + sure that they don't pipe the signed material to stdin without + using a filename together with "-" on the the command line. + + * WARNING: Corrected hash calculation for input data larger than + 512M - it was just wrong, so you might notice bad signature in + some very big files. It may be wise to keep an old copy of + GnuPG around. + + * Secret keys are no longer imported unless you use the new option + --allow-secret-key-import. This is a kludge and future versions will + handle it in another way. + + * New command "showpref" in the --edit-key menu to show an easier + to understand preference listing. + + * There is now the notation of a primary user ID. For example, it + is printed with a signature verification as the first user ID; + revoked user IDs are not printed there anymore. In general the + primary user ID is the one with the latest self-signature. + + * New --charset=utf-8 to bypass all internal conversions. + + * Large File Support (LFS) is now working. + + * New options: --ignore-crc-error, --no-sig-create-check, + --no-sig-cache, --fixed-list-mode, --no-expensive-trust-checks, + --enable-special-filenames and --use-agent. See man page. + + * New command --pipemode, which can be used to run gpg as a + co-process. Currently only the verification of detached + signatures are working. See doc/DETAILS. + + * Keyserver support for the W32 version. + + * Rewritten key selection code so that GnuPG can better cope with + multiple subkeys, expire dates and so. The drawback is that it + is slower. + + * A whole lot of bug fixes. + + * The verification status of self-signatures are now cached. To + increase the speed of key list operations for existing keys you + can do the following in your GnuPG homedir (~/.gnupg): + cp pubring.gpg pubring.gpg.save && gpg --export-all >x && \ + rm pubring.gpg && gpg --import x + Only v4 keys (i.e not the old RSA keys) benefit from this caching. + + * New translations: Estonian, Turkish. + + +Noteworthy changes in version 1.0.4 (2000-10-17) +------------------------------------------------ + + * Fixed a serious bug which could lead to false signature verification + results when more than one signature is fed to gpg. This is the + primary reason for releasing this version. + + * New utility gpgv which is a stripped down version of gpg to + be used to verify signatures against a list of trusted keys. + + * Rijndael (AES) is now supported and listed with top preference. + + * --with-colons now works with --print-md[s]. + +Noteworthy changes in version 1.0.3 (2000-09-18) +------------------------------------------------ + + * Fixed problems with piping to/from other MS-Windows software + + * Expiration time of the primary key can be changed again. + + * Revoked user IDs are now marked in the output of --list-key + + * New options --show-session-key and --override-session-key + to help the British folks to somewhat minimize the danger + of this Orwellian RIP bill. + + * New options --merge-only and --try-all-secrets. + + * New configuration option --with-egd-socket. + + * The --trusted-key option is back after it left us with 0.9.5 + + * RSA is supported. Key generation does not yet work but will come + soon. + + * CAST5 and SHA-1 are now the default algorithms to protect the key + and for symmetric-only encryption. This should solve a couple + of compatibility problems because the old algorithms are optional + according to RFC2440 + + * Twofish and MDC enhanced encryption is now used. PGP 7 supports + this. Older versions of GnuPG don't support it, so they should be + upgraded to at least 1.0.2 + + +Noteworthy changes in version 1.0.2 (2000-07-12) +---------------------------------------------- + + * Fixed expiration handling of encryption keys. + + * Add an experimental feature to do unattended key generation. + + * The user is now asked for the reason of revocation as required + by the new OpenPGP draft. + + * There is a ~/.gnupg/random_seed file now which saves the + state of the internal RNG and increases system performance + somewhat. This way the full entropy source is only used in + cases were it is really required. + Use the option --no-random-seed-file to disable this feature. + + * New options --ignore-time-conflict and --lock-never. + + * Some fixes for the W32 version. + + * The entropy.dll is not anymore used by the W32 version but replaced + by code derived from Cryptlib. + + * Encryption is now much faster: About 2 times for 1k bit keys + and 8 times for 4k keys. + + * New encryption keys are generated in a way which allows a much + faster decryption. + + * New command --export-secret-subkeys which outputs the + the _primary_ key with it's secret parts deleted. This is + useful for automated decryption/signature creation as it + allows to keep the real secret primary key offline and + thereby protecting the key certificates and allowing to + create revocations for the subkeys. See the FAQ for a + procedure to install such secret keys. + + * Keygeneration now writes to the first writeable keyring or + as default to the one in the homedirectory. Prior versions + ignored all --keyring options. + + * New option --command-fd to take user input from a file descriptor; + to be used with --status-fd by software which uses GnuPG as a backend. + + * There is a new status PROGRESS which is used to show progress during + key generation. + + * Support for the new MDC encryption packets. To create them either + --force-mdc must be use or cipher algorithm with a blocksize other + than 64 bits is to be used. --openpgp currently disables MDC packets + entirely. This option should not yet be used. + + * New option --no-auto-key-retrieve to disable retrieving of + a missing public key from a keyserver, when a keyserver has been set. + + * Danish translation + +Noteworthy changes in version 1.0.1 (1999-12-16) +----------------------------------- + + * New command --verify-files. New option --fast-list-mode. + + * $http_proxy is now used when --honor-http-proxy is set. + + * Fixed some minor bugs and the problem with conventional encrypted + packets which did use the gpg v3 partial length headers. + + * Add Indonesian and Portugese translations. + + * Fixed a bug with symmetric-only encryption using the non-default 3DES. + The option --emulate-3des-s2k-bug may be used to decrypt documents + which have been encrypted this way; this should be done immediately + as this workaround will be remove in 1.1 + + * Can now handle (but not display) PGP's photo IDs. I don't know the + format of that packet but after stripping a few bytes from the start + it looks like a JPEG (at least my test data). Handling of this + package is required because otherwise it would mix up the + self signatures and you can't import those keys. + + * Passing non-ascii user IDs on the commandline should now work in all + cases. + + * New keys are now generated with an additional preference to Blowfish. + + * Removed the GNU Privacy Handbook from the distribution as it will go + into a separate one. + + +Noteworthy changes in version 1.0.0 (1999-09-07) +----------------------------------- + + * Add a very preliminary version of the GNU Privacy Handbook to + the distribution (lynx doc/gph/index.html). + + * Changed the version number to GnuPG 2001 ;-) + + +Noteworthy changes in version 0.9.11 (1999-09-03) +------------------------------------ + + * UTF-8 strings are now correctly printed (if --charset is set correctly). + Output of --with-colons remains C-style escaped UTF-8. + + * Workaround for a problem with PGP 5 detached signature in textmode. + + * Fixed a problem when importing new subkeys (duplicated signatures). + + +Noteworthy changes in version 0.9.10 (1999-07-23) +------------------------------------ + + * Some strange new options to help pgpgpg + + * Cleaned up the dox a bit. + + +Noteworthy changes in version 0.9.9 +----------------------------------- + + * New options --[no-]utf8-strings. + + * New edit-menu commands "enable" and "disable" for entire keys. + + * You will be asked for a filename if gpg cannot deduce one. + + * Changes to support libtool which is needed for the development + of libgcrypt. + + * New script tools/lspgpot to help transferring assigned + trustvalues from PGP to GnuPG. + + * New commands --lsign-key and made --sign-key a shortcut for --edit + and sign. + + * New options (#122--126 ;-) --[no-]default-recipient[-self], + --disable-{cipher,pubkey}-algo. See the man page. + + * Enhanced info output in case of multiple recipients and fixed exit code. + + * New option --allow-non-selfsigned-uid to work around a problem with + the German IN way of separating signing and encryption keys. + + +Noteworthy changes in version 0.9.8 (1999-06-26) +----------------------------------- + + * New subcommand "delsig" in the edit menu. + + * The name of the output file is not anymore the one which is + embedded in the processed message, but the used filename with + the extension stripped. To revert to the old behaviour you can + use the option --use-embedded-filename. + + * Another hack to cope with pgp2 generated detached signatures. + + * latin-2 character set works (--charset=iso-8859-2). + + * New option --with-key-data to list the public key parameters. + New option -N to insert notations and a --set-policy-url. + A couple of other options to allow reseting of options. + + * Better support for HPUX. + + +Noteworthy changes in version 0.9.7 (1999-05-23) +----------------------------------- + + * Add some work arounds for a bugs in pgp 2 which led to bad signatures + when used with canonical texts in some cases. + + * Enhanced some status outputs. + + +Noteworthy changes in version 0.9.6 (1999-05-06) +----------------------------------- + + * Twofish is now statically linked by default. The experimental 128 bit + version is now disabled. Full support will be available as soon as + the OpenPGP WG has decided on an interpretation of rfc2440. + + * Dropped support for the ancient Blowfish160 which is not OpenPGP. + + * Merged gpgm and gpg into one binary. + + * Add "revsig" and "revkey" commands to the edit menu. It is now + possible to revoke signature and subkeys. + + +Noteworthy changes in version 0.9.5 (1999-03-20) +----------------------------------- + + * New command "lsign" in the keyedit menu to create non-exportable + signatures. Removed --trusted-keys option. + + * A bunch of changes to the key validation code. + + * --list-trust-path now has an optional --with-colons format. + + * New command --recv-keys to import keys from an keyserver. + + +Noteworthy changes in version 0.9.4 (1999-03-08) +----------------------------------- + + * New configure option --enable-static-rnd=[egd|linux|unix|none] + to select a random gathering module for static linking. + + * The original text is now verbatim copied to a cleartext signed message. + + * Bugfixes but there are still a couple of bugs. + + +Noteworthy changes in version 0.9.3 (1999-02-19) +----------------------------------- + + * Changed the internal design of getkey which now allows a + efficient lookup of multiple keys and add a word match mode. + + * New options --[no-]encrypt-to. + + * Some changes to the configure stuff. Switched to automake 1.4. + Removed intl/ from CVS, autogen.sh now uses gettextize. + + * Preferences now include Twofish. Removed preference to Blowfish with + a special hack to suppress the "not listed in preferences" warning; + this is to allow us to switch completely to Twofish in the near future. + + * Changed the locking stuff. + + * Print all user ids of a good signature. + + +Noteworthy changes in version 0.9.2 (1999-01-01) +----------------------------------- + + * add some additional time warp checks. + + * Option --keyserver and command --send-keys to utilize HKP servers. + + * Upgraded to zlib 1.1.3 and fixed an inflate bug + + * More cleanup on the cleartext signatures. + + +Noteworthy changes in version 0.9.1 (1999-01-01) +----------------------------------- + + * Polish language support. + + * When querying the passphrase, the key ID of the primary key is + displayed along with the one of the used secondary key. + + * Fixed a bug occurring when decrypting pgp 5 encrypted messages, + fixed an infinite loop bug in the 3DES code and in the code + which looks for trusted signatures. + + * Fixed a bug in the mpi library which caused signatures not to + compare okay. + + * Rewrote the handling of cleartext signatures; the code is now + better maintainable (I hope so). + + * New status output VALIDSIG only for valid signatures together + with the fingerprint of the signer's key. + + +Noteworthy changes in version 0.9.0 (1998-12-23) +----------------------------------- + + * --export does now only exports rfc2440 compatible keys; the + old behaviour is available with --export-all. + Generation of v3 ElGamal (sign and encrypt) keys is not longer + supported. + + * Fixed the uncompress bug. + + * Rewrote the rndunix module. There are two environment variables + used for debugging now: GNUPG_RNDUNIX_DBG give the file to write + debugging information (use "-" for stdout) and if GNUPG_RNDUNIX_DBGALL + is set, all programs which are only tried are also printed. + + * New option --escape-from-lines to "dash-escape" "From " lines to + prevent mailers to change them to ">From ". This is not enabled by + default because it is not in compliance with rfc2440 - however, you + should turn it on. + + +Noteworthy changes in version 0.4.5 (1998-12-08) +----------------------------------- + + * The keyrings and the trustdb is now locked, so that + other GnuPG processes won't damage these files. You + may want to put the option --lock-once into your options file. + + * The latest self-signatures are now used; this enables --import + to see updated preferences etc. + + * Import of subkeys should now work. + + * Random gathering modules may now be loaded as extensions. Add + such a module for most Unices but it is very experimental! + + * Brazilian language support. + + +Noteworthy changes in version 0.4.4 (1998-11-20) +----------------------------------- + + * Fixed the way the key expiration time is stored. If you have + an expiration time on your key you should fix it with --edit-key + and the command "expire". I apologize for this inconvenience. + + * Add option --charset to support "koi8-r" encoding of user ids. + (Not yet tested). + + * Preferences should now work again. You should run + "gpgm --check-trustdb \*" to rebuild all preferences. + + * Checking of certificates should now work but this needs a lot + of testing. Key validation values are now cached in the + trustdb; they should be recalculated as needed, but you may + use --check-trustdb or --update-trustdb to do this. + + * Spanish translation by Urko Lusa. + + * Patch files are from now on signed. See the man page + for the new option --not-dash-escaped. + + * New syntax: --edit-key [] + If you run it without --batch the commands are executed and then + you are put into normal mode unless you use "quit" or "save" as + one of the commands. When in batch mode, the program quits after + the last command, so you have to use "save" if you did some changes. + It does not yet work completely, but may be used to list so the + keys etc. + + +Noteworthy changes in version 0.4.3 (1998-11-08) +----------------------------------- + + * Fixed the gettext configure bug. + + * Kludge for RSA keys: keyid and length of a RSA key are + correctly reported, but you get an error if you try to use + this key (If you do not have the non-US version). + + * Experimental support for keyrings stored in a GDBM database. + This is *much* faster than a standard keyring. You will notice + that the import gets slower with time; the reason is that all + new keys are used to verify signatures of previous inserted + keys. Use "--keyring gnupg-gdbm:". This is + not (yet) supported for secret keys. + + * A Russian language file in the distribution (alternatives are in + the contrib directory of the FTP servers) + + * commandline option processing now works as expected for GNU programs + with the exception that you can't mix options and normal arguments. + + * Now --list-key lists all matching keys. This is needed in some + other places too. + + +Noteworthy changes in version 0.4.2 (1998-10-18) +----------------------------------- + + * This is only a snapshot: There are still a few bugs. + + * Fixed this huge memory leak. + + * Redesigned the trust database: You should run "gpgm --check-trustdb". + New command --update-trustdb, which adds new key from the public + keyring into your trustdb + + * Fixed a bug in the armor code, leading to invalid packet errors. + (a workaround for this was to use --no-armor). The shorten line + length (64 instead of 72) fixes a problem with pgp5 and keyservers. + + * comment packets are not anymore generated. "--export" filters + them out. One Exception: The comment packets in a secret keyring + are still used because they carry the factorization of the public + prime product. + + * --import now only looks for KEYBLOCK headers, so you can now simply + remove the "- " in front of such a header if someone accidently signed + such a message or the keyblock is part of a cleartext signed message. + + * --with-colons now lists the key expiration time and not anymore + the valid period. + + * Some keyblocks created with old releases have a wrong sequence + of packets, so that the keyservers don't accept these keys. + Simply using "--edit-key" fixes the problem. + + * New option --force-v3-sigs to generate signed messages which are + compatible to PGP 5. + + * Add some code to support DLD (for non ELF systems) - but this is + not tested because my BSD box is currently broken. + + * New command "expire" in the edit-key menu. + + + +Noteworthy changes in version 0.4.1 (1998-10-07) +----------------------------------- + + * A secondary key is used when the primary key is specified but cannot + be used for the operation (if it is a sign-only key). + + * GNUPG can now handle concatenated armored messages: There is still a + bug if different kinds of messages are mixed. + + * Iterated+Salted passphrases now work. If want to be sure that PGP5 + is able to handle them you may want to use the options + "--s2k-mode 3 --s2k-cipher-algo cast5 --s2k-digest-algo sha1" + when changing a passphrase. + + * doc/OpenPGP talks about OpenPGP compliance, doc/HACKING gives + a few hints about the internal structure. + + * Checked gnupg against the August 1998 draft (07) and I believe + it is in compliance with this document (except for one point). + + * Fixed some bugs in the import merging code and rewrote some + code for the trustdb. + + +Noteworthy changes in version 0.4.0 (1998-09-18) +----------------------------------- + + * Triple DES is now supported. Michael Roth did this piece of + needed work. We have now all the coded needed to be OpenPGP + compliant. + + * Added a simple rpm spec file (see INSTALL). + + * detached and armored signatures are now using "PGP SIGNATURE", + except when --rfc1991 is used. + + * All times which are not in the yyyy-mm-dd format are now printed + in local time. + + +Noteworthy changes in version 0.3.5 (1998-09-14) +----------------------------------- + + * New option --throw-keyid to create anonymous enciphered messages. + If gpg detects such a message it tires all available secret keys + in turn so decode it. This is a gnupg extension and not in OpenPGP + but it has been discussed there and afaik some products use this + scheme too (Suggested by Nimrod Zimmerman). + + * Fixed a bug with 5 byte length headers. + + * --delete-[secret-]key is now also available in gpgm. + + * cleartext signatures are not anymore converted to LF only. + + * Fixed a trustdb problem. Run "gpgm --check-trustdb" to fix old + trust dbs. + + * Building in another directory should now work. + + * Weak key detection mechanism (Niklas Hernaeus). + + +Noteworthy changes in version 0.3.4 (1998-08-11) +----------------------------------- + + * New options --comment and --set-filename; see g10/OPTIONS + + * yes/no, y/n localized. + + * Fixed some bugs. + + +Noteworthy changes in version 0.3.3 (1998-08-08) +----------------------------------- + + * IMPORTANT: I found yet another bug in the way the secret keys + are encrypted - I did it the way pgp 2.x did it, but OpenPGP + and pgp 5.x specify another (in some aspects simpler) method. + To convert your secret keys you have to do this: + 1. Build the new release but don't install it and keep + a copy of the old program. + 2. Disable the network, make sure that you are the only + user, be sure that there are no Trojan horses etc .... + 3. Use your old gpg (version 0.3.[12]) and set the + passphrases of ALL your secret keys to empty! + (gpg --change-passphrase your-user-id). + 4. Save your ownertrusts (see the next point) + 5. rm ~/.gnupg/trustdb.gpg + 6. install the new version of gpg (0.3.3) + 7. For every secret key call "gpg --edit-key your-user-id", + enter "passwd" at the prompt, follow the instructions and + change your password back, enter "save" to store it. + 8. Restore the ownertrust (see next point). + + * The format of the trust database has changed; you must delete + the old one, so gnupg can create a new one. + IMPORTANT: Use version 0.3.[12] to save your assigned ownertrusts + ("gpgm --list-ownertrust >saved-trust"); then build this new version + and restore the ownertrust with this new version + ("gpgm --import-ownertrust saved-trust"). Please note that + --list-ownertrust has been renamed to --export-ownertrust in this + release and it does now only export defined ownertrusts. + + * The command --edit-key now provides a commandline driven menu + which can be used for various tasks. --sign-key is only an + an alias to --edit-key and maybe removed in future: use the + command "sign" of this new menu - you can select which user ids + you want to sign. + + * Alternate user ids can now be created an signed. + + * Owner trust values can now be changed with --edit-key (trust) + + * GNUPG can now run as a coprocess; this enables sophisticated + frontends. tools/shmtest.c is a simple sample implementation. + This needs some more work: all tty_xxx() are to be replaced + by cpr_xxx() and some changes in the display logics is needed. + + * Removed options --gen-prime and --gen-random. + + * Removed option --add-key; use --edit-key instead. + + * Removed option --change-passphrase; use --edit-key instead. + + * Signatures are now checked even if the output file could not + be created. Command "--verify" tries to find the detached data. + + * gpg now disables core dumps. + + * compress and symmetric cipher preferences are now used. + Because there is no 3DES yet, this is replaced by Blowfish. + + * We have added the Twofish as an experimental cipher algorithm. + Many thanks to Matthew Skala for doing this work. + Twofish is the AES submission from Schneier et al.; see + "www.counterpane.com/twofish.html" for more information. + + * Started with a help system: If you enter a question mark at some + prompt; you should get a specific help for this prompt. + + * There is no more backup copy of the secret keyring. + + * A lot of new bugs. I think this release is not as stable as + the previous one. + + +Noteworthy changes in version 0.3.2 (1998-07-09) +----------------------------------- + + * Fixed some bugs when using --textmode (-seat) + + * Now displays the trust status of a positive verified message. + + * Keyrings are now scanned in the sequence they are added with + --[secret-]keyring. Note that the default keyring is implicitly + added as the very first one unless --no-default-keyring is used. + + * Fixed setuid and dlopen bug. + + +Noteworthy changes in version 0.3.1 (1998-07-06) +----------------------------------- + + * Partial headers are now written in the OpenPGP format if + a key in a v4 packet is used. + + * Removed some unused options, removed the gnupg.sig stuff. + + * Key lookup by name now returns a key which can be used for + the desired action. + + * New options --list-ownertrust (gpgm) to make a backup copy + of the ownertrust values you assigned. + + * clear signature headers are now in compliance with OpenPGP. + + +Noteworthy changes in version 0.3.0 (1998-06-25) +----------------------------------- + + * New option --emulate-checksum-bug. If your passphrase does not + work anymore, use this option and --change-passphrase to rewrite + your passphrase. + + * More complete v4 key support: Preferences and expiration time + is set into the self signature. + + * Key generation defaults to DSA/ElGamal keys, so that new keys are + interoperable with pgp5 + + * DSA key generation is faster and key generation does not anymore + remove entropy from the random generator (the primes are public + parameters, so there is really no need for a cryptographic secure + prime number generator which we had used). + + * A complete new structure for representing the key parameters. + + * Removed most public key knowledge into the cipher library. + + * Support for dynamic loading of new algorithms. + + * Moved tiger to an extension module. + + +Noteworthy changes in version 0.2.19 (1998-05-29) +------------------------------------ + + * Replaced /dev/urandom in checks with new tool mk-tdata. + + * Some assembler file cleanups; some more functions for the Alpha. + + * Tiger has now the OpenPGP assigned number 6. Because the OID has + changed, old signatures using this algorithm can't be verified. + + * gnupg now encrypts the compressed packed and not any longer in the + reverse order; anyway it can decrypt both versions. Thanks to Tom + for telling me this (not security related) bug. + + * --add-key works and you are now able to generate subkeys. + + * It is now possible to generate ElGamal keys in v4 packets to create + valid OpenPGP keys. + + * Some new features for better integration into MUAs. + + +Noteworthy changes in version 0.2.18 (1998-05-15) +------------------------------------ + + * Splitted cipher/random.c, add new option "--disable-dev-random" + to configure to support the development of a random source for + other systems. Prepared sourcefiles rand-unix.c, rand-w32.c + and rand-dummy.c (which is used to allow compilation on systems + without a random source). + + * Fixed a small bug in the key generation (it was possible that 48 bits + of a key were not taken from the random pool) + + * Add key generation for DSA and v4 signatures. + + * Add a function trap_unaligned(), so that a SIGBUS is issued on + Alphas and not the slow emulation code is used. And success: rmd160 + raised a SIGBUS. + + * Enhanced the formatting facility of argparse and changed the use of + \r,\v to @ because gettext does not like it. + + * New option "--compress-algo 1" to allow the creation of compressed + messages which are readable by PGP and "--print-md" (gpgm) to make + speed measurement easier. + + +Noteworthy changes in version 0.2.17 (1998-05-04) +------------------------------------ + + * Comment packets are now of private type 61. + + * Passphrase code still used a 160 bit blowfish key, added a + silly workaround. Please change your passphrase again - sorry. + + * Conventional encryption now uses a type 3 packet to describe the + used algorithms. + + * The new algorithm number for Blowfish is 20, 16 is still used for + encryption only; for signing it is only used when it is in a v3 packet, + so that GNUPG keys are still valid. + + +Noteworthy changes in version 0.2.16 (1998-04-28) +------------------------------------ + + * Add experimental support for the TIGER/192 message digest algorithm. + (But there is only a dummy ASN OID). + + * Standard cipher is now Blowfish with 128 bit key in OpenPGP's CFB + mode. I renamed the old cipher to Blowfish160. Because the OpenPGP + group refused to assign me a number for Blowfish160, I have to + drop support for this in the future. You should use + "--change-passphrase" to recode your current passphrase with 128 + bit Blowfish. + + +Noteworthy changes in version 0.2.15 (1998-04-09) +------------------------------------ + + * Fixed a bug with the old checksum calculation for secret keys. + If you run the program without --batch, a warning does inform + you if your secret key needs to be converted; simply use + --change-passphrase to recalculate the checksum. Please do this + soon, as the compatible mode will be removed sometime in the future. + + * CAST5 works (using the PGP's special CFB mode). + + * Again somewhat more PGP 5 compatible. + + * Some new test cases + +Noteworthy changes in version 0.2.14 (1998-04-02) +------------------------------------ + + * Changed the internal handling of keyrings. + + * Add support to list PGP 5 keyrings with subkeys + + * Timestamps of signatures are now verified. + + * A expiration time can now be specified during key generation. + + * Some speedups for Blowfish and SHA-1, rewrote SHA-1 transform. + Reduced the amount of random bytes needed for key generation in + some cases. + + +Noteworthy changes in version 0.2.13 (1998-03-10) +------------------------------------ + + * Verify of DSA signatures works. + + * Re-implemented the slower random number generator. + + +Noteworthy changes in version 0.2.12 (1998-03-07) +------------------------------------ + + * --delete-key checks that there is no secret key. The new + option --delete-secret-key maybe used to delete a secret key. + + * "-kv" now works as expected. Options "--list-{keys,sigs]" + and "--check-sigs" are now working. + + * New options "--verify" and "--decrypt" to better support integration + into MUAs (partly done for Mutt). + + * New option "--with-colons" to make parsing of key lists easier. + +Noteworthy changes in version 0.2.11 (1998-03-02) +------------------------------------ + + * GPG now asks for a recipient's name if option "-r" is not used. + + * If there is no good trust path, the program asks whether to use + the public keys anyway. + + * "--delete-key" works for public keys. What semantics shall I use + when there is a secret key too? Delete the secret key or leave him + and auto-regenerate the public key, next time the secret key is used? + +Noteworthy changes in version 0.2.10 (1998-02-27) +------------------------------------ + + * Code for the alpha is much faster (about 20 times); the data + was misaligned and the kernel traps this, so nearly all time + was used by system to trap the misalignments and to write + syslog messages. Shame on me and thanks to Ralph for + pointing me at this while drinking some beer yesterday. + + * Changed some configure options and add an option + --disable-m-guard to remove the memory checking code + and to compile everything with optimization on. + + * New environment variable GNUPGHOME, which can be used to set + another homedir than ~/.gnupg. Changed default homedir for + Windoze version to c:/gnupg. + + * Fixed detached signatures; detached PGP signatures caused a SEGV. + + * The Windoze version works (as usual w/o a strong RNG). + + +Noteworthy changes in version 0.2.9 (1998-02-26) +----------------------------------- + + * Fixed FreeBSD bug. + + * Added a simple man page. + + * Switched to automake1.2f and a newer gettext. + +Noteworthy changes in version 0.2.8 (1998-02-24) +----------------------------------- + + * Changed the name to GNUPG, the binaries are called gpg and gpgm. + You must rename rename the directory "~/.g10" to ~/.gnupg/, rename + {pub,sec}ring.g10 to {pub,sec}ring.gpg, trustdb.g10 to trustdb.gpg + and g10.sig to gnupg.sig. + + * New or changed passphrases are now salted. + + +Noteworthy changes in version 0.2.7 (1998-02-18) +----------------------------------- + + * New command "gen-revoke" to create a key revocation certificate. + + * New option "homedir" to set the homedir (which defaults to "~/.g10"). + This directory is created if it does not exists (only the last + part of the name and not the complete hierarchy) + + * Command "import" works. (Try: "finger gcrypt at ftp.guug.de|g10 --import") + + * New commands "dearmor/enarmor" for g10maint. These are mainly + used for internal test purposes. + + * Option --version now conforming to the GNU standards and lists + the available ciphers, message digests and public key algorithms. + + * Assembler code for m68k (not tested). + + * "make check" works. + +Noteworthy changes in version 0.2.6 (1998-02-13) +----------------------------------- + + * Option "--export" works. + + +Noteworthy changes in version 0.2.5 (1998-02-12) +----------------------------------- + + * Added zlib for systems which don't have it. + Use "./configure --with-zlib" to link with the static version. + + * Generalized some more functions and rewrote the encoding of + message digests into MPIs. + + * Enhanced the checkit script + + +Noteworthy changes in version 0.2.4 (1998-02-11) +----------------------------------- + + * nearly doubled the speed of the ElGamal signature verification. + + * backup copies of keyrings are created. + + * assembler stuff for Pentium; gives about 15% better performance. + + * fixed a lot of bugs. + + +Noteworthy changes in version 0.2.3 (1998-02-09) +----------------------------------- + + * Found a bug in the calculation of ELG fingerprints. This is now + fixed, but all existing fingerprints and keyids for ELG keys + are not any more valid. + + * armor should now work; including clear signed text. + + * moved some options to the new program g10maint + + * It's now 64 bit clean and runs fine on an alpha--linux. + + * Key generation is much faster now. I fixed this by using not + so strong random number for the primes (this was a bug because the + ElGamal primes are public parameters and it does not make sense + to generate them from strong random). The real secret is the x value + which is still generated from strong (okay: /dev/random) random bits. + + * added option "--status-fd": see g10/OPTIONS + + * We have secure memory on systems which support mlock(). + It is not complete yet, because we do not have signal handler + which does a cleanup in very case. + We should also check the ulimit for the user in the case + that the admin does not have set a limit on locked pages. + + * started with internationalization support. + + * The logic to handle the web of trust is now implemented. It is + has some bugs; but I'm going to change the algorithm anyway. + It works by calculating the trustlevel on the fly. It may ask + you to provide trust parameters if the calculated trust probability + is too low. I will write a paper which discusses this new approach. + + * a couple of changes to the configure script. + + * New option "--quick-random" which uses a much quicker random + number generator. Keys generated while this option is in effect + are flags with "INSECURE!" in the user-id. This is a development + only option. + + * Read support for new version packets (OpenPGP). + + * Comment packets are now of correct OpenPGP type 16. Old comment + packets written by G10 are detected because they always start with + a hash which is an invalid version byte. + + * The string "(INSECURE!)" is appended to a new user-id if this + is generated on a system without a good random number generator. + + +Version 0.2.2 (1998-02-09) +Version 0.2.1 (1998-01-28) +Version 0.2.0 (1998-01-25) +Version 0.1.3 (1998-01-12) +Version 0.1.2 (1998-01-07) +Version 0.1.1 (1998-01-07) +Version 0.1.0 (1998-01-05) +Version 0.0.0 (1997-12-20) + + + Copyright (C) 1998-2015 Free Software Foundation, Inc. + Copyright (C) 1997-2015 Werner Koch This file is free software; as a special exception the author gives unlimited permission to copy and/or distribute it, with or without ----------------------------------------------------------------------- Summary of changes: ChangeLog-2011 | 32 +- NEWS | 1498 +++++++++++++++++++++++++++++++++++++++++++++++++++++++- 2 files changed, 1512 insertions(+), 18 deletions(-) hooks/post-receive -- The GNU Privacy Guard http://git.gnupg.org From cvs at cvs.gnupg.org Mon Jun 15 15:39:26 2015 From: cvs at cvs.gnupg.org (by Werner Koch) Date: Mon, 15 Jun 2015 15:39:26 +0200 Subject: [git] GnuPG - branch, master, updated. gnupg-2.1.5-3-g0b3e834 Message-ID: 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 0b3e8342fa11e6be190a16c6ee12238417abc974 (commit) from b89a592a2e85e3db381cdc5022f5dcd9c07a6745 (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 0b3e8342fa11e6be190a16c6ee12238417abc974 Author: Werner Koch Date: Mon Jun 15 15:37:30 2015 +0200 doc: Update the record description of the trustdb. -- This now reflects the used version of the trustdb. However, it still missed a detailed description on how it works. diff --git a/doc/DETAILS b/doc/DETAILS index db01baa..d1f7394 100644 --- a/doc/DETAILS +++ b/doc/DETAILS @@ -924,212 +924,131 @@ pkd:0:1024:B665B1435F4C2 .... FF26ABB: The TrustDB is built from fixed length records, where the first byte describes the record type. All numeric values are stored in network - byte order. The length of each record is 40 bytes. The first record - of the DB is always of type 1 and this is the only record of this - type. - - FIXME: The layout changed, document it here. -#+begin_example - Record type 0: - -------------- - Unused record, can be reused for any purpose. - - Record type 1: - -------------- - Version information for this TrustDB. This is always the first - record of the DB and the only one with type 1. - 1 byte value 1 - 3 bytes 'gpg' magic value - 1 byte Version of the TrustDB (2) - 1 byte marginals needed - 1 byte completes needed - 1 byte max_cert_depth - The three items are used to check whether the cached - validity value from the dir record can be used. - 1 u32 locked flags [not used] - 1 u32 timestamp of trustdb creation - 1 u32 timestamp of last modification which may affect the validity - of keys in the trustdb. This value is checked against the - validity timestamp in the dir records. - 1 u32 timestamp of last validation [currently not used] - (Used to keep track of the time, when this TrustDB was checked - against the pubring) - 1 u32 record number of keyhashtable [currently not used] - 1 u32 first free record - 1 u32 record number of shadow directory hash table [currently not used] - It does not make sense to combine this table with the key table - because the keyid is not in every case a part of the fingerprint. - 1 u32 record number of the trusthashtbale - - - Record type 2: (directory record) - -------------- - Informations about a public key certificate. - These are static values which are never changed without user interaction. - - 1 byte value 2 - 1 byte reserved - 1 u32 LID . (This is simply the record number of this record.) - 1 u32 List of key-records (the first one is the primary key) - 1 u32 List of uid-records - 1 u32 cache record - 1 byte ownertrust - 1 byte dirflag - 1 byte maximum validity of all the user ids - 1 u32 time of last validity check. - 1 u32 Must check when this time has been reached. - (0 = no check required) - - - Record type 3: (key record) - -------------- - Informations about a primary public key. - (This is mainly used to lookup a trust record) - - 1 byte value 3 - 1 byte reserved - 1 u32 LID - 1 u32 next - next key record - 7 bytes reserved - 1 byte keyflags - 1 byte pubkey algorithm - 1 byte length of the fingerprint (in bytes) - 20 bytes fingerprint of the public key - (This is the value we use to identify a key) - - Record type 4: (uid record) - -------------- - Informations about a userid - We do not store the userid but the hash value of the userid because that - is sufficient. - - 1 byte value 4 - 1 byte reserved - 1 u32 LID points to the directory record. - 1 u32 next next userid - 1 u32 pointer to preference record - 1 u32 siglist list of valid signatures - 1 byte uidflags - 1 byte validity of the key calculated over this user id - 20 bytes ripemd160 hash of the username. - - - Record type 5: (pref record) - -------------- - This record type is not anymore used. - - 1 byte value 5 - 1 byte reserved - 1 u32 LID; points to the directory record (and not to the uid record!). - (or 0 for standard preference record) - 1 u32 next - 30 byte preference data - - Record type 6 (sigrec) - ------------- - Used to keep track of key signatures. Self-signatures are not - stored. If a public key is not in the DB, the signature points to - a shadow dir record, which in turn has a list of records which - might be interested in this key (and the signature record here - is one). - - 1 byte value 6 - 1 byte reserved - 1 u32 LID points back to the dir record - 1 u32 next next sigrec of this uid or 0 to indicate the - last sigrec. - 6 times - 1 u32 Local_id of signatures dir or shadow dir record - 1 byte Flag: Bit 0 = checked: Bit 1 is valid (we have a real - directory record for this) - 1 = valid is set (but may be revoked) - - - - Record type 8: (shadow directory record) - -------------- - This record is used to reserve a LID for a public key. We - need this to create the sig records of other keys, even if we - do not yet have the public key of the signature. - This record (the record number to be more precise) will be reused - as the dir record when we import the real public key. - - 1 byte value 8 - 1 byte reserved - 1 u32 LID (This is simply the record number of this record.) - 2 u32 keyid - 1 byte pubkey algorithm - 3 byte reserved - 1 u32 hintlist A list of records which have references to - this key. This is used for fast access to - signature records which are not yet checked. - Note, that this is only a hint and the actual records - may not anymore hold signature records for that key - but that the code cares about this. - 18 byte reserved - - - - Record Type 10 (hash table) - -------------- - Due to the fact that we use fingerprints to lookup keys, we can - implement quick access by some simple hash methods, and avoid - the overhead of gdbm. A property of fingerprints is that they can be - used directly as hash values. (They can be considered as strong - random numbers.) - What we use is a dynamic multilevel architecture, which combines - hashtables, record lists, and linked lists. - - This record is a hashtable of 256 entries; a special property - is that all these records are stored consecutively to make one - big table. The hash value is simple the 1st, 2nd, ... byte of - the fingerprint (depending on the indirection level). - - When used to hash shadow directory records, a different table is used - and indexed by the keyid. - - 1 byte value 10 - 1 byte reserved - n u32 recnum; n depends on the record length: - n = (reclen-2)/4 which yields 9 for the current record length - of 40 bytes. - - the total number of such record which makes up the table is: - m = (256+n-1) / n - which is 29 for a record length of 40. - - To look up a key we use the first byte of the fingerprint to get - the recnum from this hashtable and look up the addressed record: - - If this record is another hashtable, we use 2nd byte - to index this hash table and so on. - - if this record is a hashlist, we walk all entries - until we found one a matching one. - - if this record is a key record, we compare the - fingerprint and to decide whether it is the requested key; - - - Record type 11 (hash list) - -------------- - see hash table for an explanation. - This is also used for other purposes. - - 1 byte value 11 - 1 byte reserved - 1 u32 next next hash list record - n times n = (reclen-5)/5 - 1 u32 recnum - - For the current record length of 40, n is 7 - - - - Record type 254 (free record) - --------------- - All these records form a linked list of unused records. - 1 byte value 254 - 1 byte reserved (0) - 1 u32 next_free -#+end_example + byte order. The length of each record is 40 bytes. The first + record of the DB is always of type 1 and this is the only record of + this type. + + The record types: directory(2), key(3), uid(4), pref(5), sigrec(6), + and shadow directory(8) are not anymore used by version 2 of the + TrustDB. + +** Record type 0 + + Unused record or deleted, can be reused for any purpose. Such + records should in general not exist because deleted records are of + type 254 and kept in a linked list. + +** Version info (RECTYPE_VER, 1) + + Version information for this TrustDB. This is always the first + record of the DB and the only one of this type. + + - 1 u8 :: Record type (value: 1). + - 3 byte :: Magic value ("gpg") + - 1 u8 :: TrustDB version (value: 2). + - 1 u8 :: =marginals=. How many marginal trusted keys are required. + - 1 u8 :: =completes=. How many completely trusted keys are + required. + - 1 u8 :: =max_cert_depth=. How deep is the WoT evaluated. Along + with =marginals= and =completes=, this value is used to + check whether the cached validity value from a [FIXME + dir] record can be used. + - 1 u8 :: =trust_model= + - 1 u8 :: =min_cert_level= + - 2 byte :: Not used + - 1 u32 :: =created=. Timestamp of trustdb creation. + - 1 u32 :: =nextcheck=. Timestamp of last modification which may + affect the validity of keys in the trustdb. This value + is checked against the validity timestamp in the dir + records. + - 1 u32 :: =reserved=. Not used. + - 1 u32 :: =reserved2=. Not used. + - 1 u32 :: =firstfree=. Number of the record with the head record + of the RECTYPE_FREE linked list. + - 1 u32 :: =reserved3=. Not used. + - 1 u32 :: =trusthashtbl=. Record number of the trusthashtable. + + +** Hash table (RECTYPE_HTBL, 10) + + Due to the fact that we use fingerprints to lookup keys, we can + implement quick access by some simple hash methods, and avoid the + overhead of gdbm. A property of fingerprints is that they can be + used directly as hash values. What we use is a dynamic multilevel + architecture, which combines hash tables, record lists, and linked + lists. + + This record is a hash table of 256 entries with the property that + all these records are stored consecutively to make one big + table. The hash value is simple the 1st, 2nd, ... byte of the + fingerprint (depending on the indirection level). + + - 1 u8 :: Record type (value: 10). + - 1 u8 :: Reserved + - n u32 :: =recnum=. A table with the hash table items fitting into + this record. =n= depends on the record length: + $n=(reclen-2)/4$ which yields 9 for oure current record + length of 40 bytes. + + The total number of hash table records to form the table is: + $m=(256+n-1)/n$. This is 29 for our record length of 40. + + To look up a key we use the first byte of the fingerprint to get + the recnum from this hash table and then look up the addressed + record: + + - If that record is another hash table, we use 2nd byte to index + that hash table and so on; + - if that record is a hash list, we walk all entries until we find + a matching one; or + - if that record is a key record, we compare the fingerprint to + decide whether it is the requested key; + + +** Hash list (RECTYPE_HLST, 11) + + See hash table above on how it is used. It may also be used for + other purposes. + + - 1 u8 :: Record type (value: 11). + - 1 u8 :: Reserved. + - 1 u32 :: =next=. Record number of the next hash list record or 0 + if none. + - n u32 :: =rnum=. Array with record numbers to values. With + $n=(reclen-5)/5$ and our record length of 40, n is 7. + +** Trust record (RECTYPE_TRUST, 12) + + - 1 u8 :: Record type (value: 12). + - 1 u8 :: Reserved. + - 20 byte :: =fingerprint=. + - 1 u8 :: =ownertrust=. + - 1 u8 :: =depth=. + - 1 u8 :: =min_ownertrust=. + - 1 byte :: Not used. + - 1 u32 :: =validlist=. + - 10 byte :: Not used. + +** Validity record (RECTYPE_VALID, 13) + + - 1 u8 :: Record type (value: 13). + - 1 u8 :: Reserved. + - 20 byte :: =namehash=. + - 1 u8 :: =validity= + - 1 u32 :: =next=. + - 1 u8 :: =full_count=. + - 1 u8 :: =marginal_count=. + - 11 byte :: Not used. + +** Free record (RECTYPE_FREE, 254) + + All these records form a linked list of unused records in the TrustDB. + + - 1 u8 :: Record type (value: 254) + - 1 u8 :: Reserved. + - 1 u32 :: =next=. Record number of the next rcord of this type. + The record number to the head of this linked list is + stored in the version info record. * GNU extensions to the S2K algorithm ----------------------------------------------------------------------- Summary of changes: doc/DETAILS | 331 +++++++++++++++++++++++------------------------------------- 1 file changed, 125 insertions(+), 206 deletions(-) hooks/post-receive -- The GNU Privacy Guard http://git.gnupg.org From cvs at cvs.gnupg.org Mon Jun 15 16:26:16 2015 From: cvs at cvs.gnupg.org (by Werner Koch) Date: Mon, 15 Jun 2015 16:26:16 +0200 Subject: [git] GnuPG - branch, master, updated. gnupg-2.1.5-4-gef273a9 Message-ID: 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 ef273a9afc7840b75cfb9b8af78d117b7d672c6a (commit) from 0b3e8342fa11e6be190a16c6ee12238417abc974 (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 ef273a9afc7840b75cfb9b8af78d117b7d672c6a Author: Werner Koch Date: Mon Jun 15 16:19:44 2015 +0200 doc: Add defs.inc to BUILT_SOURCES diff --git a/doc/Makefile.am b/doc/Makefile.am index ee8bca2..3ea19ad 100644 --- a/doc/Makefile.am +++ b/doc/Makefile.am @@ -41,7 +41,7 @@ EXTRA_DIST = samplekeys.asc mksamplekeys \ gpgv.texi yat2m.c ChangeLog-2011 whats-new-in-2.1.txt BUILT_SOURCES = gnupg-card-architecture.eps gnupg-card-architecture.png \ - gnupg-card-architecture.pdf defsincdate + gnupg-card-architecture.pdf defsincdate defs.inc info_TEXINFOS = gnupg.texi ----------------------------------------------------------------------- Summary of changes: doc/Makefile.am | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) hooks/post-receive -- The GNU Privacy Guard http://git.gnupg.org From cvs at cvs.gnupg.org Tue Jun 16 05:03:05 2015 From: cvs at cvs.gnupg.org (by NIIBE Yutaka) Date: Tue, 16 Jun 2015 05:03:05 +0200 Subject: [git] GnuPG - branch, STABLE-BRANCH-1-4, updated. gnupg-1.4.19-8-gae38cbb Message-ID: 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, STABLE-BRANCH-1-4 has been updated via ae38cbbca493725305c4131fbcafa716ae0c6109 (commit) from 6f992d94ea708535b2f3a3de22b429401d59fac9 (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 ae38cbbca493725305c4131fbcafa716ae0c6109 Author: NIIBE Yutaka Date: Tue Jun 16 12:01:28 2015 +0900 g10: Fix a race condition initially creating trustdb. * g10/tdbio.c (take_write_lock, tdbio_set_dbname): Fix message. diff --git a/g10/tdbio.c b/g10/tdbio.c index 579db63..be7cc1d 100644 --- a/g10/tdbio.c +++ b/g10/tdbio.c @@ -100,12 +100,12 @@ take_write_lock (void) if (!lockhandle) lockhandle = dotlock_create (db_name, 0); if (!lockhandle) - log_fatal ( _("can't create lock for '%s'\n"), db_name ); + log_fatal ( _("can't create lock for `%s'\n"), db_name ); if (!is_locked) { if (dotlock_take (lockhandle, -1) ) - log_fatal ( _("can't lock '%s'\n"), db_name ); + log_fatal ( _("can't lock `%s'\n"), db_name ); else is_locked = 1; return 0; @@ -517,7 +517,7 @@ tdbio_set_dbname( const char *new_dbname, int create, int *r_nofile) if( access( fname, R_OK ) ) { if( errno != ENOENT ) - log_fatal( _("can't access '%s': %s\n"), fname, strerror(errno) ); + log_fatal( _("can't access `%s': %s\n"), fname, strerror(errno) ); if (!create) *r_nofile = 1; ----------------------------------------------------------------------- Summary of changes: g10/tdbio.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) hooks/post-receive -- The GNU Privacy Guard http://git.gnupg.org From cvs at cvs.gnupg.org Tue Jun 16 05:53:04 2015 From: cvs at cvs.gnupg.org (by NIIBE Yutaka) Date: Tue, 16 Jun 2015 05:53:04 +0200 Subject: [git] GnuPG - branch, STABLE-BRANCH-2-0, updated. gnupg-2.0.28-8-ge2eba81 Message-ID: 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, STABLE-BRANCH-2-0 has been updated via e2eba81faea28a775cbd4fadce442f561a4e06a5 (commit) from 2371553af156b5f8d6282e42cb8891f0c986d3d3 (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 e2eba81faea28a775cbd4fadce442f561a4e06a5 Author: NIIBE Yutaka Date: Tue Jun 16 12:52:19 2015 +0900 po: Update Japanese Translation. diff --git a/po/ja.po b/po/ja.po index 5ad7bc4..31ffef0 100644 --- a/po/ja.po +++ b/po/ja.po @@ -9,7 +9,7 @@ msgid "" msgstr "" "Project-Id-Version: GNU gnupg 2.0.28\n" "Report-Msgid-Bugs-To: translations at gnupg.org\n" -"PO-Revision-Date: 2015-06-02 13:05+0200\n" +"PO-Revision-Date: 2015-06-16 12:51+0900\n" "Last-Translator: NIIBE Yutaka \n" "Language-Team: Japanese \n" "Language: ja\n" @@ -31,7 +31,7 @@ msgid "|pinentry-label|_OK" msgstr "|pinentry-label|_OK" msgid "|pinentry-label|_Cancel" -msgstr "|pinentry-label|_?????" +msgstr "|pinentry-label|?????(_C)" msgid "|pinentry-label|_Yes" msgstr "|pinentry-label|_Yes" @@ -43,7 +43,7 @@ msgid "|pinentry-label|PIN:" msgstr "|pinentry-label|PIN:" msgid "|pinentry-label|_Save in password manager" -msgstr "|pinentry-label|_???????????????" +msgstr "|pinentry-label|???????????????(_S)" msgid "Do you really want to make your passphrase visible on the screen?" msgstr "????????????????????????" @@ -5169,7 +5169,7 @@ msgid "missing argument" msgstr "????????" msgid "invalid argument" -msgstr "?????\n" +msgstr "?????" msgid "invalid command" msgstr "???????" ----------------------------------------------------------------------- Summary of changes: po/ja.po | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) hooks/post-receive -- The GNU Privacy Guard http://git.gnupg.org From cvs at cvs.gnupg.org Tue Jun 16 05:53:27 2015 From: cvs at cvs.gnupg.org (by NIIBE Yutaka) Date: Tue, 16 Jun 2015 05:53:27 +0200 Subject: [git] GnuPG - branch, master, updated. gnupg-2.1.5-5-g15540f6 Message-ID: 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 15540f6233bd041b06708862a6d9535cbcabe330 (commit) from ef273a9afc7840b75cfb9b8af78d117b7d672c6a (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 15540f6233bd041b06708862a6d9535cbcabe330 Author: NIIBE Yutaka Date: Tue Jun 16 12:52:45 2015 +0900 po: Update Japanese Translation. diff --git a/po/ja.po b/po/ja.po index 7737c70..6ef36a8 100644 --- a/po/ja.po +++ b/po/ja.po @@ -8,9 +8,9 @@ # msgid "" msgstr "" -"Project-Id-Version: gnupg 2.1.1\n" +"Project-Id-Version: gnupg 2.1.5\n" "Report-Msgid-Bugs-To: translations at gnupg.org\n" -"PO-Revision-Date: 2014-12-17 09:43+0900\n" +"PO-Revision-Date: 2015-06-16 12:46+0900\n" "Last-Translator: NIIBE Yutaka \n" "Language-Team: none\n" "Language: ja\n" @@ -32,43 +32,33 @@ msgid "|pinentry-label|_OK" msgstr "|pinentry-label|_OK" msgid "|pinentry-label|_Cancel" -msgstr "|pinentry-label|_?????" +msgstr "|pinentry-label|?????(_C)" -#, fuzzy -#| msgid "|pinentry-label|_OK" msgid "|pinentry-label|_Yes" -msgstr "|pinentry-label|_OK" +msgstr "|pinentry-label|_Yes" -#, fuzzy -#| msgid "|pinentry-label|_OK" msgid "|pinentry-label|_No" -msgstr "|pinentry-label|_OK" +msgstr "|pinentry-label|_No" msgid "|pinentry-label|PIN:" msgstr "|pinentry-label|PIN:" -#, fuzzy -#| msgid "|pinentry-label|_Cancel" msgid "|pinentry-label|_Save in password manager" -msgstr "|pinentry-label|_?????" +msgstr "|pinentry-label|?????????????(_S)" -#, fuzzy -#| msgid "Do you really want to permanently delete the OpenPGP secret key:" msgid "Do you really want to make your passphrase visible on the screen?" -msgstr "????OpenPGP????????????????? (y/N) " +msgstr "????????????????????????" msgid "|pinentry-tt|Make passphrase visible" -msgstr "" +msgstr "|pinentry-tt|???????????????" -#, fuzzy -#| msgid "Enter new passphrase" msgid "|pinentry-tt|Hide passphrase" -msgstr "??????????????????" +msgstr "|pinentry-tt|?????????" #. TRANSLATORS: This string is displayed by Pinentry as the label #. for the quality bar. msgid "Quality:" -msgstr "??: %s" +msgstr "??:" #. TRANSLATORS: This string is a tooltip, shown by pinentry when #. hovering over the quality bar. Please use an appropriate @@ -343,10 +333,8 @@ msgstr "|PGM|PGM?SCdaemon??????????" msgid "do not use the SCdaemon" msgstr "SCdaemon?????" -#, fuzzy -#| msgid "|NAME|connect to host NAME" msgid "|NAME|accept some commands via NAME" -msgstr "|NAME|???NAME?????" +msgstr "|NAME|NAME?????????????" msgid "ignore requests to change the TTY" msgstr "TTY??????????" @@ -360,10 +348,8 @@ msgstr "|N|N???????PIN??????" msgid "do not use the PIN cache when signing" msgstr "??????PIN????????" -#, fuzzy -#| msgid "do not allow the reuse of old passphrases" msgid "disallow the use of an external password cache" -msgstr "?????????????????????" +msgstr "?????????????????????" msgid "disallow clients to mark keys as \"trusted\"" msgstr "?????????\"trusted\"??????????????" @@ -375,7 +361,7 @@ msgid "allow caller to override the pinentry" msgstr "pinentry??????????????????" msgid "allow passphrase to be prompted through Emacs" -msgstr "" +msgstr "Emacs?????????????????????" msgid "enable ssh support" msgstr "ssh??????????" @@ -974,7 +960,7 @@ msgid "keyword too long" msgstr "???????????" msgid "missing argument" -msgstr "???????" +msgstr "????????" msgid "invalid argument" msgstr "?????" @@ -1691,10 +1677,8 @@ msgstr "?????????" msgid "quickly generate a new key pair" msgstr "?????????????" -#, fuzzy -#| msgid "quickly generate a new key pair" msgid "quickly add a new user-id" -msgstr "?????????????" +msgstr "??????????ID???" msgid "full featured key pair generation" msgstr "??????????" @@ -3971,7 +3955,7 @@ msgid "%s: keyring created\n" msgstr "%s: ??????????\n" msgid "override proxy options set for dirmngr" -msgstr "" +msgstr "dirmngr??????????????????" msgid "include revoked keys in search results" msgstr "??????????????" @@ -3980,7 +3964,7 @@ msgid "include subkeys when searching by key ID" msgstr "key ID????????????" msgid "override timeout options set for dirmngr" -msgstr "" +msgstr "dirmngr????????????????????" msgid "automatically retrieve keys when verifying signatures" msgstr "?????????????????" ----------------------------------------------------------------------- Summary of changes: po/ja.po | 50 +++++++++++++++++--------------------------------- 1 file changed, 17 insertions(+), 33 deletions(-) hooks/post-receive -- The GNU Privacy Guard http://git.gnupg.org From cvs at cvs.gnupg.org Tue Jun 16 10:52:38 2015 From: cvs at cvs.gnupg.org (by Andre Heinecke) Date: Tue, 16 Jun 2015 10:52:38 +0200 Subject: [git] Pinentry - branch, master, updated. pinentry-0.9.4-3-g5026d0b Message-ID: 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 standard pinentry collection". The branch, master has been updated via 5026d0b9ac08d8366c82beec6c4425fb7f7b11e5 (commit) from 444598586d0abf70d5a27d2aafcd6c14989621db (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 5026d0b9ac08d8366c82beec6c4425fb7f7b11e5 Author: Andre Heinecke Date: Tue May 19 17:19:48 2015 +0200 Qt4: Fix GCC compile warnings * qt4/qsecurelineedit.cpp (QSecureLineEdit::sizeHint), (QSecureLineEdit::minimumSizeHint): Remove unused Q_D macros. (QSecureLineEdit::setCursorPosition, QSecureLineEditPrivate::setText), (QSecureLineEditPrivate::hasAcceptableInput): Explicitly cast length to int. (QSecureLineEditPrivate::maskString): Use unsigned type for strIndex. (QSecureLineEditPrivate::maskString): Remove uneccesary casts. * qt4/secstring.cpp (toUtf8): Remove unused variable. diff --git a/qt4/qsecurelineedit.cpp b/qt4/qsecurelineedit.cpp index 9611bdb..ce6fd63 100644 --- a/qt4/qsecurelineedit.cpp +++ b/qt4/qsecurelineedit.cpp @@ -715,7 +715,6 @@ void QSecureLineEditPrivate::_q_completionHighlighted(QString newText) QSize QSecureLineEdit::sizeHint() const { - Q_D(const QSecureLineEdit); ensurePolished(); QFontMetrics fm(font()); int leftmargin, topmargin, rightmargin, bottommargin; @@ -739,7 +738,6 @@ QSize QSecureLineEdit::sizeHint() const QSize QSecureLineEdit::minimumSizeHint() const { - Q_D(const QSecureLineEdit); ensurePolished(); QFontMetrics fm = fontMetrics(); int leftmargin, topmargin, rightmargin, bottommargin; @@ -773,7 +771,7 @@ void QSecureLineEdit::setCursorPosition(int pos) if (pos < 0) pos = 0; - if (pos <= d->text.length()) + if (pos <= static_cast(d->text.length())) d->moveCursor(pos); } @@ -2922,7 +2920,7 @@ void QSecureLineEditPrivate::setText(const secqstring& txt, int pos, bool edited } history.clear(); modifiedState = undoState = 0; - cursor = (pos < 0 || pos > text.size()) ? text.size() : pos; + cursor = (pos < 0 || pos > static_cast(text.size())) ? text.size() : pos; textDirty = (oldText != text); finishChange(-1, true, edited); } @@ -3211,7 +3209,7 @@ bool QSecureLineEditPrivate::hasAcceptableInput(const secqstring &str) const if (!maskData) return true; - if (str.length() != maxLength) + if (static_cast(str.length()) != maxLength) return false; for (int i=0; i < maxLength; ++i) { @@ -3240,51 +3238,51 @@ secqstring QSecureLineEditPrivate::maskString(uint pos, const secqstring &str, b secqstring fill; fill = clear ? clearString(0, maxLength) : text; - int strIndex = 0; + unsigned int strIndex = 0; secqstring s; int i = pos; while (i < maxLength) { if (strIndex < str.length()) { if (maskData[i].separator) { s += maskData[i].maskChar; - if (str[(int)strIndex] == maskData[i].maskChar) + if (str[strIndex] == maskData[i].maskChar) strIndex++; ++i; } else { - if (isValidInput(str[(int)strIndex], maskData[i].maskChar)) { + if (isValidInput(str[strIndex], maskData[i].maskChar)) { switch (maskData[i].caseMode) { case MaskInputData::Upper: - s += str[(int)strIndex].toUpper(); + s += str[strIndex].toUpper(); break; case MaskInputData::Lower: - s += str[(int)strIndex].toLower(); + s += str[strIndex].toLower(); break; default: - s += str[(int)strIndex]; + s += str[strIndex]; } ++i; } else { // search for separator first - int n = findInMask(i, true, true, str[(int)strIndex]); + int n = findInMask(i, true, true, str[strIndex]); if (n != -1) { - if (str.length() != 1 || i == 0 || (i > 0 && (!maskData[i-1].separator || maskData[i-1].maskChar != str[(int)strIndex]))) { + if (str.length() != 1 || i == 0 || (i > 0 && (!maskData[i-1].separator || maskData[i-1].maskChar != str[strIndex]))) { s += fill.substr(i, n-i+1); i = n + 1; // update i to find + 1 } } else { // search for valid blank if not - n = findInMask(i, true, false, str[(int)strIndex]); + n = findInMask(i, true, false, str[strIndex]); if (n != -1) { s += fill.substr(i, n-i); switch (maskData[n].caseMode) { case MaskInputData::Upper: - s += str[(int)strIndex].toUpper(); + s += str[strIndex].toUpper(); break; case MaskInputData::Lower: - s += str[(int)strIndex].toLower(); + s += str[strIndex].toLower(); break; default: - s += str[(int)strIndex]; + s += str[strIndex]; } i = n + 1; // updates i to find + 1 } ----------------------------------------------------------------------- Summary of changes: qt4/qsecurelineedit.cpp | 32 +++++++++++++++----------------- 1 file changed, 15 insertions(+), 17 deletions(-) hooks/post-receive -- The standard pinentry collection http://git.gnupg.org From cvs at cvs.gnupg.org Tue Jun 16 12:12:34 2015 From: cvs at cvs.gnupg.org (by Neal H. Walfield) Date: Tue, 16 Jun 2015 12:12:34 +0200 Subject: [git] Pinentry - branch, master, updated. pinentry-0.9.4-4-g302903f Message-ID: 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 standard pinentry collection". The branch, master has been updated via 302903f76b8d62b1e07219a203f7219cb3aff7d8 (commit) from 5026d0b9ac08d8366c82beec6c4425fb7f7b11e5 (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 302903f76b8d62b1e07219a203f7219cb3aff7d8 Author: Neal H. Walfield Date: Sat Jun 13 21:43:33 2015 +0200 Remove internal mini-libassuan implementation and link to libassuan. * assuan/ChangeLog-old: Remove file. * assuan/Makefile.am: Remove file. * assuan/README.1st: Remove file. * assuan/assuan-buffer.c: Remove file. * assuan/assuan-defs.h: Remove file. * assuan/assuan-handler.c: Remove file. * assuan/assuan-listen.c: Remove file. * assuan/assuan-pipe-server.c: Remove file. * assuan/assuan-util.c: Remove file. * assuan/assuan.h: Remove file. * assuan/mkerrors: Remove file. * configure.ac: Check for libgpg-error and libassuan. (COMMON_CFLAGS): Add $GPG_ERROR_CFLAGS and $LIBASSUAN_CFLAGS. (COMMAND_LIBS): Add $GPG_ERROR_LIBS and $LIBASSUAN_LIBS. (GPG_ERR_ENABLE_GETTEXT_MACROS): Define this macro. (GPG_ERR_ENABLE_ERRNO_MACROS): Likewise. (GNUPG_LIBASSUAN_VERSION): Likewise. (AC_CONFIG_FILES): Don't generate assuan/Makefile. (config.h): Define GPG_ERR_SOURCE_DEFAULT. * Makefile.am (SUBDIRS): Remove assuan. * curses/Makefile.am (LDADD): Remove ../assuan/libassuan.a. * gnome3/Makefile.am (AM_CPPFLAGS): Remove -I$(top_srcdir)/assuan. (LDADD): Remove ../assuan/libassuan.a. * gtk+-2/Makefile.am (LDADD): Remove ../assuan/libassuan.a. * pinentry/Makefile.am: Remove -I$(top_srcdir)/assuan. * qt4/Makefile.am (AM_CPPFLAGS): Remove -I$(top_srcdir)/assuan. (pinentry_qt4_LDADD): Remove $(top_builddir)/assuan/libassuan.a. * tty/Makefile.am (LDADD): Remove ../assuan/libassuan.a. * gnome3/pinentry-gnome3.c: Include , not "assuan.h". Replace ASSUAN_General_Error, etc. with gpg_error or gpg_error_from_syserror. * pinentry/pinentry-curses.c: Likewise. * pinentry/pinentry.c: Likewise. (pinentry_assuan_reset_handler): Change return type to gpg_error_t. Change type of argument CTX from ASSUAN_CONTEXT to assuan_context_t. Return 0. (pinentry_inq_quality): Change variable CTX's type from ASSUAN_CONTEXT to assuan_context_t. (assuan_malloc_hooks): New variable. (pinentry_init): Call gpgrt_check_version. Change use of assuan_set_malloc_hooks to match libassuan's semantics. (option_handler): Return a gpg_error_t, not an int. Replace use of ASSUAN_Out_Of_Core, etc. with gpg_error or gpg_error_from_syserror. (cmd_setdesc): Return a gpg_error_t, not an int. Change argument CTX's type from ASSUAN_CONTEXT to assuan_context_t. Replace use of ASSUAN_Out_Of_Core, etc. with gpg_error or gpg_error_from_syserror. GPG_ERR_ENOMEM), etc. (cmd_setprompt): Likewise. (cmd_setkeyinfo): Likewise. (cmd_setrepeat): Likewise. (cmd_setrepeaterror): Likewise. (cmd_seterror): Likewise. (cmd_setok): Likewise. (cmd_setnotok): Likewise. (cmd_setcancel): Likewise. (cmd_settimeout): Likewise. (cmd_settitle): Likewise. (cmd_setqualitybar): Likewise. (cmd_setqualitybar_tt): Likewise. (cmd_getpin): Likewise. (cmd_confirm): Likewise. (cmd_message): Likewise. (cmd_getinfo): Likewise. (cmd_clear_passphrase): Likewise. (register_commands): Likewise. Change use of assuan_register_command to match libassuan's semantics. (pinentry_loop2): Change variable RC's type from int to gpg_error_t. Change variable CTX's type from ASSUAN_CONTEXT to assuan_context_t. Use assuan_new to initialize CTX. Change use of assuan_init_pipe_server to match libassuan's semantics. Replace use of assuan_strerror with gpg_strerror. Call assuan_release instead of assuan_deinit_server. diff --git a/Makefile.am b/Makefile.am index 177f37e..71f8541 100644 --- a/Makefile.am +++ b/Makefile.am @@ -64,7 +64,7 @@ else pinentry_w32 = endif -SUBDIRS = assuan secmem pinentry ${pinentry_curses} ${pinentry_tty} \ +SUBDIRS = secmem pinentry ${pinentry_curses} ${pinentry_tty} \ ${pinentry_gtk_2} ${pinentry_gnome_3} ${pinentry_qt4} \ ${pinentry_w32} doc diff --git a/assuan/ChangeLog-old b/assuan/ChangeLog-old deleted file mode 100644 index 077831d..0000000 --- a/assuan/ChangeLog-old +++ /dev/null @@ -1,254 +0,0 @@ -2012-08-08 Werner Koch - - NB: ChangeLog files are no longer manually maintained. Starting - on August 8, 2012 we put change information only in the GIT commit - log, and generate a top-level ChangeLog file from logs at "make - dist". See doc/HACKING for details. - -2008-02-14 Werner Koch - - * assuan.h (ASSUAN_Parameter_Error): Add new alias. - -2008-01-10 Marcus Brinkmann - - * assuan-handler.c (dispatch_command): Use Syntax_Error instead of - Invalid_Command. - * assuan.h (assuan_error_t): Change all error codes to gpg-error - codes. - -2004-12-22 Werner Koch - - * assuan.h (assuan_error_t, assuan_context_t): New aliases. - * assuan-buffer.c (readline): Renamed EOF to ISEOF to avoid - compiler warnings. - -2004-04-20 Werner Koch - - * mkerrors: Add missing last LF. - -2004-01-30 Werner Koch - - * assuan-inquire.c, assuan-connect.c, assuan-client.c - * assuan-socket-server.c, assuan-pipe-connect.c - * assuan-socket-connect.c: Removed. - * assuan-handler.c (assuan_get_data_fp): Removed. - -2003-12-23 Werner Koch - - * Makefile.am (EXTRA_DIST): Added Manifest. - * Manifest: Added. - -2003-12-22 Werner Koch - - * assuan.h (ASSUAN_Locale_Problem): Added. - -2002-04-04 Werner Koch - - * assuan-buffer.c (my_log_prefix): New. Use it for all i/o debug - output. - -2002-03-06 Werner Koch - - * assuan-client.c (_assuan_read_from_server): Detect END. - (assuan_transact): Pass it to the data callback. - -2002-02-27 Werner Koch - - * assuan-client.c (assuan_transact): Add 2 more arguments to - support status lines. Passing NULL yields the old behaviour. - - * assuan-handler.c (process_request): Flush data lines send - without using the data fp. - -2002-02-14 Werner Koch - - * assuan-inquire.c (assuan_inquire): Check for a cancel command - and return ASSUAN_Canceled. Allow for non-data inquiry. - - * assuan.h: Add a few token specific error codes. - -2002-02-13 Werner Koch - - * assuan-defs.h (assuan_context_s): New var CLIENT_PID. - * assuan-pipe-server.c (_assuan_new_context): set default value. - * assuan-socket-server.c (accept_connection): get the actual pid. - -2002-02-12 Werner Koch - - * assuan-buffer.c (writen,readline) [USE_GNU_PT]: Use pth_read/write. - * assuan-socket-server.c (accept_connection) [USE_GNU_PTH]: Ditto. - -2002-02-01 Marcus Brinkmann - - * Makefile.am (MOSTLYCLEANFILES): New variable. - -2002-01-23 Werner Koch - - * assuan-socket-connect.c (LOGERRORX): and removed typo. - -2002-01-22 Marcus Brinkmann - - * assuan-socket-connect.c (LOGERRORX): Reverse arguments to fputs. - -2002-01-21 Werner Koch - - * assuan-connect.c: Move all except assuan_get_pid to... - * assuan-pipe-connect.c: this. - (assuan_pipe_disconnect): Removed. - (do_finish, do_deinit): New - (assuan_pipe_connect): and set them into the context. - * assuan-socket-connect.c: New. - - * assuan-util.c (_assuan_log_sanitized_string): New. - - * assuan-pipe-server.c (assuan_init_pipe_server): Factored most - code out to ... - (_assuan_new_context): new func. - (_assuan_release_context): New - * assuan-connect.c (assuan_pipe_connect): Use the new functions. - -2002-01-20 Werner Koch - - * assuan.h: Added Invalid Option error code. - - * assuan-handler.c (std_handler_option): New. - (std_cmd_tbl): Add OPTION as standard command. - (assuan_register_option_handler): New. - (dispatch_command): Use case insensitive matching as a fallback. - (my_strcasecmp): New. - -2002-01-19 Werner Koch - - * assuan-buffer.c (_assuan_read_line): Add output logging. - (assuan_write_line): Ditto. - (_assuan_cookie_write_data): Ditto. - (_assuan_cookie_write_flush): Ditto. - * assuan-util.c (_assuan_log_print_buffer): New. - (assuan_set_log_stream): New. - (assuan_begin_confidential): New. - (assuan_end_confidential): New. - - * assuan-defs.h: Add a few handler variables. - * assuan-pipe-server.c (assuan_deinit_pipe_server): Removed. - (deinit_pipe_server): New. - (assuan_deinit_server): New. Changed all callers to use this. - * assuan-listen.c (assuan_accept): Use the accept handler. - * assuan-handler.c (process_request): Use the close Handler. - * assuan-socket-server.c: New. - -2002-01-14 Werner Koch - - * assuan-client.c (_assuan_read_from_server): Skip spaces after - the keyword. - -2002-01-03 Werner Koch - - * assuan-handler.c (assuan_set_okay_line): New. - (process_request): And use it here. - -2002-01-02 Werner Koch - - * assuan-inquire.c (init_membuf,put_membuf,get_membuf): Apply a - hidden 0 behind the buffer so that the buffer can be used as a - string in certain contexts. - -2001-12-14 Marcus Brinkmann - - * assuan-connect.c (assuan_pipe_connect): New argument - FD_CHILD_LIST. Don't close those fds. - * assuan.h: Likewise for prototype. - -2001-12-14 Werner Koch - - * assuan-listen.c (assuan_close_input_fd): New. - (assuan_close_output_fd): New. - * assuan-handler.c (std_handler_reset): Always close them after a - reset command. - (std_handler_bye): Likewise. - -2001-12-14 Marcus Brinkmann - - * assuan-buffer.c (_assuan_read_line): New variable ATTICLEN, use - it to save the length of the attic line. - Rediddle the code a bit to make it more clear what happens. - -2001-12-14 Marcus Brinkmann - - * assuan-defs.h (LINELENGTH): Define as ASSUAN_LINELENGTH. - assuan.h: Define ASSUAN_LINELENGTH. - -2001-12-13 Marcus Brinkmann - - * assuan-buffer.c (assuan_read_line): Fix order of execution to - get correct return values. - -2001-12-13 Werner Koch - - * assuan-handler.c (assuan_get_active_fds): Fixed silly bug, - pretty obvious that nobody ever tested this function. - -2001-12-12 Werner Koch - - * assuan-connect.c (assuan_pipe_connect): Implemented the inital - handshake. - * assuan-client.c (read_from_server): Renamed to - (_assuan_read_from_server): this and made external. - - * assuan-listen.c (assuan_set_hello_line): New. - (assuan_accept): Use a custom hello line is available. - - * assuan-buffer.c (assuan_read_line): New. - (assuan_pending_line): New. - (_assuan_write_line): Renamed to .. - (assuan_write_line): this, made public and changed all callers. - -2001-12-04 Werner Koch - - * assuan-connect.c (assuan_pipe_connect): Add more error reporting. - * assuan-client.c: New. - - * assuan-inquire.c: New. - * assuan-handler.c (process_request): Check for nested invocations. - -2001-11-27 Werner Koch - - * assuan-handler.c (assuan_register_input_notify): New. - (assuan_register_output_notify): New. - -2001-11-26 Werner Koch - - * assuan.h: Added more status codes. - -2001-11-25 Werner Koch - - * assuan-handler.c (assuan_register_bye_notify) - (assuan_register_reset_notify) - (assuan_register_cancel_notify): New and call them from the - standard handlers. - (assuan_process): Moved bulk of function to .. - (process_request): .. new. - (assuan_process_next): One shot version of above. - (assuan_get_active_fds): New. - -2001-11-24 Werner Koch - - * assuan-connect.c (assuan_get_pid): New. - - * assuan-buffer.c (_assuan_read_line): Deal with reads of more - than a line. - * assuan-defs.h: Add space in the context for this. - - - ************************************************************ - * Please note that this is a stripped down Assuan version. * - ************************************************************ - - Copyright 2001, 2002, 2004 Free Software Foundation, Inc. - - This file is free software; as a special exception the author gives - unlimited permission to copy and/or distribute it, with or without - modifications, as long as this notice is preserved. - - This file is distributed in the hope that it will be useful, but - WITHOUT ANY WARRANTY, to the extent permitted by law; without even the - implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. diff --git a/assuan/Makefile.am b/assuan/Makefile.am deleted file mode 100644 index 2553f3e..0000000 --- a/assuan/Makefile.am +++ /dev/null @@ -1,43 +0,0 @@ -# Assuan Makefile for test purposes -# Copyright (C) 2001 Free Software Foundation, Inc. -# -# This file is part of GnuPG. -# -# GnuPG 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 2 of the License, or -# (at your option) any later version. -# -# GnuPG 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, write to the Free Software -# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA - -## Process this file with automake to produce Makefile.in - -EXTRA_DIST = mkerrors ChangeLog-old -AM_CPPFLAGS = -I.. -I$(top_srcdir)/include -BUILT_SOURCES = assuan-errors.c -MOSTLYCLEANFILES = assuan-errors.c - -noinst_LIBRARIES = libassuan.a - - -#libassuan_a_LDFLAGS = -libassuan_a_SOURCES = \ - assuan.h \ - assuan-defs.h \ - assuan-util.c \ - assuan-errors.c \ - assuan-buffer.c \ - assuan-handler.c \ - assuan-listen.c \ - assuan-pipe-server.c - - -assuan-errors.c : assuan.h - $(srcdir)/mkerrors < $(srcdir)/assuan.h > assuan-errors.c diff --git a/assuan/README.1st b/assuan/README.1st deleted file mode 100644 index bb52959..0000000 --- a/assuan/README.1st +++ /dev/null @@ -1 +0,0 @@ -Please don't modify it here but in the copy which comes with GnuPG. \ No newline at end of file diff --git a/assuan/assuan-buffer.c b/assuan/assuan-buffer.c deleted file mode 100644 index 363d6cf..0000000 --- a/assuan/assuan-buffer.c +++ /dev/null @@ -1,474 +0,0 @@ -/* assuan-buffer.c - read and send data - * Copyright (C) 2001 Free Software Foundation, Inc. - * - * This file is part of GnuPG. - * - * GnuPG 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 2 of the License, or - * (at your option) any later version. - * - * GnuPG 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, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA - */ - -#include -#include -#include -#include -#ifndef HAVE_W32CE_SYSTEM -# include -#endif -#include -#include -#ifdef USE_GNU_PTH -# include -#endif -#ifdef HAVE_W32CE_SYSTEM -# include -#endif - -#include "assuan-defs.h" - -#ifdef HAVE_JNLIB_LOGGING -#include "../jnlib/logging.h" -#endif - -#ifdef HAVE_W32CE_SYSTEM -const char * -strerror (int e) -{ - return "error"; -} -static int errno; -#endif - - -static const char * -my_log_prefix (void) -{ -#ifdef HAVE_JNLIB_LOGGING - return log_get_prefix (NULL); -#else - return ""; -#endif -} - - -static int -writen ( int fd, const char *buffer, size_t length ) -{ - while (length) - { - int nwritten; -#ifdef HAVE_W32CE_SYSTEM - do - { - if (!WriteFile ((HANDLE)fd, buffer, length, &nwritten, NULL)) - nwritten = -1; - } - while (nwritten == -1 && GetLastError () == ERROR_PIPE_NOT_CONNECTED); -#elif defined(USE_GNU_PTH) - nwritten = pth_write (fd, buffer, length); -#else - nwritten = write (fd, buffer, length); -#endif - if (nwritten < 0) - { -#ifndef HAVE_W32CE_SYSTEM - if (errno == EINTR) - continue; -#endif - return -1; /* write error */ - } - length -= nwritten; - buffer += nwritten; - } - return 0; /* okay */ -} - -/* read an entire line */ -static int -readline (int fd, char *buf, size_t buflen, int *r_nread, int *iseof) -{ - size_t nleft = buflen; char *p; - - *iseof = 0; - *r_nread = 0; - while (nleft > 0) - { - int n; -#ifdef HAVE_W32CE_SYSTEM - do - { - if (!ReadFile ((HANDLE)fd, buf, nleft, &n, NULL)) - n = -1; - } - while (n == -1 && GetLastError () == ERROR_PIPE_NOT_CONNECTED); -#elif defined(USE_GNU_PTH) - n = pth_read (fd, buf, nleft); -#else - n = read (fd, buf, nleft); -#endif - if (n < 0) - { -#ifndef HAVE_W32CE_SYSTEM - if (errno == EINTR) - continue; -#endif - return -1; /* read error */ - } - else if (!n) - { - *iseof = 1; - break; /* allow incomplete lines */ - } - p = buf; - nleft -= n; - buf += n; - *r_nread += n; - - for (; n && *p != '\n'; n--, p++) - ; - if (n) - break; /* at least one full line available - that's enough for now */ - } - - return 0; -} - - -int -_assuan_read_line (ASSUAN_CONTEXT ctx) -{ - char *line = ctx->inbound.line; - int n, nread, atticlen; - int rc; - - if (ctx->inbound.eof) - return -1; - - atticlen = ctx->inbound.attic.linelen; - if (atticlen) - { - memcpy (line, ctx->inbound.attic.line, atticlen); - ctx->inbound.attic.linelen = 0; - for (n=0; n < atticlen && line[n] != '\n'; n++) - ; - if (n < atticlen) - { - rc = 0; /* found another line in the attic */ - nread = atticlen; - atticlen = 0; - } - else - { /* read the rest */ - assert (atticlen < LINELENGTH); - rc = readline (ctx->inbound.fd, line + atticlen, - LINELENGTH - atticlen, &nread, &ctx->inbound.eof); - } - } - else - rc = readline (ctx->inbound.fd, line, LINELENGTH, - &nread, &ctx->inbound.eof); - if (rc) - { - if (ctx->log_fp) - fprintf (ctx->log_fp, "%s[%p] <- [Error: %s]\n", - my_log_prefix (), ctx, strerror (errno)); - return ASSUAN_Read_Error; - } - if (!nread) - { - assert (ctx->inbound.eof); - if (ctx->log_fp) - fprintf (ctx->log_fp, "%s[%p] <- [EOF]\n", my_log_prefix (),ctx); - return -1; - } - - ctx->inbound.attic.pending = 0; - nread += atticlen; - for (n=0; n < nread; n++) - { - if (line[n] == '\n') - { - if (n+1 < nread) - { - char *s, *d; - int i; - - n++; - /* we have to copy the rest because the handlers are - allowed to modify the passed buffer */ - for (d=ctx->inbound.attic.line, s=line+n, i=nread-n; i; i--) - { - if (*s=='\n') - ctx->inbound.attic.pending = 1; - *d++ = *s++; - } - ctx->inbound.attic.linelen = nread-n; - n--; - } - if (n && line[n-1] == '\r') - n--; - line[n] = 0; - ctx->inbound.linelen = n; - if (ctx->log_fp) - { - fprintf (ctx->log_fp, "%s[%p] <- ", my_log_prefix (), ctx); - if (ctx->confidential) - fputs ("[Confidential data not shown]", ctx->log_fp); - else - _assuan_log_print_buffer (ctx->log_fp, - ctx->inbound.line, - ctx->inbound.linelen); - putc ('\n', ctx->log_fp); - } - return 0; - } - } - - if (ctx->log_fp) - fprintf (ctx->log_fp, "%s[%p] <- [Invalid line]\n", my_log_prefix (), ctx); - *line = 0; - ctx->inbound.linelen = 0; - return ctx->inbound.eof? ASSUAN_Line_Not_Terminated : ASSUAN_Line_Too_Long; -} - - -/* Read the next line from the client or server and return a pointer - to a buffer with holding that line. linelen returns the length of - the line. This buffer is valid until another read operation is - done on this buffer. The caller is allowed to modify this buffer. - He should only use the buffer if the function returns without an - error. - - Returns: 0 on success or an assuan error code - See also: assuan_pending_line(). -*/ -AssuanError -assuan_read_line (ASSUAN_CONTEXT ctx, char **line, size_t *linelen) -{ - AssuanError err; - - if (!ctx) - return ASSUAN_Invalid_Value; - - err = _assuan_read_line (ctx); - *line = ctx->inbound.line; - *linelen = ctx->inbound.linelen; - return err; -} - - -/* Return true when a full line is pending for a read, without the need - for actual IO */ -int -assuan_pending_line (ASSUAN_CONTEXT ctx) -{ - return ctx && ctx->inbound.attic.pending; -} - - -AssuanError -assuan_write_line (ASSUAN_CONTEXT ctx, const char *line ) -{ - int rc; - - if (!ctx) - return ASSUAN_Invalid_Value; - - /* fixme: we should do some kind of line buffering */ - if (ctx->log_fp) - { - fprintf (ctx->log_fp, "%s[%p] -> ", my_log_prefix (), ctx); - if (ctx->confidential) - fputs ("[Confidential data not shown]", ctx->log_fp); - else - _assuan_log_print_buffer (ctx->log_fp, - line, strlen (line)); - putc ('\n', ctx->log_fp); - } - - rc = writen (ctx->outbound.fd, line, strlen(line)); - if (rc) - rc = ASSUAN_Write_Error; - if (!rc) - { - rc = writen (ctx->outbound.fd, "\n", 1); - if (rc) - rc = ASSUAN_Write_Error; - } - - return rc; -} - - - -/* Write out the data in buffer as datalines with line wrapping and - percent escaping. This fucntion is used for GNU's custom streams */ -int -_assuan_cookie_write_data (void *cookie, const char *buffer, size_t size) -{ - ASSUAN_CONTEXT ctx = cookie; - char *line; - size_t linelen; - - if (ctx->outbound.data.error) - return 0; - - line = ctx->outbound.data.line; - linelen = ctx->outbound.data.linelen; - line += linelen; - while (size) - { - /* insert data line header */ - if (!linelen) - { - *line++ = 'D'; - *line++ = ' '; - linelen += 2; - } - - /* copy data, keep some space for the CRLF and to escape one character */ - while (size && linelen < LINELENGTH-2-2) - { - if (*buffer == '%' || *buffer == '\r' || *buffer == '\n') - { - sprintf (line, "%%%02X", *(unsigned char*)buffer); - line += 3; - linelen += 3; - buffer++; - } - else - { - *line++ = *buffer++; - linelen++; - } - size--; - } - - if (linelen >= LINELENGTH-2-2) - { - if (ctx->log_fp) - { - fprintf (ctx->log_fp, "%s[%p] -> ", my_log_prefix (), ctx); - if (ctx->confidential) - fputs ("[Confidential data not shown]", ctx->log_fp); - else - _assuan_log_print_buffer (ctx->log_fp, - ctx->outbound.data.line, - linelen); - putc ('\n', ctx->log_fp); - } - *line++ = '\n'; - linelen++; - if (writen (ctx->outbound.fd, ctx->outbound.data.line, linelen)) - { - ctx->outbound.data.error = ASSUAN_Write_Error; - return 0; - } - line = ctx->outbound.data.line; - linelen = 0; - } - } - - ctx->outbound.data.linelen = linelen; - return 0; -} - - -/* Write out any buffered data - This fucntion is used for GNU's custom streams */ -int -_assuan_cookie_write_flush (void *cookie) -{ - ASSUAN_CONTEXT ctx = cookie; - char *line; - size_t linelen; - - if (ctx->outbound.data.error) - return 0; - - line = ctx->outbound.data.line; - linelen = ctx->outbound.data.linelen; - line += linelen; - if (linelen) - { - if (ctx->log_fp) - { - fprintf (ctx->log_fp, "%s[%p] -> ", my_log_prefix (), ctx); - if (ctx->confidential) - fputs ("[Confidential data not shown]", ctx->log_fp); - else - _assuan_log_print_buffer (ctx->log_fp, - ctx->outbound.data.line, - linelen); - putc ('\n', ctx->log_fp); - } - *line++ = '\n'; - linelen++; - if (writen (ctx->outbound.fd, ctx->outbound.data.line, linelen)) - { - ctx->outbound.data.error = ASSUAN_Write_Error; - return 0; - } - ctx->outbound.data.linelen = 0; - } - return 0; -} - - -/** - * assuan_send_data: - * @ctx: An assuan context - * @buffer: Data to send or NULL to flush - * @length: length of the data to send/ - * - * This function may be used by the server or the client to send data - * lines. The data will be escaped as required by the Assuan protocol - * and may get buffered until a line is full. To force sending the - * data out @buffer may be passed as NULL (in which case @length must - * also be 0); however when used by a client this flush operation does - * also send the terminating "END" command to terminate the reponse on - * a INQUIRE response. However, when assuan_transact() is used, this - * function takes care of sending END itself. - * - * Return value: 0 on success or an error code - **/ - -AssuanError -assuan_send_data (ASSUAN_CONTEXT ctx, const void *buffer, size_t length) -{ - if (!ctx) - return ASSUAN_Invalid_Value; - if (!buffer && length) - return ASSUAN_Invalid_Value; - - if (!buffer) - { /* flush what we have */ - _assuan_cookie_write_flush (ctx); - if (ctx->outbound.data.error) - return ctx->outbound.data.error; - if (!ctx->is_server) - return assuan_write_line (ctx, "END"); - } - else - { - _assuan_cookie_write_data (ctx, buffer, length); - if (ctx->outbound.data.error) - return ctx->outbound.data.error; - } - - return 0; -} - - - - diff --git a/assuan/assuan-defs.h b/assuan/assuan-defs.h deleted file mode 100644 index 6c502bf..0000000 --- a/assuan/assuan-defs.h +++ /dev/null @@ -1,139 +0,0 @@ -/* assuan-defs.c - Internal definitions to Assuan - * Copyright (C) 2001 Free Software Foundation, Inc. - * - * This file is part of GnuPG. - * - * GnuPG 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 2 of the License, or - * (at your option) any later version. - * - * GnuPG 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, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA - */ - -#ifndef ASSUAN_DEFS_H -#define ASSUAN_DEFS_H - -#include -#include "assuan.h" - -#define LINELENGTH ASSUAN_LINELENGTH - -struct cmdtbl_s { - const char *name; - int cmd_id; - int (*handler)(ASSUAN_CONTEXT, char *line); -}; - -struct assuan_context_s { - AssuanError err_no; - const char *err_str; - int os_errno; /* last system error number used with certain error codes*/ - - int confidential; - int is_server; /* set if this is context belongs to a server */ - int in_inquire; - char *hello_line; - char *okay_line; /* see assan_set_okay_line() */ - - void *user_pointer; /* for assuan_[gs]et_pointer () */ - - FILE *log_fp; - - struct { - int fd; - int eof; - char line[LINELENGTH]; - int linelen; /* w/o CR, LF - might not be the same as - strlen(line) due to embedded nuls. However a nul - is always written at this pos */ - struct { - char line[LINELENGTH]; - int linelen ; - int pending; /* i.e. at least one line is available in the attic */ - } attic; - } inbound; - - struct { - int fd; - struct { - FILE *fp; - char line[LINELENGTH]; - int linelen; - int error; - } data; - } outbound; - - int pipe_mode; /* We are in pipe mode, i.e. we can handle just one - connection and must terminate then */ - pid_t pid; /* In pipe mode, the pid of the child server process. - In socket mode, the pid of the server */ - int listen_fd; /* The fd we are listening on (used by socket servers) */ - - pid_t client_pid; /* for a socket server the PID of the client or -1 - if not available */ - - void (*deinit_handler)(ASSUAN_CONTEXT); - int (*accept_handler)(ASSUAN_CONTEXT); - int (*finish_handler)(ASSUAN_CONTEXT); - - struct cmdtbl_s *cmdtbl; - size_t cmdtbl_used; /* used entries */ - size_t cmdtbl_size; /* allocated size of table */ - - void (*bye_notify_fnc)(ASSUAN_CONTEXT); - void (*reset_notify_fnc)(ASSUAN_CONTEXT); - void (*cancel_notify_fnc)(ASSUAN_CONTEXT); - int (*option_handler_fnc)(ASSUAN_CONTEXT,const char*, const char*); - void (*input_notify_fnc)(ASSUAN_CONTEXT, const char *); - void (*output_notify_fnc)(ASSUAN_CONTEXT, const char *); - - int input_fd; /* set by INPUT command */ - int output_fd; /* set by OUTPUT command */ - -}; - - -/*-- assuan-pipe-server.c --*/ -int _assuan_new_context (ASSUAN_CONTEXT *r_ctx); -void _assuan_release_context (ASSUAN_CONTEXT ctx); - - -/*-- assuan-handler.c --*/ -int _assuan_register_std_commands (ASSUAN_CONTEXT ctx); - -/*-- assuan-buffer.c --*/ -int _assuan_read_line (ASSUAN_CONTEXT ctx); -int _assuan_cookie_write_data (void *cookie, const char *buffer, size_t size); -int _assuan_cookie_write_flush (void *cookie); - -/*-- assuan-client.c --*/ -AssuanError _assuan_read_from_server (ASSUAN_CONTEXT ctx, int *okay, int *off); - - -/*-- assuan-util.c --*/ -void *_assuan_malloc (size_t n); -void *_assuan_calloc (size_t n, size_t m); -void *_assuan_realloc (void *p, size_t n); -void _assuan_free (void *p); - -#define xtrymalloc(a) _assuan_malloc ((a)) -#define xtrycalloc(a,b) _assuan_calloc ((a),(b)) -#define xtryrealloc(a,b) _assuan_realloc((a),(b)) -#define xfree(a) _assuan_free ((a)) - -#define set_error(c,e,t) assuan_set_error ((c), ASSUAN_ ## e, (t)) - -void _assuan_log_print_buffer (FILE *fp, const void *buffer, size_t length); -void _assuan_log_sanitized_string (const char *string); - - -#endif /*ASSUAN_DEFS_H*/ - diff --git a/assuan/assuan-handler.c b/assuan/assuan-handler.c deleted file mode 100644 index aadad21..0000000 --- a/assuan/assuan-handler.c +++ /dev/null @@ -1,672 +0,0 @@ -/* assuan-handler.c - dispatch commands - * Copyright (C) 2001 Free Software Foundation, Inc. - * - * This file is part of GnuPG. - * - * GnuPG 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 2 of the License, or - * (at your option) any later version. - * - * GnuPG 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, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA - */ - -#include -#include -#include -#include - -#include "assuan-defs.h" - -#define spacep(p) (*(p) == ' ' || *(p) == '\t') -#define digitp(a) ((a) >= '0' && (a) <= '9') - - -static int -dummy_handler (ASSUAN_CONTEXT ctx, char *line) -{ - (void)line; - return set_error (ctx, Server_Fault, "no handler registered"); -} - - -static int -std_handler_nop (ASSUAN_CONTEXT ctx, char *line) -{ - (void)ctx; - (void)line; - return 0; /* okay */ -} - -static int -std_handler_cancel (ASSUAN_CONTEXT ctx, char *line) -{ - (void)line; - if (ctx->cancel_notify_fnc) - ctx->cancel_notify_fnc (ctx); - return set_error (ctx, Not_Implemented, NULL); -} - -static int -std_handler_option (ASSUAN_CONTEXT ctx, char *line) -{ - char *key, *value, *p; - - for (key=line; spacep (key); key++) - ; - if (!*key) - return set_error (ctx, Syntax_Error, "argument required"); - if (*key == '=') - return set_error (ctx, Syntax_Error, "no option name given"); - for (value=key; *value && !spacep (value) && *value != '='; value++) - ; - if (*value) - { - if (spacep (value)) - *value++ = 0; /* terminate key */ - for (; spacep (value); value++) - ; - if (*value == '=') - { - *value++ = 0; /* terminate key */ - for (; spacep (value); value++) - ; - if (!*value) - return set_error (ctx, Syntax_Error, "option argument expected"); - } - if (*value) - { - for (p = value + strlen(value) - 1; p > value && spacep (p); p--) - ; - if (p > value) - *++p = 0; /* strip trailing spaces */ - } - } - - if (*key == '-' && key[1] == '-' && key[2]) - key += 2; /* the double dashes are optional */ - if (*key == '-') - return set_error (ctx, Syntax_Error, - "option should not begin with one dash"); - - if (ctx->option_handler_fnc) - return ctx->option_handler_fnc (ctx, key, value); - return 0; -} - -static int -std_handler_bye (ASSUAN_CONTEXT ctx, char *line) -{ - (void)line; - if (ctx->bye_notify_fnc) - ctx->bye_notify_fnc (ctx); - assuan_close_input_fd (ctx); - assuan_close_output_fd (ctx); - return -1; /* pretty simple :-) */ -} - -static int -std_handler_auth (ASSUAN_CONTEXT ctx, char *line) -{ - (void)line; - return set_error (ctx, Not_Implemented, NULL); -} - -static int -std_handler_reset (ASSUAN_CONTEXT ctx, char *line) -{ - (void)line; - if (ctx->reset_notify_fnc) - ctx->reset_notify_fnc (ctx); - assuan_close_input_fd (ctx); - assuan_close_output_fd (ctx); - return 0; -} - -static int -std_handler_end (ASSUAN_CONTEXT ctx, char *line) -{ - (void)line; - return set_error (ctx, Not_Implemented, NULL); -} - -static int -parse_cmd_input_output (ASSUAN_CONTEXT ctx, char *line, int *rfd) -{ - char *endp; - - if (strncmp (line, "FD=", 3)) - return set_error (ctx, Syntax_Error, "FD= expected"); - line += 3; - if (!digitp (*line)) - return set_error (ctx, Syntax_Error, "number required"); - *rfd = strtoul (line, &endp, 10); - /* remove that argument so that a notify handler won't see it */ - memset (line, ' ', endp? (endp-line):strlen(line)); - - if (*rfd == ctx->inbound.fd) - return set_error (ctx, Parameter_Conflict, "fd same as inbound fd"); - if (*rfd == ctx->outbound.fd) - return set_error (ctx, Parameter_Conflict, "fd same as outbound fd"); - return 0; -} - -/* Format is INPUT FD= */ -static int -std_handler_input (ASSUAN_CONTEXT ctx, char *line) -{ - int rc, fd; - - rc = parse_cmd_input_output (ctx, line, &fd); - if (rc) - return rc; - ctx->input_fd = fd; - if (ctx->input_notify_fnc) - ctx->input_notify_fnc (ctx, line); - return 0; -} - -/* Format is OUTPUT FD= */ -static int -std_handler_output (ASSUAN_CONTEXT ctx, char *line) -{ - int rc, fd; - - rc = parse_cmd_input_output (ctx, line, &fd); - if (rc) - return rc; - ctx->output_fd = fd; - if (ctx->output_notify_fnc) - ctx->output_notify_fnc (ctx, line); - return 0; -} - - - - - -/* This is a table with the standard commands and handler for them. - The table is used to initialize a new context and assuciate strings - and handlers with cmd_ids */ -static struct { - const char *name; - int cmd_id; - int (*handler)(ASSUAN_CONTEXT, char *line); - int always; /* always initialize this command */ -} std_cmd_table[] = { - { "NOP", ASSUAN_CMD_NOP, std_handler_nop, 1 }, - { "CANCEL", ASSUAN_CMD_CANCEL, std_handler_cancel, 1 }, - { "OPTION", ASSUAN_CMD_OPTION, std_handler_option, 1 }, - { "BYE", ASSUAN_CMD_BYE, std_handler_bye, 1 }, - { "AUTH", ASSUAN_CMD_AUTH, std_handler_auth, 1 }, - { "RESET", ASSUAN_CMD_RESET, std_handler_reset, 1 }, - { "END", ASSUAN_CMD_END, std_handler_end, 1 }, - - { "INPUT", ASSUAN_CMD_INPUT, std_handler_input }, - { "OUTPUT", ASSUAN_CMD_OUTPUT, std_handler_output }, - { "OPTION", ASSUAN_CMD_OPTION, std_handler_option, 1 }, - { NULL } -}; - - -/** - * assuan_register_command: - * @ctx: the server context - * @cmd_id: An ID value for the command - * @cmd_name: A string with the command name - * @handler: The handler function to be called - * - * Register a handler to be used for a given command. - * - * The @cmd_name must be %NULL or an empty string for all @cmd_ids - * below %ASSUAN_CMD_USER because predefined values are used. - * - * Return value: - **/ -int -assuan_register_command (ASSUAN_CONTEXT ctx, - int cmd_id, const char *cmd_name, - int (*handler)(ASSUAN_CONTEXT, char *)) -{ - int i; - - if (cmd_name && !*cmd_name) - cmd_name = NULL; - - if (cmd_id < ASSUAN_CMD_USER) - { - if (cmd_name) - return ASSUAN_Invalid_Value; /* must be NULL for these values*/ - - for (i=0; std_cmd_table[i].name; i++) - { - if (std_cmd_table[i].cmd_id == cmd_id) - { - cmd_name = std_cmd_table[i].name; - if (!handler) - handler = std_cmd_table[i].handler; - break; - } - } - if (!std_cmd_table[i].name) - return ASSUAN_Invalid_Value; /* not a pre-registered one */ - } - - if (!handler) - handler = dummy_handler; - - if (!cmd_name) - return ASSUAN_Invalid_Value; - -/* fprintf (stderr, "DBG-assuan: registering %d as `%s'\n", cmd_id, cmd_name); */ - - if (!ctx->cmdtbl) - { - ctx->cmdtbl_size = 50; - ctx->cmdtbl = xtrycalloc ( ctx->cmdtbl_size, sizeof *ctx->cmdtbl); - if (!ctx->cmdtbl) - return ASSUAN_Out_Of_Core; - ctx->cmdtbl_used = 0; - } - else if (ctx->cmdtbl_used >= ctx->cmdtbl_size) - { - struct cmdtbl_s *x; - - x = xtryrealloc ( ctx->cmdtbl, (ctx->cmdtbl_size+10) * sizeof *x); - if (!x) - return ASSUAN_Out_Of_Core; - ctx->cmdtbl = x; - ctx->cmdtbl_size += 50; - } - - ctx->cmdtbl[ctx->cmdtbl_used].name = cmd_name; - ctx->cmdtbl[ctx->cmdtbl_used].cmd_id = cmd_id; - ctx->cmdtbl[ctx->cmdtbl_used].handler = handler; - ctx->cmdtbl_used++; - return 0; -} - -int -assuan_register_bye_notify (ASSUAN_CONTEXT ctx, void (*fnc)(ASSUAN_CONTEXT)) -{ - if (!ctx) - return ASSUAN_Invalid_Value; - ctx->bye_notify_fnc = fnc; - return 0; -} - -int -assuan_register_reset_notify (ASSUAN_CONTEXT ctx, void (*fnc)(ASSUAN_CONTEXT)) -{ - if (!ctx) - return ASSUAN_Invalid_Value; - ctx->reset_notify_fnc = fnc; - return 0; -} - -int -assuan_register_cancel_notify (ASSUAN_CONTEXT ctx, void (*fnc)(ASSUAN_CONTEXT)) -{ - if (!ctx) - return ASSUAN_Invalid_Value; - ctx->cancel_notify_fnc = fnc; - return 0; -} - -int -assuan_register_option_handler (ASSUAN_CONTEXT ctx, - int (*fnc)(ASSUAN_CONTEXT, - const char*, const char*)) -{ - if (!ctx) - return ASSUAN_Invalid_Value; - ctx->option_handler_fnc = fnc; - return 0; -} - -int -assuan_register_input_notify (ASSUAN_CONTEXT ctx, - void (*fnc)(ASSUAN_CONTEXT, const char *)) -{ - if (!ctx) - return ASSUAN_Invalid_Value; - ctx->input_notify_fnc = fnc; - return 0; -} - -int -assuan_register_output_notify (ASSUAN_CONTEXT ctx, - void (*fnc)(ASSUAN_CONTEXT, const char *)) -{ - if (!ctx) - return ASSUAN_Invalid_Value; - ctx->output_notify_fnc = fnc; - return 0; -} - - -/* Helper to register the standards commands */ -int -_assuan_register_std_commands (ASSUAN_CONTEXT ctx) -{ - int i, rc; - - for (i=0; std_cmd_table[i].name; i++) - { - if (std_cmd_table[i].always) - { - rc = assuan_register_command (ctx, std_cmd_table[i].cmd_id, - NULL, NULL); - if (rc) - return rc; - } - } - return 0; -} - - - -/* Process the special data lines. The "D " has already been removed - from the line. As all handlers this function may modify the line. */ -static int -handle_data_line (ASSUAN_CONTEXT ctx, char *line, int linelen) -{ - (void)line; - (void)linelen; - return set_error (ctx, Not_Implemented, NULL); -} - -/* like ascii_strcasecmp but assume that B is already uppercase */ -static int -my_strcasecmp (const char *a, const char *b) -{ - if (a == b) - return 0; - - for (; *a && *b; a++, b++) - { - if (((*a >= 'a' && *a <= 'z')? (*a&~0x20):*a) != *b) - break; - } - return *a == *b? 0 : (((*a >= 'a' && *a <= 'z')? (*a&~0x20):*a) - *b); -} - -/* Parse the line, break out the command, find it in the command - table, remove leading and white spaces from the arguments, all the - handler with the argument line and return the error */ -static int -dispatch_command (ASSUAN_CONTEXT ctx, char *line, int linelen) -{ - char *p; - const char *s; - int shift, i; - - if (*line == 'D' && line[1] == ' ') /* divert to special handler */ - return handle_data_line (ctx, line+2, linelen-2); - - for (p=line; *p && *p != ' ' && *p != '\t'; p++) - ; - if (p==line) - return set_error (ctx, Syntax_Error, "leading white-space"); - if (*p) - { /* Skip over leading WS after the keyword */ - *p++ = 0; - while ( *p == ' ' || *p == '\t') - p++; - } - shift = p - line; - - for (i=0; (s=ctx->cmdtbl[i].name); i++) - { - if (!strcmp (line, s)) - break; - } - if (!s) - { /* and try case insensitive */ - for (i=0; (s=ctx->cmdtbl[i].name); i++) - { - if (!my_strcasecmp (line, s)) - break; - } - } - if (!s) - return set_error (ctx, Unknown_Command, NULL); - line += shift; - linelen -= shift; - -/* fprintf (stderr, "DBG-assuan: processing %s `%s'\n", s, line); */ - return ctx->cmdtbl[i].handler (ctx, line); -} - - - - -static int -process_request (ASSUAN_CONTEXT ctx) -{ - int rc; - - if (ctx->in_inquire) - return ASSUAN_Nested_Commands; - - rc = _assuan_read_line (ctx); - if (rc) - return rc; - if (*ctx->inbound.line == '#' || !ctx->inbound.linelen) - return 0; /* comment line - ignore */ - - ctx->outbound.data.error = 0; - ctx->outbound.data.linelen = 0; - /* dispatch command and return reply */ - rc = dispatch_command (ctx, ctx->inbound.line, ctx->inbound.linelen); - /* check from data write errors */ - if (ctx->outbound.data.fp) - { /* Flush the data lines */ - fclose (ctx->outbound.data.fp); - ctx->outbound.data.fp = NULL; - if (!rc && ctx->outbound.data.error) - rc = ctx->outbound.data.error; - } - else /* flush any data send w/o using the data fp */ - { - assuan_send_data (ctx, NULL, 0); - if (!rc && ctx->outbound.data.error) - rc = ctx->outbound.data.error; - } - /* Error handling */ - if (!rc) - { - rc = assuan_write_line (ctx, ctx->okay_line? ctx->okay_line : "OK"); - } - else if (rc == -1) - { /* No error checking because the peer may have already disconnect */ - assuan_write_line (ctx, "OK closing connection"); - ctx->finish_handler (ctx); - } - else - { - char errline[256]; - - if (rc < 100) - sprintf (errline, "ERR %d server fault (%.50s)", - ASSUAN_Server_Fault, assuan_strerror (rc)); - else - { - const char *text = ctx->err_no == rc? ctx->err_str:NULL; - - sprintf (errline, "ERR %d %.50s%s%.100s", - rc, assuan_strerror (rc), text? " - ":"", text?text:""); - } - rc = assuan_write_line (ctx, errline); - } - - ctx->confidential = 0; - if (ctx->okay_line) - { - xfree (ctx->okay_line); - ctx->okay_line = NULL; - } - return rc; -} - -/** - * assuan_process: - * @ctx: assuan context - * - * This fucntion is used to handle the assuan protocol after a - * connection has been established using assuan_accept(). This is the - * main protocol handler. - * - * Return value: 0 on success or an error code if the assuan operation - * failed. Note, that no error is returned for operational errors. - **/ -int -assuan_process (ASSUAN_CONTEXT ctx) -{ - int rc; - - do { - rc = process_request (ctx); - } while (!rc); - - if (rc == -1) - rc = 0; - - return rc; -} - - -/** - * assuan_process_next: - * @ctx: Assuan context - * - * Same as assuan_process() but the user has to provide the outer - * loop. He should loop as long as the return code is zero and stop - * otherwise; -1 is regular end. - * - * See also: assuan_get_active_fds() - * Return value: -1 for end of server, 0 on success or an error code - **/ -int -assuan_process_next (ASSUAN_CONTEXT ctx) -{ - return process_request (ctx); -} - - -/** - * assuan_get_active_fds: - * @ctx: Assuan context - * @what: 0 for read fds, 1 for write fds - * @fdarray: Caller supplied array to store the FDs - * @fdarraysize: size of that array - * - * Return all active filedescriptors for the given context. This - * function can be used to select on the fds and call - * assuan_process_next() if there is an active one. The first fd in - * the array is the one used for the command connection. - * - * Note, that write FDs are not yet supported. - * - * Return value: number of FDs active and put into @fdarray or -1 on - * error which is most likely a too small fdarray. - **/ -int -assuan_get_active_fds (ASSUAN_CONTEXT ctx, int what, - int *fdarray, int fdarraysize) -{ - int n = 0; - - if (!ctx || fdarraysize < 2 || what < 0 || what > 1) - return -1; - - if (!what) - { - if (ctx->inbound.fd != -1) - fdarray[n++] = ctx->inbound.fd; - } - else - { - if (ctx->outbound.fd != -1) - fdarray[n++] = ctx->outbound.fd; - if (ctx->outbound.data.fp) - fdarray[n++] = fileno (ctx->outbound.data.fp); - } - - return n; -} - - -/* Set the text used for the next OK reponse. This string is - automatically reset to NULL after the next command. */ -AssuanError -assuan_set_okay_line (ASSUAN_CONTEXT ctx, const char *line) -{ - if (!ctx) - return ASSUAN_Invalid_Value; - if (!line) - { - xfree (ctx->okay_line); - ctx->okay_line = NULL; - } - else - { - /* FIXME: we need to use gcry_is_secure() to test whether - we should allocate the entire line in secure memory */ - char *buf = xtrymalloc (3+strlen(line)+1); - if (!buf) - return ASSUAN_Out_Of_Core; - strcpy (buf, "OK "); - strcpy (buf+3, line); - xfree (ctx->okay_line); - ctx->okay_line = buf; - } - return 0; -} - - - -void -assuan_write_status (ASSUAN_CONTEXT ctx, const char *keyword, const char *text) -{ - char buffer[256]; - char *helpbuf; - size_t n; - - if ( !ctx || !keyword) - return; - if (!text) - text = ""; - - n = 2 + strlen (keyword) + 1 + strlen (text) + 1; - if (n < sizeof (buffer)) - { - strcpy (buffer, "S "); - strcat (buffer, keyword); - if (*text) - { - strcat (buffer, " "); - strcat (buffer, text); - } - assuan_write_line (ctx, buffer); - } - else if ( (helpbuf = xtrymalloc (n)) ) - { - strcpy (helpbuf, "S "); - strcat (helpbuf, keyword); - if (*text) - { - strcat (helpbuf, " "); - strcat (helpbuf, text); - } - assuan_write_line (ctx, helpbuf); - xfree (helpbuf); - } -} diff --git a/assuan/assuan-listen.c b/assuan/assuan-listen.c deleted file mode 100644 index db63ad2..0000000 --- a/assuan/assuan-listen.c +++ /dev/null @@ -1,132 +0,0 @@ -/* assuan-listen.c - Wait for a connection (server) - * Copyright (C) 2001 Free Software Foundation, Inc. - * - * This file is part of GnuPG. - * - * GnuPG 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 2 of the License, or - * (at your option) any later version. - * - * GnuPG 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, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA - */ - -#include -#include -#include -#include -#include - -#include "assuan-defs.h" - -AssuanError -assuan_set_hello_line (ASSUAN_CONTEXT ctx, const char *line) -{ - if (!ctx) - return ASSUAN_Invalid_Value; - if (!line) - { - xfree (ctx->hello_line); - ctx->hello_line = NULL; - } - else - { - char *buf = xtrymalloc (3+strlen(line)+1); - if (!buf) - return ASSUAN_Out_Of_Core; - strcpy (buf, "OK "); - strcpy (buf+3, line); - xfree (ctx->hello_line); - ctx->hello_line = buf; - } - return 0; -} - - -/** - * assuan_accept: - * @ctx: context - * - * Cancel any existing connectiion and wait for a connection from a - * client. The initial handshake is performed which may include an - * initial authentication or encryption negotiation. - * - * Return value: 0 on success or an error if the connection could for - * some reason not be established. - **/ -AssuanError -assuan_accept (ASSUAN_CONTEXT ctx) -{ - int rc; - - if (!ctx) - return ASSUAN_Invalid_Value; - - if (ctx->pipe_mode > 1) - return -1; /* second invocation for pipemode -> terminate */ - ctx->finish_handler (ctx); - - rc = ctx->accept_handler (ctx); - if (rc) - return rc; - - /* send the hello */ - rc = assuan_write_line (ctx, ctx->hello_line? ctx->hello_line - : "OK Your orders please"); - if (rc) - return rc; - - if (ctx->pipe_mode) - ctx->pipe_mode = 2; - - return 0; -} - - - -int -assuan_get_input_fd (ASSUAN_CONTEXT ctx) -{ - return ctx? ctx->input_fd : -1; -} - - -int -assuan_get_output_fd (ASSUAN_CONTEXT ctx) -{ - return ctx? ctx->output_fd : -1; -} - - -/* Close the fd descriptor set by the command INPUT FD=n. We handle - this fd inside assuan so that we can do some initial checks */ -AssuanError -assuan_close_input_fd (ASSUAN_CONTEXT ctx) -{ - if (!ctx || ctx->input_fd == -1) - return ASSUAN_Invalid_Value; - close (ctx->input_fd); - ctx->input_fd = -1; - return 0; -} - -/* Close the fd descriptor set by the command OUTPUT FD=n. We handle - this fd inside assuan so that we can do some initial checks */ -AssuanError -assuan_close_output_fd (ASSUAN_CONTEXT ctx) -{ - if (!ctx || ctx->output_fd == -1) - return ASSUAN_Invalid_Value; - - close (ctx->output_fd); - ctx->output_fd = -1; - return 0; -} - diff --git a/assuan/assuan-pipe-server.c b/assuan/assuan-pipe-server.c deleted file mode 100644 index c0d464f..0000000 --- a/assuan/assuan-pipe-server.c +++ /dev/null @@ -1,127 +0,0 @@ -/* assuan-pipe-server.c - Assuan server working over a pipe - * Copyright (C) 2001 Free Software Foundation, Inc. - * - * This file is part of GnuPG. - * - * GnuPG 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 2 of the License, or - * (at your option) any later version. - * - * GnuPG 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, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA - */ - -#include -#include -#include - -#include "assuan-defs.h" - -static void -deinit_pipe_server (ASSUAN_CONTEXT ctx) -{ - (void)ctx; - /* nothing to do for this simple server */ -} - -static int -accept_connection (ASSUAN_CONTEXT ctx) -{ - (void)ctx; - /* This is a NOP for a pipe server */ - return 0; -} - -static int -finish_connection (ASSUAN_CONTEXT ctx) -{ - (void)ctx; - /* This is a NOP for a pipe server */ - return 0; -} - - -/* Create a new context. Note that the handlers are set up for a pipe - server/client - this way we don't need extra dummy functions */ -int -_assuan_new_context (ASSUAN_CONTEXT *r_ctx) -{ - ASSUAN_CONTEXT ctx; - int rc; - - *r_ctx = NULL; - ctx = xtrycalloc (1, sizeof *ctx); - if (!ctx) - return ASSUAN_Out_Of_Core; - ctx->input_fd = -1; - ctx->output_fd = -1; - - ctx->inbound.fd = -1; - ctx->outbound.fd = -1; - - ctx->listen_fd = -1; - ctx->client_pid = (pid_t)-1; - /* use the pipe server handler as a default */ - ctx->deinit_handler = deinit_pipe_server; - ctx->accept_handler = accept_connection; - ctx->finish_handler = finish_connection; - - rc = _assuan_register_std_commands (ctx); - if (rc) - xfree (ctx); - else - *r_ctx = ctx; - return rc; -} - - - -int -assuan_init_pipe_server (ASSUAN_CONTEXT *r_ctx, int filedes[2]) -{ - int rc; - - rc = _assuan_new_context (r_ctx); - if (!rc) - { - ASSUAN_CONTEXT ctx = *r_ctx; - - ctx->is_server = 1; - ctx->inbound.fd = filedes[0]; - ctx->outbound.fd = filedes[1]; - ctx->pipe_mode = 1; - } - return rc; -} - - -void -_assuan_release_context (ASSUAN_CONTEXT ctx) -{ - if (ctx) - { - xfree (ctx->hello_line); - xfree (ctx->okay_line); - xfree (ctx); - } -} - -void -assuan_deinit_server (ASSUAN_CONTEXT ctx) -{ - if (ctx) - { - /* We use this function pointer to avoid linking other server - when not needed but still allow for a generic deinit function */ - ctx->deinit_handler (ctx); - ctx->deinit_handler = NULL; - _assuan_release_context (ctx); - } -} diff --git a/assuan/assuan-util.c b/assuan/assuan-util.c deleted file mode 100644 index c2c899f..0000000 --- a/assuan/assuan-util.c +++ /dev/null @@ -1,196 +0,0 @@ -/* assuan-util.c - Utility functions for Assuan - * Copyright (C) 2001 Free Software Foundation, Inc. - * - * This file is part of GnuPG. - * - * GnuPG 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 2 of the License, or - * (at your option) any later version. - * - * GnuPG 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, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA - */ - -#include -#include -#include -#include - -#include "assuan-defs.h" - -#ifdef HAVE_JNLIB_LOGGING -#include "../jnlib/logging.h" -#endif - - -static void *(*alloc_func)(size_t n) = malloc; -static void *(*realloc_func)(void *p, size_t n) = realloc; -static void (*free_func)(void*) = free; - - - -void -assuan_set_malloc_hooks ( void *(*new_alloc_func)(size_t n), - void *(*new_realloc_func)(void *p, size_t n), - void (*new_free_func)(void*) ) -{ - alloc_func = new_alloc_func; - realloc_func = new_realloc_func; - free_func = new_free_func; -} - -void * -_assuan_malloc (size_t n) -{ - return alloc_func (n); -} - -void * -_assuan_realloc (void *a, size_t n) -{ - return realloc_func (a, n); -} - -void * -_assuan_calloc (size_t n, size_t m) -{ - void *p = _assuan_malloc (n*m); - if (p) - memset (p, 0, n* m); - return p; -} - -void -_assuan_free (void *p) -{ - if (p) - free_func (p); -} - - - -/* Store the error in the context so that the error sending function - can take out a descriptive text. Inside the assuan code, use the - macro set_error instead of this function. */ -int -assuan_set_error (ASSUAN_CONTEXT ctx, int err, const char *text) -{ - ctx->err_no = err; - ctx->err_str = text; - return err; -} - -void -assuan_set_pointer (ASSUAN_CONTEXT ctx, void *pointer) -{ - if (ctx) - ctx->user_pointer = pointer; -} - -void * -assuan_get_pointer (ASSUAN_CONTEXT ctx) -{ - return ctx? ctx->user_pointer : NULL; -} - - -void -assuan_set_log_stream (ASSUAN_CONTEXT ctx, FILE *fp) -{ - if (ctx) - { - if (ctx->log_fp) - fflush (ctx->log_fp); - ctx->log_fp = fp; - } -} - - -void -assuan_begin_confidential (ASSUAN_CONTEXT ctx) -{ - if (ctx) - { - ctx->confidential = 1; - } -} - -void -assuan_end_confidential (ASSUAN_CONTEXT ctx) -{ - if (ctx) - { - ctx->confidential = 0; - } -} - -void -_assuan_log_print_buffer (FILE *fp, const void *buffer, size_t length) -{ - const unsigned char *s; - int n; - - for (n=length,s=buffer; n; n--, s++) - { - if (*s < ' ' || (*s >= 0x7f && *s <= 0xa0)) - break; - } - s = buffer; - if (!n && *s != '[') - fwrite (buffer, length, 1, fp); - else - { - putc ('[', fp); - for (n=0; n < length; n++, s++) - fprintf (fp, " %02x", *s); - putc (' ', fp); - putc (']', fp); - } -} - - -/* print a user supplied string after filtering out potential bad - characters*/ -void -_assuan_log_sanitized_string (const char *string) -{ - const unsigned char *s = (const unsigned char*)string; -#ifdef HAVE_JNLIB_LOGGING - FILE *fp = log_get_stream (); -#else - FILE *fp = stderr; -#endif - - for (; *s; s++) - { - if (*s < 0x20 || (*s >= 0x7f && *s <= 0xa0)) - { - putc ('\\', fp); - if (*s == '\n') - putc ('n', fp); - else if (*s == '\r') - putc ('r', fp); - else if (*s == '\f') - putc ('f', fp); - else if (*s == '\v') - putc ('v', fp); - else if (*s == '\b') - putc ('b', fp); - else if (!*s) - putc ('0', fp); - else - fprintf (fp, "x%02x", *s ); - } - else - putc (*s, fp); - } -} - - diff --git a/assuan/assuan.h b/assuan/assuan.h deleted file mode 100644 index 7087d7b..0000000 --- a/assuan/assuan.h +++ /dev/null @@ -1,202 +0,0 @@ -/* assuan.c - Definitions for the Assuna protocol - * Copyright (C) 2001, 2002 Free Software Foundation, Inc. - * - * This file is part of GnuPG. - * - * GnuPG 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 2 of the License, or - * (at your option) any later version. - * - * GnuPG 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, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA - */ - -#ifndef ASSUAN_H -#define ASSUAN_H - -#include -#include - -#ifdef __cplusplus -extern "C" { -#if 0 - } -#endif -#endif - -/* 5 is pinentry. */ -#define ASSUAN_ERROR(code) ((5 << 24) | code) - -typedef enum { - ASSUAN_No_Error = 0, - ASSUAN_General_Error = ASSUAN_ERROR (257), - ASSUAN_Out_Of_Core = ASSUAN_ERROR (86 | (1 << 15)), - ASSUAN_Invalid_Value = ASSUAN_ERROR (261), - ASSUAN_Timeout = ASSUAN_ERROR (62), - ASSUAN_Read_Error = ASSUAN_ERROR (270), /* Not 100%, but sufficient here. */ - ASSUAN_Write_Error = ASSUAN_ERROR (271), /* Not 100%, but sufficient here. */ - ASSUAN_Problem_Starting_Server = ASSUAN_ERROR (269), - ASSUAN_Not_A_Server = ASSUAN_ERROR (267), - ASSUAN_Not_A_Client = ASSUAN_ERROR (268), - ASSUAN_Nested_Commands = ASSUAN_ERROR (264), - ASSUAN_Invalid_Response = ASSUAN_ERROR (260), - ASSUAN_No_Data_Callback = ASSUAN_ERROR (265), - ASSUAN_No_Inquire_Callback = ASSUAN_ERROR (266), - ASSUAN_Connect_Failed = ASSUAN_ERROR (259), - ASSUAN_Accept_Failed = ASSUAN_ERROR (258), - - /* error codes above 99 are meant as status codes */ - ASSUAN_Not_Implemented = ASSUAN_ERROR (69), - ASSUAN_Server_Fault = ASSUAN_ERROR (80), - ASSUAN_Unknown_Command = ASSUAN_ERROR (275), - ASSUAN_Syntax_Error = ASSUAN_ERROR (276), - ASSUAN_Parameter_Conflict = ASSUAN_ERROR (280), - ASSUAN_Line_Too_Long = ASSUAN_ERROR (263), - ASSUAN_Line_Not_Terminated = ASSUAN_ERROR (262), - ASSUAN_Canceled = ASSUAN_ERROR (99), - ASSUAN_Invalid_Option = ASSUAN_ERROR (174), /* GPG_ERR_UNKNOWN_OPTION */ - ASSUAN_Locale_Problem = ASSUAN_ERROR (166), - ASSUAN_Not_Confirmed = ASSUAN_ERROR (114), - ASSUAN_Too_Short = ASSUAN_ERROR (66), - ASSUAN_ENOENT = ASSUAN_ERROR (81 | (1 << 15)), - ASSUAN_ENOTTY = ASSUAN_ERROR (102 | (1 << 15)), - -} assuan_error_t; - -#define ASSUAN_Parameter_Error ASSUAN_Parameter_Conflict - - -typedef assuan_error_t AssuanError; /* Deprecated. */ - -/* This is a list of pre-registered ASSUAN commands */ -typedef enum { - ASSUAN_CMD_NOP = 0, - ASSUAN_CMD_CANCEL, /* cancel the current request */ - ASSUAN_CMD_BYE, - ASSUAN_CMD_AUTH, - ASSUAN_CMD_RESET, - ASSUAN_CMD_OPTION, - ASSUAN_CMD_DATA, - ASSUAN_CMD_END, - ASSUAN_CMD_INPUT, - ASSUAN_CMD_OUTPUT, - - ASSUAN_CMD_USER = 256 /* Other commands should be used with this offset*/ -} AssuanCommand; - -#define ASSUAN_LINELENGTH 1002 /* 1000 + [CR,]LF */ - -struct assuan_context_s; -typedef struct assuan_context_s *assuan_context_t; -typedef struct assuan_context_s *ASSUAN_CONTEXT; /* Deprecated. */ - -/*-- assuan-handler.c --*/ -int assuan_register_command (ASSUAN_CONTEXT ctx, - int cmd_id, const char *cmd_string, - int (*handler)(ASSUAN_CONTEXT, char *)); -int assuan_register_bye_notify (ASSUAN_CONTEXT ctx, - void (*fnc)(ASSUAN_CONTEXT)); -int assuan_register_reset_notify (ASSUAN_CONTEXT ctx, - void (*fnc)(ASSUAN_CONTEXT)); -int assuan_register_cancel_notify (ASSUAN_CONTEXT ctx, - void (*fnc)(ASSUAN_CONTEXT)); -int assuan_register_input_notify (ASSUAN_CONTEXT ctx, - void (*fnc)(ASSUAN_CONTEXT, const char *)); -int assuan_register_output_notify (ASSUAN_CONTEXT ctx, - void (*fnc)(ASSUAN_CONTEXT, const char *)); - -int assuan_register_option_handler (ASSUAN_CONTEXT ctx, - int (*fnc)(ASSUAN_CONTEXT, - const char*, const char*)); - -int assuan_process (ASSUAN_CONTEXT ctx); -int assuan_process_next (ASSUAN_CONTEXT ctx); -int assuan_get_active_fds (ASSUAN_CONTEXT ctx, int what, - int *fdarray, int fdarraysize); - - -AssuanError assuan_set_okay_line (ASSUAN_CONTEXT ctx, const char *line); -void assuan_write_status (ASSUAN_CONTEXT ctx, - const char *keyword, const char *text); - - -/*-- assuan-listen.c --*/ -AssuanError assuan_set_hello_line (ASSUAN_CONTEXT ctx, const char *line); -AssuanError assuan_accept (ASSUAN_CONTEXT ctx); -int assuan_get_input_fd (ASSUAN_CONTEXT ctx); -int assuan_get_output_fd (ASSUAN_CONTEXT ctx); -AssuanError assuan_close_input_fd (ASSUAN_CONTEXT ctx); -AssuanError assuan_close_output_fd (ASSUAN_CONTEXT ctx); - - -/*-- assuan-pipe-server.c --*/ -int assuan_init_pipe_server (ASSUAN_CONTEXT *r_ctx, int filedes[2]); -void assuan_deinit_server (ASSUAN_CONTEXT ctx); - -/*-- assuan-socket-server.c --*/ -int assuan_init_socket_server (ASSUAN_CONTEXT *r_ctx, int listen_fd); - - -/*-- assuan-pipe-connect.c --*/ -AssuanError assuan_pipe_connect (ASSUAN_CONTEXT *ctx, const char *name, - char *const argv[], int *fd_child_list); -/*-- assuan-socket-connect.c --*/ -AssuanError assuan_socket_connect (ASSUAN_CONTEXT *ctx, const char *name, - pid_t server_pid); - -/*-- assuan-connect.c --*/ -void assuan_disconnect (ASSUAN_CONTEXT ctx); -pid_t assuan_get_pid (ASSUAN_CONTEXT ctx); - -/*-- assuan-client.c --*/ -AssuanError -assuan_transact (ASSUAN_CONTEXT ctx, - const char *command, - AssuanError (*data_cb)(void *, const void *, size_t), - void *data_cb_arg, - AssuanError (*inquire_cb)(void*, const char *), - void *inquire_cb_arg, - AssuanError (*status_cb)(void*, const char *), - void *status_cb_arg); - - -/*-- assuan-inquire.c --*/ -AssuanError assuan_inquire (ASSUAN_CONTEXT ctx, const char *keyword, - char **r_buffer, size_t *r_length, size_t maxlen); - -/*-- assuan-buffer.c --*/ -AssuanError assuan_read_line (ASSUAN_CONTEXT ctx, - char **line, size_t *linelen); -int assuan_pending_line (ASSUAN_CONTEXT ctx); -AssuanError assuan_write_line (ASSUAN_CONTEXT ctx, const char *line ); -AssuanError assuan_send_data (ASSUAN_CONTEXT ctx, - const void *buffer, size_t length); - - -/*-- assuan-util.c --*/ -void assuan_set_malloc_hooks ( void *(*new_alloc_func)(size_t n), - void *(*new_realloc_func)(void *p, size_t n), - void (*new_free_func)(void*) ); -void assuan_set_log_stream (ASSUAN_CONTEXT ctx, FILE *fp); -int assuan_set_error (ASSUAN_CONTEXT ctx, int err, const char *text); -void assuan_set_pointer (ASSUAN_CONTEXT ctx, void *pointer); -void *assuan_get_pointer (ASSUAN_CONTEXT ctx); - -void assuan_begin_confidential (ASSUAN_CONTEXT ctx); -void assuan_end_confidential (ASSUAN_CONTEXT ctx); - -/*-- assuan-errors.c (built) --*/ -const char *assuan_strerror (AssuanError err); - - -#ifdef __cplusplus -} -#endif -#endif /*ASSUAN_H*/ diff --git a/assuan/mkerrors b/assuan/mkerrors deleted file mode 100755 index 91902bf..0000000 --- a/assuan/mkerrors +++ /dev/null @@ -1,71 +0,0 @@ -#!/bin/sh -# mkerrors - Extract error strings from assuan.h -# and create C source for assuan_strerror -# Copyright (C) 2001 Free Software Foundation, Inc. -# -# This file is part of GnuPG. -# -# GnuPG 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 2 of the License, or -# (at your option) any later version. -# -# GnuPG 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, write to the Free Software -# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA - -cat < -#include "assuan.h" - -/** - * assuan_strerror: - * @err: Error code - * - * This function returns a textual representaion of the given - * errorcode. If this is an unknown value, a string with the value - * is returned (Beware: it is hold in a static buffer). - * - * Return value: String with the error description. - **/ -const char * -assuan_strerror (AssuanError err) -{ - const char *s; - static char buf[25]; - - switch (err) - { -EOF - -awk ' -/ASSUAN_No_Error/ { okay=1 } -!okay {next} -/}/ { exit 0 } -/ASSUAN_[A-Za-z_]*/ { print_code($1) } - - -function print_code( s ) -{ -printf " case %s: s=\"", s ; -gsub(/_/, " ", s ); -printf "%s\"; break;\n", tolower(substr(s,8)); -} -' - -cat < None required because we use a stripped down version of libassuan. +# +# libassuan is used for IPC +# +NEED_LIBASSUAN_API=2 +NEED_LIBASSUAN_VERSION=2.1.0 +have_libassuan=no +AM_PATH_LIBASSUAN("$NEED_LIBASSUAN_API:$NEED_LIBASSUAN_VERSION", + have_libassuan=yes,have_libassuan=no) +if test "$have_libassuan" = "yes"; then + AC_DEFINE_UNQUOTED(GNUPG_LIBASSUAN_VERSION, "$libassuan_version", + [version of the libassuan library]) +fi + +COMMON_CFLAGS="$LIBASSUAN_CFLAGS $COMMON_CFLAGS" +COMMON_LIBS="$LIBASSUAN_LIBS $COMMON_LIBS" dnl Checks for libsecmem. @@ -442,8 +476,8 @@ if test "$libsecret" = "yes"; then AC_DEFINE(HAVE_LIBSECRET, 1, [The pinentries should optionally cache the passphrase using libsecret.]) - COMMON_CFLAGS="$COMMON_CFLAGS $LIBSECRET_CFLAGS" - COMMON_LIBS="$COMMON_LIBS $LIBSECRET_LIBS" + COMMON_CFLAGS="$LIBSECRET_CFLAGS $COMMON_CFLAGS" + COMMON_LIBS="$LIBSECRET_LIBS $COMMON_LIBS" fi dnl @@ -561,9 +595,66 @@ else fi AC_SUBST(PINENTRY_DEFAULT) +# +# Print errors here so that they are visible all +# together and the user can acquire them all together. +# +die=no +if test "$have_gpg_error" = "no"; then + die=yes + AC_MSG_NOTICE([[ +*** +*** You need libgpg-error to build this program. +** This library is for example available at +*** ftp://ftp.gnupg.org/gcrypt/libgpg-error +*** (at least version $NEED_GPG_ERROR_VERSION is required.) +***]]) +fi + +if test "$have_libassuan" = "no"; then + die=yes + AC_MSG_NOTICE([[ +*** +*** You need libassuan to build this program. +*** This library is for example available at +*** ftp://ftp.gnupg.org/gcrypt/libassuan/ +*** (at least version $NEED_LIBASSUAN_VERSION (API $NEED_LIBASSUAN_API) is required). +***]]) +fi + +if test "$die" = "yes"; then + AC_MSG_ERROR([[ +*** +*** Required libraries not found. Please consult the above messages +*** and install them before running configure again. +***]]) +fi + + + +# +# To avoid double inclusion of config.h which might happen at some +# places, we add the usual double inclusion protection at the top of +# config.h. +# +AH_TOP([ +#ifndef GNUPG_CONFIG_H_INCLUDED +#define GNUPG_CONFIG_H_INCLUDED +]) + +# +# Stuff which goes at the bottom of config.h. +# +AH_BOTTOM([ +#ifdef GPG_ERR_SOURCE_DEFAULT +# error GPG_ERR_SOURCE_DEFAULT already defined +#endif +#define GPG_ERR_SOURCE_DEFAULT GPG_ERR_SOURCE_PINENTRY +#endif /*GNUPG_CONFIG_H_INCLUDED*/ +]) + AC_CONFIG_FILES([ -assuan/Makefile secmem/Makefile pinentry/Makefile curses/Makefile diff --git a/curses/Makefile.am b/curses/Makefile.am index 4d764c7..915f8a8 100644 --- a/curses/Makefile.am +++ b/curses/Makefile.am @@ -23,7 +23,6 @@ bin_PROGRAMS = pinentry-curses AM_CPPFLAGS = $(COMMON_CFLAGS) $(NCURSES_INCLUDE) -I$(top_srcdir)/pinentry LDADD = ../pinentry/libpinentry.a ../pinentry/libpinentry-curses.a \ - ../assuan/libassuan.a ../secmem/libsecmem.a \ - $(COMMON_LIBS) $(LIBCAP) $(LIBCURSES) $(LIBICONV) + ../secmem/libsecmem.a $(COMMON_LIBS) $(LIBCAP) $(LIBCURSES) $(LIBICONV) pinentry_curses_SOURCES = pinentry-curses.c diff --git a/gnome3/Makefile.am b/gnome3/Makefile.am index 46639de..71c0732 100644 --- a/gnome3/Makefile.am +++ b/gnome3/Makefile.am @@ -30,9 +30,8 @@ libcurses = endif AM_CPPFLAGS = $(COMMON_CFLAGS) $(GNOME3CFLAGS) \ - $(ncurses_include) -I$(top_srcdir)/assuan \ - -I$(top_srcdir)/secmem -I$(top_srcdir)/pinentry -LDADD = ../pinentry/libpinentry.a ../assuan/libassuan.a ../secmem/libsecmem.a \ + $(ncurses_include) -I$(top_srcdir)/secmem -I$(top_srcdir)/pinentry +LDADD = ../pinentry/libpinentry.a ../secmem/libsecmem.a \ $(COMMON_LIBS) $(LIBCAP) $(GNOME3LIBS) $(libcurses) pinentry_gnome3_SOURCES = pinentry-gnome3.c diff --git a/gnome3/pinentry-gnome3.c b/gnome3/pinentry-gnome3.c index 0fea8f0..2799904 100644 --- a/gnome3/pinentry-gnome3.c +++ b/gnome3/pinentry-gnome3.c @@ -27,7 +27,7 @@ #include -#include "assuan.h" +#include #include "memory.h" @@ -189,7 +189,7 @@ gnome3_cmd_handler (pinentry_t pe) if (error) /* Error. */ { - pe->specific_err = ASSUAN_General_Error; + pe->specific_err = gpg_error (GPG_ERR_ASS_GENERAL); g_error_free (error); ret = -1; } @@ -231,7 +231,7 @@ gnome3_cmd_handler (pinentry_t pe) reply = gcr_prompt_confirm_run (prompt, NULL, &error); if (error) { - pe->specific_err = ASSUAN_General_Error; + pe->specific_err = gpg_error (GPG_ERR_ASS_GENERAL); ret = 0; } else if (reply == GCR_PROMPT_REPLY_CONTINUE diff --git a/gtk+-2/Makefile.am b/gtk+-2/Makefile.am index 7e37469..88f245e 100644 --- a/gtk+-2/Makefile.am +++ b/gtk+-2/Makefile.am @@ -31,7 +31,7 @@ endif AM_CPPFLAGS = $(COMMON_CFLAGS) $(GTK2CFLAGS) $(ncurses_include) \ -I$(top_srcdir)/secmem -I$(top_srcdir)/pinentry -LDADD = ../pinentry/libpinentry.a ../assuan/libassuan.a ../secmem/libsecmem.a \ +LDADD = ../pinentry/libpinentry.a ../secmem/libsecmem.a \ $(COMMON_LIBS) $(LIBCAP) $(GTK2LIBS) $(libcurses) pinentry_gtk_2_SOURCES = pinentry-gtk-2.c \ diff --git a/pinentry/Makefile.am b/pinentry/Makefile.am index 7fbbab6..d24581b 100644 --- a/pinentry/Makefile.am +++ b/pinentry/Makefile.am @@ -30,7 +30,7 @@ endif noinst_LIBRARIES = libpinentry.a $(pinentry_curses) LDADD = $(COMMON_LIBS) -AM_CPPFLAGS = $(COMMON_CFLAGS) -I$(top_srcdir)/assuan -I$(top_srcdir)/secmem +AM_CPPFLAGS = $(COMMON_CFLAGS) -I$(top_srcdir)/secmem libpinentry_a_SOURCES = pinentry.h pinentry.c argparse.c argparse.h \ password-cache.h password-cache.c diff --git a/pinentry/pinentry-curses.c b/pinentry/pinentry-curses.c index d25ab2e..235435a 100644 --- a/pinentry/pinentry-curses.c +++ b/pinentry/pinentry-curses.c @@ -50,8 +50,9 @@ #include #endif /*HAVE_WCHAR_H*/ +#include + #include "pinentry.h" -#include "assuan.h" /* FIXME: We should allow configuration of these button labels and in any case use the default_ok, default_cancel values if available. @@ -250,7 +251,7 @@ dialog_create (pinentry_t pinentry, dialog_t dialog) if (!what) \ { \ err = 1; \ - pinentry->specific_err = ASSUAN_Locale_Problem; \ + pinentry->specific_err = gpg_error (GPG_ERR_LOCALE_PROBLEM); \ goto out; \ } \ } \ @@ -282,7 +283,7 @@ dialog_create (pinentry_t pinentry, dialog_t dialog) if (!new) \ { \ err = 1; \ - pinentry->specific_err = ASSUAN_Out_Of_Core; \ + pinentry->specific_err = gpg_error_from_syserror (); \ goto out; \ } \ \ @@ -307,7 +308,7 @@ dialog_create (pinentry_t pinentry, dialog_t dialog) if (!dialog->which) \ { \ err = 1; \ - pinentry->specific_err = ASSUAN_Locale_Problem; \ + pinentry->specific_err = gpg_error (GPG_ERR_LOCALE_PROBLEM); \ goto out; \ } \ } \ @@ -373,7 +374,7 @@ dialog_create (pinentry_t pinentry, dialog_t dialog) if (y > size_y) { err = 1; - pinentry->specific_err = ASSUAN_Too_Short; + pinentry->specific_err = gpg_error (GPG_ERR_ASS_LINE_TOO_LONG); goto out; } @@ -428,7 +429,7 @@ dialog_create (pinentry_t pinentry, dialog_t dialog) if (x > size_x) { err = 1; - pinentry->specific_err = ASSUAN_Too_Short; + pinentry->specific_err = gpg_error (GPG_ERR_ASS_LINE_TOO_LONG); goto out; } @@ -833,7 +834,7 @@ dialog_run (pinentry_t pinentry, const char *tty_name, const char *tty_type) ttyfi = fopen (tty_name, "r"); if (!ttyfi) { - pinentry->specific_err = ASSUAN_ENOENT; + pinentry->specific_err = gpg_error_from_syserror (); return -1; } ttyfo = fopen (tty_name, "w"); @@ -842,7 +843,7 @@ dialog_run (pinentry_t pinentry, const char *tty_name, const char *tty_type) int err = errno; fclose (ttyfi); errno = err; - pinentry->specific_err = ASSUAN_ENOENT; + pinentry->specific_err = gpg_error_from_syserror (); return -1; } screen = newterm (tty_type, ttyfo, ttyfi); @@ -855,7 +856,7 @@ dialog_run (pinentry_t pinentry, const char *tty_name, const char *tty_type) if (!(isatty(fileno(stdin)) && isatty(fileno(stdout)))) { errno = ENOTTY; - pinentry->specific_err = ASSUAN_ENOTTY; + pinentry->specific_err = gpg_error_from_syserror (); return -1; } init_screen = 1; diff --git a/pinentry/pinentry.c b/pinentry/pinentry.c index 6f7a62c..47d9b06 100644 --- a/pinentry/pinentry.c +++ b/pinentry/pinentry.c @@ -43,7 +43,8 @@ #include #endif -#include "assuan.h" +#include + #include "memory.h" #include "secmem-util.h" #include "argparse.h" @@ -165,11 +166,15 @@ pinentry_reset (int use_defaults) } } -static void -pinentry_assuan_reset_handler (ASSUAN_CONTEXT ctx) +static gpg_error_t +pinentry_assuan_reset_handler (assuan_context_t ctx, char *line) { (void)ctx; + (void)line; + pinentry_reset (0); + + return 0; } @@ -356,7 +361,7 @@ copy_and_escape (char *buffer, const void *text, size_t textlen) int pinentry_inq_quality (pinentry_t pin, const char *passphrase, size_t length) { - ASSUAN_CONTEXT ctx = pin->ctx_assuan; + assuan_context_t ctx = pin->ctx_assuan; const char prefix[] = "INQUIRE QUALITY "; char *command; char *line; @@ -500,6 +505,10 @@ pinentry_setbuffer_use (pinentry_t pin, char *passphrase, int len) pin->pin_len = len; } +static struct assuan_malloc_hooks assuan_malloc_hooks = { + secmem_malloc, secmem_realloc, secmem_free +}; + /* Initialize the secure memory subsystem, drop privileges and return. Must be called early. */ void @@ -510,6 +519,8 @@ pinentry_init (const char *pgmname) abort (); strcpy (this_pgmname, pgmname); + gpgrt_check_version (NULL); + /* Initialize secure memory. 1 is too small, so the default size will be used. */ secmem_init (1); @@ -521,7 +532,7 @@ pinentry_init (const char *pgmname) /* FIXME: Could not register at-exit function, bail out. */ } - assuan_set_malloc_hooks (secmem_malloc, secmem_realloc, secmem_free); + assuan_set_malloc_hooks (&assuan_malloc_hooks); } /* Simple test to check whether DISPLAY is set or the option --display @@ -755,8 +766,8 @@ pinentry_parse_opts (int argc, char *argv[]) } -static int -option_handler (ASSUAN_CONTEXT ctx, const char *key, const char *value) +static gpg_error_t +option_handler (assuan_context_t ctx, const char *key, const char *value) { (void)ctx; @@ -779,7 +790,7 @@ option_handler (ASSUAN_CONTEXT ctx, const char *key, const char *value) free (pinentry.display); pinentry.display = strdup (value); if (!pinentry.display) - return ASSUAN_Out_Of_Core; + return gpg_error_from_syserror (); } else if (!strcmp (key, "ttyname")) { @@ -787,7 +798,7 @@ option_handler (ASSUAN_CONTEXT ctx, const char *key, const char *value) free (pinentry.ttyname); pinentry.ttyname = strdup (value); if (!pinentry.ttyname) - return ASSUAN_Out_Of_Core; + return gpg_error_from_syserror (); } else if (!strcmp (key, "ttytype")) { @@ -795,7 +806,7 @@ option_handler (ASSUAN_CONTEXT ctx, const char *key, const char *value) free (pinentry.ttytype); pinentry.ttytype = strdup (value); if (!pinentry.ttytype) - return ASSUAN_Out_Of_Core; + return gpg_error_from_syserror (); } else if (!strcmp (key, "lc-ctype")) { @@ -803,7 +814,7 @@ option_handler (ASSUAN_CONTEXT ctx, const char *key, const char *value) free (pinentry.lc_ctype); pinentry.lc_ctype = strdup (value); if (!pinentry.lc_ctype) - return ASSUAN_Out_Of_Core; + return gpg_error_from_syserror (); } else if (!strcmp (key, "lc-messages")) { @@ -811,7 +822,7 @@ option_handler (ASSUAN_CONTEXT ctx, const char *key, const char *value) free (pinentry.lc_messages); pinentry.lc_messages = strdup (value); if (!pinentry.lc_messages) - return ASSUAN_Out_Of_Core; + return gpg_error_from_syserror (); } else if (!strcmp (key, "parent-wid")) { @@ -824,31 +835,31 @@ option_handler (ASSUAN_CONTEXT ctx, const char *key, const char *value) free (pinentry.touch_file); pinentry.touch_file = strdup (value); if (!pinentry.touch_file) - return ASSUAN_Out_Of_Core; + return gpg_error_from_syserror (); } else if (!strcmp (key, "default-ok")) { pinentry.default_ok = strdup (value); if (!pinentry.default_ok) - return ASSUAN_Out_Of_Core; + return gpg_error_from_syserror (); } else if (!strcmp (key, "default-cancel")) { pinentry.default_cancel = strdup (value); if (!pinentry.default_cancel) - return ASSUAN_Out_Of_Core; + return gpg_error_from_syserror (); } else if (!strcmp (key, "default-prompt")) { pinentry.default_prompt = strdup (value); if (!pinentry.default_prompt) - return ASSUAN_Out_Of_Core; + return gpg_error_from_syserror (); } else if (!strcmp (key, "default-pwmngr")) { pinentry.default_pwmngr = strdup (value); if (!pinentry.default_pwmngr) - return ASSUAN_Out_Of_Core; + return gpg_error_from_syserror (); } else if (!strcmp (key, "allow-external-password-cache") && !*value) { @@ -856,7 +867,7 @@ option_handler (ASSUAN_CONTEXT ctx, const char *key, const char *value) pinentry.tried_password_cache = 0; } else - return ASSUAN_Invalid_Option; + return gpg_error (GPG_ERR_UNKNOWN_OPTION); return 0; } @@ -881,8 +892,8 @@ strcpy_escaped (char *d, const char *s) } -static int -cmd_setdesc (ASSUAN_CONTEXT ctx, char *line) +static gpg_error_t +cmd_setdesc (assuan_context_t ctx, char *line) { char *newd; @@ -890,7 +901,7 @@ cmd_setdesc (ASSUAN_CONTEXT ctx, char *line) newd = malloc (strlen (line) + 1); if (!newd) - return ASSUAN_Out_Of_Core; + return gpg_error_from_syserror (); strcpy_escaped (newd, line); if (pinentry.description) @@ -900,8 +911,8 @@ cmd_setdesc (ASSUAN_CONTEXT ctx, char *line) } -static int -cmd_setprompt (ASSUAN_CONTEXT ctx, char *line) +static gpg_error_t +cmd_setprompt (assuan_context_t ctx, char *line) { char *newp; @@ -909,7 +920,7 @@ cmd_setprompt (ASSUAN_CONTEXT ctx, char *line) newp = malloc (strlen (line) + 1); if (!newp) - return ASSUAN_Out_Of_Core; + return gpg_error_from_syserror (); strcpy_escaped (newp, line); if (pinentry.prompt) @@ -923,8 +934,8 @@ cmd_setprompt (ASSUAN_CONTEXT ctx, char *line) to identify a key for caching strategies of its own. The empty string and --clear mean that the key does not have a stable identifier. */ -static int -cmd_setkeyinfo (ASSUAN_CONTEXT ctx, char *line) +static gpg_error_t +cmd_setkeyinfo (assuan_context_t ctx, char *line) { (void)ctx; @@ -940,8 +951,8 @@ cmd_setkeyinfo (ASSUAN_CONTEXT ctx, char *line) } -static int -cmd_setrepeat (ASSUAN_CONTEXT ctx, char *line) +static gpg_error_t +cmd_setrepeat (assuan_context_t ctx, char *line) { char *p; @@ -949,7 +960,7 @@ cmd_setrepeat (ASSUAN_CONTEXT ctx, char *line) p = malloc (strlen (line) + 1); if (!p) - return ASSUAN_Out_Of_Core; + return gpg_error_from_syserror (); strcpy_escaped (p, line); free (pinentry.repeat_passphrase); @@ -958,8 +969,8 @@ cmd_setrepeat (ASSUAN_CONTEXT ctx, char *line) } -static int -cmd_setrepeaterror (ASSUAN_CONTEXT ctx, char *line) +static gpg_error_t +cmd_setrepeaterror (assuan_context_t ctx, char *line) { char *p; @@ -967,7 +978,7 @@ cmd_setrepeaterror (ASSUAN_CONTEXT ctx, char *line) p = malloc (strlen (line) + 1); if (!p) - return ASSUAN_Out_Of_Core; + return gpg_error_from_syserror (); strcpy_escaped (p, line); free (pinentry.repeat_error_string); @@ -976,8 +987,8 @@ cmd_setrepeaterror (ASSUAN_CONTEXT ctx, char *line) } -static int -cmd_seterror (ASSUAN_CONTEXT ctx, char *line) +static gpg_error_t +cmd_seterror (assuan_context_t ctx, char *line) { char *newe; @@ -985,7 +996,7 @@ cmd_seterror (ASSUAN_CONTEXT ctx, char *line) newe = malloc (strlen (line) + 1); if (!newe) - return ASSUAN_Out_Of_Core; + return gpg_error_from_syserror (); strcpy_escaped (newe, line); if (pinentry.error) @@ -995,8 +1006,8 @@ cmd_seterror (ASSUAN_CONTEXT ctx, char *line) } -static int -cmd_setok (ASSUAN_CONTEXT ctx, char *line) +static gpg_error_t +cmd_setok (assuan_context_t ctx, char *line) { char *newo; @@ -1004,7 +1015,7 @@ cmd_setok (ASSUAN_CONTEXT ctx, char *line) newo = malloc (strlen (line) + 1); if (!newo) - return ASSUAN_Out_Of_Core; + return gpg_error_from_syserror (); strcpy_escaped (newo, line); if (pinentry.ok) @@ -1014,8 +1025,8 @@ cmd_setok (ASSUAN_CONTEXT ctx, char *line) } -static int -cmd_setnotok (ASSUAN_CONTEXT ctx, char *line) +static gpg_error_t +cmd_setnotok (assuan_context_t ctx, char *line) { char *newo; @@ -1023,7 +1034,7 @@ cmd_setnotok (ASSUAN_CONTEXT ctx, char *line) newo = malloc (strlen (line) + 1); if (!newo) - return ASSUAN_Out_Of_Core; + return gpg_error_from_syserror (); strcpy_escaped (newo, line); if (pinentry.notok) @@ -1033,8 +1044,8 @@ cmd_setnotok (ASSUAN_CONTEXT ctx, char *line) } -static int -cmd_setcancel (ASSUAN_CONTEXT ctx, char *line) +static gpg_error_t +cmd_setcancel (assuan_context_t ctx, char *line) { char *newc; @@ -1042,7 +1053,7 @@ cmd_setcancel (ASSUAN_CONTEXT ctx, char *line) newc = malloc (strlen (line) + 1); if (!newc) - return ASSUAN_Out_Of_Core; + return gpg_error_from_syserror (); strcpy_escaped (newc, line); if (pinentry.cancel) @@ -1052,8 +1063,8 @@ cmd_setcancel (ASSUAN_CONTEXT ctx, char *line) } -static int -cmd_settimeout (ASSUAN_CONTEXT ctx, char *line) +static gpg_error_t +cmd_settimeout (assuan_context_t ctx, char *line) { (void)ctx; @@ -1063,8 +1074,8 @@ cmd_settimeout (ASSUAN_CONTEXT ctx, char *line) return 0; } -static int -cmd_settitle (ASSUAN_CONTEXT ctx, char *line) +static gpg_error_t +cmd_settitle (assuan_context_t ctx, char *line) { char *newt; @@ -1072,7 +1083,7 @@ cmd_settitle (ASSUAN_CONTEXT ctx, char *line) newt = malloc (strlen (line) + 1); if (!newt) - return ASSUAN_Out_Of_Core; + return gpg_error_from_syserror (); strcpy_escaped (newt, line); if (pinentry.title) @@ -1081,8 +1092,8 @@ cmd_settitle (ASSUAN_CONTEXT ctx, char *line) return 0; } -static int -cmd_setqualitybar (ASSUAN_CONTEXT ctx, char *line) +static gpg_error_t +cmd_setqualitybar (assuan_context_t ctx, char *line) { char *newval; @@ -1093,7 +1104,7 @@ cmd_setqualitybar (ASSUAN_CONTEXT ctx, char *line) newval = malloc (strlen (line) + 1); if (!newval) - return ASSUAN_Out_Of_Core; + return gpg_error_from_syserror (); strcpy_escaped (newval, line); if (pinentry.quality_bar) @@ -1103,8 +1114,8 @@ cmd_setqualitybar (ASSUAN_CONTEXT ctx, char *line) } /* Set the tooltip to be used for a quality bar. */ -static int -cmd_setqualitybar_tt (ASSUAN_CONTEXT ctx, char *line) +static gpg_error_t +cmd_setqualitybar_tt (assuan_context_t ctx, char *line) { char *newval; @@ -1114,7 +1125,7 @@ cmd_setqualitybar_tt (ASSUAN_CONTEXT ctx, char *line) { newval = malloc (strlen (line) + 1); if (!newval) - return ASSUAN_Out_Of_Core; + return gpg_error_from_syserror (); strcpy_escaped (newval, line); } @@ -1127,8 +1138,8 @@ cmd_setqualitybar_tt (ASSUAN_CONTEXT ctx, char *line) } -static int -cmd_getpin (ASSUAN_CONTEXT ctx, char *line) +static gpg_error_t +cmd_getpin (assuan_context_t ctx, char *line) { int result; int set_prompt = 0; @@ -1138,7 +1149,7 @@ cmd_getpin (ASSUAN_CONTEXT ctx, char *line) pinentry_setbuffer_init (&pinentry); if (!pinentry.pin) - return ASSUAN_Out_Of_Core; + return gpg_error (GPG_ERR_ENOMEM); /* Try reading from the password cache. */ if (/* If repeat passphrase is set, then we don't want to read from @@ -1224,7 +1235,9 @@ cmd_getpin (ASSUAN_CONTEXT ctx, char *line) pinentry_setbuffer_clear (&pinentry); if (pinentry.specific_err) return pinentry.specific_err; - return pinentry.locale_err? ASSUAN_Locale_Problem: ASSUAN_Canceled; + return (pinentry.locale_err + ? gpg_error (GPG_ERR_LOCALE_PROBLEM) + : gpg_error (GPG_ERR_CANCELED)); } out: @@ -1259,8 +1272,8 @@ cmd_getpin (ASSUAN_CONTEXT ctx, char *line) update pinentry or to have the caller test for the message command. New applications which are free to require an updated pinentry should use MESSAGE instead. */ -static int -cmd_confirm (ASSUAN_CONTEXT ctx, char *line) +static gpg_error_t +cmd_confirm (assuan_context_t ctx, char *line) { int result; @@ -1288,19 +1301,19 @@ cmd_confirm (ASSUAN_CONTEXT ctx, char *line) return pinentry.specific_err; if (pinentry.locale_err) - return ASSUAN_Locale_Problem; + return gpg_error (GPG_ERR_LOCALE_PROBLEM); if (pinentry.one_button) return 0; if (pinentry.canceled) - return ASSUAN_Canceled; - return ASSUAN_Not_Confirmed; + return gpg_error (GPG_ERR_CANCELED); + return gpg_error (GPG_ERR_NOT_CONFIRMED); } -static int -cmd_message (ASSUAN_CONTEXT ctx, char *line) +static gpg_error_t +cmd_message (assuan_context_t ctx, char *line) { (void)line; @@ -1315,7 +1328,7 @@ cmd_message (ASSUAN_CONTEXT ctx, char *line) version - Return the version of the program. pid - Return the process id of the server. */ -static int +static gpg_error_t cmd_getinfo (assuan_context_t ctx, char *line) { int rc; @@ -1333,7 +1346,7 @@ cmd_getinfo (assuan_context_t ctx, char *line) rc = assuan_send_data (ctx, numbuf, strlen (numbuf)); } else - rc = ASSUAN_Parameter_Error; + rc = gpg_error (GPG_ERR_ASS_PARAMETER); return rc; } @@ -1342,13 +1355,13 @@ cmd_getinfo (assuan_context_t ctx, char *line) Clear the cache passphrase associated with the key identified by cacheid. */ -static int -cmd_clear_passphrase (ASSUAN_CONTEXT ctx, char *line) +static gpg_error_t +cmd_clear_passphrase (assuan_context_t ctx, char *line) { (void)ctx; if (! line) - return ASSUAN_Invalid_Value; + return gpg_error (GPG_ERR_ASS_INV_VALUE); /* Remove leading and trailing white space. */ while (*line == ' ') @@ -1359,50 +1372,47 @@ cmd_clear_passphrase (ASSUAN_CONTEXT ctx, char *line) switch (password_cache_clear (line)) { case 1: return 0; - case 0: return ASSUAN_Invalid_Value; - default: return ASSUAN_General_Error; + case 0: return gpg_error (GPG_ERR_ASS_INV_VALUE); + default: return gpg_error (GPG_ERR_ASS_GENERAL); } } /* Tell the assuan library about our commands. */ -static int -register_commands (ASSUAN_CONTEXT ctx) +static gpg_error_t +register_commands (assuan_context_t ctx) { static struct { const char *name; - int cmd_id; - int (*handler) (ASSUAN_CONTEXT, char *line); + gpg_error_t (*handler) (assuan_context_t, char *line); } table[] = { - { "SETDESC", 0, cmd_setdesc }, - { "SETPROMPT", 0, cmd_setprompt }, - { "SETKEYINFO", 0, cmd_setkeyinfo }, - { "SETREPEAT", 0, cmd_setrepeat }, - { "SETREPEATERROR",0, cmd_setrepeaterror }, - { "SETERROR", 0, cmd_seterror }, - { "SETOK", 0, cmd_setok }, - { "SETNOTOK", 0, cmd_setnotok }, - { "SETCANCEL", 0, cmd_setcancel }, - { "GETPIN", 0, cmd_getpin }, - { "CONFIRM", 0, cmd_confirm }, - { "MESSAGE", 0, cmd_message }, - { "SETQUALITYBAR", 0, cmd_setqualitybar }, - { "SETQUALITYBAR_TT", 0, cmd_setqualitybar_tt }, - { "GETINFO", 0, cmd_getinfo }, - { "SETTITLE", 0, cmd_settitle }, - { "SETTIMEOUT", 0, cmd_settimeout }, - { "CLEARPASSPHRASE", 0, cmd_clear_passphrase }, + { "SETDESC", cmd_setdesc }, + { "SETPROMPT", cmd_setprompt }, + { "SETKEYINFO", cmd_setkeyinfo }, + { "SETREPEAT", cmd_setrepeat }, + { "SETREPEATERROR", cmd_setrepeaterror }, + { "SETERROR", cmd_seterror }, + { "SETOK", cmd_setok }, + { "SETNOTOK", cmd_setnotok }, + { "SETCANCEL", cmd_setcancel }, + { "GETPIN", cmd_getpin }, + { "CONFIRM", cmd_confirm }, + { "MESSAGE", cmd_message }, + { "SETQUALITYBAR", cmd_setqualitybar }, + { "SETQUALITYBAR_TT", cmd_setqualitybar_tt }, + { "GETINFO", cmd_getinfo }, + { "SETTITLE", cmd_settitle }, + { "SETTIMEOUT", cmd_settimeout }, + { "CLEARPASSPHRASE", cmd_clear_passphrase }, { NULL } }; - int i, j, rc; + int i, j; + gpg_error_t rc; for (i = j = 0; table[i].name; i++) { - rc = assuan_register_command (ctx, - table[i].cmd_id ? table[i].cmd_id - : (ASSUAN_CMD_USER + j++), - table[i].name, table[i].handler); + rc = assuan_register_command (ctx, table[i].name, table[i].handler, NULL); if (rc) return rc; } @@ -1413,9 +1423,9 @@ register_commands (ASSUAN_CONTEXT ctx) int pinentry_loop2 (int infd, int outfd) { - int rc; + gpg_error_t rc; int filedes[2]; - ASSUAN_CONTEXT ctx; + assuan_context_t ctx; /* Extra check to make sure we have dropped privs. */ #ifndef HAVE_DOSISH_SYSTEM @@ -1423,23 +1433,31 @@ pinentry_loop2 (int infd, int outfd) abort (); #endif + rc = assuan_new (&ctx); + if (rc) + { + fprintf (stderr, "server context creation failed: %s\n", + gpg_strerror (rc)); + return -1; + } + /* For now we use a simple pipe based server so that we can work from scripts. We will later add options to run as a daemon and wait for requests on a Unix domain socket. */ filedes[0] = infd; filedes[1] = outfd; - rc = assuan_init_pipe_server (&ctx, filedes); + rc = assuan_init_pipe_server (ctx, filedes); if (rc) { fprintf (stderr, "%s: failed to initialize the server: %s\n", - this_pgmname, assuan_strerror(rc)); + this_pgmname, gpg_strerror (rc)); return -1; } rc = register_commands (ctx); if (rc) { fprintf (stderr, "%s: failed to the register commands with Assuan: %s\n", - this_pgmname, assuan_strerror(rc)); + this_pgmname, gpg_strerror (rc)); return -1; } @@ -1457,7 +1475,7 @@ pinentry_loop2 (int infd, int outfd) else if (rc) { fprintf (stderr, "%s: Assuan accept problem: %s\n", - this_pgmname, assuan_strerror (rc)); + this_pgmname, gpg_strerror (rc)); break; } @@ -1465,12 +1483,12 @@ pinentry_loop2 (int infd, int outfd) if (rc) { fprintf (stderr, "%s: Assuan processing failed: %s\n", - this_pgmname, assuan_strerror (rc)); + this_pgmname, gpg_strerror (rc)); continue; } } - assuan_deinit_server (ctx); + assuan_release (ctx); return 0; } diff --git a/qt4/Makefile.am b/qt4/Makefile.am index 816aade..e2014e3 100644 --- a/qt4/Makefile.am +++ b/qt4/Makefile.am @@ -35,12 +35,11 @@ endif AM_CPPFLAGS = $(COMMON_CFLAGS) \ - -I$(top_srcdir) -I$(top_srcdir)/assuan -I$(top_srcdir)/secmem \ + -I$(top_srcdir) -I$(top_srcdir)/secmem \ $(ncurses_include) -I$(top_srcdir)/pinentry AM_CXXFLAGS = $(QT4_CORE_CFLAGS) $(QT4_GUI_CFLAGS) pinentry_qt4_LDADD = \ - ../pinentry/libpinentry.a $(top_builddir)/assuan/libassuan.a \ - $(top_builddir)/secmem/libsecmem.a \ + ../pinentry/libpinentry.a $(top_builddir)/secmem/libsecmem.a \ $(COMMON_LIBS) $(QT4_CORE_LIBS) $(QT4_GUI_LIBS) $(libcurses) $(LIBCAP) BUILT_SOURCES = \ diff --git a/tty/Makefile.am b/tty/Makefile.am index ca6406f..e232473 100644 --- a/tty/Makefile.am +++ b/tty/Makefile.am @@ -21,8 +21,7 @@ bin_PROGRAMS = pinentry-tty AM_CPPFLAGS = $(COMMON_CFLAGS) -I$(top_srcdir)/secmem -I$(top_srcdir)/pinentry -LDADD = ../pinentry/libpinentry.a \ - ../assuan/libassuan.a ../secmem/libsecmem.a \ +LDADD = ../pinentry/libpinentry.a ../secmem/libsecmem.a \ $(COMMON_LIBS) $(LIBCAP) $(LIBICONV) pinentry_tty_SOURCES = pinentry-tty.c ----------------------------------------------------------------------- Summary of changes: Makefile.am | 2 +- assuan/ChangeLog-old | 254 ----------------- assuan/Makefile.am | 43 --- assuan/README.1st | 1 - assuan/assuan-buffer.c | 474 ------------------------------- assuan/assuan-defs.h | 139 --------- assuan/assuan-handler.c | 672 -------------------------------------------- assuan/assuan-listen.c | 132 --------- assuan/assuan-pipe-server.c | 127 --------- assuan/assuan-util.c | 196 ------------- assuan/assuan.h | 202 ------------- assuan/mkerrors | 71 ----- configure.ac | 99 ++++++- curses/Makefile.am | 3 +- gnome3/Makefile.am | 5 +- gnome3/pinentry-gnome3.c | 6 +- gtk+-2/Makefile.am | 2 +- pinentry/Makefile.am | 2 +- pinentry/pinentry-curses.c | 19 +- pinentry/pinentry.c | 234 ++++++++------- qt4/Makefile.am | 5 +- tty/Makefile.am | 3 +- 22 files changed, 243 insertions(+), 2448 deletions(-) delete mode 100644 assuan/ChangeLog-old delete mode 100644 assuan/Makefile.am delete mode 100644 assuan/README.1st delete mode 100644 assuan/assuan-buffer.c delete mode 100644 assuan/assuan-defs.h delete mode 100644 assuan/assuan-handler.c delete mode 100644 assuan/assuan-listen.c delete mode 100644 assuan/assuan-pipe-server.c delete mode 100644 assuan/assuan-util.c delete mode 100644 assuan/assuan.h delete mode 100755 assuan/mkerrors hooks/post-receive -- The standard pinentry collection http://git.gnupg.org From cvs at cvs.gnupg.org Tue Jun 16 12:52:56 2015 From: cvs at cvs.gnupg.org (by Neal H. Walfield) Date: Tue, 16 Jun 2015 12:52:56 +0200 Subject: [git] Pinentry - branch, master, updated. pinentry-0.9.4-7-g34f3cdb Message-ID: 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 standard pinentry collection". The branch, master has been updated via 34f3cdbf5aa0b7b8647a3bcedef7e1a51746b5ed (commit) via 34539f97a6ddc552295b5cb64676eee9dab5bd30 (commit) via 56fe7ef451ee473407b7dc604e3d73a6a5771c5d (commit) from 302903f76b8d62b1e07219a203f7219cb3aff7d8 (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 34f3cdbf5aa0b7b8647a3bcedef7e1a51746b5ed Author: Neal H. Walfield Date: Tue Jun 16 12:52:46 2015 +0200 If we fail to initialize gtk, fallback to the curses frontend. * gnome3/pinentry-gnome3.c (main): Use gtk_init_check instead of gtk_init. If it fails, fallback to the curses frontend. diff --git a/gnome3/pinentry-gnome3.c b/gnome3/pinentry-gnome3.c index 2799904..8f91cb8 100644 --- a/gnome3/pinentry-gnome3.c +++ b/gnome3/pinentry-gnome3.c @@ -262,7 +262,10 @@ main (int argc, char *argv[]) #ifdef FALLBACK_CURSES if (pinentry_have_display (argc, argv)) - gtk_init (&argc, &argv); + { + if (! gtk_init_check (&argc, &argv)) + pinentry_cmd_handler = curses_cmd_handler; + } else pinentry_cmd_handler = curses_cmd_handler; #else commit 34539f97a6ddc552295b5cb64676eee9dab5bd30 Author: Neal H. Walfield Date: Tue Jun 16 12:18:06 2015 +0200 Fix comment for pinentry_cmd_handler_t. * pinentry/pinentry.h (pinentry_cmd_handler_t): Fix comment. diff --git a/pinentry/pinentry.h b/pinentry/pinentry.h index a5882bf..abcc3a5 100644 --- a/pinentry/pinentry.h +++ b/pinentry/pinentry.h @@ -202,7 +202,7 @@ typedef struct pinentry *pinentry_t; entry. On confirmation, the function should return TRUE if confirmed, and FALSE otherwise. On PIN entry, the function should return -1 if an error occured or the user cancelled the operation - and the length of the secret otherwise. */ + and 1 otherwise. */ typedef int (*pinentry_cmd_handler_t) (pinentry_t pin); /* Start the pinentry event loop. The program will start to process commit 56fe7ef451ee473407b7dc604e3d73a6a5771c5d Author: Neal H. Walfield Date: Tue Jun 16 12:17:32 2015 +0200 Describe default-prompt in the implementation section of the manual. * doc/pinentry.texi (Implementation Details): Describe default-prompt. diff --git a/doc/pinentry.texi b/doc/pinentry.texi index 154e61a..90902bd 100644 --- a/doc/pinentry.texi +++ b/doc/pinentry.texi @@ -552,9 +552,17 @@ again prompt the user. In this case, this variable contains a description of the error message. This text should typically be highlighted in someway. - at item @code{prompt} + at item @code{prompt}, @code{default-prompt} The string to associate with the passphrase entry box. +There is a subtle difference between @code{prompt} and + at code{default-prompt}. @code{default-prompt} means that a stylized +prompt (e.g., an icon suggesting a prompt) may be used. @code{prompt} +means that the entry's meaning is not consistent with such a style +and, as such, no icon should be used. + +If both variables are set, the @code{prompt} variant takes precedence. + @item @code{repeat_passphrase} The string to associate with the second passphrase entry box. The second passphrase entry box should only be shown if this is not ----------------------------------------------------------------------- Summary of changes: doc/pinentry.texi | 10 +++++++++- gnome3/pinentry-gnome3.c | 5 ++++- pinentry/pinentry.h | 2 +- 3 files changed, 14 insertions(+), 3 deletions(-) hooks/post-receive -- The standard pinentry collection http://git.gnupg.org From cvs at cvs.gnupg.org Tue Jun 16 16:07:29 2015 From: cvs at cvs.gnupg.org (by Neal H. Walfield) Date: Tue, 16 Jun 2015 16:07:29 +0200 Subject: [git] GnuPG - branch, master, updated. gnupg-2.1.5-6-geac081b Message-ID: 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 eac081ba1278855fa223b031b527498fec558bc7 (commit) from 15540f6233bd041b06708862a6d9535cbcabe330 (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 eac081ba1278855fa223b031b527498fec558bc7 Author: Neal H. Walfield Date: Tue Jun 16 16:00:39 2015 +0200 Don't prompt for the password multiple times in pinentry loopback mode. * g10/gpg.c (main): If OPT.PINENTRY_MODE is PINENTRY_MODE_LOOPBACK, clear OPT.PASSPHRASE_REPEAT. diff --git a/g10/gpg.c b/g10/gpg.c index 1801c87..5eae240 100644 --- a/g10/gpg.c +++ b/g10/gpg.c @@ -3531,6 +3531,13 @@ main (int argc, char **argv) } FREE_STRLIST(nrings); + if (opt.pinentry_mode == PINENTRY_MODE_LOOPBACK) + /* In loopback mode, never ask for the password multiple + times. */ + { + opt.passphrase_repeat = 0; + } + if (cmd == aGPGConfTest) g10_exit(0); ----------------------------------------------------------------------- Summary of changes: g10/gpg.c | 7 +++++++ 1 file changed, 7 insertions(+) hooks/post-receive -- The GNU Privacy Guard http://git.gnupg.org From cvs at cvs.gnupg.org Tue Jun 16 18:13:31 2015 From: cvs at cvs.gnupg.org (by Werner Koch) Date: Tue, 16 Jun 2015 18:13:31 +0200 Subject: [git] GnuPG - branch, master, updated. gnupg-2.1.5-10-g685b782 Message-ID: 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 685b782a18adb90bbf78956682e4e7f89fed678c (commit) via eb4d33cba9cd0f6929cbb556b7fa2deca0a3a87e (commit) via 82c72e2db7bc5b633768d59822f2e2a353fa6e32 (commit) via 43211f553dd2741f855db4023fc4920da1c3789c (commit) from eac081ba1278855fa223b031b527498fec558bc7 (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 685b782a18adb90bbf78956682e4e7f89fed678c Author: Werner Koch Date: Tue Jun 16 18:08:32 2015 +0200 dirmngr: Cleanup zombies and fix hang on shutdown. * dirmngr/ldap-wrapper.c (ldap_wrapper_thread): Move nfds computation into the loop. Check the queue also on timeout. Close log_fd and reader context on EOF or error. -- The major bug here was that on an EOF of the log fd the log fd was not closed and thus the final queue item removal could not work. Checking the queue on a timeout is not really necessary but it help in case there is a race condition lingering. GnuPG-bug-id: 1838, 1978 Signed-off-by: Werner Koch diff --git a/dirmngr/ldap-wrapper.c b/dirmngr/ldap-wrapper.c index 30bbda3..0dcc7ba 100644 --- a/dirmngr/ldap-wrapper.c +++ b/dirmngr/ldap-wrapper.c @@ -259,26 +259,12 @@ ldap_wrapper_thread (void *dummy) struct timespec abstime; struct timespec curtime; struct timespec timeout; - int saved_errno; - fd_set fdset, read_fdset; + fd_set fdset; int ret; time_t exptime; (void)dummy; - FD_ZERO (&fdset); - nfds = -1; - for (ctx = wrapper_list; ctx; ctx = ctx->next) - { - if (ctx->log_fd != -1) - { - FD_SET (ctx->log_fd, &fdset); - if (ctx->log_fd > nfds) - nfds = ctx->log_fd; - } - } - nfds++; - npth_clock_gettime (&abstime); abstime.tv_sec += TIMERTICK_INTERVAL; @@ -286,38 +272,42 @@ ldap_wrapper_thread (void *dummy) { int any_action = 0; - /* POSIX says that fd_set should be implemented as a structure, - thus a simple assignment is fine to copy the entire set. */ - read_fdset = fdset; - npth_clock_gettime (&curtime); if (!(npth_timercmp (&curtime, &abstime, <))) { /* Inactivity is checked below. Nothing else to do. */ - // handle_tick (); npth_clock_gettime (&abstime); abstime.tv_sec += TIMERTICK_INTERVAL; } npth_timersub (&abstime, &curtime, &timeout); + FD_ZERO (&fdset); + nfds = -1; + for (ctx = wrapper_list; ctx; ctx = ctx->next) + { + if (ctx->log_fd != -1) + { + FD_SET (ctx->log_fd, &fdset); + if (ctx->log_fd > nfds) + nfds = ctx->log_fd; + } + } + nfds++; + /* FIXME: For Windows, we have to use a reader thread on the pipe that signals an event (and a npth_select_ev variant). */ - ret = npth_pselect (nfds + 1, &read_fdset, NULL, NULL, &timeout, NULL); - saved_errno = errno; - - if (ret == -1 && saved_errno != EINTR) + ret = npth_pselect (nfds + 1, &fdset, NULL, NULL, &timeout, NULL); + if (ret == -1) { - log_error (_("npth_select failed: %s - waiting 1s\n"), - strerror (saved_errno)); - npth_sleep (1); + if (errno != EINTR) + { + log_error (_("npth_select failed: %s - waiting 1s\n"), + strerror (errno)); + npth_sleep (1); + } continue; } - if (ret <= 0) - /* Interrupt or timeout. Will be handled when calculating the - next timeout. */ - continue; - /* All timestamps before exptime should be considered expired. */ exptime = time (NULL); if (exptime > INACTIVITY_TIMEOUT) @@ -331,10 +321,15 @@ ldap_wrapper_thread (void *dummy) for (ctx = wrapper_list; ctx; ctx = ctx->next) { /* Check whether there is any logging to be done. */ - if (nfds && ctx->log_fd != -1 && FD_ISSET (ctx->log_fd, &read_fdset)) + if (nfds && ctx->log_fd != -1 && FD_ISSET (ctx->log_fd, &fdset)) { if (read_log_data (ctx)) - any_action = 1; + { + ksba_reader_release (ctx->reader); + ctx->reader = NULL; + SAFE_CLOSE (ctx->log_fd); + any_action = 1; + } } /* Check whether the process is still running. */ commit eb4d33cba9cd0f6929cbb556b7fa2deca0a3a87e Author: Werner Koch Date: Tue Jun 16 11:47:07 2015 +0200 dirmngr: Add missing cast for use of pid_t in printf. -- diff --git a/dirmngr/ldap-wrapper.c b/dirmngr/ldap-wrapper.c index 5588468..30bbda3 100644 --- a/dirmngr/ldap-wrapper.c +++ b/dirmngr/ldap-wrapper.c @@ -234,7 +234,7 @@ read_log_data (struct wrapper_context_s *ctx) { if (n < 0) log_error (_("error reading log from ldap wrapper %d: %s\n"), - ctx->pid, strerror (errno)); + (int)ctx->pid, strerror (errno)); print_log_line (ctx, NULL); SAFE_CLOSE (ctx->log_fd); return 1; commit 82c72e2db7bc5b633768d59822f2e2a353fa6e32 Author: Werner Koch Date: Tue Jun 16 12:12:03 2015 +0200 dirmngr: Avoid accessing uninitialized memory in log callback. * dirmngr/dirmngr.c (pid_suffix_callback): Clear int_and_ptr_u before use. (start_connection_thread): Ditto. (handle_connections): Ditto. -- Example valgrind output: ==2921== Conditional jump or move depends on uninitialised value(s) ==2921== at 0x5BBDEF4: pthread_getspecific (pthread_getspecific.c:57) ==2921== by 0x40AAEE: pid_suffix_callback (dirmngr.c:614) ==2921== by 0x433F5A: do_logv (logging.c:684) This is because on 64 bit systems "sizeof aptr > sizeof aint" and thus Valgrind complains about this. It is no a real problem because we don't use the unitialized bits. Signed-off-by: Werner Koch diff --git a/dirmngr/dirmngr.c b/dirmngr/dirmngr.c index 3375a4a..a9efba9 100644 --- a/dirmngr/dirmngr.c +++ b/dirmngr/dirmngr.c @@ -297,7 +297,7 @@ union int_and_ptr_u /* The key used to store the current file descriptor in the thread local storage. We use this in conjunction with the - log_set_pid_suffix_cb feature.. */ + log_set_pid_suffix_cb feature. */ #ifndef HAVE_W32_SYSTEM static int my_tlskey_current_fd; #endif @@ -611,6 +611,7 @@ pid_suffix_callback (unsigned long *r_suffix) { union int_and_ptr_u value; + memset (&value, 0, sizeof value); value.aptr = npth_getspecific (my_tlskey_current_fd); *r_suffix = value.aint; return (*r_suffix != -1); /* Use decimal representation. */ @@ -1915,6 +1916,7 @@ start_connection_thread (void *arg) union int_and_ptr_u argval; gnupg_fd_t fd; + memset (&argval, 0, sizeof argval); argval.aptr = arg; fd = argval.afd; @@ -2054,12 +2056,14 @@ handle_connections (assuan_fd_t listen_fd) union int_and_ptr_u argval; npth_t thread; + memset (&argval, 0, sizeof argval); argval.afd = fd; snprintf (threadname, sizeof threadname-1, "conn fd=%d", FD2INT(fd)); threadname[sizeof threadname -1] = 0; - ret = npth_create (&thread, &tattr, start_connection_thread, argval.aptr); + ret = npth_create (&thread, &tattr, + start_connection_thread, argval.aptr); if (ret) { log_error ("error spawning connection handler: %s\n", commit 43211f553dd2741f855db4023fc4920da1c3789c Author: Werner Koch Date: Tue Jun 16 11:41:55 2015 +0200 build: Distribute swdb.lst with the w32-source target. -- diff --git a/build-aux/speedo.mk b/build-aux/speedo.mk index 0dd5e2e..dc949ba 100644 --- a/build-aux/speedo.mk +++ b/build-aux/speedo.mk @@ -91,7 +91,8 @@ git-w32-installer: check-tools $(SPEEDOMAKE) TARGETOS=w32 WHAT=git WITH_GUI=0 installer this-w32-installer: check-tools - $(SPEEDOMAKE) TARGETOS=w32 WHAT=this WITH_GUI=0 installer + $(SPEEDOMAKE) TARGETOS=w32 WHAT=this WITH_GUI=0 \ + CUSTOM_SWDB=1 installer w32-source: check-tools $(SPEEDOMAKE) TARGETOS=w32 WHAT=release WITH_GUI=0 dist-source @@ -100,7 +101,8 @@ git-w32-source: check-tools $(SPEEDOMAKE) TARGETOS=w32 WHAT=git WITH_GUI=0 dist-source this-w32-source: check-tools - $(SPEEDOMAKE) TARGETOS=w32 WHAT=git WITH_GUI=0 dist-source + $(SPEEDOMAKE) TARGETOS=w32 WHAT=this WITH_GUI=0 \ + CUSTOM_SWDB=1 dist-source # Set this to "git" to build from git, @@ -1058,7 +1060,7 @@ dist-source: all --anchored --exclude './PLAY' . ;\ tar --totals -rf "$$tarname" --exclude-backups --exclude-vc \ --transform='s,^,$(INST_NAME)-$(INST_VERSION)/,' \ - PLAY/stamps/stamp-*-00-unpack PLAY/src ;\ + PLAY/stamps/stamp-*-00-unpack PLAY/src swdb.lst swdb.lst.sig ;\ xz "$$tarname" ;\ ) ----------------------------------------------------------------------- Summary of changes: build-aux/speedo.mk | 8 ++++--- dirmngr/dirmngr.c | 8 +++++-- dirmngr/ldap-wrapper.c | 65 +++++++++++++++++++++++--------------------------- 3 files changed, 41 insertions(+), 40 deletions(-) hooks/post-receive -- The GNU Privacy Guard http://git.gnupg.org From cvs at cvs.gnupg.org Wed Jun 17 08:40:53 2015 From: cvs at cvs.gnupg.org (by Werner Koch) Date: Wed, 17 Jun 2015 08:40:53 +0200 Subject: [git] GnuPG - branch, STABLE-BRANCH-2-0, updated. gnupg-2.0.28-9-gbe34857 Message-ID: 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, STABLE-BRANCH-2-0 has been updated via be348579397797bdf814c41e3cbd086156f77dd6 (commit) from e2eba81faea28a775cbd4fadce442f561a4e06a5 (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 be348579397797bdf814c41e3cbd086156f77dd6 Author: Werner Koch Date: Wed Jun 17 08:37:02 2015 +0200 gpg: Print PGP-2 fingerprint instead of all zeroes. * g10/keyid.c (fingerprint_from_pk): Allow PGP-2 fingerprints. * g10/keylist.c (print_fingerprint): Print a warning after a PGP-2 fingerprint. -- Printing all zeroes for a PGP-2 (v3 key) fingerprint has the problem that frontends (or the user) may use that fingerprint to lookup a key and gpg will return all PGP2 keys. They may then show a different PGP-2 key than the one actually used for a signature. This is worse than displaying a weak fingerprint. GnuPG-bug-id: 2000 Signed-off-by: Werner Koch diff --git a/g10/keyid.c b/g10/keyid.c index ef6ee1c..83020e9 100644 --- a/g10/keyid.c +++ b/g10/keyid.c @@ -670,7 +670,7 @@ fingerprint_from_pk( PKT_public_key *pk, byte *array, size_t *ret_len ) if ( pk->version < 4 ) { - if ( is_RSA(pk->pubkey_algo) && opt.flags.allow_weak_digest_algos) + if (is_RSA(pk->pubkey_algo)) { /* RSA in version 3 packets is special. */ gcry_md_hd_t md; diff --git a/g10/keylist.c b/g10/keylist.c index bb19bc3..457695b 100644 --- a/g10/keylist.c +++ b/g10/keylist.c @@ -1590,6 +1590,14 @@ print_fingerprint (PKT_public_key *pk, PKT_secret_key *sk, int mode ) putc ('\n', fp); else tty_printf ("\n"); + + if (n==16 && !opt.with_colons && !opt.flags.allow_weak_digest_algos) + { + if (fp) + fprintf (fp, _("WARNING: a PGP-2 fingerprint is not safe\n")); + else + tty_printf (_("WARNING: a PGP-2 fingerprint is not safe\n")); + } } /* Print the serial number of an OpenPGP card if available. */ ----------------------------------------------------------------------- Summary of changes: g10/keyid.c | 2 +- g10/keylist.c | 8 ++++++++ 2 files changed, 9 insertions(+), 1 deletion(-) hooks/post-receive -- The GNU Privacy Guard http://git.gnupg.org From cvs at cvs.gnupg.org Wed Jun 17 12:24:19 2015 From: cvs at cvs.gnupg.org (by Daiki Ueno) Date: Wed, 17 Jun 2015 12:24:19 +0200 Subject: [git] Pinentry - branch, master, updated. pinentry-0.9.4-8-g3ef5d07 Message-ID: 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 standard pinentry collection". The branch, master has been updated via 3ef5d07873ab917e66c299521e85cff12fbbf40c (commit) from 34f3cdbf5aa0b7b8647a3bcedef7e1a51746b5ed (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 3ef5d07873ab917e66c299521e85cff12fbbf40c Author: Daiki Ueno Date: Wed Jun 17 10:32:22 2015 +0900 Add inside-Emacs mode to GUI pinentry programs * configure.ac: Add --enable-pinentry-emacs and --enable-inside-emacs option. (BUILD_LIBPINENTRY_EMACS): New conditional. (BUILD_PINENTRY_EMACS): New conditional. (INSIDE_EMACS): New conditional. * Makefile.am (pinentry_emacs): New. (SUBDIRS): Add "emacs" subdir if PINENTRY_EMACS is set. * pinentry/pinentry-emacs.h: New file. * pinentry/pinentry-emacs.c: New file. * pinentry/Makefile.am: New file. * pinentry/pinentry.c (option_handler): Handle the allow-emacs-prompt Assuan option. * emacs/pinentry-emacs.c: New file. * emacs/Makefile.am: New file. diff --git a/Makefile.am b/Makefile.am index 71f8541..999f82d 100644 --- a/Makefile.am +++ b/Makefile.am @@ -40,6 +40,12 @@ else pinentry_tty = endif +if BUILD_PINENTRY_EMACS +pinentry_emacs = emacs +else +pinentry_emacs = +endif + if BUILD_PINENTRY_GTK_2 pinentry_gtk_2 = gtk+-2 else @@ -65,8 +71,8 @@ pinentry_w32 = endif SUBDIRS = secmem pinentry ${pinentry_curses} ${pinentry_tty} \ - ${pinentry_gtk_2} ${pinentry_gnome_3} ${pinentry_qt4} \ - ${pinentry_w32} doc + ${pinentry_emacs} ${pinentry_gtk_2} ${pinentry_gnome_3} \ + ${pinentry_qt4} ${pinentry_w32} doc install-exec-local: diff --git a/configure.ac b/configure.ac index e5343c0..48316bf 100644 --- a/configure.ac +++ b/configure.ac @@ -223,6 +223,9 @@ dnl Checks for library functions. AC_CHECK_FUNCS(seteuid stpcpy mmap) GNUPG_CHECK_MLOCK +dnl Checks for standard types. +AC_TYPE_UINT32_T + # Common libraries and cflags. COMMON_CFLAGS= COMMON_LIBS= @@ -361,6 +364,57 @@ if test "$pinentry_curses" = "yes" \ fi fi +dnl +dnl Check for emacs pinentry program. +dnl +AC_ARG_ENABLE(pinentry-emacs, + AC_HELP_STRING([--enable-pinentry-emacs], [build emacs pinentry]), + pinentry_emacs=$enableval, pinentry_emacs=maybe) +AC_ARG_ENABLE(inside-emacs, + AC_HELP_STRING([--enable-inside-emacs], [include emacs hack]), + inside_emacs=$enableval, inside_emacs=maybe) + +if test "$pinentry_emacs" != "no" -o "$inside_emacs" != "no"; then + AC_MSG_CHECKING([if Unix domain socket is supported]) + AC_TRY_COMPILE([ +#include +#include +], + [int s = socket (AF_UNIX, SOCK_STREAM, 0);], + [_unixsock_works=yes], + [_unixsock_works=no]) + AC_MSG_RESULT($_unixsock_works) + if test "$_unixsock_works" = "yes"; then + if test "$pinentry_emacs" != "no"; then + pinentry_emacs=yes + fi + if test "$inside_emacs" != "no"; then + inside_emacs=yes + AC_DEFINE(INSIDE_EMACS, 1, + [The GUI pinentries should respect INSIDE_EMACS envvar.]) + fi + else + if test "$pinentry_emacs" = "yes" -o "$inside_emacs" = "yes"; then + AC_MSG_ERROR([[ +*** +*** Support for Unix domain sockets is required. +***]]) + fi + pinentry_emacs=no + inside_emacs=no + fi +fi + +AM_CONDITIONAL(BUILD_LIBPINENTRY_EMACS, + test "$pinentry_emacs" = "yes" -o "$inside_emacs" = "yes") +AM_CONDITIONAL(BUILD_PINENTRY_EMACS, test "$pinentry_emacs" = "yes") +AM_CONDITIONAL(INSIDE_EMACS, test "$inside_emacs" = "yes") + +if test "$pinentry_emacs" = "yes"; then + AC_DEFINE(PINENTRY_EMACS, 1, + [The Emacs version of Pinentry is to be build]) +fi + dnl @@ -659,6 +713,7 @@ secmem/Makefile pinentry/Makefile curses/Makefile tty/Makefile +emacs/Makefile gtk+-2/Makefile gnome3/Makefile qt4/Makefile @@ -678,12 +733,14 @@ AC_MSG_NOTICE([ Curses Pinentry ..: $pinentry_curses TTY Pinentry .....: $pinentry_tty + Emacs Pinentry ...: $pinentry_emacs GTK+-2 Pinentry ..: $pinentry_gtk_2 GNOME 3 Pinentry .: $pinentry_gnome_3 Qt4 Pinentry .....: $pinentry_qt4 $pinentry_qt4_clip_msg W32 Pinentry .....: $pinentry_w32 Fallback to Curses: $fallback_curses + Emacs integration : $inside_emacs libsecret ........: $libsecret diff --git a/pinentry/Makefile.am b/emacs/Makefile.am similarity index 65% copy from pinentry/Makefile.am copy to emacs/Makefile.am index d24581b..e2102bc 100644 --- a/pinentry/Makefile.am +++ b/emacs/Makefile.am @@ -1,4 +1,4 @@ -# Pinentry support library Makefile +# Makefile.am - PIN entry emacs frontend. # Copyright (C) 2002, 2015 g10 Code GmbH # # This file is part of PINENTRY. @@ -19,19 +19,11 @@ ## Process this file with automake to produce Makefile.in -EXTRA_DIST = +bin_PROGRAMS = pinentry-emacs -if BUILD_LIBPINENTRY_CURSES -pinentry_curses = libpinentry-curses.a -else -pinentry_curses = -endif +AM_CPPFLAGS = $(COMMON_CFLAGS) $(NEMACS_INCLUDE) -I$(top_srcdir)/pinentry +LDADD = ../pinentry/libpinentry.a \ + ../assuan/libassuan.a ../secmem/libsecmem.a \ + $(COMMON_LIBS) $(LIBCAP) $(LIBEMACS) $(LIBICONV) -noinst_LIBRARIES = libpinentry.a $(pinentry_curses) - -LDADD = $(COMMON_LIBS) -AM_CPPFLAGS = $(COMMON_CFLAGS) -I$(top_srcdir)/secmem - -libpinentry_a_SOURCES = pinentry.h pinentry.c argparse.c argparse.h \ - password-cache.h password-cache.c -libpinentry_curses_a_SOURCES = pinentry-curses.h pinentry-curses.c +pinentry_emacs_SOURCES = pinentry-emacs.c diff --git a/emacs/pinentry-emacs.c b/emacs/pinentry-emacs.c new file mode 100644 index 0000000..de4ca05 --- /dev/null +++ b/emacs/pinentry-emacs.c @@ -0,0 +1,47 @@ +/* pinentry-emacs.c - A secure emacs dialog for PIN entry, library version + Copyright (C) 2015 Daiki Ueno + + This file is part of PINENTRY. + + PINENTRY 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 2 of the License, or + (at your option) any later version. + + PINENTRY 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 . +*/ + +#ifdef HAVE_CONFIG_H +#include +#endif + +#include +#include + +#include "pinentry.h" +#include "pinentry-emacs.h" + +pinentry_cmd_handler_t pinentry_cmd_handler = emacs_cmd_handler; + + +int +main (int argc, char *argv[]) +{ + pinentry_init ("pinentry-emacs"); + + if (!pinentry_emacs_init ()) + return 1; + + pinentry_parse_opts (argc, argv); + + if (pinentry_loop ()) + return 1; + + return 0; +} diff --git a/pinentry/Makefile.am b/pinentry/Makefile.am index d24581b..be99822 100644 --- a/pinentry/Makefile.am +++ b/pinentry/Makefile.am @@ -27,11 +27,17 @@ else pinentry_curses = endif +if BUILD_LIBPINENTRY_EMACS +pinentry_emacs_sources = pinentry-emacs.h pinentry-emacs.c +else +pinentry_emacs_sources = +endif + noinst_LIBRARIES = libpinentry.a $(pinentry_curses) LDADD = $(COMMON_LIBS) AM_CPPFLAGS = $(COMMON_CFLAGS) -I$(top_srcdir)/secmem libpinentry_a_SOURCES = pinentry.h pinentry.c argparse.c argparse.h \ - password-cache.h password-cache.c + password-cache.h password-cache.c $(pinentry_emacs_sources) libpinentry_curses_a_SOURCES = pinentry-curses.h pinentry-curses.c diff --git a/pinentry/pinentry-emacs.c b/pinentry/pinentry-emacs.c new file mode 100644 index 0000000..9ced8da --- /dev/null +++ b/pinentry/pinentry-emacs.c @@ -0,0 +1,695 @@ +/* pinentry-emacs.c - A secure emacs dialog for PIN entry, library version + Copyright (C) 2015 Daiki Ueno + + This file is part of PINENTRY. + + PINENTRY 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 2 of the License, or + (at your option) any later version. + + PINENTRY 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 . +*/ + +#ifdef HAVE_CONFIG_H +#include +#endif +#ifdef HAVE_STDINT_H +#include +#endif +#ifdef HAVE_INTTYPES_H +#include +#endif +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#ifdef HAVE_UTIME_H +#include +#endif /*HAVE_UTIME_H*/ + +#include + +#include "pinentry-emacs.h" +#include "memory.h" +#include "secmem-util.h" + +/* The communication mechanism is similar to emacsclient, but there + are a few differences: + + - To avoid unnecessary character escaping and encoding conversion, + we use a subset of the Pinentry Assuan protocol, instead of the + emacsclient protocol. + + - We only use a Unix domain socket, while emacsclient has an + ability to use a TCP socket. The socket file is located at + ${TMPDIR-/tmp}/emacs$(id -u)/pinentry (i.e., under the same + directory as the socket file used by emacsclient, so the same + permission and file owner settings apply). + + - The server implementation can be found in pinentry.el, which is + available in Emacs 25+ or from ELPA. */ + +#define LINELENGTH ASSUAN_LINELENGTH +#define SEND_BUFFER_SIZE 4096 +#define INITIAL_TIMEOUT 60 + +static int initial_timeout = INITIAL_TIMEOUT; + +#undef MIN +#define MIN(x, y) ((x) < (y) ? (x) : (y)) + +#undef MAX +#define MAX(x, y) ((x) < (y) ? (y) : (x)) + +#ifndef SUN_LEN +# define SUN_LEN(ptr) ((size_t) (((struct sockaddr_un *) 0)->sun_path) \ + + strlen ((ptr)->sun_path)) +#endif + +/* FIXME: We could use the I/O functions in Assuan directly, once + Pinentry links to libassuan. */ +static int emacs_socket = -1; +static char send_buffer[SEND_BUFFER_SIZE + 1]; +static int send_buffer_length; /* Fill pointer for the send buffer. */ + +static pinentry_cmd_handler_t fallback_cmd_handler; + +#ifndef HAVE_DOSISH_SYSTEM +static int timed_out; +#endif + +static int +set_socket (const char *socket_name) +{ + struct sockaddr_un unaddr; + struct stat statbuf; + const char *tmpdir; + char *tmpdir_storage = NULL; + char *socket_name_storage = NULL; + uid_t uid; + + unaddr.sun_family = AF_UNIX; + + /* We assume 32-bit UIDs, which can be represented with 10 decimal + digits. */ + uid = getuid (); + if (uid != (uint32_t) uid) + { + fprintf (stderr, "UID is too large\n"); + return 0; + } + + tmpdir = getenv ("TMPDIR"); + if (!tmpdir) + { +#ifdef _CS_DARWIN_USER_TEMP_DIR + size_t n = confstr (_CS_DARWIN_USER_TEMP_DIR, NULL, (size_t) 0); + if (n > 0) + { + tmpdir = tmpdir_storage = malloc (n); + if (!tmpdir) + { + fprintf (stderr, "out of core\n"); + return 0; + } + confstr (_CS_DARWIN_USER_TEMP_DIR, tmpdir_storage, n); + } + else +#endif + tmpdir = "/tmp"; + } + + socket_name_storage = malloc (strlen (tmpdir) + + strlen ("/emacs") + 10 + strlen ("/") + + strlen (socket_name) + + 1); + if (!socket_name_storage) + { + fprintf (stderr, "out of core\n"); + free (tmpdir_storage); + return 0; + } + + sprintf (socket_name_storage, "%s/emacs%u/%s", tmpdir, + (uint32_t) uid, socket_name); + free (tmpdir_storage); + + if (strlen (socket_name_storage) >= sizeof (unaddr.sun_path)) + { + fprintf (stderr, "socket name is too long\n"); + free (socket_name_storage); + return 0; + } + + strcpy (unaddr.sun_path, socket_name_storage); + free (socket_name_storage); + + /* See if the socket exists, and if it's owned by us. */ + if (stat (unaddr.sun_path, &statbuf) == -1) + { + perror ("stat"); + return 0; + } + + if (statbuf.st_uid != geteuid ()) + { + fprintf (stderr, "socket is not owned by the same user\n"); + return 0; + } + + emacs_socket = socket (AF_UNIX, SOCK_STREAM, 0); + if (emacs_socket < 0) + { + perror ("socket"); + return 0; + } + + if (connect (emacs_socket, (struct sockaddr *) &unaddr, + SUN_LEN (&unaddr)) < 0) + { + perror ("connect"); + close (emacs_socket); + emacs_socket = -1; + return 0; + } + + return 1; +} + +/* Percent-escape control characters in DATA. Return a newly + allocated string. */ +static char * +escape (const char *data) +{ + char *buffer, *out_p; + size_t length, buffer_length; + size_t offset; + size_t count = 0; + + length = strlen (data); + for (offset = 0; offset < length; offset++) + { + switch (data[offset]) + { + case '%': case '\n': case '\r': + count++; + break; + default: + break; + } + } + + buffer_length = length + count * 2; + buffer = malloc (buffer_length + 1); + if (!buffer) + return NULL; + + out_p = buffer; + for (offset = 0; offset < length; offset++) + { + int c = data[offset]; + switch (c) + { + case '%': case '\n': case '\r': + sprintf (out_p, "%%%02X", c); + out_p += 3; + break; + default: + *out_p++ = c; + break; + } + } + *out_p = '\0'; + + return buffer; +} + +/* The inverse of escape. Unlike escape, it removes quoting in string + DATA by modifying the string in place, to avoid copying of secret + data sent from Emacs. */ +static char * +unescape (char *data) +{ + char *p = data, *q = data; + + while (*p) + { + if (*p == '%' && p[1] && p[2]) + { + p++; + *q++ = xtoi_2 (p); + p += 2; + } + else + *q++ = *p++; + } + *q = 0; + return data; +} + +/* Let's send the data to Emacs when either + - the data ends in "\n", or + - the buffer is full (but this shouldn't happen) + Otherwise, we just accumulate it. */ +static int +send_to_emacs (int s, const char *buffer) +{ + size_t length; + + length = strlen (buffer); + while (*buffer) + { + size_t part = MIN (length, SEND_BUFFER_SIZE - send_buffer_length); + memcpy (&send_buffer[send_buffer_length], buffer, part); + buffer += part; + send_buffer_length += part; + + if (send_buffer_length == SEND_BUFFER_SIZE + || (send_buffer_length > 0 + && send_buffer[send_buffer_length-1] == '\n')) + { + int sent = send (s, send_buffer, send_buffer_length, 0); + if (sent < 0) + { + fprintf (stderr, "failed to send %d bytes to socket: %s\n", + send_buffer_length, strerror (errno)); + send_buffer_length = 0; + return 0; + } + if (sent != send_buffer_length) + memmove (send_buffer, &send_buffer[sent], + send_buffer_length - sent); + send_buffer_length -= sent; + } + + length -= part; + } + + return 1; +} + +/* Read a server response. If the response contains data, it will be + stored in BUFFER with a terminating NUL byte. BUFFER must be + at least as large as CAPACITY. */ +static gpg_error_t +read_from_emacs (int s, int timeout, char *buffer, size_t capacity) +{ + struct timeval tv; + fd_set rfds; + int retval; + /* Offset in BUFFER. */ + size_t offset = 0; + int got_response = 0; + char read_buffer[LINELENGTH + 1]; + /* Offset in READ_BUFFER. */ + size_t read_offset = 0; + gpg_error_t result = 0; + + tv.tv_sec = timeout; + tv.tv_usec = 0; + + FD_ZERO (&rfds); + FD_SET (s, &rfds); + retval = select (s + 1, &rfds, NULL, NULL, &tv); + if (retval == -1) + { + perror ("select"); + return gpg_error (GPG_ERR_ASS_GENERAL); + } + else if (retval == 0) + { + timed_out = 1; + return gpg_error (GPG_ERR_TIMEOUT); + } + + /* Loop until we get either OK or ERR. */ + while (!got_response) + { + int rl = 0; + char *p, *end_p; + do + { + errno = 0; + rl = recv (s, read_buffer + read_offset, LINELENGTH - read_offset, 0); + } + /* If we receive a signal (e.g. SIGWINCH, which we pass + through to Emacs), on some OSes we get EINTR and must retry. */ + while (rl < 0 && errno == EINTR); + + if (rl < 0) + { + perror ("recv"); + return gpg_error (GPG_ERR_ASS_GENERAL);; + } + if (rl == 0) + break; + + read_offset += rl; + read_buffer[read_offset] = '\0'; + + end_p = strchr (read_buffer, '\n'); + + /* If the buffer is filled without NL, throw away the content + and start over the buffering. + + FIXME: We could return ASSUAN_Line_Too_Long or + ASSUAN_Line_Not_Terminated here. */ + if (!end_p && read_offset == sizeof (read_buffer) - 1) + { + read_offset = 0; + continue; + } + + /* Loop over all NL-terminated messages. */ + for (p = read_buffer; end_p; p = end_p + 1, end_p = strchr (p, '\n')) + { + *end_p = '\0'; + if (!strncmp ("D ", p, 2)) + { + char *data; + size_t data_length; + size_t needed_capacity; + + data = p + 2; + data_length = end_p - data; + if (data_length > 0) + { + needed_capacity = offset + data_length + 1; + + /* Check overflow. This is unrealistic but can + happen since OFFSET is cumulative. */ + if (needed_capacity < offset) + return gpg_error (GPG_ERR_ASS_GENERAL);; + + if (needed_capacity > capacity) + return gpg_error (GPG_ERR_ASS_GENERAL);; + + memcpy (&buffer[offset], data, data_length); + offset += data_length; + buffer[offset] = 0; + } + } + else if (!strcmp ("OK", p) || !strncmp ("OK ", p, 3)) + { + got_response = 1; + break; + } + else if (!strncmp ("ERR ", p, 4)) + { + unsigned long code = strtoul (p + 4, NULL, 10); + if (code == ULONG_MAX && errno == ERANGE) + return gpg_error (GPG_ERR_ASS_GENERAL); + else + result = code; + got_response = 1; + break; + } + else if (*p == '#') + ; + else + fprintf (stderr, "invalid response: %s\n", p); + } + + if (!got_response) + { + size_t length = &read_buffer[read_offset] - p; + memmove (read_buffer, p, length); + read_offset = length; + } + } + + return result; +} + +int +set_label (pinentry_t pe, const char *name, const char *value) +{ + char buffer[16], *escaped; + gpg_error_t error; + int retval; + + if (!send_to_emacs (emacs_socket, name) + || !send_to_emacs (emacs_socket, " ")) + return 0; + + escaped = escape (value); + if (!escaped) + return 0; + + retval = send_to_emacs (emacs_socket, escaped) + && send_to_emacs (emacs_socket, "\n"); + + free (escaped); + if (!retval) + return 0; + + error = read_from_emacs (emacs_socket, pe->timeout, buffer, sizeof (buffer)); + return error == 0; +} + +static void +set_labels (pinentry_t pe) +{ + if (pe->title) + set_label (pe, "SETTITLE", pe->title); + if (pe->description) + set_label (pe, "SETDESC", pe->description); + if (pe->error) + set_label (pe, "SETERROR", pe->error); + if (pe->prompt) + set_label (pe, "SETPROMPT", pe->prompt); + else if (pe->default_prompt) + set_label (pe, "SETPROMPT", pe->default_prompt); + if (pe->repeat_passphrase) + set_label (pe, "SETREPEAT", pe->repeat_passphrase); + if (pe->repeat_error_string) + set_label (pe, "SETREPEATERROR", pe->repeat_error_string); + + /* XXX: pe->quality_bar and pe->quality_bar_tt are not supported. */ + + /* Buttons. */ + if (pe->ok) + set_label (pe, "SETOK", pe->ok); + else if (pe->default_ok) + set_label (pe, "SETOK", pe->default_ok); + if (pe->cancel) + set_label (pe, "SETCANCEL", pe->cancel); + else if (pe->default_ok) + set_label (pe, "SETCANCEL", pe->default_cancel); + if (pe->notok) + set_label (pe, "SETNOTOK", pe->notok); +} + +static int +do_password (pinentry_t pe) +{ + char *buffer, *password; + size_t length = LINELENGTH; + gpg_error_t error; + + set_labels (pe); + + if (!send_to_emacs (emacs_socket, "GETPIN\n")) + return -1; + + buffer = secmem_malloc (length); + if (!buffer) + { + pe->specific_err = gpg_error (GPG_ERR_ENOMEM); + return -1; + } + + error = read_from_emacs (emacs_socket, pe->timeout, buffer, length); + if (error != 0) + { + if (gpg_err_code (error) == GPG_ERR_CANCELED) + pe->canceled = 1; + + secmem_free (buffer); + pe->specific_err = error; + return -1; + } + + password = unescape (buffer); + pinentry_setbufferlen (pe, strlen (password) + 1); + if (pe->pin) + strcpy (pe->pin, password); + secmem_free (buffer); + + if (pe->repeat_passphrase) + pe->repeat_okay = 1; + + /* XXX: we don't support external password cache (yet). */ + + return 1; +} + +static int +do_confirm (pinentry_t pe) +{ + char buffer[16]; + gpg_error_t error; + + set_labels (pe); + + if (!send_to_emacs (emacs_socket, "CONFIRM\n")) + return 0; + + error = read_from_emacs (emacs_socket, pe->timeout, buffer, sizeof (buffer)); + if (error != 0) + { + if (gpg_err_code (error) == GPG_ERR_CANCELED) + pe->canceled = 1; + + pe->specific_err = error; + return 0; + } + + return 1; +} + +/* If a touch has been registered, touch that file. */ +static void +do_touch_file (pinentry_t pinentry) +{ +#ifdef HAVE_UTIME_H + struct stat st; + time_t tim; + + if (!pinentry->touch_file || !*pinentry->touch_file) + return; + + if (stat (pinentry->touch_file, &st)) + return; /* Oops. */ + + /* Make sure that we actually update the mtime. */ + while ( (tim = time (NULL)) == st.st_mtime ) + sleep (1); + + /* Update but ignore errors as we can't do anything in that case. + Printing error messages may even clubber the display further. */ + utime (pinentry->touch_file, NULL); +#endif /*HAVE_UTIME_H*/ +} + +#ifndef HAVE_DOSISH_SYSTEM +static void +catchsig (int sig) +{ + if (sig == SIGALRM) + timed_out = 1; +} +#endif + +int +emacs_cmd_handler (pinentry_t pe) +{ + int rc; + +#ifndef HAVE_DOSISH_SYSTEM + timed_out = 0; + + if (pe->timeout) + { + struct sigaction sa; + + memset (&sa, 0, sizeof(sa)); + sa.sa_handler = catchsig; + sigaction (SIGALRM, &sa, NULL); + alarm (pe->timeout); + } +#endif + + if (pe->pin) + rc = do_password (pe); + else + rc = do_confirm (pe); + + do_touch_file (pe); + return rc; +} + +static int +initial_emacs_cmd_handler (pinentry_t pe) +{ + /* Let the select() call in pinentry_emacs_init honor the timeout + value set through an Assuan option. */ + initial_timeout = pe->timeout; + + if (emacs_socket < 0) + pinentry_emacs_init (); + + /* If we have successfully connected to Emacs, swap + pinentry_cmd_handler to emacs_cmd_handler, so further + interactions will be forwarded to Emacs. Otherwise, set it back + to the original command handler saved as + fallback_cmd_handler. */ + if (emacs_socket < 0) + pinentry_cmd_handler = fallback_cmd_handler; + else + pinentry_cmd_handler = emacs_cmd_handler; + + return (* pinentry_cmd_handler) (pe); +} + +void +pinentry_enable_emacs_cmd_handler (void) +{ + const char *envvar; + + /* Check if pinentry_cmd_handler is already prepared for Emacs. */ + if (pinentry_cmd_handler == initial_emacs_cmd_handler + || pinentry_cmd_handler == emacs_cmd_handler) + return; + + /* Check if INSIDE_EMACS envvar is set. */ + envvar = getenv ("INSIDE_EMACS"); + if (!envvar || !*envvar) + return; + + /* Save the original command handler as fallback_cmd_handler, and + swap pinentry_cmd_handler to initial_emacs_cmd_handler. */ + fallback_cmd_handler = pinentry_cmd_handler; + pinentry_cmd_handler = initial_emacs_cmd_handler; +} + +int +pinentry_emacs_init (void) +{ + char buffer[256]; + gpg_error_t error; + + assert (emacs_socket < 0); + + /* Check if we can connect to the Emacs server socket. */ + if (!set_socket ("pinentry")) + return 0; + + /* Check if the server responds. */ + error = read_from_emacs (emacs_socket, initial_timeout, + buffer, sizeof (buffer)); + if (error != 0) + { + close (emacs_socket); + emacs_socket = -1; + return 0; + } + return 1; +} diff --git a/pinentry/pinentry-emacs.h b/pinentry/pinentry-emacs.h new file mode 100644 index 0000000..61d04cc --- /dev/null +++ b/pinentry/pinentry-emacs.h @@ -0,0 +1,43 @@ +/* pinentry-emacs.c - A secure emacs dialog for PIN entry, library version + Copyright (C) 2015 Daiki Ueno + + This file is part of PINENTRY. + + PINENTRY 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 2 of the License, or + (at your option) any later version. + + PINENTRY 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 . +*/ + +#ifndef PINENTRY_EMACS_H +#define PINENTRY_EMACS_H + +#include "pinentry.h" + +#ifdef __cplusplus +extern "C" { +#endif + +/* Enable pinentry command handler which interacts with Emacs, if + INSIDE_EMACS envvar is set. This function shall be called upon + receiving an Assuan request "OPTION allow-emacs-prompt". */ +void pinentry_enable_emacs_cmd_handler (void); + +/* Initialize the Emacs interface, return true if success. */ +int pinentry_emacs_init (void); + +int emacs_cmd_handler (pinentry_t pinentry); + +#ifdef __cplusplus +} +#endif + +#endif /* PINENTRY_EMACS_H */ diff --git a/pinentry/pinentry.c b/pinentry/pinentry.c index 47d9b06..e682de7 100644 --- a/pinentry/pinentry.c +++ b/pinentry/pinentry.c @@ -51,6 +51,10 @@ #include "pinentry.h" #include "password-cache.h" +#ifdef INSIDE_EMACS +#include "pinentry-emacs.h" +#endif + #ifdef HAVE_W32CE_SYSTEM #define getpid() GetCurrentProcessId () #endif @@ -866,6 +870,14 @@ option_handler (assuan_context_t ctx, const char *key, const char *value) pinentry.allow_external_password_cache = 1; pinentry.tried_password_cache = 0; } + else if (!strcmp (key, "allow-emacs-prompt") && !*value) + { +#ifdef INSIDE_EMACS + pinentry_enable_emacs_cmd_handler (); +#else + return gpg_error (GPG_ERR_NOT_SUPPORTED); +#endif + } else return gpg_error (GPG_ERR_UNKNOWN_OPTION); return 0; ----------------------------------------------------------------------- Summary of changes: Makefile.am | 10 +- configure.ac | 57 ++ {curses => emacs}/Makefile.am | 13 +- curses/pinentry-curses.c => emacs/pinentry-emacs.c | 18 +- pinentry/Makefile.am | 8 +- pinentry/pinentry-emacs.c | 695 +++++++++++++++++++++ pinentry/{pinentry-curses.h => pinentry-emacs.h} | 33 +- pinentry/pinentry.c | 12 + 8 files changed, 816 insertions(+), 30 deletions(-) copy {curses => emacs}/Makefile.am (71%) copy curses/pinentry-curses.c => emacs/pinentry-emacs.c (69%) create mode 100644 pinentry/pinentry-emacs.c copy pinentry/{pinentry-curses.h => pinentry-emacs.h} (51%) hooks/post-receive -- The standard pinentry collection http://git.gnupg.org From cvs at cvs.gnupg.org Wed Jun 17 13:01:56 2015 From: cvs at cvs.gnupg.org (by Werner Koch) Date: Wed, 17 Jun 2015 13:01:56 +0200 Subject: [git] GnuPG - branch, master, updated. gnupg-2.1.5-11-g010d26a Message-ID: 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 010d26a85bfe15c4aa12eefeab851dbde0609c26 (commit) from 685b782a18adb90bbf78956682e4e7f89fed678c (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 010d26a85bfe15c4aa12eefeab851dbde0609c26 Author: Werner Koch Date: Wed Jun 17 12:59:29 2015 +0200 agent: Print a warning for obsolete options. * g10/misc.c (obsolete_scdaemon_option): Move to * common/miscellaneous.c (obsolete_option): ... here. * agent/gpg-agent.c (main): Use obsolete_option for the 3 obsolete options. -- GnuPG-bug-id: 2016 Signed-off-by: Werner Koch diff --git a/agent/gpg-agent.c b/agent/gpg-agent.c index e721d8a..8c71e0d 100644 --- a/agent/gpg-agent.c +++ b/agent/gpg-agent.c @@ -908,8 +908,10 @@ main (int argc, char **argv ) case oXauthority: default_xauthority = xstrdup (pargs.r.ret_str); break; - case oUseStandardSocket: /* dummy */ break; - case oNoUseStandardSocket: /* dummy */ break; + case oUseStandardSocket: + case oNoUseStandardSocket: + obsolete_option (configname, configlineno, "use-standard-socket"); + break; case oFakedSystemTime: { @@ -945,7 +947,9 @@ main (int argc, char **argv ) /* Only used by the first stage command line parser. */ break; - case oWriteEnvFile: /* dummy */ break; + case oWriteEnvFile: + obsolete_option (configname, configlineno, "write-env-file"); + break; default : pargs.err = configfp? 1:2; break; } diff --git a/common/miscellaneous.c b/common/miscellaneous.c index a0dae8f..8e71071 100644 --- a/common/miscellaneous.c +++ b/common/miscellaneous.c @@ -104,6 +104,7 @@ setup_libgcrypt_logging (void) gcry_set_outofcore_handler (my_gcry_outofcore_handler, NULL); } + /* A wrapper around gcry_cipher_algo_name to return the string "AES-128" instead of "AES". Given that we have an alias in libgcrypt for it, it does not harm to too much to return this other @@ -122,6 +123,19 @@ gnupg_cipher_algo_name (int algo) } +void +obsolete_option (const char *configname, unsigned int configlineno, + const char *name) +{ + if (configname) + log_info (_("%s:%u: obsolete option \"%s\" - it has no effect\n"), + configname, configlineno, name); + else + log_info (_("WARNING: \"%s%s\" is an obsolete option - it has no effect\n"), + "--", name); +} + + /* Decide whether the filename is stdout or a real filename and return * an appropriate string. */ const char * diff --git a/common/util.h b/common/util.h index 0e585df..82e9887 100644 --- a/common/util.h +++ b/common/util.h @@ -370,6 +370,9 @@ char *xtryasprintf (const char *fmt, ...) GPGRT_GCC_A_PRINTF(1,2); /* Replacement for gcry_cipher_algo_name. */ const char *gnupg_cipher_algo_name (int algo); +void obsolete_option (const char *configname, unsigned int configlineno, + const char *name); + const char *print_fname_stdout (const char *s); const char *print_fname_stdin (const char *s); void print_utf8_buffer3 (estream_t fp, const void *p, size_t n, diff --git a/g10/main.h b/g10/main.h index 9370ae5..f4bf17f 100644 --- a/g10/main.h +++ b/g10/main.h @@ -134,8 +134,6 @@ char *pct_expando(const char *string,struct expando_args *args); void deprecated_warning(const char *configname,unsigned int configlineno, const char *option,const char *repl1,const char *repl2); void deprecated_command (const char *name); -void obsolete_option (const char *configname, unsigned int configlineno, - const char *name); void obsolete_scdaemon_option (const char *configname, unsigned int configlineno, const char *name); diff --git a/g10/misc.c b/g10/misc.c index 654908d..9134b28 100644 --- a/g10/misc.c +++ b/g10/misc.c @@ -1013,19 +1013,6 @@ deprecated_command (const char *name) void -obsolete_option (const char *configname, unsigned int configlineno, - const char *name) -{ - if(configname) - log_info (_("%s:%u: obsolete option \"%s\" - it has no effect\n"), - configname, configlineno, name); - else - log_info (_("WARNING: \"%s%s\" is an obsolete option - it has no effect\n"), - "--", name); -} - - -void obsolete_scdaemon_option (const char *configname, unsigned int configlineno, const char *name) { ----------------------------------------------------------------------- Summary of changes: agent/gpg-agent.c | 10 +++++++--- common/miscellaneous.c | 14 ++++++++++++++ common/util.h | 3 +++ g10/main.h | 2 -- g10/misc.c | 13 ------------- 5 files changed, 24 insertions(+), 18 deletions(-) hooks/post-receive -- The GNU Privacy Guard http://git.gnupg.org From cvs at cvs.gnupg.org Thu Jun 18 13:37:30 2015 From: cvs at cvs.gnupg.org (by Werner Koch) Date: Thu, 18 Jun 2015 13:37:30 +0200 Subject: [git] GnuPG - branch, master, updated. gnupg-2.1.5-12-gc971983 Message-ID: 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 c97198371b7307e64afdd323231977b2247f64ec (commit) from 010d26a85bfe15c4aa12eefeab851dbde0609c26 (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 c97198371b7307e64afdd323231977b2247f64ec Author: Werner Koch Date: Thu Jun 18 13:34:48 2015 +0200 dirmngr: Fix the cleanup zombies fix (685b782). * dirmngr/ldap-wrapper.c (ldap_wrapper_thread): Do not close the stdout reader after EOF from read_log_data. * dirmngr/crlcache.c (crl_cache_reload_crl): Close the reader before the next iteration. -- I assumed that the log_fd also has a reader object but that reader object is used for stdout and needs to be closed by the consumer. The real bug with the non-released ldap_wrapper control objects was that when looping over distribution points we did not closed the used reader object before the next iteration. Now, the test case had more than one DP and thus we lost one reader object. Signed-off-by: Werner Koch diff --git a/dirmngr/crlcache.c b/dirmngr/crlcache.c index d4c3dcb..a0a5104 100644 --- a/dirmngr/crlcache.c +++ b/dirmngr/crlcache.c @@ -2525,6 +2525,9 @@ crl_cache_reload_crl (ctrl_t ctrl, ksba_cert_t cert) issuername_uri = ksba_name_get_uri (issuername, 0); ksba_name_release (issuername); issuername = NULL; + /* Close the reader. */ + crl_close_reader (reader); + reader = NULL; } if (gpg_err_code (err) == GPG_ERR_EOF) err = 0; @@ -2535,11 +2538,8 @@ crl_cache_reload_crl (ctrl_t ctrl, ksba_cert_t cert) if (opt.verbose) log_info ("no distribution point - trying issuer name\n"); - if (reader) - { - crl_close_reader (reader); - reader = NULL; - } + crl_close_reader (reader); + reader = NULL; issuer = ksba_cert_get_issuer (cert, 0); if (!issuer) @@ -2571,8 +2571,7 @@ crl_cache_reload_crl (ctrl_t ctrl, ksba_cert_t cert) } leave: - if (reader) - crl_close_reader (reader); + crl_close_reader (reader); xfree (distpoint_uri); xfree (issuername_uri); ksba_name_release (distpoint); diff --git a/dirmngr/ldap-wrapper.c b/dirmngr/ldap-wrapper.c index 0dcc7ba..a54e405 100644 --- a/dirmngr/ldap-wrapper.c +++ b/dirmngr/ldap-wrapper.c @@ -325,8 +325,6 @@ ldap_wrapper_thread (void *dummy) { if (read_log_data (ctx)) { - ksba_reader_release (ctx->reader); - ctx->reader = NULL; SAFE_CLOSE (ctx->log_fd); any_action = 1; } ----------------------------------------------------------------------- Summary of changes: dirmngr/crlcache.c | 13 ++++++------- dirmngr/ldap-wrapper.c | 2 -- 2 files changed, 6 insertions(+), 9 deletions(-) hooks/post-receive -- The GNU Privacy Guard http://git.gnupg.org From cvs at cvs.gnupg.org Fri Jun 19 12:42:47 2015 From: cvs at cvs.gnupg.org (by Werner Koch) Date: Fri, 19 Jun 2015 12:42:47 +0200 Subject: [git] GnuPG - branch, master, updated. gnupg-2.1.5-13-gc5604ee Message-ID: 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 c5604eeee4b64a44a1ca1d517ace14fc1cbda298 (commit) from c97198371b7307e64afdd323231977b2247f64ec (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 c5604eeee4b64a44a1ca1d517ace14fc1cbda298 Author: Werner Koch Date: Fri Jun 19 12:39:29 2015 +0200 gpg: Fix export problem in case an old keyring has PGP-2 keys. * g10/export.c (do_export_stream): Skip legacy keys. Signed-off-by: Werner Koch diff --git a/g10/export.c b/g10/export.c index b65fb8d..5050128 100644 --- a/g10/export.c +++ b/g10/export.c @@ -851,19 +851,26 @@ do_export_stream (ctrl_t ctrl, iobuf_t out, strlist_t users, int secret, kek = NULL; } - while (!(err = keydb_search (kdbhd, desc, ndesc, &descindex))) + for (;;) { int skip_until_subkey = 0; u32 keyid[2]; PKT_public_key *pk; + err = keydb_search (kdbhd, desc, ndesc, &descindex); if (!users) desc[0].mode = KEYDB_SEARCH_MODE_NEXT; + if (gpg_err_code (err) == GPG_ERR_LEGACY_KEY) + continue; /* Skip PGP2 keys. */ + if (err) + break; /* Read the keyblock. */ release_kbnode (keyblock); keyblock = NULL; err = keydb_get_keyblock (kdbhd, &keyblock); + if (gpg_err_code (err) == GPG_ERR_LEGACY_KEY) + continue; /* Skip PGP2 keys. */ if (err) { log_error (_("error reading keyblock: %s\n"), gpg_strerror (err)); ----------------------------------------------------------------------- Summary of changes: g10/export.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) hooks/post-receive -- The GNU Privacy Guard http://git.gnupg.org From cvs at cvs.gnupg.org Sat Jun 20 15:07:58 2015 From: cvs at cvs.gnupg.org (by Werner Koch) Date: Sat, 20 Jun 2015 15:07:58 +0200 Subject: [git] GnuPG - branch, master, updated. gnupg-2.1.5-17-g0948c4f Message-ID: 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 0948c4f217308ffa0ec61ce189d387fd61b02bbd (commit) via 6500f338a35f4148606480c79f3a0c1b0d15f13a (commit) via 53e9b86085ac70ede8a0b1de9018ccbfe55b0932 (commit) via 663a31f1ea2fc5a43c822e916cf20fece5243851 (commit) from c5604eeee4b64a44a1ca1d517ace14fc1cbda298 (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 0948c4f217308ffa0ec61ce189d387fd61b02bbd Author: Werner Koch Date: Sat Jun 20 15:05:32 2015 +0200 gpg: Print number of good signatures with --check-sigs. * g10/keylist.c (keylist_context): Add field good_sigs. (list_keyblock_print): Updated good_sigs. (print_signature_stats): Print number of good signatures and use log_info instead of tty_printf. Signed-off-by: Werner Koch diff --git a/g10/keylist.c b/g10/keylist.c index 2cd988d..d4e572e 100644 --- a/g10/keylist.c +++ b/g10/keylist.c @@ -53,6 +53,7 @@ static void print_card_serialno (const char *serialno); struct keylist_context { int check_sigs; /* If set signatures shall be verified. */ + int good_sigs; /* Counter used if CHECK_SIGS is set. */ int inv_sigs; /* Counter used if CHECK_SIGS is set. */ int no_key; /* Counter used if CHECK_SIGS is set. */ int oth_err; /* Counter used if CHECK_SIGS is set. */ @@ -439,19 +440,25 @@ print_signature_stats (struct keylist_context *s) if (!s->check_sigs) return; /* Signature checking was not requested. */ + if (s->good_sigs == 1) + log_info (_("1 good signature\n")); + else if (s->good_sigs) + log_info (_("%d good signatures\n"), s->good_sigs); + if (s->inv_sigs == 1) - tty_printf (_("1 bad signature\n")); + log_info (_("1 bad signature\n")); else if (s->inv_sigs) - tty_printf (_("%d bad signatures\n"), s->inv_sigs); + log_info (_("%d bad signatures\n"), s->inv_sigs); + if (s->no_key == 1) - tty_printf (_("1 signature not checked due to a missing key\n")); + log_info (_("1 signature not checked due to a missing key\n")); else if (s->no_key) - tty_printf (_("%d signatures not checked due to missing keys\n"), - s->no_key); + log_info (_("%d signatures not checked due to missing keys\n"), s->no_key); + if (s->oth_err == 1) - tty_printf (_("1 signature not checked due to an error\n")); + log_info (_("1 signature not checked due to an error\n")); else if (s->oth_err) - tty_printf (_("%d signatures not checked due to errors\n"), s->oth_err); + log_info (_("%d signatures not checked due to errors\n"), s->oth_err); } @@ -1138,6 +1145,7 @@ list_keyblock_print (KBNODE keyblock, int secret, int fpr, switch (gpg_err_code (rc)) { case 0: + listctx->good_sigs++; sigrc = '!'; break; case GPG_ERR_BAD_SIGNATURE: commit 6500f338a35f4148606480c79f3a0c1b0d15f13a Author: Werner Koch Date: Sat Jun 20 15:03:32 2015 +0200 gpg: Improve speed of --check-sigs and --lish-sigs. * g10/keydb.c (kid_list_t): New. (kid_not_found_table, n_kid_not_found_table): New. (kid_not_found_p, kid_not_found_insert, kid_not_found_flush): New. (keydb_insert_keyblock): Flush the new cache. (keydb_delete_keyblock): Ditto. (keydb_update_keyblock): Ditto. (keydb_search): Use the new cache. (keydb_dump_stats): New. * g10/gpg.c (g10_exit): Dump keydb stats. -- What we do here is to keep track of key searches by long keyids (as stored in all signatures) so that we do not need to scan the keybox again after we already found that this keyid will result in not-found. As soon as we change gpg to run as a co-process we should store this table per session because other instances of gpg may have updated the keybox without us knowing. On a test ring with gpg: 94721 good signatures gpg: 6831 bad signatures gpg: 150703 signatures not checked due to missing keys gpg: 5 signatures not checked due to errors gpg: keydb: kid_not_found_table: total: 14132 this new cache speeds a --check-sigs listing up from 28 minutes to less than 3 minutes. Signed-off-by: Werner Koch diff --git a/g10/gpg.c b/g10/gpg.c index b7b81c9..eebb668 100644 --- a/g10/gpg.c +++ b/g10/gpg.c @@ -4361,8 +4361,10 @@ g10_exit( int rc ) gcry_control (GCRYCTL_UPDATE_RANDOM_SEED_FILE); if (DBG_CLOCK) log_clock ("stop"); + if ( (opt.debug & DBG_MEMSTAT_VALUE) ) { + keydb_dump_stats (); gcry_control (GCRYCTL_DUMP_MEMORY_STATS); gcry_control (GCRYCTL_DUMP_RANDOM_STATS); } diff --git a/g10/keydb.c b/g10/keydb.c index 6c79903..71ea113 100644 --- a/g10/keydb.c +++ b/g10/keydb.c @@ -75,6 +75,24 @@ struct keydb_handle }; +/* This object is used to keep a list of keyids in a linked list. */ +typedef struct kid_list_s +{ + struct kid_list_s *next; + u32 kid[2]; +} *kid_list_t; + +/* To avoid looking up a key by keyid where we know that it does not + yet exist, we keep a table of keyids where a search resulted in + not-found. This improves the --list-sigs and --check-sigs commands + substantively. To avoid extra complexity we clear the entire table + on any inert or update operation. The array is indexed by the + LSByte of the keyid. N_KID_NOT_FOUND_TABLE is the nu,ber of keys + in the table. */ +static kid_list_t kid_not_found_table[256]; +static unsigned int n_kid_not_found_table; + + /* This is a simple cache used to return the last result of a successful fingerprint search. This works only for keybox resources because (due to lack of a copy_keyblock function) we need to store @@ -100,6 +118,61 @@ static int lock_all (KEYDB_HANDLE hd); static void unlock_all (KEYDB_HANDLE hd); +/* Return true if the keyid KID is in the table of keyids whcih were + not found in a previous searches. */ +static int +kid_not_found_p (u32 *kid) +{ + kid_list_t k; + + for (k = kid_not_found_table[kid[0] % 256]; k; k = k->next) + if (k->kid[0] == kid[0] && k->kid[1] == kid[1]) + return 1; + return 0; +} + + +/* Put the keyid KID into the table of keyids whcih were not found in + previous searches. Note that there is no check whether the keyid + is already in the table, thus kid_not_found_p() should be used prior. */ +static void +kid_not_found_insert (u32 *kid) +{ + kid_list_t k; + + k = xmalloc (sizeof *k); + k->kid[0] = kid[0]; + k->kid[1] = kid[1]; + k->next = kid_not_found_table[kid[0]%256]; + kid_not_found_table[kid[0]%256] = k; + n_kid_not_found_table++; +} + + +/* Flush the entire table of keyids whche were not found in previous + searches. */ +static void +kid_not_found_flush (void) +{ + kid_list_t k, knext; + int i; + + if (!n_kid_not_found_table) + return; + + for (i=0; i < DIM(kid_not_found_table); i++) + { + for (k = kid_not_found_table[i]; k; k = knext) + { + knext = k->next; + xfree (k); + } + kid_not_found_table[i] = NULL; + } + n_kid_not_found_table = 0; +} + + static void keyblock_cache_clear (void) { @@ -529,6 +602,12 @@ keydb_add_resource (const char *url, unsigned int flags) } +void +keydb_dump_stats (void) +{ + if (n_kid_not_found_table) + log_info ("keydb: kid_not_found_table: total: %u\n", n_kid_not_found_table); +} KEYDB_HANDLE @@ -1151,6 +1230,7 @@ keydb_update_keyblock (KEYDB_HANDLE hd, kbnode_t kb) if (!hd) return gpg_error (GPG_ERR_INV_ARG); + kid_not_found_flush (); keyblock_cache_clear (); if (hd->found < 0 || hd->found >= hd->used) @@ -1204,6 +1284,7 @@ keydb_insert_keyblock (KEYDB_HANDLE hd, kbnode_t kb) if (!hd) return gpg_error (GPG_ERR_INV_ARG); + kid_not_found_flush (); keyblock_cache_clear (); if (opt.dry_run) @@ -1266,6 +1347,7 @@ keydb_delete_keyblock (KEYDB_HANDLE hd) if (!hd) return gpg_error (GPG_ERR_INV_ARG); + kid_not_found_flush (); keyblock_cache_clear (); if (hd->found < 0 || hd->found >= hd->used) @@ -1509,6 +1591,15 @@ keydb_search (KEYDB_HANDLE hd, KEYDB_SEARCH_DESC *desc, if (DBG_CACHE) dump_search_desc (hd, "keydb_search", desc, ndesc); + + if (ndesc == 1 && desc[0].mode == KEYDB_SEARCH_MODE_LONG_KID + && kid_not_found_p (desc[0].u.kid)) + { + if (DBG_CLOCK) + log_clock ("keydb_search leave (not found, cached)"); + return gpg_error (GPG_ERR_NOT_FOUND); + } + /* NB: If one of the exact search modes below is used in a loop to walk over all keys (with the same fingerprint) the caching must have been disabled for the handle. */ @@ -1567,6 +1658,12 @@ keydb_search (KEYDB_HANDLE hd, KEYDB_SEARCH_DESC *desc, memcpy (keyblock_cache.fpr, desc[0].u.fpr, 20); } + if (gpg_err_code (rc) == GPG_ERR_NOT_FOUND + && ndesc == 1 && desc[0].mode == KEYDB_SEARCH_MODE_LONG_KID) + { + kid_not_found_insert (desc[0].u.kid); + } + if (DBG_CLOCK) log_clock (rc? "keydb_search leave (not found)" : "keydb_search leave (found)"); diff --git a/g10/keydb.h b/g10/keydb.h index 0e3816f..1aa4e0e 100644 --- a/g10/keydb.h +++ b/g10/keydb.h @@ -132,6 +132,7 @@ union pref_hint #define KEYDB_RESOURCE_FLAG_READONLY 8 /* Open in read only mode. */ gpg_error_t keydb_add_resource (const char *url, unsigned int flags); +void keydb_dump_stats (void); KEYDB_HANDLE keydb_new (void); void keydb_release (KEYDB_HANDLE hd); @@ -154,6 +155,7 @@ gpg_error_t keydb_search_next (KEYDB_HANDLE hd); gpg_error_t keydb_search_kid (KEYDB_HANDLE hd, u32 *kid); gpg_error_t keydb_search_fpr (KEYDB_HANDLE hd, const byte *fpr); + /*-- pkclist.c --*/ void show_revocation_reason( PKT_public_key *pk, int mode ); int check_signatures_trust( PKT_signature *sig ); commit 53e9b86085ac70ede8a0b1de9018ccbfe55b0932 Author: Werner Koch Date: Fri Jun 19 16:59:46 2015 +0200 gpg: Add more log_clock calls to keydb.c * g10/keydb.c (keydb_get_keyblock): Add log_clock calls. diff --git a/g10/keydb.c b/g10/keydb.c index 2d1e07c..6c79903 100644 --- a/g10/keydb.c +++ b/g10/keydb.c @@ -980,6 +980,9 @@ keydb_get_keyblock (KEYDB_HANDLE hd, KBNODE *ret_kb) if (!hd) return gpg_error (GPG_ERR_INV_ARG); + if (DBG_CLOCK) + log_clock ("keydb_get_keybock enter"); + if (keyblock_cache.state == KEYBLOCK_CACHE_FILLED) { iobuf_seek (keyblock_cache.iobuf, 0); @@ -990,6 +993,9 @@ keydb_get_keyblock (KEYDB_HANDLE hd, KBNODE *ret_kb) ret_kb); if (err) keyblock_cache_clear (); + if (DBG_CLOCK) + log_clock (err? "keydb_get_keyblock leave (cached, failed)" + : "keydb_get_keyblock leave (cached)"); return err; } @@ -1037,6 +1043,9 @@ keydb_get_keyblock (KEYDB_HANDLE hd, KBNODE *ret_kb) if (keyblock_cache.state != KEYBLOCK_CACHE_FILLED) keyblock_cache_clear (); + if (DBG_CLOCK) + log_clock (err? "keydb_get_keyblock leave (failed)" + : "keydb_get_keyblock leave"); return err; } commit 663a31f1ea2fc5a43c822e916cf20fece5243851 Author: Werner Koch Date: Fri Jun 19 14:56:46 2015 +0200 gpg: Print available debug flags using "--debug-level help". * g10/gpg.c (set_debug): Add "help" option and use a table for the flags. Signed-off-by: Werner Koch diff --git a/doc/gpg.texi b/doc/gpg.texi index 6fcfe58..83dbda7 100644 --- a/doc/gpg.texi +++ b/doc/gpg.texi @@ -2320,6 +2320,8 @@ a numeric value or by a keyword: All of the debug messages you can get. A value greater than 8 may be used instead of the keyword. The creation of hash tracing files is only enabled if the keyword is used. + @item help + List all available debug flags (see @option{debug}) and stop. @end table How these messages are mapped to the actual debugging flags is not diff --git a/g10/gpg.c b/g10/gpg.c index 5eae240..b7b81c9 100644 --- a/g10/gpg.c +++ b/g10/gpg.c @@ -1084,8 +1084,27 @@ set_opt_session_env (const char *name, const char *value) static void set_debug (const char *level) { + static struct { unsigned short val; const char *name; } flags [] = { + { DBG_PACKET_VALUE , "packet" }, + { DBG_MPI_VALUE , "mpi" }, + { DBG_CRYPTO_VALUE , "crypto" }, + { DBG_FILTER_VALUE , "filter" }, + { DBG_IOBUF_VALUE , "iobuf" }, + { DBG_MEMORY_VALUE , "memory" }, + { DBG_CACHE_VALUE , "cache" }, + { DBG_MEMSTAT_VALUE, "memstat" }, + { DBG_TRUST_VALUE , "trust" }, + { DBG_HASHING_VALUE, "hashing" }, + { DBG_CARD_IO_VALUE, "cardio" }, + { DBG_IPC_VALUE , "ipc" }, + { DBG_CLOCK_VALUE , "clock" }, + { DBG_LOOKUP_VALUE , "lookup"}, + { DBG_EXTPROG_VALUE, "extprog" }, + { 0, NULL } + }; int numok = (level && digitp (level)); int numlvl = numok? atoi (level) : 0; + int i; if (!level) ; @@ -1108,10 +1127,26 @@ set_debug (const char *level) if (numok) opt.debug &= ~(DBG_HASHING_VALUE); } + else if (!strcmp (level, "help")) + { + es_printf ("Available debug flags:\n"); + for (i=0; flags[i].name; i++) + es_printf (" %5hu %s\n", flags[i].val, flags[i].name); + g10_exit (0); + } else { - log_error (_("invalid debug-level '%s' given\n"), level); - g10_exit (2); + for (i=0; flags[i].name; i++) + if (!strcmp (level, flags[i].name)) + { + opt.debug |= flags[i].val; + break; + } + if (!flags[i].name) + { + log_error (_("invalid debug-level '%s' given\n"), level); + g10_exit (2); + } } if (opt.debug & DBG_MEMORY_VALUE ) @@ -1127,22 +1162,13 @@ set_debug (const char *level) gcry_control (GCRYCTL_SET_VERBOSITY, (int)opt.verbose); if (opt.debug) - log_info ("enabled debug flags:%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s\n", - (opt.debug & DBG_PACKET_VALUE )? " packet":"", - (opt.debug & DBG_MPI_VALUE )? " mpi":"", - (opt.debug & DBG_CRYPTO_VALUE )? " crypto":"", - (opt.debug & DBG_FILTER_VALUE )? " filter":"", - (opt.debug & DBG_IOBUF_VALUE )? " iobuf":"", - (opt.debug & DBG_MEMORY_VALUE )? " memory":"", - (opt.debug & DBG_CACHE_VALUE )? " cache":"", - (opt.debug & DBG_MEMSTAT_VALUE)? " memstat":"", - (opt.debug & DBG_TRUST_VALUE )? " trust":"", - (opt.debug & DBG_HASHING_VALUE)? " hashing":"", - (opt.debug & DBG_EXTPROG_VALUE)? " extprog":"", - (opt.debug & DBG_CARD_IO_VALUE)? " cardio":"", - (opt.debug & DBG_IPC_VALUE )? " ipc":"", - (opt.debug & DBG_CLOCK_VALUE )? " clock":"", - (opt.debug & DBG_LOOKUP_VALUE )? " lookup":""); + { + log_info ("enabled debug flags:"); + for (i=0; flags[i].name; i++) + if ((opt.debug & flags[i].val)) + log_printf (" %s", flags[i].name); + log_printf ("\n"); + } } ----------------------------------------------------------------------- Summary of changes: doc/gpg.texi | 2 ++ g10/gpg.c | 64 +++++++++++++++++++++++++---------- g10/keydb.c | 106 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ g10/keydb.h | 2 ++ g10/keylist.c | 22 ++++++++---- 5 files changed, 171 insertions(+), 25 deletions(-) hooks/post-receive -- The GNU Privacy Guard http://git.gnupg.org From cvs at cvs.gnupg.org Mon Jun 22 07:36:13 2015 From: cvs at cvs.gnupg.org (by NIIBE Yutaka) Date: Mon, 22 Jun 2015 07:36:13 +0200 Subject: [git] GnuPG - branch, master, updated. gnupg-2.1.5-18-g444e923 Message-ID: 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 444e9232aa9e00aacd939cbf7bdb881b550dfebe (commit) from 0948c4f217308ffa0ec61ce189d387fd61b02bbd (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 444e9232aa9e00aacd939cbf7bdb881b550dfebe Author: NIIBE Yutaka Date: Mon Jun 22 14:31:25 2015 +0900 scd: Fix Cherry ST-2000 support for pinpad input. * scd/apdu.c (pcsc_vendor_specific_init): Set pinmax to 15. * scd/ccid-driver.c (ccid_transceive_secure): Add zero for the template of APDU. -- GnuPG-bug-id: 2003, 2004 diff --git a/scd/apdu.c b/scd/apdu.c index 189fd4a..82b2e1f 100644 --- a/scd/apdu.c +++ b/scd/apdu.c @@ -1825,8 +1825,12 @@ pcsc_vendor_specific_init (int slot) reader_table[slot].is_spr532 = 1; reader_table[slot].pinpad_varlen_supported = 1; } - else if (strstr (reader_table[slot].rdrname, "ST-2xxx") - || strstr (reader_table[slot].rdrname, "cyberJack") + else if (strstr (reader_table[slot].rdrname, "ST-2xxx")) + { + reader_table[slot].pcsc.pinmax = 15; + reader_table[slot].pinpad_varlen_supported = 1; + } + else if (strstr (reader_table[slot].rdrname, "cyberJack") || strstr (reader_table[slot].rdrname, "DIGIPASS") || strstr (reader_table[slot].rdrname, "Gnuk") || strstr (reader_table[slot].rdrname, "KAAN")) @@ -1891,8 +1895,12 @@ pcsc_vendor_specific_init (int slot) reader_table[slot].is_spr532 = 1; reader_table[slot].pinpad_varlen_supported = 1; } - else if ((vendor == 0x046a && product == 0x003e) /* Cherry ST-2xxx */ - || vendor == 0x0c4b /* Tested with Reiner cyberJack GO */ + else if (vendor == 0x046a && product == 0x003e) /* Cherry ST-2xxx */ + { + reader_table[slot].pcsc.pinmax = 15; + reader_table[slot].pinpad_varlen_supported = 1; + } + else if (vendor == 0x0c4b /* Tested with Reiner cyberJack GO */ || vendor == 0x1a44 /* Tested with Vasco DIGIPASS 920 */ || vendor == 0x234b /* Tested with FSIJ Gnuk Token */ || vendor == 0x0d46 /* Tested with KAAN Advanced??? */) diff --git a/scd/ccid-driver.c b/scd/ccid-driver.c index 4f0a489..fe1f679 100644 --- a/scd/ccid-driver.c +++ b/scd/ccid-driver.c @@ -3316,6 +3316,7 @@ ccid_transceive_secure (ccid_driver_t handle, size_t dummy_nresp; int testmode; int cherry_mode = 0; + int add_zero = 0; int enable_varlen = 0; testmode = !resp && !nresp; @@ -3357,7 +3358,7 @@ ccid_transceive_secure (ccid_driver_t handle, enable_varlen = 1; break; case VENDOR_CHERRY: - pininfo->maxlen = 25; + pininfo->maxlen = 15; enable_varlen = 1; /* The CHERRY XX44 keyboard echos an asterisk for each entered character on the keyboard channel. We use a special variant @@ -3366,6 +3367,7 @@ ccid_transceive_secure (ccid_driver_t handle, Lc byte to the APDU. It seems that it will be replaced with the actual length instead of being appended before the APDU is send to the card. */ + add_zero = 1; if (handle->id_product != CHERRY_ST2000) cherry_mode = 1; break; @@ -3488,7 +3490,7 @@ ccid_transceive_secure (ccid_driver_t handle, msg[msglen++] = apdu_buf[1]; /* INS */ msg[msglen++] = apdu_buf[2]; /* P1 */ msg[msglen++] = apdu_buf[3]; /* P2 */ - if (cherry_mode) + if (add_zero) msg[msglen++] = 0; else if (pininfo->fixedlen != 0) { ----------------------------------------------------------------------- Summary of changes: scd/apdu.c | 16 ++++++++++++---- scd/ccid-driver.c | 6 ++++-- 2 files changed, 16 insertions(+), 6 deletions(-) hooks/post-receive -- The GNU Privacy Guard http://git.gnupg.org From cvs at cvs.gnupg.org Mon Jun 22 15:19:01 2015 From: cvs at cvs.gnupg.org (by Werner Koch) Date: Mon, 22 Jun 2015 15:19:01 +0200 Subject: [git] GnuPG - branch, master, updated. gnupg-2.1.5-19-ge0873a3 Message-ID: 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 e0873a3372800d51c90ca656450f937dbae9c169 (commit) from 444e9232aa9e00aacd939cbf7bdb881b550dfebe (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 e0873a3372800d51c90ca656450f937dbae9c169 Author: Werner Koch Date: Mon Jun 22 15:15:39 2015 +0200 gpg: Fix regression due to recent commit 6500f33 * g10/keydb.c (kid_list_s): Keep a state in the table. (kid_not_found_table): Rename to kid_found_table. (n_kid_not_found_table): Rename to kid_found_table_count. (kid_not_found_p): Return found state. (kid_not_found_insert): Add arg found. (keydb_search): Store found state in the table. Signed-off-by: Werner Koch diff --git a/g10/keydb.c b/g10/keydb.c index 71ea113..68cf832 100644 --- a/g10/keydb.c +++ b/g10/keydb.c @@ -80,17 +80,17 @@ typedef struct kid_list_s { struct kid_list_s *next; u32 kid[2]; + int state; /* True if found. */ } *kid_list_t; /* To avoid looking up a key by keyid where we know that it does not - yet exist, we keep a table of keyids where a search resulted in - not-found. This improves the --list-sigs and --check-sigs commands - substantively. To avoid extra complexity we clear the entire table - on any inert or update operation. The array is indexed by the - LSByte of the keyid. N_KID_NOT_FOUND_TABLE is the nu,ber of keys - in the table. */ -static kid_list_t kid_not_found_table[256]; -static unsigned int n_kid_not_found_table; + yet exist, we keep a table of keyids with search results. This + improves the --list-sigs and --check-sigs commands substantively. + To avoid extra complexity we clear the entire table on any insert + or update operation. The array is indexed by the LSB of the keyid. + KID_FOUND_TABLE_COUNT gives the number of keys in the table. */ +static kid_list_t kid_found_table[256]; +static unsigned int kid_found_table_count; /* This is a simple cache used to return the last result of a @@ -118,34 +118,54 @@ static int lock_all (KEYDB_HANDLE hd); static void unlock_all (KEYDB_HANDLE hd); -/* Return true if the keyid KID is in the table of keyids whcih were - not found in a previous searches. */ +/* Checkwhether the keyid KID is in the table of found or not found + keyids. + + Returns: + 0 - Keyid not in table + 1 - Keyid in table because not found in a previous search + 2 - Keyid in table because found in a previous search + */ static int kid_not_found_p (u32 *kid) { kid_list_t k; - for (k = kid_not_found_table[kid[0] % 256]; k; k = k->next) + for (k = kid_found_table[kid[0] % 256]; k; k = k->next) if (k->kid[0] == kid[0] && k->kid[1] == kid[1]) - return 1; + { + if (DBG_CACHE) + log_debug ("keydb: kid_not_found_p (%08lx%08lx) => %s\n", + (ulong)kid[0], (ulong)kid[1], + k->state? "false (found)": "true"); + return k->state? 2 : 1; + } + + if (DBG_CACHE) + log_debug ("keydb: kid_not_found_p (%08lx%08lx) => false\n", + (ulong)kid[0], (ulong)kid[1]); return 0; } -/* Put the keyid KID into the table of keyids whcih were not found in +/* Put the keyid KID into the table of keyids with their find states of previous searches. Note that there is no check whether the keyid is already in the table, thus kid_not_found_p() should be used prior. */ static void -kid_not_found_insert (u32 *kid) +kid_not_found_insert (u32 *kid, int found) { kid_list_t k; + if (DBG_CACHE) + log_debug ("keydb: kid_not_found_insert (%08lx%08lx, %d)\n", + (ulong)kid[0], (ulong)kid[1], found); k = xmalloc (sizeof *k); k->kid[0] = kid[0]; k->kid[1] = kid[1]; - k->next = kid_not_found_table[kid[0]%256]; - kid_not_found_table[kid[0]%256] = k; - n_kid_not_found_table++; + k->state = found; + k->next = kid_found_table[kid[0]%256]; + kid_found_table[kid[0]%256] = k; + kid_found_table_count++; } @@ -157,19 +177,22 @@ kid_not_found_flush (void) kid_list_t k, knext; int i; - if (!n_kid_not_found_table) + if (DBG_CACHE) + log_debug ("keydb: kid_not_found_flush\n"); + + if (!kid_found_table_count) return; - for (i=0; i < DIM(kid_not_found_table); i++) + for (i=0; i < DIM(kid_found_table); i++) { - for (k = kid_not_found_table[i]; k; k = knext) + for (k = kid_found_table[i]; k; k = knext) { knext = k->next; xfree (k); } - kid_not_found_table[i] = NULL; + kid_found_table[i] = NULL; } - n_kid_not_found_table = 0; + kid_found_table_count = 0; } @@ -605,8 +628,8 @@ keydb_add_resource (const char *url, unsigned int flags) void keydb_dump_stats (void) { - if (n_kid_not_found_table) - log_info ("keydb: kid_not_found_table: total: %u\n", n_kid_not_found_table); + if (kid_found_table_count) + log_info ("keydb: kid_not_found_table: total: %u\n", kid_found_table_count); } @@ -1578,6 +1601,7 @@ keydb_search (KEYDB_HANDLE hd, KEYDB_SEARCH_DESC *desc, size_t ndesc, size_t *descindex) { gpg_error_t rc; + int once_found = 0; if (descindex) *descindex = 0; /* Make sure it is always set on return. */ @@ -1592,8 +1616,14 @@ keydb_search (KEYDB_HANDLE hd, KEYDB_SEARCH_DESC *desc, dump_search_desc (hd, "keydb_search", desc, ndesc); + /* Note that we track the found state in the table to cope with the + case that a initial search found the key and the next search + (without a reset) did not found the key. Without keeping the + found state we would falsely claim that the key has not been + found. Actually this is quite common because we need to check + for ambgious keyids. */ if (ndesc == 1 && desc[0].mode == KEYDB_SEARCH_MODE_LONG_KID - && kid_not_found_p (desc[0].u.kid)) + && (once_found = kid_not_found_p (desc[0].u.kid)) == 1 ) { if (DBG_CLOCK) log_clock ("keydb_search leave (not found, cached)"); @@ -1658,10 +1688,11 @@ keydb_search (KEYDB_HANDLE hd, KEYDB_SEARCH_DESC *desc, memcpy (keyblock_cache.fpr, desc[0].u.fpr, 20); } - if (gpg_err_code (rc) == GPG_ERR_NOT_FOUND - && ndesc == 1 && desc[0].mode == KEYDB_SEARCH_MODE_LONG_KID) + if ((!rc || gpg_err_code (rc) == GPG_ERR_NOT_FOUND) + && ndesc == 1 && desc[0].mode == KEYDB_SEARCH_MODE_LONG_KID + && !once_found) { - kid_not_found_insert (desc[0].u.kid); + kid_not_found_insert (desc[0].u.kid, !rc); } if (DBG_CLOCK) ----------------------------------------------------------------------- Summary of changes: g10/keydb.c | 87 +++++++++++++++++++++++++++++++++++++++++-------------------- 1 file changed, 59 insertions(+), 28 deletions(-) hooks/post-receive -- The GNU Privacy Guard http://git.gnupg.org From cvs at cvs.gnupg.org Mon Jun 22 21:03:52 2015 From: cvs at cvs.gnupg.org (by Werner Koch) Date: Mon, 22 Jun 2015 21:03:52 +0200 Subject: [git] GnuPG - branch, master, updated. gnupg-2.1.5-22-g4698e5b Message-ID: 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 4698e5b203bd983503b5fd784fcd09dd3bc3a15e (commit) via 22147952b744958ec46d356e942540356ff7d93e (commit) via d37f47081d41584efc0c397432811f9cfa5d5867 (commit) from e0873a3372800d51c90ca656450f937dbae9c169 (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 4698e5b203bd983503b5fd784fcd09dd3bc3a15e Author: Werner Koch Date: Mon Jun 22 21:01:10 2015 +0200 gpg: Allow debug flag names for --debug. * g10/gpg.c (opts): Change arg for oDebug to a string. (debug_flags): New; factored out from set_debug. (set_debug): Remove "--debug-level help". Use parse_debug_flag to print the used flags. (main): Use parse_debug_flag for oDebug. Signed-off-by: Werner Koch diff --git a/doc/gpg.texi b/doc/gpg.texi index 83dbda7..6c5cc5d 100644 --- a/doc/gpg.texi +++ b/doc/gpg.texi @@ -2320,8 +2320,6 @@ a numeric value or by a keyword: All of the debug messages you can get. A value greater than 8 may be used instead of the keyword. The creation of hash tracing files is only enabled if the keyword is used. - @item help - List all available debug flags (see @option{debug}) and stop. @end table How these messages are mapped to the actual debugging flags is not @@ -2330,8 +2328,10 @@ however carefully selected to best aid in debugging. @item --debug @var{flags} @opindex debug -Set debugging flags. All flags are or-ed and @var{flags} may -be given in C syntax (e.g. 0x0042). +Set debugging flags. All flags are or-ed and @var{flags} may be given +in C syntax (e.g. 0x0042) or as a comma separated list of flag names. +To get a list of all supported flags the single word "help" can be +used. @item --debug-all @opindex debug-all diff --git a/g10/gpg.c b/g10/gpg.c index eebb668..f9d9be3 100644 --- a/g10/gpg.c +++ b/g10/gpg.c @@ -557,7 +557,7 @@ static ARGPARSE_OPTS opts[] = { ARGPARSE_s_s (oDisplayCharset, "charset", "@"), ARGPARSE_s_s (oOptions, "options", "@"), - ARGPARSE_p_u (oDebug, "debug", "@"), + ARGPARSE_s_s (oDebug, "debug", "@"), ARGPARSE_s_s (oDebugLevel, "debug-level", "@"), ARGPARSE_s_n (oDebugAll, "debug-all", "@"), ARGPARSE_s_n (oDebugIOLBF, "debug-iolbf", "@"), @@ -820,6 +820,28 @@ static ARGPARSE_OPTS opts[] = { }; +/* The list of supported debug flags. */ +static struct debug_flags_s debug_flags [] = + { + { DBG_PACKET_VALUE , "packet" }, + { DBG_MPI_VALUE , "mpi" }, + { DBG_CRYPTO_VALUE , "crypto" }, + { DBG_FILTER_VALUE , "filter" }, + { DBG_IOBUF_VALUE , "iobuf" }, + { DBG_MEMORY_VALUE , "memory" }, + { DBG_CACHE_VALUE , "cache" }, + { DBG_MEMSTAT_VALUE, "memstat" }, + { DBG_TRUST_VALUE , "trust" }, + { DBG_HASHING_VALUE, "hashing" }, + { DBG_CARD_IO_VALUE, "cardio" }, + { DBG_IPC_VALUE , "ipc" }, + { DBG_CLOCK_VALUE , "clock" }, + { DBG_LOOKUP_VALUE , "lookup" }, + { DBG_EXTPROG_VALUE, "extprog" }, + { 0, NULL } + }; + + #ifdef ENABLE_SELINUX_HACKS #define ALWAYS_ADD_KEYRINGS 1 #else @@ -1077,6 +1099,7 @@ set_opt_session_env (const char *name, const char *value) gpg_strerror (err)); } + /* Setup the debugging. With a LEVEL of NULL only the active debug flags are propagated to the subsystems. With LEVEL set, a specific set of debug flags is set; thus overriding all flags already @@ -1084,24 +1107,6 @@ set_opt_session_env (const char *name, const char *value) static void set_debug (const char *level) { - static struct { unsigned short val; const char *name; } flags [] = { - { DBG_PACKET_VALUE , "packet" }, - { DBG_MPI_VALUE , "mpi" }, - { DBG_CRYPTO_VALUE , "crypto" }, - { DBG_FILTER_VALUE , "filter" }, - { DBG_IOBUF_VALUE , "iobuf" }, - { DBG_MEMORY_VALUE , "memory" }, - { DBG_CACHE_VALUE , "cache" }, - { DBG_MEMSTAT_VALUE, "memstat" }, - { DBG_TRUST_VALUE , "trust" }, - { DBG_HASHING_VALUE, "hashing" }, - { DBG_CARD_IO_VALUE, "cardio" }, - { DBG_IPC_VALUE , "ipc" }, - { DBG_CLOCK_VALUE , "clock" }, - { DBG_LOOKUP_VALUE , "lookup"}, - { DBG_EXTPROG_VALUE, "extprog" }, - { 0, NULL } - }; int numok = (level && digitp (level)); int numlvl = numok? atoi (level) : 0; int i; @@ -1127,26 +1132,10 @@ set_debug (const char *level) if (numok) opt.debug &= ~(DBG_HASHING_VALUE); } - else if (!strcmp (level, "help")) - { - es_printf ("Available debug flags:\n"); - for (i=0; flags[i].name; i++) - es_printf (" %5hu %s\n", flags[i].val, flags[i].name); - g10_exit (0); - } else { - for (i=0; flags[i].name; i++) - if (!strcmp (level, flags[i].name)) - { - opt.debug |= flags[i].val; - break; - } - if (!flags[i].name) - { - log_error (_("invalid debug-level '%s' given\n"), level); - g10_exit (2); - } + log_error (_("invalid debug-level '%s' given\n"), level); + g10_exit (2); } if (opt.debug & DBG_MEMORY_VALUE ) @@ -1162,13 +1151,7 @@ set_debug (const char *level) gcry_control (GCRYCTL_SET_VERBOSITY, (int)opt.verbose); if (opt.debug) - { - log_info ("enabled debug flags:"); - for (i=0; flags[i].name; i++) - if ((opt.debug & flags[i].val)) - log_printf (" %s", flags[i].name); - log_printf ("\n"); - } + parse_debug_flag (NULL, &opt.debug, debug_flags); } @@ -2447,7 +2430,14 @@ main (int argc, char **argv) opt.list_options|=LIST_SHOW_KEYRING; break; - case oDebug: opt.debug |= pargs.r.ret_ulong; break; + case oDebug: + if (parse_debug_flag (pargs.r.ret_str, &opt.debug, debug_flags)) + { + pargs.r_opt = ARGPARSE_INVALID_ARG; + pargs.err = ARGPARSE_PRINT_ERROR; + } + break; + case oDebugAll: opt.debug = ~0; break; case oDebugLevel: debug_level = pargs.r.ret_str; break; commit 22147952b744958ec46d356e942540356ff7d93e Author: Werner Koch Date: Mon Jun 22 20:54:23 2015 +0200 common: Add function parse_debug_flag * common/miscellaneous.c (parse_debug_flag): New. * common/util.h (struct debug_flags_s): New. Signed-off-by: Werner Koch diff --git a/common/miscellaneous.c b/common/miscellaneous.c index 8e71071..e840895 100644 --- a/common/miscellaneous.c +++ b/common/miscellaneous.c @@ -29,6 +29,7 @@ #include #include +#include #include #include "util.h" @@ -394,3 +395,83 @@ gnupg_compare_version (const char *a, const char *b) && a_micro == b_micro && strcmp (a_plvl, b_plvl) >= 0)); } + + + +/* Parse an --debug style argument. We allow the use of number values + * in the usual C notation or a string with comma separated keywords. + * + * Returns: 0 on success or -1 and ERRNO set on error. On success the + * supplied variable is updated by the parsed flags. + * + * If STRING is NULL the enabled debug flags are printed. + */ +int +parse_debug_flag (const char *string, unsigned int *debugvar, + const struct debug_flags_s *flags) + +{ + unsigned long result = 0; + int i, j; + + if (!string) + { + if (debugvar) + { + log_info ("enabled debug flags:"); + for (i=0; flags[i].name; i++) + if ((*debugvar & flags[i].flag)) + log_printf (" %s", flags[i].name); + log_printf ("\n"); + } + return 0; + } + + while (spacep (string)) + string++; + if (*string == '-') + { + errno = EINVAL; + return -1; + } + + if (!strcmp (string, "?") || !strcmp (string, "help")) + { + log_info ("available debug flags:\n"); + for (i=0; flags[i].name; i++) + log_info (" %5u %s\n", flags[i].flag, flags[i].name); + exit (0); + } + else if (digitp (string)) + { + errno = 0; + result = strtoul (string, NULL, 0); + if (result == ULONG_MAX && errno == ERANGE) + return -1; + } + else + { + char **words; + words = strtokenize (string, ","); + if (!words) + return -1; + for (i=0; words[i]; i++) + { + if (*words[i]) + { + for (j=0; flags[j].name; j++) + if (!strcmp (words[i], flags[j].name)) + { + result |= flags[j].flag; + break; + } + if (!flags[j].name) + log_info (_("unknown debug flag '%s' ignored\n"), words[i]); + } + } + xfree (words); + } + + *debugvar |= result; + return 0; +} diff --git a/common/util.h b/common/util.h index 82e9887..d5ddc1f 100644 --- a/common/util.h +++ b/common/util.h @@ -389,6 +389,14 @@ int match_multistr (const char *multistr,const char *match); int gnupg_compare_version (const char *a, const char *b); +struct debug_flags_s +{ + unsigned int flag; + const char *name; +}; +int parse_debug_flag (const char *string, unsigned int *debugvar, + const struct debug_flags_s *flags); + /*-- Simple replacement functions. */ commit d37f47081d41584efc0c397432811f9cfa5d5867 Author: Werner Koch Date: Mon Jun 22 19:28:33 2015 +0200 common: Add function strtokenize. * common/stringhelp.c: Include assert.h. (strtokenize): New. * common/t-stringhelp.c (test_strtokenize): New. Signed-off-by: Werner Koch diff --git a/common/stringhelp.c b/common/stringhelp.c index ca8ae0b..6714eb8 100644 --- a/common/stringhelp.c +++ b/common/stringhelp.c @@ -48,6 +48,7 @@ # endif # include #endif +#include #include "util.h" #include "common-defs.h" @@ -1234,3 +1235,69 @@ strsplit (char *string, char delim, char replacement, int *count) return result; } + + +/* Tokenize STRING using the set of delimiters in DELIM. Leading + * spaces and tabs are removed from all tokens. The caller must xfree + * the result. + * + * Returns: A malloced and NULL delimited array with the tokens. On + * memory error NULL is returned and ERRNO is set. + */ +char ** +strtokenize (const char *string, const char *delim) +{ + const char *s; + size_t fields; + size_t bytes, n; + char *buffer; + char *p, *px, *pend; + char **result; + + /* Count the number of fields. */ + for (fields = 1, s = strpbrk (string, delim); s; s = strpbrk (s + 1, delim)) + fields++; + fields++; /* Add one for the terminating NULL. */ + + /* Allocate an array for all fields, a terminating NULL, and space + for a copy of the string. */ + bytes = fields * sizeof *result; + if (bytes / sizeof *result != fields) + { + gpg_err_set_errno (ENOMEM); + return NULL; + } + n = strlen (string) + 1; + bytes += n; + if (bytes < n) + { + gpg_err_set_errno (ENOMEM); + return NULL; + } + result = xtrymalloc (bytes); + if (!result) + return NULL; + buffer = (char*)(result + fields); + + /* Copy and parse the string. */ + strcpy (buffer, string); + for (n = 0, p = buffer; (pend = strpbrk (p, delim)); p = pend + 1) + { + *pend = 0; + while (spacep (p)) + p++; + for (px = pend - 1; px >= p && spacep (px); px--) + *px = 0; + result[n++] = p; + } + while (spacep (p)) + p++; + for (px = p + strlen (p) - 1; px >= p && spacep (px); px--) + *px = 0; + result[n++] = p; + result[n] = NULL; + + assert ((char*)(result + n + 1) == buffer); + + return result; +} diff --git a/common/stringhelp.h b/common/stringhelp.h index b9b51fd..ab16d16 100644 --- a/common/stringhelp.h +++ b/common/stringhelp.h @@ -145,6 +145,10 @@ char *xstrconcat (const char *s1, ...) GNUPG_GCC_A_SENTINEL(0); char **strsplit (char *string, char delim, char replacement, int *count); +/* Tokenize STRING using the set of delimiters in DELIM. */ +char **strtokenize (const char *string, const char *delim); + + /*-- mapstrings.c --*/ const char *map_static_macro_string (const char *string); diff --git a/common/t-stringhelp.c b/common/t-stringhelp.c index 6c47237..13f3afa 100644 --- a/common/t-stringhelp.c +++ b/common/t-stringhelp.c @@ -538,6 +538,146 @@ test_strsplit (void) } } + + +static void +test_strtokenize (void) +{ + struct { + const char *s; + const char *delim; + const char *fields_expected[10]; + } tv[] = { + { + "", ":", + { "", NULL } + }, + { + "a", ":", + { "a", NULL } + }, + { + ":", ":", + { "", "", NULL } + }, + { + "::", ":", + { "", "", "", NULL } + }, + { + "a:b:c", ":", + { "a", "b", "c", NULL } + }, + { + "a:b:", ":", + { "a", "b", "", NULL } + }, + { + "a:b", ":", + { "a", "b", NULL } + }, + { + "aa:b:cd", ":", + { "aa", "b", "cd", NULL } + }, + { + "aa::b:cd", ":", + { "aa", "", "b", "cd", NULL } + }, + { + "::b:cd", ":", + { "", "", "b", "cd", NULL } + }, + { + "aa: : b:cd ", ":", + { "aa", "", "b", "cd", NULL } + }, + { + " aa: : b: cd ", ":", + { "aa", "", "b", "cd", NULL } + }, + { + " ", ":", + { "", NULL } + }, + { + " :", ":", + { "", "", NULL } + }, + { + " : ", ":", + { "", "", NULL } + }, + { + ": ", ":", + { "", "", NULL } + }, + { + ": x ", ":", + { "", "x", NULL } + }, + { + "a:bc:cde:fghi:jklmn::foo:", ":", + { "a", "bc", "cde", "fghi", "jklmn", "", "foo", "", NULL } + }, + { + ",a,bc,,def,", ",", + { "", "a", "bc", "", "def", "", NULL } + }, + { + " a ", " ", + { "", "a", "", NULL } + }, + { + " ", " ", + { "", "", NULL } + }, + { + "", " ", + { "", NULL } + } + }; + + int tidx; + + for (tidx = 0; tidx < DIM(tv); tidx++) + { + char **fields; + int field_count; + int field_count_expected; + int i; + + for (field_count_expected = 0; + tv[tidx].fields_expected[field_count_expected]; + field_count_expected ++) + ; + + fields = strtokenize (tv[tidx].s, tv[tidx].delim); + if (!fields) + fail (tidx * 1000); + else + { + for (field_count = 0; fields[field_count]; field_count++) + ; + if (field_count != field_count_expected) + fail (tidx * 1000); + else + { + for (i = 0; i < field_count_expected; i++) + if (strcmp (tv[tidx].fields_expected[i], fields[i])) + { + printf ("For field %d, expected '%s', but got '%s'\n", + i, tv[tidx].fields_expected[i], fields[i]); + fail (tidx * 1000 + i + 1); + } + } + } + + xfree (fields); + } +} + + int main (int argc, char **argv) { @@ -551,6 +691,7 @@ main (int argc, char **argv) test_make_filename_try (); test_make_absfilename_try (); test_strsplit (); + test_strtokenize (); xfree (home_buffer); return 0; ----------------------------------------------------------------------- Summary of changes: common/miscellaneous.c | 81 ++++++++++++++++++++++++++++ common/stringhelp.c | 67 +++++++++++++++++++++++ common/stringhelp.h | 4 ++ common/t-stringhelp.c | 141 +++++++++++++++++++++++++++++++++++++++++++++++++ common/util.h | 8 +++ doc/gpg.texi | 8 +-- g10/gpg.c | 80 ++++++++++++---------------- 7 files changed, 340 insertions(+), 49 deletions(-) hooks/post-receive -- The GNU Privacy Guard http://git.gnupg.org From cvs at cvs.gnupg.org Tue Jun 23 03:25:13 2015 From: cvs at cvs.gnupg.org (by NIIBE Yutaka) Date: Tue, 23 Jun 2015 03:25:13 +0200 Subject: [git] GnuPG - branch, master, updated. gnupg-2.1.5-23-g5e1d2fe Message-ID: 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 5e1d2fe6555d06f9dcd2daac713b2edfbc0428a5 (commit) from 4698e5b203bd983503b5fd784fcd09dd3bc3a15e (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 5e1d2fe6555d06f9dcd2daac713b2edfbc0428a5 Author: NIIBE Yutaka Date: Tue Jun 23 10:10:15 2015 +0900 scd: pinpad workaround for PC/SC implementations. * scd/adpu.c (pcsc_pinpad_verify, pcsc_pinpad_modify): Bigger buffer for TPDU card reader. -- GnuPG-bug-id: 2003, 2004 This is needed for PC/SC on Debian Jessie. Note that it's not only for Cherry ST-2000, but also, for any TPDU card readers. diff --git a/scd/apdu.c b/scd/apdu.c index 82b2e1f..e8797cd 100644 --- a/scd/apdu.c +++ b/scd/apdu.c @@ -2290,8 +2290,16 @@ pcsc_pinpad_verify (int slot, int class, int ins, int p0, int p1, int sw; unsigned char *pin_verify; int len = PIN_VERIFY_STRUCTURE_SIZE + pininfo->fixedlen; - unsigned char result[2]; - pcsc_dword_t resultlen = 2; + /* + * The result buffer is only expected to have two-byte result on + * return. However, some implementation uses this buffer for lower + * layer too and it assumes that there is enough space for lower + * layer communication. Such an implementation fails for TPDU + * readers with "insufficient buffer", as it needs header and + * trailer. Six is the number for header + result + trailer (TPDU). + */ + unsigned char result[6]; + pcsc_dword_t resultlen = 6; int no_lc; if (!reader_table[slot].atrlen @@ -2365,8 +2373,8 @@ pcsc_pinpad_modify (int slot, int class, int ins, int p0, int p1, int sw; unsigned char *pin_modify; int len = PIN_MODIFY_STRUCTURE_SIZE + 2 * pininfo->fixedlen; - unsigned char result[2]; - pcsc_dword_t resultlen = 2; + unsigned char result[6]; /* See the comment at pinpad_verify. */ + pcsc_dword_t resultlen = 6; int no_lc; if (!reader_table[slot].atrlen ----------------------------------------------------------------------- Summary of changes: scd/apdu.c | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) hooks/post-receive -- The GNU Privacy Guard http://git.gnupg.org From cvs at cvs.gnupg.org Tue Jun 23 03:48:59 2015 From: cvs at cvs.gnupg.org (by NIIBE Yutaka) Date: Tue, 23 Jun 2015 03:48:59 +0200 Subject: [git] GnuPG - branch, STABLE-BRANCH-2-0, updated. gnupg-2.0.28-11-g0227196 Message-ID: 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, STABLE-BRANCH-2-0 has been updated via 022719695e3900005d78564dfe4b2154fe0537a5 (commit) via 9200bf1babd1398a07202b530a255912d0ffdd71 (commit) from be348579397797bdf814c41e3cbd086156f77dd6 (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 022719695e3900005d78564dfe4b2154fe0537a5 Author: NIIBE Yutaka Date: Tue Jun 23 10:10:15 2015 +0900 scd: pinpad workaround for PC/SC implementations. * scd/adpu.c (pcsc_pinpad_verify, pcsc_pinpad_modify): Bigger buffer for TPDU card reader. -- (backport from 2.1 commit 5e1d2fe6555d06f9dcd2daac713b2edfbc0428a5) GnuPG-bug-id: 2003, 2004 This is needed for PC/SC on Debian Jessie. Note that it's not only for Cherry ST-2000, but also, for any TPDU card readers. diff --git a/scd/apdu.c b/scd/apdu.c index a2880f8..f9a1a2d 100644 --- a/scd/apdu.c +++ b/scd/apdu.c @@ -2252,8 +2252,16 @@ pcsc_pinpad_verify (int slot, int class, int ins, int p0, int p1, int sw; unsigned char *pin_verify; int len = PIN_VERIFY_STRUCTURE_SIZE + pininfo->fixedlen; - unsigned char result[2]; - pcsc_dword_t resultlen = 2; + /* + * The result buffer is only expected to have two-byte result on + * return. However, some implementation uses this buffer for lower + * layer too and it assumes that there is enough space for lower + * layer communication. Such an implementation fails for TPDU + * readers with "insufficient buffer", as it needs header and + * trailer. Six is the number for header + result + trailer (TPDU). + */ + unsigned char result[6]; + pcsc_dword_t resultlen = 6; int no_lc; if (!reader_table[slot].atrlen @@ -2327,8 +2335,8 @@ pcsc_pinpad_modify (int slot, int class, int ins, int p0, int p1, int sw; unsigned char *pin_modify; int len = PIN_MODIFY_STRUCTURE_SIZE + 2 * pininfo->fixedlen; - unsigned char result[2]; - pcsc_dword_t resultlen = 2; + unsigned char result[6]; /* See the comment at pinpad_verify. */ + pcsc_dword_t resultlen = 6; int no_lc; if (!reader_table[slot].atrlen commit 9200bf1babd1398a07202b530a255912d0ffdd71 Author: NIIBE Yutaka Date: Mon Jun 22 14:31:25 2015 +0900 scd: Fix Cherry ST-2000 support for pinpad input. * scd/apdu.c (pcsc_vendor_specific_init): Set pinmax to 15. * scd/ccid-driver.c (ccid_transceive_secure): Add zero for the template of APDU. -- (backport from 2.1 commit 444e9232aa9e00aacd939cbf7bdb881b550dfebe) GnuPG-bug-id: 2003, 2004 diff --git a/scd/apdu.c b/scd/apdu.c index 72b291e..a2880f8 100644 --- a/scd/apdu.c +++ b/scd/apdu.c @@ -1784,8 +1784,12 @@ pcsc_vendor_specific_init (int slot) reader_table[slot].is_spr532 = 1; reader_table[slot].pinpad_varlen_supported = 1; } - else if (strstr (reader_table[slot].rdrname, "ST-2xxx") - || strstr (reader_table[slot].rdrname, "cyberJack") + else if (strstr (reader_table[slot].rdrname, "ST-2xxx")) + { + reader_table[slot].pcsc.pinmax = 15; + reader_table[slot].pinpad_varlen_supported = 1; + } + else if (strstr (reader_table[slot].rdrname, "cyberJack") || strstr (reader_table[slot].rdrname, "DIGIPASS") || strstr (reader_table[slot].rdrname, "Gnuk") || strstr (reader_table[slot].rdrname, "KAAN")) @@ -1850,8 +1854,12 @@ pcsc_vendor_specific_init (int slot) reader_table[slot].is_spr532 = 1; reader_table[slot].pinpad_varlen_supported = 1; } - else if ((vendor == 0x046a && product == 0x003e) /* Cherry ST-2xxx */ - || vendor == 0x0c4b /* Tested with Reiner cyberJack GO */ + else if (vendor == 0x046a && product == 0x003e) /* Cherry ST-2xxx */ + { + reader_table[slot].pcsc.pinmax = 15; + reader_table[slot].pinpad_varlen_supported = 1; + } + else if (vendor == 0x0c4b /* Tested with Reiner cyberJack GO */ || vendor == 0x1a44 /* Tested with Vasco DIGIPASS 920 */ || vendor == 0x234b /* Tested with FSIJ Gnuk Token */ || vendor == 0x0d46 /* Tested with KAAN Advanced??? */) diff --git a/scd/ccid-driver.c b/scd/ccid-driver.c index 490569f..8a68a44 100644 --- a/scd/ccid-driver.c +++ b/scd/ccid-driver.c @@ -3355,6 +3355,7 @@ ccid_transceive_secure (ccid_driver_t handle, size_t dummy_nresp; int testmode; int cherry_mode = 0; + int add_zero = 0; int enable_varlen = 0; testmode = !resp && !nresp; @@ -3396,7 +3397,7 @@ ccid_transceive_secure (ccid_driver_t handle, enable_varlen = 1; break; case VENDOR_CHERRY: - pininfo->maxlen = 25; + pininfo->maxlen = 15; enable_varlen = 1; /* The CHERRY XX44 keyboard echos an asterisk for each entered character on the keyboard channel. We use a special variant @@ -3405,6 +3406,7 @@ ccid_transceive_secure (ccid_driver_t handle, Lc byte to the APDU. It seems that it will be replaced with the actual length instead of being appended before the APDU is send to the card. */ + add_zero = 1; if (handle->id_product != CHERRY_ST2000) cherry_mode = 1; break; @@ -3527,7 +3529,7 @@ ccid_transceive_secure (ccid_driver_t handle, msg[msglen++] = apdu_buf[1]; /* INS */ msg[msglen++] = apdu_buf[2]; /* P1 */ msg[msglen++] = apdu_buf[3]; /* P2 */ - if (cherry_mode) + if (add_zero) msg[msglen++] = 0; else if (pininfo->fixedlen != 0) { ----------------------------------------------------------------------- Summary of changes: scd/apdu.c | 32 ++++++++++++++++++++++++-------- scd/ccid-driver.c | 6 ++++-- 2 files changed, 28 insertions(+), 10 deletions(-) hooks/post-receive -- The GNU Privacy Guard http://git.gnupg.org From cvs at cvs.gnupg.org Tue Jun 23 09:15:54 2015 From: cvs at cvs.gnupg.org (by Werner Koch) Date: Tue, 23 Jun 2015 09:15:54 +0200 Subject: [git] GnuPG - branch, master, updated. gnupg-2.1.5-25-g54a0ed3 Message-ID: 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 54a0ed3d9b10a3c6dfb3d6a4d20b693a3183f8f6 (commit) via 8195e55d0c134a45f7c9bd95c8b5741781841c18 (commit) from 5e1d2fe6555d06f9dcd2daac713b2edfbc0428a5 (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 54a0ed3d9b10a3c6dfb3d6a4d20b693a3183f8f6 Author: Werner Koch Date: Tue Jun 23 09:12:44 2015 +0200 Allow use of debug flag names for all tools. * g13/g13.c: Make use of debug_parse_flag. * scd/scdaemon.c: Ditto. * sm/gpgsm.c: Ditto * agent/gpg-agent.c: Ditto. But do not terminate on "help" * dirmngr/dirmngr.c: Ditto. Signed-off-by: Werner Koch diff --git a/agent/gpg-agent.c b/agent/gpg-agent.c index 8c71e0d..b27abe3 100644 --- a/agent/gpg-agent.c +++ b/agent/gpg-agent.c @@ -153,7 +153,7 @@ static ARGPARSE_OPTS opts[] = { ARGPARSE_s_n (oCsh, "csh", N_("csh-style command output")), ARGPARSE_s_s (oOptions, "options", N_("|FILE|read options from FILE")), - ARGPARSE_s_u (oDebug, "debug", "@"), + ARGPARSE_s_s (oDebug, "debug", "@"), ARGPARSE_s_n (oDebugAll, "debug-all", "@"), ARGPARSE_s_s (oDebugLevel, "debug-level", "@"), ARGPARSE_s_i (oDebugWait," debug-wait", "@"), @@ -239,6 +239,22 @@ static ARGPARSE_OPTS opts[] = { }; +/* The list of supported debug flags. */ +static struct debug_flags_s debug_flags [] = + { + { DBG_COMMAND_VALUE, "command" }, + { DBG_MPI_VALUE , "mpi" }, + { DBG_CRYPTO_VALUE , "crypto" }, + { DBG_MEMORY_VALUE , "memory" }, + { DBG_CACHE_VALUE , "cache" }, + { DBG_MEMSTAT_VALUE, "memstat" }, + { DBG_HASHING_VALUE, "hashing" }, + { DBG_IPC_VALUE , "ipc" }, + { 77, NULL } /* 77 := Do not exit on "help" or "?". */ + }; + + + #define DEFAULT_CACHE_TTL (10*60) /* 10 minutes */ #define DEFAULT_CACHE_TTL_SSH (30*60) /* 30 minutes */ #define MAX_CACHE_TTL (120*60) /* 2 hours */ @@ -490,15 +506,7 @@ set_debug (void) gcry_control (GCRYCTL_SET_VERBOSITY, (int)opt.verbose); if (opt.debug) - log_info ("enabled debug flags:%s%s%s%s%s%s%s%s\n", - (opt.debug & DBG_COMMAND_VALUE)? " command":"", - (opt.debug & DBG_MPI_VALUE )? " mpi":"", - (opt.debug & DBG_CRYPTO_VALUE )? " crypto":"", - (opt.debug & DBG_MEMORY_VALUE )? " memory":"", - (opt.debug & DBG_CACHE_VALUE )? " cache":"", - (opt.debug & DBG_MEMSTAT_VALUE)? " memstat":"", - (opt.debug & DBG_HASHING_VALUE)? " hashing":"", - (opt.debug & DBG_IPC_VALUE )? " ipc":""); + parse_debug_flag (NULL, &opt.debug, debug_flags); } @@ -590,7 +598,9 @@ parse_rereadable_options (ARGPARSE_ARGS *pargs, int reread) case oQuiet: opt.quiet = 1; break; case oVerbose: opt.verbose++; break; - case oDebug: opt.debug |= pargs->r.ret_ulong; break; + case oDebug: + parse_debug_flag (pargs->r.ret_str, &opt.debug, debug_flags); + break; case oDebugAll: opt.debug = ~0; break; case oDebugLevel: debug_level = pargs->r.ret_str; break; case oDebugPinentry: opt.debug_pinentry = 1; break; diff --git a/dirmngr/dirmngr.c b/dirmngr/dirmngr.c index a9efba9..10cc45e 100644 --- a/dirmngr/dirmngr.c +++ b/dirmngr/dirmngr.c @@ -219,7 +219,7 @@ static ARGPARSE_OPTS opts[] = { ARGPARSE_s_s (oSocketName, "socket-name", "@"), /* Only for debugging. */ ARGPARSE_s_u (oFakedSystemTime, "faked-system-time", "@"), /*(epoch time)*/ - ARGPARSE_p_u (oDebug, "debug", "@"), + ARGPARSE_s_s (oDebug, "debug", "@"), ARGPARSE_s_n (oDebugAll, "debug-all", "@"), ARGPARSE_s_i (oGnutlsDebug, "gnutls-debug", "@"), ARGPARSE_s_i (oGnutlsDebug, "tls-debug", "@"), @@ -237,6 +237,20 @@ static ARGPARSE_OPTS opts[] = { ARGPARSE_end () }; +/* The list of supported debug flags. */ +static struct debug_flags_s debug_flags [] = + { + { DBG_X509_VALUE , "x509" }, + { DBG_CRYPTO_VALUE , "crypto" }, + { DBG_MEMORY_VALUE , "memory" }, + { DBG_CACHE_VALUE , "cache" }, + { DBG_MEMSTAT_VALUE, "memstat" }, + { DBG_HASHING_VALUE, "hashing" }, + { DBG_IPC_VALUE , "ipc" }, + { DBG_LOOKUP_VALUE , "lookup" }, + { 77, NULL } /* 77 := Do not exit on "help" or "?". */ + }; + #define DEFAULT_MAX_REPLIES 10 #define DEFAULT_LDAP_TIMEOUT 100 /* arbitrary large timeout */ @@ -441,6 +455,9 @@ set_debug (void) gnutls_global_set_log_level (opt_gnutls_debug); } #endif /*HTTP_USE_GNUTLS*/ + + if (opt.debug) + parse_debug_flag (NULL, &opt.debug, debug_flags); } @@ -508,7 +525,9 @@ parse_rereadable_options (ARGPARSE_ARGS *pargs, int reread) { case oQuiet: opt.quiet = 1; break; case oVerbose: opt.verbose++; break; - case oDebug: opt.debug |= pargs->r.ret_ulong; break; + case oDebug: + parse_debug_flag (pargs->r.ret_str, &opt.debug, debug_flags); + break; case oDebugAll: opt.debug = ~0; break; case oDebugLevel: debug_level = pargs->r.ret_str; break; case oGnutlsDebug: opt_gnutls_debug = pargs->r.ret_int; break; @@ -866,9 +885,6 @@ main (int argc, char **argv) case oVerbose: opt.verbose++; break; case oBatch: opt.batch=1; break; - case oDebug: opt.debug |= pargs.r.ret_ulong; break; - case oDebugAll: opt.debug = ~0; break; - case oDebugLevel: debug_level = pargs.r.ret_str; break; case oDebugWait: debug_wait = pargs.r.ret_int; break; case oOptions: diff --git a/g13/g13.c b/g13/g13.c index 2e4e63d..a6fddd0 100644 --- a/g13/g13.c +++ b/g13/g13.c @@ -128,7 +128,7 @@ static ARGPARSE_OPTS opts[] = { ARGPARSE_s_s (oOptions, "options", N_("|FILE|read options from FILE")), - ARGPARSE_p_u (oDebug, "debug", "@"), + ARGPARSE_s_s (oDebug, "debug", "@"), ARGPARSE_s_s (oDebugLevel, "debug-level", N_("|LEVEL|set the debugging level to LEVEL")), ARGPARSE_s_n (oDebugAll, "debug-all", "@"), @@ -171,6 +171,18 @@ static ARGPARSE_OPTS opts[] = { }; +/* The list of supported debug flags. */ +static struct debug_flags_s debug_flags [] = + { + { DBG_MOUNT_VALUE , "mount" }, + { DBG_CRYPTO_VALUE , "crypto" }, + { DBG_MEMORY_VALUE , "memory" }, + { DBG_MEMSTAT_VALUE, "memstat" }, + { DBG_IPC_VALUE , "ipc" }, + { 0, NULL } + }; + + /* The timer tick interval used by the idle task. */ #define TIMERTICK_INTERVAL_SEC (1) @@ -289,12 +301,7 @@ set_debug (void) gcry_control (GCRYCTL_SET_VERBOSITY, (int)opt.verbose); if (opt.debug) - log_info ("enabled debug flags:%s%s%s%s%s\n", - (opt.debug & DBG_MOUNT_VALUE )? " mount":"", - (opt.debug & DBG_CRYPTO_VALUE )? " crypto":"", - (opt.debug & DBG_MEMORY_VALUE )? " memory":"", - (opt.debug & DBG_MEMSTAT_VALUE)? " memstat":"", - (opt.debug & DBG_IPC_VALUE )? " ipc":""); + parse_debug_flag (NULL, &opt.debug, debug_flags); } @@ -507,7 +514,13 @@ main ( int argc, char **argv) case oNoDetach: /*nodetach = 1; */break; - case oDebug: debug_value |= pargs.r.ret_ulong; break; + case oDebug: + if (parse_debug_flag (pargs.r.ret_str, &opt.debug, debug_flags)) + { + pargs.r_opt = ARGPARSE_INVALID_ARG; + pargs.err = ARGPARSE_PRINT_ERROR; + } + break; case oDebugAll: debug_value = ~0; break; case oDebugNone: debug_value = 0; break; case oDebugLevel: debug_level = pargs.r.ret_str; break; diff --git a/scd/scdaemon.c b/scd/scdaemon.c index 2cabee8..0f92efe 100644 --- a/scd/scdaemon.c +++ b/scd/scdaemon.c @@ -118,7 +118,7 @@ static ARGPARSE_OPTS opts[] = { ARGPARSE_s_n (oSh, "sh", N_("sh-style command output")), ARGPARSE_s_n (oCsh, "csh", N_("csh-style command output")), ARGPARSE_s_s (oOptions, "options", N_("|FILE|read options from FILE")), - ARGPARSE_p_u (oDebug, "debug", "@"), + ARGPARSE_s_s (oDebug, "debug", "@"), ARGPARSE_s_n (oDebugAll, "debug-all", "@"), ARGPARSE_s_s (oDebugLevel, "debug-level" , N_("|LEVEL|set the debugging level to LEVEL")), @@ -161,6 +161,23 @@ static ARGPARSE_OPTS opts[] = { }; +/* The list of supported debug flags. */ +static struct debug_flags_s debug_flags [] = + { + { DBG_COMMAND_VALUE, "command" }, + { DBG_MPI_VALUE , "mpi" }, + { DBG_CRYPTO_VALUE , "crypto" }, + { DBG_MEMORY_VALUE , "memory" }, + { DBG_CACHE_VALUE , "cache" }, + { DBG_MEMSTAT_VALUE, "memstat" }, + { DBG_HASHING_VALUE, "hashing" }, + { DBG_IPC_VALUE , "ipc" }, + { DBG_CARD_IO_VALUE, "cardio" }, + { DBG_READER_VALUE , "reader" }, + { 0, NULL } + }; + + /* The card driver we use by default for PC/SC. */ #if defined(HAVE_W32_SYSTEM) || defined(__CYGWIN__) #define DEFAULT_PCSC_DRIVER "winscard.dll" @@ -343,17 +360,7 @@ set_debug (const char *level) gcry_control (GCRYCTL_SET_VERBOSITY, (int)opt.verbose); if (opt.debug) - log_info ("enabled debug flags:%s%s%s%s%s%s%s%s%s%s\n", - (opt.debug & DBG_COMMAND_VALUE)? " command":"", - (opt.debug & DBG_MPI_VALUE )? " mpi":"", - (opt.debug & DBG_CRYPTO_VALUE )? " crypto":"", - (opt.debug & DBG_MEMORY_VALUE )? " memory":"", - (opt.debug & DBG_CACHE_VALUE )? " cache":"", - (opt.debug & DBG_MEMSTAT_VALUE)? " memstat":"", - (opt.debug & DBG_HASHING_VALUE)? " hashing":"", - (opt.debug & DBG_IPC_VALUE )? " ipc":"", - (opt.debug & DBG_CARD_IO_VALUE)? " cardio":"", - (opt.debug & DBG_READER_VALUE )? " reader":""); + parse_debug_flag (NULL, &opt.debug, debug_flags); } @@ -536,7 +543,13 @@ main (int argc, char **argv ) case oVerbose: opt.verbose++; break; case oBatch: opt.batch=1; break; - case oDebug: opt.debug |= pargs.r.ret_ulong; break; + case oDebug: + if (parse_debug_flag (pargs.r.ret_str, &opt.debug, debug_flags)) + { + pargs.r_opt = ARGPARSE_INVALID_ARG; + pargs.err = ARGPARSE_PRINT_ERROR; + } + break; case oDebugAll: opt.debug = ~0; break; case oDebugLevel: debug_level = pargs.r.ret_str; break; case oDebugWait: debug_wait = pargs.r.ret_int; break; diff --git a/sm/gpgsm.c b/sm/gpgsm.c index 8cd7e84..39c3c40 100644 --- a/sm/gpgsm.c +++ b/sm/gpgsm.c @@ -323,7 +323,7 @@ static ARGPARSE_OPTS opts[] = { N_("|SPEC|use this keyserver to lookup keys")), ARGPARSE_s_s (oOptions, "options", N_("|FILE|read options from FILE")), - ARGPARSE_p_u (oDebug, "debug", "@"), + ARGPARSE_s_s (oDebug, "debug", "@"), ARGPARSE_s_s (oDebugLevel, "debug-level", N_("|LEVEL|set the debugging level to LEVEL")), ARGPARSE_s_n (oDebugAll, "debug-all", "@"), @@ -406,6 +406,19 @@ static ARGPARSE_OPTS opts[] = { }; +/* The list of supported debug flags. */ +static struct debug_flags_s debug_flags [] = + { + { DBG_X509_VALUE , "x509" }, + { DBG_MPI_VALUE , "mpi" }, + { DBG_CRYPTO_VALUE , "crypto" }, + { DBG_MEMORY_VALUE , "memory" }, + { DBG_CACHE_VALUE , "cache" }, + { DBG_MEMSTAT_VALUE, "memstat" }, + { DBG_HASHING_VALUE, "hashing" }, + { DBG_IPC_VALUE , "ipc" }, + { 0, NULL } + }; /* Global variable to keep an error count. */ @@ -706,15 +719,7 @@ set_debug (void) gcry_control (GCRYCTL_SET_VERBOSITY, (int)opt.verbose); if (opt.debug) - log_info ("enabled debug flags:%s%s%s%s%s%s%s%s\n", - (opt.debug & DBG_X509_VALUE )? " x509":"", - (opt.debug & DBG_MPI_VALUE )? " mpi":"", - (opt.debug & DBG_CRYPTO_VALUE )? " crypto":"", - (opt.debug & DBG_MEMORY_VALUE )? " memory":"", - (opt.debug & DBG_CACHE_VALUE )? " cache":"", - (opt.debug & DBG_MEMSTAT_VALUE)? " memstat":"", - (opt.debug & DBG_HASHING_VALUE)? " hashing":"", - (opt.debug & DBG_IPC_VALUE )? " ipc":"" ); + parse_debug_flag (NULL, &opt.debug, debug_flags); } @@ -1243,7 +1248,13 @@ main ( int argc, char **argv) case oKeyring: append_to_strlist (&nrings, pargs.r.ret_str); break; - case oDebug: debug_value |= pargs.r.ret_ulong; break; + case oDebug: + if (parse_debug_flag (pargs.r.ret_str, &debug_value, debug_flags)) + { + pargs.r_opt = ARGPARSE_INVALID_ARG; + pargs.err = ARGPARSE_PRINT_ERROR; + } + break; case oDebugAll: debug_value = ~0; break; case oDebugNone: debug_value = 0; break; case oDebugLevel: debug_level = pargs.r.ret_str; break; commit 8195e55d0c134a45f7c9bd95c8b5741781841c18 Author: Werner Koch Date: Tue Jun 23 09:10:56 2015 +0200 common: Improve fucntion parse_debug_flag. * common/miscellaneous.c (parse_debug_flag): Add hack not to call exit. Add "none" and "all" flags. Signed-off-by: Werner Koch diff --git a/common/miscellaneous.c b/common/miscellaneous.c index e840895..ec36f08 100644 --- a/common/miscellaneous.c +++ b/common/miscellaneous.c @@ -440,7 +440,8 @@ parse_debug_flag (const char *string, unsigned int *debugvar, log_info ("available debug flags:\n"); for (i=0; flags[i].name; i++) log_info (" %5u %s\n", flags[i].flag, flags[i].name); - exit (0); + if (flags[i].flag != 77) + exit (0); } else if (digitp (string)) { @@ -466,7 +467,17 @@ parse_debug_flag (const char *string, unsigned int *debugvar, break; } if (!flags[j].name) - log_info (_("unknown debug flag '%s' ignored\n"), words[i]); + { + if (!strcmp (words[i], "none")) + { + *debugvar = 0; + result = 0; + } + else if (!strcmp (words[i], "all")) + result = ~0; + else + log_info (_("unknown debug flag '%s' ignored\n"), words[i]); + } } } xfree (words); ----------------------------------------------------------------------- Summary of changes: agent/gpg-agent.c | 32 +++++++++++++++++++++----------- common/miscellaneous.c | 15 +++++++++++++-- dirmngr/dirmngr.c | 26 +++++++++++++++++++++----- g13/g13.c | 29 +++++++++++++++++++++-------- scd/scdaemon.c | 39 ++++++++++++++++++++++++++------------- sm/gpgsm.c | 33 ++++++++++++++++++++++----------- 6 files changed, 124 insertions(+), 50 deletions(-) hooks/post-receive -- The GNU Privacy Guard http://git.gnupg.org From cvs at cvs.gnupg.org Tue Jun 23 09:48:07 2015 From: cvs at cvs.gnupg.org (by Werner Koch) Date: Tue, 23 Jun 2015 09:48:07 +0200 Subject: [git] gnupg-doc - branch, master, updated. 88434826fdc718a2849833eb011707def7e6191f Message-ID: 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 GnuPG website and other docs". The branch, master has been updated via 88434826fdc718a2849833eb011707def7e6191f (commit) from 7140aea155040cb7b41ce952b43a8e822b118e94 (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 88434826fdc718a2849833eb011707def7e6191f Author: Werner Koch Date: Tue Jun 23 09:44:22 2015 +0200 blog: Fix URL of OpenKeychain https does not work right now diff --git a/misc/blog.gnupg.org/20150426-openpgp-summit.org b/misc/blog.gnupg.org/20150426-openpgp-summit.org index b12ccfc..3cad236 100644 --- a/misc/blog.gnupg.org/20150426-openpgp-summit.org +++ b/misc/blog.gnupg.org/20150426-openpgp-summit.org @@ -36,7 +36,7 @@ [[https://enigmail.net][Enigmail]], Gpg4o, r2mail2, - [[https://openkeychain.org][OpenKeychain,]] + [[http://openkeychain.org][OpenKeychain,]] [[https://gpgtools.org][GPG Tools]], [[https://pixelated-project.org][Pixelated]], [[https://whiteout.io][Whiteout]], ----------------------------------------------------------------------- Summary of changes: misc/blog.gnupg.org/20150426-openpgp-summit.org | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) hooks/post-receive -- The GnuPG website and other docs http://git.gnupg.org From cvs at cvs.gnupg.org Tue Jun 23 19:57:38 2015 From: cvs at cvs.gnupg.org (by Neal H. Walfield) Date: Tue, 23 Jun 2015 19:57:38 +0200 Subject: [git] Pinentry - branch, master, updated. pinentry-0.9.4-9-g6ce1d0c Message-ID: 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 standard pinentry collection". The branch, master has been updated via 6ce1d0c0d4106c359eee65d7cf27d522d3f8b72a (commit) from 3ef5d07873ab917e66c299521e85cff12fbbf40c (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 6ce1d0c0d4106c359eee65d7cf27d522d3f8b72a Author: Neal H. Walfield Date: Tue Jun 23 19:57:11 2015 +0200 curses: Recognize ASCII DEL as backspace. * pinentry/pinentry-curses.c (dialog_input): Recognize ASCII DEL as backspace. -- Reported-by chdiza GnuPG-bug-id: 2020 diff --git a/pinentry/pinentry-curses.c b/pinentry/pinentry-curses.c index 235435a..784c770 100644 --- a/pinentry/pinentry-curses.c +++ b/pinentry/pinentry-curses.c @@ -705,7 +705,11 @@ dialog_input (dialog_t diag, int alt, int chr) switch (chr) { case KEY_BACKSPACE: - case 'h' - 'a' + 1: /* control-h. */ + /* control-h. */ + case 'h' - 'a' + 1: + /* ASCII DEL. What Mac OS X apparently emits when the "delete" + (backspace) key is pressed. */ + case 127: if (diag->pin_len > 0) { diag->pin_len--; ----------------------------------------------------------------------- Summary of changes: pinentry/pinentry-curses.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) hooks/post-receive -- The standard pinentry collection http://git.gnupg.org From cvs at cvs.gnupg.org Tue Jun 23 20:59:24 2015 From: cvs at cvs.gnupg.org (by Neal H. Walfield) Date: Tue, 23 Jun 2015 20:59:24 +0200 Subject: [git] Pinentry - branch, master, updated. pinentry-0.9.4-10-g266f1c9 Message-ID: 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 standard pinentry collection". The branch, master has been updated via 266f1c9e3542627b1cbd191141af4e6f76f706fe (commit) from 6ce1d0c0d4106c359eee65d7cf27d522d3f8b72a (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 266f1c9e3542627b1cbd191141af4e6f76f706fe Author: Neal H. Walfield Date: Tue Jun 23 20:59:19 2015 +0200 emacs: Don't link against ../assuan/libassuan.a. * emacs/Makefile.am (LDADD): Don't link against ../assuan/libassuan.a. We now use the system libassuan. diff --git a/emacs/Makefile.am b/emacs/Makefile.am index e2102bc..ca0a4dc 100644 --- a/emacs/Makefile.am +++ b/emacs/Makefile.am @@ -22,8 +22,7 @@ bin_PROGRAMS = pinentry-emacs AM_CPPFLAGS = $(COMMON_CFLAGS) $(NEMACS_INCLUDE) -I$(top_srcdir)/pinentry -LDADD = ../pinentry/libpinentry.a \ - ../assuan/libassuan.a ../secmem/libsecmem.a \ +LDADD = ../pinentry/libpinentry.a ../secmem/libsecmem.a \ $(COMMON_LIBS) $(LIBCAP) $(LIBEMACS) $(LIBICONV) pinentry_emacs_SOURCES = pinentry-emacs.c ----------------------------------------------------------------------- Summary of changes: emacs/Makefile.am | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) hooks/post-receive -- The standard pinentry collection http://git.gnupg.org From cvs at cvs.gnupg.org Wed Jun 24 07:27:32 2015 From: cvs at cvs.gnupg.org (by Ben McGinnes) Date: Wed, 24 Jun 2015 07:27:32 +0200 Subject: [git] GPGME - branch, ben/master, created. gpgme-1.5.5-2-g5f05820 Message-ID: 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 "GnuPG Made Easy". The branch, ben/master has been created at 5f0582030ee52eb85fea6183e2f473d828e3dbce (commit) - Log ----------------------------------------------------------------- commit 5f0582030ee52eb85fea6183e2f473d828e3dbce Author: Ben McGinnes Date: Wed Jun 24 15:22:29 2015 +1000 Added myself * For pyme and Python 3, see lang/pyme and the pyme branch. * For gpygme or pygme (the first g is silent, but not the second), this will be the new API for non C languages which will, unlike pyme, provide a REST-like interface for other applications or languages utilising JSON data formats (and possibly other formats). See lang/gpygme for details. diff --git a/AUTHORS b/AUTHORS index dd4b492..0c837f1 100644 --- a/AUTHORS +++ b/AUTHORS @@ -23,6 +23,11 @@ Werner Koch Wojciech Polak - gpgme.spec +Ben McGinnes + - Python 3 port of SWIG generated wrappers; pyme 0.9: lang/pyme. + - Python 3 API for all non-C languages; GPyGME (pronounced "pig-me"): + lang/gpygme. + Authors with a DCO ================== ----------------------------------------------------------------------- hooks/post-receive -- GnuPG Made Easy http://git.gnupg.org From cvs at cvs.gnupg.org Wed Jun 24 11:20:39 2015 From: cvs at cvs.gnupg.org (by Ben McGinnes) Date: Wed, 24 Jun 2015 11:20:39 +0200 Subject: [git] GPGME - branch, ben/gpygme, created. gpgme-1.5.5-5-g881a57f Message-ID: 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 "GnuPG Made Easy". The branch, ben/gpygme has been created at 881a57f8c766e8d0600151456d11c9759162f5b1 (commit) - Log ----------------------------------------------------------------- commit 881a57f8c766e8d0600151456d11c9759162f5b1 Author: Ben McGinnes Date: Wed Jun 24 19:18:21 2015 +1000 Added FAQ * Addresses some licensing issues. * Addresses any possible concerns pertaining to export of dual use technology from Australia. diff --git a/lang/gpygme/docs/FAQ.rst b/lang/gpygme/docs/FAQ.rst new file mode 100644 index 0000000..cbad050 --- /dev/null +++ b/lang/gpygme/docs/FAQ.rst @@ -0,0 +1,72 @@ +=========================== +Frequently Asked??? Questions +=========================== + +??? At this stage these are more like Frequently Anticipated Questions. + +----------------- +Using the Project +----------------- + +**1. Why implement an interactive codebase?** + +For good or ill, modern application development has turned to many web based technologies. As a result there are many more developers who no longer use or know languages like C. Consequently complete APIs like GPGME are not available to them when they may very well need it or benefit greatly from it. Rather than continuing existing systems which utilise wrappers calling command line programs (e.g. `python-gnupg `_), it is best to provide access to GPGME in a manner which can be safely used by newer developers. + +**2. Won't that create bottlenecks or performance issues?** + +It might, but chances are these will be negligible for most implementations. Projects which truly needs greater optimisation should consider utilising the GPGME C code directly. + +**3. I want (or need) to use a proprietary licence with my project, can I use this?** + +Yes, when interacting with GPyGME as a stand alone API it is much the same as using any external API. That is, your code is simply communicating with another system and not integrating that system into your own code. Only when implementing your project in Python and importing the API as a module or library would your code then become subject to the LGPL 2.1+ (which might be fine anyway, consult with a lawyer for issues pertaining to your specific situation). + +---------------------- +International Treaties +---------------------- + +**1. The current author/maintainer is in Australia, won't that cause problems with ITAR and the Wassenaar Arrangement?** + +I'm not developing a cryptosystem or any encryption algorithms, I'm developing an API. So I should not be affected one way or the other by the provisions of the `Defence Trade Control Act 2012 `_ (DTCA), particularly with the 2015 amendments which have been passed by the Australian Parliament. + +**2. What if you're wrong about that?** + +That seems somewhat unlikely. The DSGL explicitly cites cryptography and encryption software as being in Part 2 of the `Defence Trade Cooperation Munitions List `_, but neither GPGME nor GPyGME are encryption software directly. Even GPGME simply provides a means of accessing what it refers to as encryption engines; currently the engines it supports are GnuPG and GpgSM. As long as I do not develop any of these encryption engines my work is not affected by the provisions of Australia's export controls, no matter how backward or useless I might consider those controls to be. + +**3. In April 2016 the enforcement provisions of the DTCA come into force, could that change anything here?** + +If the Minister of Defence makes a specific announcement in Parliament naming me and this work as falling under the purview of the DTCA, then yes; otherwise no. + +The only other way it could happen is if the Defence definition of "public domain" changes or if exemptions based on something being in the public domain are removed. + +**4. What if that happens?** + +This is getting a bit ridiculous, but alright ... should any of those incredibly unlikely events actually occur I will be faced with the following options: + +- Capitulate immediately and cease maintaining the software. +- Capitulate immediately and apply for a permit to continue maintaining the software. +- Ignore the decision and fight it in Court (which would be hideously expensive, but interesting). +- Leave Australia. + +As far as I'm concerned the only really viable options in that scenario would be to either leave the project or to leave my country. In all likelihood this would be a permanent departure in either case. + +**5. Which of those would you do?** + +I'm not a hundred percent sure, it would depend on whatever other factors were in play at such a time as it might occur. If it were to happen now or I were in essentially the same position at such a time as I am now, then the most likely scenario is that I'd tell my government where to go; then emigrate to Europe somewhere. + +**6. Really?** + +Yes, really. It wouldn't mean I'd never be able to visit Australia, it just means I'd never be able to work in Australia. I would lose nothing and the Australian government would lose a tiny amount of income tax revenue. + +**7. What assurances can you give that questions 3 to 6 are just paranoia and everything will be fine?** + +The Department of Defence's `Defence Export Control Office `_ (DECO) provides numerous resources to address concerns relating to this type of development. Included in this is the `Defence and Strategic Goods List `_ (DSGL) and its accompanying `Activity Questionnaire `_ and `Online DSGL Search Tool `_. + +I completed the questionaire using the following conservative assumptions: that this work is either or both of supply and publishing of software and technology; and that the entire project really is in the category of Part 2 of the DSGL as a dual-use technology. Even though I am still pretty sure that only GPG itself and GpgSM would be placed in that category. Maybe libassuan, dirmngr and pinentry would too. Still, assuming that it all did, including GPGME and GPyGME, the results are clear that both supply and publication are fine. The `definitions of supply and publishing `_, however, indicate that this work would likely only ever be considered publishing. + +The reason for this is that all the existing software on which this work is built is what Defence classifies as being in the public domain. In this context that is not the same as the term is used for copyright and licensing, it means that the software and information is already freely available to anyone. Thus it would be the same for all or almost all free (libre) and open source software. + +Only Australian cryptographers developing entirely new encryption algortithms are likely to be directly impacted by the provisions of the DCTA. I am very much *not* in that category. Furthermore, any algorithm added to the specifications for GPG would need to pass through an international selection process anyway, by which stage it would be exempt from these types of restrictions because it would already be in the public domain as far as Australia's Department of Defence is concerned. + +The results of my completed questionnaire are available `here `_ (PDF) and a GPG signature of the file is `here `_. The file is signed with my key (ID 0x321E4E2373590E5D). + +With regards to current sanctions by Australia against any entity as referenced in that document and available `here `_, my method of publication consists of uploading information to the GPG git server in Germany. Germany is not currently a sanctioned country by Australia, nor are any of the involved companies sanctioned separately. In fact, the only reference to Germany on Australia's list of sanctioned entities pertains to a number of individuals, mostly members of Al-Qaeda, currently serving time in German prisons or having been deported from Germany. Additional details on those sanctions can be found `here `_ and `here `_. commit 6f2218989401f85bf315e285c752b5e1ac467cb3 Author: Ben McGinnes Date: Wed Jun 24 19:15:33 2015 +1000 Dual Use export exemption * Document and GPG signature of same pertaining to exemption from the DCTA provisions in Australia. diff --git a/lang/gpygme/docs/Australian_DCTA_export_DECO_Questionnaire_Results.pdf b/lang/gpygme/docs/Australian_DCTA_export_DECO_Questionnaire_Results.pdf new file mode 100644 index 0000000..f6818d5 --- /dev/null +++ b/lang/gpygme/docs/Australian_DCTA_export_DECO_Questionnaire_Results.pdf @@ -0,0 +1,2264 @@ +%PDF-1.3 +3 0 obj +<> +endobj +4 0 obj +<> +stream +0.57 w +0 G +0.00 0.00 0.00 RG +1.42 w +q 188.50 0 0 53.86 70.87 678.90 cm /I0 Do Q +BT +/F10 12 Tf +13.799999999999999 TL +0 g +277.80 710.08 Td +(ONLINE DSGL TOOL ? SUMMARY OF) Tj +T* (ACTIVITY QUESTIONNAIRE) Tj +ET +70.866 664.724 m +524.409 664.724 l +S +70.866 76.535 m +524.409 76.535 l +S +BT +/F11 12 Tf +13.799999999999999 TL +0 g +184.25 65.20 Td +(DECO - Ensuring Australia Exports Responsibly) Tj +ET +BT +/F9 9 Tf +10.35 TL +0 g +496.06 48.19 Td +(Page 1) Tj +ET +BT +/F9 9 Tf +10.35 TL +0 g +70.87 48.19 Td +(Report ID: 17780224395) Tj +ET +BT +/F9 12 Tf +13.799999999999999 TL +0 g +82.20 630.71 Td +(This report is issued by the Defence Export Control Office in response to your query in) Tj +T* (the Online DSGL Tool. The assessment in this report is based on the information you) Tj +T* (provided.) Tj +ET +BT +/F10 12 Tf +13.799999999999999 TL +0 g +82.20 574.02 Td +(Assessment of proposed activity) Tj +ET +82.20 569.76 141.73 -22.68 re +S +223.94 569.76 289.13 -22.68 re +S +BT +/F9 12 Tf +13.799999999999999 TL +0 g +87.87 554.17 Td +(Report ID:) Tj +ET +BT +/F9 12 Tf +13.799999999999999 TL +0 g +229.61 554.17 Td +(17780224395-1) Tj +ET +82.20 547.09 141.73 -22.68 re +S +223.94 547.09 289.13 -22.68 re +S +BT +/F9 12 Tf +13.799999999999999 TL +0 g +87.87 531.50 Td +(Produced at:) Tj +ET +BT +/F9 12 Tf +13.799999999999999 TL +0 g +229.61 531.50 Td +(June 24th 2015, 5:57:10 pm) Tj +ET +82.20 524.41 141.73 -22.68 re +S +223.94 524.41 289.13 -22.68 re +S +BT +/F9 12 Tf +13.799999999999999 TL +0 g +87.87 508.82 Td +(Your reference:) Tj +ET +BT +/F9 12 Tf +13.799999999999999 TL +0 g +229.61 508.82 Td +() Tj +ET +82.20 501.73 141.73 -22.68 re +S +223.94 501.73 289.13 -22.68 re +S +BT +/F9 12 Tf +13.799999999999999 TL +0 g +87.87 486.14 Td +(Activity Assessed:) Tj +ET +BT +/F9 12 Tf +13.799999999999999 TL +0 g +229.61 486.14 Td +(Supply) Tj +ET +82.20 479.06 141.73 -107.72 re +S +223.94 479.06 289.13 -107.72 re +S +BT +/F9 12 Tf +13.799999999999999 TL +0 g +87.87 463.46 Td +(Assessment of the) Tj +ET +BT +/F9 12 Tf +13.799999999999999 TL +0 g +87.87 449.29 Td +(answers you provided:) Tj +ET +BT +/F9 12 Tf +13.799999999999999 TL +0 g +229.61 463.46 Td +(Your ) Tj +ET +BT +/F9 12 Tf +13.799999999999999 TL +0 g +256.09 463.46 Td +(activity ) Tj +ET +BT +/F9 12 Tf +13.799999999999999 TL +0 g +295.40 463.46 Td +(is ) Tj +ET +BT +/F10 12 Tf +13.799999999999999 TL +0 g +306.53 463.46 Td +(not ) Tj +ET +BT +/F10 12 Tf +13.799999999999999 TL +0 g +325.03 463.46 Td +(controlled) Tj +ET +BT +/F9 12 Tf +13.799999999999999 TL +0 g +379.71 463.46 Td +(because ) Tj +ET +BT +/F9 12 Tf +13.799999999999999 TL +0 g +422.77 463.46 Td +(there ) Tj +ET +BT +/F9 12 Tf +13.799999999999999 TL +0 g +449.86 463.46 Td +(is ) Tj +ET +BT +/F9 12 Tf +13.799999999999999 TL +0 g +460.99 463.46 Td +(an ) Tj +ET +BT +/F9 12 Tf +13.799999999999999 TL +0 g +229.61 449.29 Td +(exemption ) Tj +ET +BT +/F9 12 Tf +13.799999999999999 TL +0 g +283.67 449.29 Td +(for ) Tj +ET +BT +/F9 12 Tf +13.799999999999999 TL +0 g +300.72 449.29 Td +(the ) Tj +ET +BT +/F9 12 Tf +13.799999999999999 TL +0 g +318.50 449.29 Td +(supply ) Tj +ET +BT +/F9 12 Tf +13.799999999999999 TL +0 g +353.82 449.29 Td +(of ) Tj +ET +BT +/F9 12 Tf +13.799999999999999 TL +0 g +366.88 449.29 Td +(Part ) Tj +ET +BT +/F9 12 Tf +13.799999999999999 TL +0 g +389.25 449.29 Td +(2 ) Tj +ET +BT +/F9 12 Tf +13.799999999999999 TL +0 g +398.32 449.29 Td +(DSGL ) Tj +ET +BT +/F9 12 Tf +13.799999999999999 TL +0 g +432.79 449.29 Td +(technology ) Tj +ET +BT +/F9 12 Tf +13.799999999999999 TL +0 g +229.61 435.12 Td +(when ) Tj +ET +BT +/F9 12 Tf +13.799999999999999 TL +0 g +258.75 435.12 Td +(that ) Tj +ET +BT +/F9 12 Tf +13.799999999999999 TL +0 g +279.92 435.12 Td +(supply ) Tj +ET +BT +/F9 12 Tf +13.799999999999999 TL +0 g +315.24 435.12 Td +(is ) Tj +ET +BT +/F9 12 Tf +13.799999999999999 TL +0 g +326.36 435.12 Td +(preparatory ) Tj +ET +BT +/F9 12 Tf +13.799999999999999 TL +0 g +384.90 435.12 Td +(to ) Tj +ET +BT +/F9 12 Tf +13.799999999999999 TL +0 g +397.36 435.12 Td +(the ) Tj +ET +BT +/F9 12 Tf +13.799999999999999 TL +0 g +415.14 435.12 Td +(DSGL ) Tj +ET +BT +/F9 12 Tf +13.799999999999999 TL +0 g +449.61 435.12 Td +(technology ) Tj +ET +BT +/F9 12 Tf +13.799999999999999 TL +0 g +229.61 420.94 Td +(being ) Tj +ET +BT +/F9 12 Tf +13.799999999999999 TL +0 g +259.48 420.94 Td +(published.) Tj +ET +BT +/F9 12 Tf +13.799999999999999 TL +0 g +229.61 398.27 Td +(See ) Tj +ET +BT +/F9 12 Tf +13.799999999999999 TL +0 g +249.93 398.27 Td +(section ) Tj +ET +BT +/F9 12 Tf +13.799999999999999 TL +0 g +287.18 398.27 Td +(10\(3A\) ) Tj +ET +BT +/F9 12 Tf +13.799999999999999 TL +0 g +325.03 398.27 Td +(of ) Tj +ET +BT +/F9 12 Tf +13.799999999999999 TL +0 g +338.09 398.27 Td +(the ) Tj +ET +BT +/F9 12 Tf +13.799999999999999 TL +0 g +355.87 398.27 Td +(Defence ) Tj +ET +BT +/F9 12 Tf +13.799999999999999 TL +0 g +398.93 398.27 Td +(Trade ) Tj +ET +BT +/F9 12 Tf +13.799999999999999 TL +0 g +430.01 398.27 Td +(Controls ) Tj +ET +BT +/F9 12 Tf +13.799999999999999 TL +0 g +474.64 398.27 Td +(Act ) Tj +ET +BT +/F9 12 Tf +13.799999999999999 TL +0 g +229.61 384.09 Td +(2012) Tj +ET +BT +/F9 12 Tf +13.799999999999999 TL +0 g +253.80 384.09 Td +(.) Tj +ET +BT +/F9 12 Tf +13.799999999999999 TL +0 g +82.20 344.41 Td +(DECO ) Tj +ET +BT +/F9 12 Tf +13.799999999999999 TL +0 g +118.00 344.41 Td +(advises ) Tj +ET +BT +/F9 12 Tf +13.799999999999999 TL +0 g +156.59 344.41 Td +(that ) Tj +ET +BT +/F10 12 Tf +13.799999999999999 TL +0 g +177.75 344.41 Td +(you ) Tj +ET +BT +/F10 12 Tf +13.799999999999999 TL +0 g +198.92 344.41 Td +(do ) Tj +ET +BT +/F10 12 Tf +13.799999999999999 TL +0 g +214.64 344.41 Td +(not ) Tj +ET +BT +/F10 12 Tf +13.799999999999999 TL +0 g +234.35 344.41 Td +(require ) Tj +ET +BT +/F10 12 Tf +13.799999999999999 TL +0 g +275.35 344.41 Td +(a ) Tj +ET +BT +/F10 12 Tf +13.799999999999999 TL +0 g +284.42 344.41 Td +(permit) Tj +ET +BT +/F9 12 Tf +13.799999999999999 TL +0 g +321.69 344.41 Td +(under ) Tj +ET +BT +/F9 12 Tf +13.799999999999999 TL +0 g +355.31 344.41 Td +(Regulation ) Tj +ET +BT +/F9 12 Tf +13.799999999999999 TL +0 g +411.31 344.41 Td +(13E ) Tj +ET +BT +/F9 12 Tf +13.799999999999999 TL +0 g +433.80 344.41 Td +(of ) Tj +ET +BT +/F9 12 Tf +13.799999999999999 TL +0 g +446.86 344.41 Td +(the ) Tj +ET +BT +/F11 12 Tf +13.799999999999999 TL +0 g +464.64 344.41 Td +(Customs ) Tj +ET +BT +/F11 12 Tf +13.799999999999999 TL +0 g +82.20 330.24 Td +(\(Prohibited ) Tj +ET +BT +/F11 12 Tf +13.799999999999999 TL +0 g +140.98 330.24 Td +(Exports\) ) Tj +ET +BT +/F11 12 Tf +13.799999999999999 TL +0 g +185.61 330.24 Td +(Regulations ) Tj +ET +BT +/F11 12 Tf +13.799999999999999 TL +0 g +246.45 330.24 Td +(1958) Tj +ET +BT +/F9 12 Tf +13.799999999999999 TL +0 g +273.75 330.24 Td +(or ) Tj +ET +BT +/F9 12 Tf +13.799999999999999 TL +0 g +287.54 330.24 Td +(under ) Tj +ET +BT +/F9 12 Tf +13.799999999999999 TL +0 g +318.02 330.24 Td +(the ) Tj +ET +BT +/F11 12 Tf +13.799999999999999 TL +0 g +335.80 330.24 Td +(Defence ) Tj +ET +BT +/F11 12 Tf +13.799999999999999 TL +0 g +378.86 330.24 Td +(Trade ) Tj +ET +BT +/F11 12 Tf +13.799999999999999 TL +0 g +410.66 330.24 Td +(Controls ) Tj +ET +BT +/F11 12 Tf +13.799999999999999 TL +0 g +456.02 330.24 Td +(Act ) Tj +ET +BT +/F11 12 Tf +13.799999999999999 TL +0 g +475.13 330.24 Td +(2012.) Tj +ET +BT +/F9 12 Tf +13.799999999999999 TL +0 g +82.20 301.89 Td +(You should note that the DSGL is updated annually and changes to the DSGL may result) Tj +T* (in your items becoming subject to export controls administered by the Department of) Tj +T* (Defence.) Tj +ET +BT +/F9 12 Tf +13.799999999999999 TL +0 g +82.20 245.20 Td +(Further information on export controls, can be found on the DECO website at) Tj +T* (www.defence.gov.au/deco.) Tj +ET +BT +/F10 12 Tf +13.799999999999999 TL +0 g +82.20 199.84 Td +(Statement of the Questions and Answers) Tj +ET +82.20 195.59 345.83 -36.85 re +S +428.03 195.59 85.04 -36.85 re +S +BT +/F9 12 Tf +13.799999999999999 TL +0 g +87.87 181.42 Td +(Q1: Are you in Australia at the time you supply the "software" or) Tj +T* ("technology"?) Tj +ET +BT +/F9 12 Tf +13.799999999999999 TL +0 g +433.70 181.42 Td +(Yes) Tj +ET +82.20 158.74 345.83 -36.85 re +S +428.03 158.74 85.04 -36.85 re +S +BT +/F9 12 Tf +13.799999999999999 TL +0 g +87.87 144.57 Td +(Q2: Are you supplying "software" or "technology" to a person or) Tj +T* (entity outside Australia?) Tj +ET +BT +/F9 12 Tf +13.799999999999999 TL +0 g +433.70 144.57 Td +(Yes) Tj +ET +endstream +endobj +5 0 obj +<> +endobj +6 0 obj +<> +stream +0.57 w +0 G +q 188.50 0 0 53.86 70.87 678.90 cm /I0 Do Q +BT +/F10 12 Tf +13.799999999999999 TL +0 g +277.80 710.08 Td +(ONLINE DSGL TOOL ? SUMMARY OF) Tj +T* (ACTIVITY QUESTIONNAIRE) Tj +ET +70.866 664.724 m +524.409 664.724 l +S +70.866 76.535 m +524.409 76.535 l +S +BT +/F11 12 Tf +13.799999999999999 TL +0 g +184.25 65.20 Td +(DECO - Ensuring Australia Exports Responsibly) Tj +ET +BT +/F9 9 Tf +10.35 TL +0 g +496.06 48.19 Td +(Page 2) Tj +ET +BT +/F9 9 Tf +10.35 TL +0 g +70.87 48.19 Td +(Report ID: 17780224395) Tj +ET +BT +/F10 12 Tf +13.799999999999999 TL +0 g +82.20 626.46 Td +(Statement of the Questions and Answers \(cont\)) Tj +ET +82.20 622.20 345.83 -22.68 re +S +428.03 622.20 85.04 -22.68 re +S +BT +/F9 12 Tf +13.799999999999999 TL +0 g +87.87 608.03 Td +(Q3: Are you communicating "software" or "technology" orally?) Tj +ET +BT +/F9 12 Tf +13.799999999999999 TL +0 g +433.70 608.03 Td +(No) Tj +ET +82.20 599.53 345.83 -36.85 re +S +428.03 599.53 85.04 -36.85 re +S +BT +/F9 12 Tf +13.799999999999999 TL +0 g +87.87 585.35 Td +(Q4: Are you a member of the "ADF", "APS", "ASIO", "ASIS" or) Tj +T* ("Police" and supplying in the course of your duties?) Tj +ET +BT +/F9 12 Tf +13.799999999999999 TL +0 g +433.70 585.35 Td +(No) Tj +ET +82.20 562.68 345.83 -51.02 re +S +428.03 562.68 85.04 -51.02 re +S +BT +/F9 12 Tf +13.799999999999999 TL +0 g +87.87 548.50 Td +(Q5: Are you supplying to a member of the ADF, "APS", "ASIO",) Tj +T* ("ASIS" or "Police" who receives the supply in the course of your) Tj +T* (duties?) Tj +ET +BT +/F9 12 Tf +13.799999999999999 TL +0 g +433.70 548.50 Td +(No) Tj +ET +82.20 511.65 345.83 -51.02 re +S +428.03 511.65 85.04 -51.02 re +S +BT +/F9 12 Tf +13.799999999999999 TL +0 g +87.87 497.48 Td +(Q6: Are you a member of the Approved Community supplying) Tj +T* ("software" or "technology" under the AUS-US Defence Trade) Tj +T* (Cooperation Treaty?) Tj +ET +BT +/F9 12 Tf +13.799999999999999 TL +0 g +433.70 497.48 Td +(No) Tj +ET +82.20 460.63 345.83 -36.85 re +S +428.03 460.63 85.04 -36.85 re +S +BT +/F9 12 Tf +13.799999999999999 TL +0 g +87.87 446.46 Td +(Q7: Are you supplying "software" or "technology" that is listed in) Tj +T* (Part 1 \(military\) or Part 2 \(dual-use\) of the DSGL?) Tj +ET +BT +/F9 12 Tf +13.799999999999999 TL +0 g +433.70 446.46 Td +(Part 2) Tj +ET +82.20 423.78 345.83 -22.68 re +S +428.03 423.78 85.04 -22.68 re +S +BT +/F9 12 Tf +13.799999999999999 TL +0 g +87.87 409.61 Td +(Q8: Are you supplying a draft of material you intend to publish?) Tj +ET +BT +/F9 12 Tf +13.799999999999999 TL +0 g +433.70 409.61 Td +(Yes) Tj +ET +endstream +endobj +7 0 obj +<> +endobj +8 0 obj +<> +stream +0.57 w +0 G +q 188.50 0 0 53.86 70.87 678.90 cm /I0 Do Q +BT +/F10 12 Tf +13.799999999999999 TL +0 g +277.80 710.08 Td +(ONLINE DSGL TOOL ? SUMMARY OF) Tj +T* (ACTIVITY QUESTIONNAIRE) Tj +ET +70.866 664.724 m +524.409 664.724 l +S +70.866 76.535 m +524.409 76.535 l +S +BT +/F11 12 Tf +13.799999999999999 TL +0 g +184.25 65.20 Td +(DECO - Ensuring Australia Exports Responsibly) Tj +ET +BT +/F9 9 Tf +10.35 TL +0 g +496.06 48.19 Td +(Page 3) Tj +ET +BT +/F9 9 Tf +10.35 TL +0 g +70.87 48.19 Td +(Report ID: 17780224395) Tj +ET +BT +/F10 12 Tf +13.799999999999999 TL +0 g +82.20 630.71 Td +(ADVISORY INFORMATION) Tj +ET +BT +/F12 12 Tf +13.799999999999999 TL +0 g +82.20 585.35 Td +(Weapons ) Tj +ET +BT +/F12 12 Tf +13.799999999999999 TL +0 g +132.76 585.35 Td +(of ) Tj +ET +BT +/F12 12 Tf +13.799999999999999 TL +0 g +145.82 585.35 Td +(Mass ) Tj +ET +BT +/F12 12 Tf +13.799999999999999 TL +0 g +175.09 585.35 Td +(Destruction ) Tj +ET +BT +/F12 12 Tf +13.799999999999999 TL +0 g +236.41 585.35 Td +(\(Prevention ) Tj +ET +BT +/F12 12 Tf +13.799999999999999 TL +0 g +297.61 585.35 Td +(of ) Tj +ET +BT +/F12 12 Tf +13.799999999999999 TL +0 g +310.67 585.35 Td +(Proliferation\) ) Tj +ET +BT +/F12 12 Tf +13.799999999999999 TL +0 g +382.15 585.35 Td +(Act ) Tj +ET +BT +/F12 12 Tf +13.799999999999999 TL +0 g +401.86 585.35 Td +(1995 ) Tj +ET +BT +/F10 12 Tf +13.799999999999999 TL +0 g +432.19 585.35 Td +(\(the ) Tj +ET +BT +/F10 12 Tf +13.799999999999999 TL +0 g +82.20 571.18 Td +(WMD ) Tj +ET +BT +/F10 12 Tf +13.799999999999999 TL +0 g +117.40 571.18 Td +(Act\) ) Tj +ET +BT +/F10 12 Tf +13.799999999999999 TL +0 g +142.44 571.18 Td +(and ) Tj +ET +BT +/F10 12 Tf +13.799999999999999 TL +0 g +164.81 571.18 Td +(Military ) Tj +ET +BT +/F10 12 Tf +13.799999999999999 TL +0 g +210.77 571.18 Td +(End-Use ) Tj +ET +BT +/F10 12 Tf +13.799999999999999 TL +0 g +257.82 571.18 Td +(\(MEU\) ) Tj +ET +BT +/F10 12 Tf +13.799999999999999 TL +0 g +296.88 571.18 Td +(Control) Tj +ET +BT +/F9 12 Tf +13.799999999999999 TL +0 g +82.20 557.01 Td +(If, at any time, you have reason to believe or suspect that your proposed activities will or) Tj +T* (may be used in a weapons of mass destruction program, or may be intended for use in) Tj +T* (military or paramilitary activities, you must advise DECO immediately and not proceed) Tj +T* (with the activity without first discussing the reason for the belief or suspicion.) Tj +ET +BT +/F10 12 Tf +13.799999999999999 TL +0 g +82.20 483.31 Td +(Sanctions) Tj +ET +BT +/F9 12 Tf +13.799999999999999 TL +0 g +82.20 469.13 Td +(You are strongly advised to familiarise yourself with the Australian Government?s) Tj +T* (implementation of sanctions against certain destinations and entities. Information is) Tj +T* (available on the Department of Foreign Affairs and Trade \(DFAT\) website at) Tj +T* (www.dfat.gov.au/sanctions. If sanctions apply, you should seek advice from DFAT) Tj +T* (before continuing with the proposed activity.) Tj +ET +BT +/F10 12 Tf +13.799999999999999 TL +0 g +82.20 381.26 Td +(Foreign Import Approval) Tj +ET +BT +/F9 12 Tf +13.799999999999999 TL +0 g +82.20 367.09 Td +(The government of each foreign country is responsible for import approval to that) Tj +T* (country. You are responsible for ensuring that any necessary approvals are) Tj +T* (obtained and the issue of this advice does not in any way indicate whether such) Tj +T* (approval may or may not be provided.) Tj +ET +BT +/F10 12 Tf +13.799999999999999 TL +0 g +82.20 293.39 Td +(DEFENCE EXPORT CONTROL OFFICE) Tj +ET +BT +/F9 12 Tf +13.799999999999999 TL +0 g +82.20 279.21 Td +(R1-1-A037) Tj +ET +BT +/F9 12 Tf +13.799999999999999 TL +0 g +82.20 265.04 Td +(PO BOX 7901) Tj +ET +BT +/F9 12 Tf +13.799999999999999 TL +0 g +82.20 250.87 Td +(CANBERRA BC ACT 2610) Tj +ET +BT +/F9 12 Tf +13.799999999999999 TL +0 g +82.20 228.19 Td +(TEL: 1800 66 10 66) Tj +ET +BT +/F10 12 Tf +13.799999999999999 TL +0 g +82.20 214.02 Td +(EMAIL: DECO at DEFENCE.GOV.AU) Tj +ET +endstream +endobj +9 0 obj +<> +endobj +10 0 obj +<> +stream +0.57 w +0 G +q 188.50 0 0 53.86 70.87 678.90 cm /I0 Do Q +BT +/F10 12 Tf +13.799999999999999 TL +0 g +277.80 710.08 Td +(ONLINE DSGL TOOL ? SUMMARY OF) Tj +T* (ACTIVITY QUESTIONNAIRE) Tj +ET +70.866 664.724 m +524.409 664.724 l +S +70.866 76.535 m +524.409 76.535 l +S +BT +/F11 12 Tf +13.799999999999999 TL +0 g +184.25 65.20 Td +(DECO - Ensuring Australia Exports Responsibly) Tj +ET +BT +/F9 9 Tf +10.35 TL +0 g +496.06 48.19 Td +(Page 4) Tj +ET +BT +/F9 9 Tf +10.35 TL +0 g +70.87 48.19 Td +(Report ID: 17780224395) Tj +ET +BT +/F9 12 Tf +13.799999999999999 TL +0 g +82.20 630.71 Td +(This report is issued by the Defence Export Control Office in response to your query in) Tj +T* (the Online DSGL Tool. The assessment in this report is based on the information you) Tj +T* (provided.) Tj +ET +BT +/F10 12 Tf +13.799999999999999 TL +0 g +82.20 574.02 Td +(Assessment of proposed activity) Tj +ET +82.20 569.76 141.73 -22.68 re +S +223.94 569.76 289.13 -22.68 re +S +BT +/F9 12 Tf +13.799999999999999 TL +0 g +87.87 554.17 Td +(Report ID:) Tj +ET +BT +/F9 12 Tf +13.799999999999999 TL +0 g +229.61 554.17 Td +(17780224395-2) Tj +ET +82.20 547.09 141.73 -22.68 re +S +223.94 547.09 289.13 -22.68 re +S +BT +/F9 12 Tf +13.799999999999999 TL +0 g +87.87 531.50 Td +(Produced at:) Tj +ET +BT +/F9 12 Tf +13.799999999999999 TL +0 g +229.61 531.50 Td +(June 24th 2015, 5:57:10 pm) Tj +ET +82.20 524.41 141.73 -22.68 re +S +223.94 524.41 289.13 -22.68 re +S +BT +/F9 12 Tf +13.799999999999999 TL +0 g +87.87 508.82 Td +(Your reference:) Tj +ET +BT +/F9 12 Tf +13.799999999999999 TL +0 g +229.61 508.82 Td +() Tj +ET +82.20 501.73 141.73 -22.68 re +S +223.94 501.73 289.13 -22.68 re +S +BT +/F9 12 Tf +13.799999999999999 TL +0 g +87.87 486.14 Td +(Activity Assessed:) Tj +ET +BT +/F9 12 Tf +13.799999999999999 TL +0 g +229.61 486.14 Td +(Publication) Tj +ET +82.20 479.06 141.73 -79.37 re +S +223.94 479.06 289.13 -79.37 re +S +BT +/F9 12 Tf +13.799999999999999 TL +0 g +87.87 463.46 Td +(Assessment of the) Tj +ET +BT +/F9 12 Tf +13.799999999999999 TL +0 g +87.87 449.29 Td +(answers you provided:) Tj +ET +BT +/F9 12 Tf +13.799999999999999 TL +0 g +229.61 463.46 Td +(Your ) Tj +ET +BT +/F9 12 Tf +13.799999999999999 TL +0 g +256.09 463.46 Td +(activity ) Tj +ET +BT +/F9 12 Tf +13.799999999999999 TL +0 g +295.40 463.46 Td +(is ) Tj +ET +BT +/F10 12 Tf +13.799999999999999 TL +0 g +306.53 463.46 Td +(not ) Tj +ET +BT +/F10 12 Tf +13.799999999999999 TL +0 g +325.03 463.46 Td +(controlled) Tj +ET +BT +/F9 12 Tf +13.799999999999999 TL +0 g +379.71 463.46 Td +(because ) Tj +ET +BT +/F9 12 Tf +13.799999999999999 TL +0 g +422.77 463.46 Td +(the ) Tj +ET +BT +/F9 12 Tf +13.799999999999999 TL +0 g +440.55 463.46 Td +(software ) Tj +ET +BT +/F9 12 Tf +13.799999999999999 TL +0 g +485.05 463.46 Td +(or ) Tj +ET +BT +/F9 12 Tf +13.799999999999999 TL +0 g +229.61 449.29 Td +(technology ) Tj +ET +BT +/F9 12 Tf +13.799999999999999 TL +0 g +286.33 449.29 Td +(is ) Tj +ET +BT +/F9 12 Tf +13.799999999999999 TL +0 g +297.46 449.29 Td +(already ) Tj +ET +BT +/F9 12 Tf +13.799999999999999 TL +0 g +335.92 449.29 Td +(available ) Tj +ET +BT +/F9 12 Tf +13.799999999999999 TL +0 g +382.48 449.29 Td +(to ) Tj +ET +BT +/F9 12 Tf +13.799999999999999 TL +0 g +394.94 449.29 Td +(the ) Tj +ET +BT +/F9 12 Tf +13.799999999999999 TL +0 g +412.72 449.29 Td +(public.) Tj +ET +BT +/F9 12 Tf +13.799999999999999 TL +0 g +229.61 426.61 Td +(See ) Tj +ET +BT +/F9 12 Tf +13.799999999999999 TL +0 g +249.93 426.61 Td +(section ) Tj +ET +BT +/F9 12 Tf +13.799999999999999 TL +0 g +287.18 426.61 Td +(14A\(2\) ) Tj +ET +BT +/F9 12 Tf +13.799999999999999 TL +0 g +325.03 426.61 Td +(of ) Tj +ET +BT +/F9 12 Tf +13.799999999999999 TL +0 g +338.09 426.61 Td +(the ) Tj +ET +BT +/F9 12 Tf +13.799999999999999 TL +0 g +355.87 426.61 Td +(Defence ) Tj +ET +BT +/F9 12 Tf +13.799999999999999 TL +0 g +398.93 426.61 Td +(Trade ) Tj +ET +BT +/F9 12 Tf +13.799999999999999 TL +0 g +430.01 426.61 Td +(Controls ) Tj +ET +BT +/F9 12 Tf +13.799999999999999 TL +0 g +474.64 426.61 Td +(Act ) Tj +ET +BT +/F9 12 Tf +13.799999999999999 TL +0 g +229.61 412.44 Td +(2012) Tj +ET +BT +/F9 12 Tf +13.799999999999999 TL +0 g +253.80 412.44 Td +(.) Tj +ET +BT +/F9 12 Tf +13.799999999999999 TL +0 g +82.20 372.76 Td +(DECO ) Tj +ET +BT +/F9 12 Tf +13.799999999999999 TL +0 g +118.00 372.76 Td +(advises ) Tj +ET +BT +/F9 12 Tf +13.799999999999999 TL +0 g +156.59 372.76 Td +(that ) Tj +ET +BT +/F10 12 Tf +13.799999999999999 TL +0 g +177.75 372.76 Td +(you ) Tj +ET +BT +/F10 12 Tf +13.799999999999999 TL +0 g +198.92 372.76 Td +(do ) Tj +ET +BT +/F10 12 Tf +13.799999999999999 TL +0 g +214.64 372.76 Td +(not ) Tj +ET +BT +/F10 12 Tf +13.799999999999999 TL +0 g +234.35 372.76 Td +(require ) Tj +ET +BT +/F10 12 Tf +13.799999999999999 TL +0 g +275.35 372.76 Td +(a ) Tj +ET +BT +/F10 12 Tf +13.799999999999999 TL +0 g +284.42 372.76 Td +(permit) Tj +ET +BT +/F9 12 Tf +13.799999999999999 TL +0 g +321.69 372.76 Td +(under ) Tj +ET +BT +/F9 12 Tf +13.799999999999999 TL +0 g +355.31 372.76 Td +(Regulation ) Tj +ET +BT +/F9 12 Tf +13.799999999999999 TL +0 g +411.31 372.76 Td +(13E ) Tj +ET +BT +/F9 12 Tf +13.799999999999999 TL +0 g +433.80 372.76 Td +(of ) Tj +ET +BT +/F9 12 Tf +13.799999999999999 TL +0 g +446.86 372.76 Td +(the ) Tj +ET +BT +/F11 12 Tf +13.799999999999999 TL +0 g +464.64 372.76 Td +(Customs ) Tj +ET +BT +/F11 12 Tf +13.799999999999999 TL +0 g +82.20 358.58 Td +(\(Prohibited ) Tj +ET +BT +/F11 12 Tf +13.799999999999999 TL +0 g +140.98 358.58 Td +(Exports\) ) Tj +ET +BT +/F11 12 Tf +13.799999999999999 TL +0 g +185.61 358.58 Td +(Regulations ) Tj +ET +BT +/F11 12 Tf +13.799999999999999 TL +0 g +246.45 358.58 Td +(1958) Tj +ET +BT +/F9 12 Tf +13.799999999999999 TL +0 g +273.75 358.58 Td +(or ) Tj +ET +BT +/F9 12 Tf +13.799999999999999 TL +0 g +287.54 358.58 Td +(under ) Tj +ET +BT +/F9 12 Tf +13.799999999999999 TL +0 g +318.02 358.58 Td +(the ) Tj +ET +BT +/F11 12 Tf +13.799999999999999 TL +0 g +335.80 358.58 Td +(Defence ) Tj +ET +BT +/F11 12 Tf +13.799999999999999 TL +0 g +378.86 358.58 Td +(Trade ) Tj +ET +BT +/F11 12 Tf +13.799999999999999 TL +0 g +410.66 358.58 Td +(Controls ) Tj +ET +BT +/F11 12 Tf +13.799999999999999 TL +0 g +456.02 358.58 Td +(Act ) Tj +ET +BT +/F11 12 Tf +13.799999999999999 TL +0 g +475.13 358.58 Td +(2012.) Tj +ET +BT +/F9 12 Tf +13.799999999999999 TL +0 g +82.20 330.24 Td +(You should note that the DSGL is updated annually and changes to the DSGL may result) Tj +T* (in your items becoming subject to export controls administered by the Department of) Tj +T* (Defence.) Tj +ET +BT +/F9 12 Tf +13.799999999999999 TL +0 g +82.20 273.54 Td +(Further information on export controls, can be found on the DECO website at) Tj +T* (www.defence.gov.au/deco.) Tj +ET +BT +/F10 12 Tf +13.799999999999999 TL +0 g +82.20 228.19 Td +(Statement of the Questions and Answers) Tj +ET +82.20 223.94 345.83 -22.68 re +S +428.03 223.94 85.04 -22.68 re +S +BT +/F9 12 Tf +13.799999999999999 TL +0 g +87.87 209.76 Td +(Q1: Are you in Australia at the time of the publication?) Tj +ET +BT +/F9 12 Tf +13.799999999999999 TL +0 g +433.70 209.76 Td +(Yes) Tj +ET +82.20 201.26 345.83 -36.85 re +S +428.03 201.26 85.04 -36.85 re +S +BT +/F9 12 Tf +13.799999999999999 TL +0 g +87.87 187.09 Td +(Q2: Are you placing "software" or "technology" in the public) Tj +T* (domain?) Tj +ET +BT +/F9 12 Tf +13.799999999999999 TL +0 g +433.70 187.09 Td +(Yes) Tj +ET +82.20 164.41 345.83 -36.85 re +S +428.03 164.41 85.04 -36.85 re +S +BT +/F9 12 Tf +13.799999999999999 TL +0 g +87.87 150.24 Td +(Q3: Is the "software" or "technology" already "in the public) Tj +T* (domain"?) Tj +ET +BT +/F9 12 Tf +13.799999999999999 TL +0 g +433.70 150.24 Td +(Yes) Tj +ET +endstream +endobj +11 0 obj +<> +endobj +12 0 obj +<> +stream +0.57 w +0 G +q 188.50 0 0 53.86 70.87 678.90 cm /I0 Do Q +BT +/F10 12 Tf +13.799999999999999 TL +0 g +277.80 710.08 Td +(ONLINE DSGL TOOL ? SUMMARY OF) Tj +T* (ACTIVITY QUESTIONNAIRE) Tj +ET +70.866 664.724 m +524.409 664.724 l +S +70.866 76.535 m +524.409 76.535 l +S +BT +/F11 12 Tf +13.799999999999999 TL +0 g +184.25 65.20 Td +(DECO - Ensuring Australia Exports Responsibly) Tj +ET +BT +/F9 9 Tf +10.35 TL +0 g +496.06 48.19 Td +(Page 5) Tj +ET +BT +/F9 9 Tf +10.35 TL +0 g +70.87 48.19 Td +(Report ID: 17780224395) Tj +ET +BT +/F10 12 Tf +13.799999999999999 TL +0 g +82.20 630.71 Td +(ADVISORY INFORMATION) Tj +ET +BT +/F12 12 Tf +13.799999999999999 TL +0 g +82.20 585.35 Td +(Weapons ) Tj +ET +BT +/F12 12 Tf +13.799999999999999 TL +0 g +132.76 585.35 Td +(of ) Tj +ET +BT +/F12 12 Tf +13.799999999999999 TL +0 g +145.82 585.35 Td +(Mass ) Tj +ET +BT +/F12 12 Tf +13.799999999999999 TL +0 g +175.09 585.35 Td +(Destruction ) Tj +ET +BT +/F12 12 Tf +13.799999999999999 TL +0 g +236.41 585.35 Td +(\(Prevention ) Tj +ET +BT +/F12 12 Tf +13.799999999999999 TL +0 g +297.61 585.35 Td +(of ) Tj +ET +BT +/F12 12 Tf +13.799999999999999 TL +0 g +310.67 585.35 Td +(Proliferation\) ) Tj +ET +BT +/F12 12 Tf +13.799999999999999 TL +0 g +382.15 585.35 Td +(Act ) Tj +ET +BT +/F12 12 Tf +13.799999999999999 TL +0 g +401.86 585.35 Td +(1995 ) Tj +ET +BT +/F10 12 Tf +13.799999999999999 TL +0 g +432.19 585.35 Td +(\(the ) Tj +ET +BT +/F10 12 Tf +13.799999999999999 TL +0 g +82.20 571.18 Td +(WMD ) Tj +ET +BT +/F10 12 Tf +13.799999999999999 TL +0 g +117.40 571.18 Td +(Act\) ) Tj +ET +BT +/F10 12 Tf +13.799999999999999 TL +0 g +142.44 571.18 Td +(and ) Tj +ET +BT +/F10 12 Tf +13.799999999999999 TL +0 g +164.81 571.18 Td +(Military ) Tj +ET +BT +/F10 12 Tf +13.799999999999999 TL +0 g +210.77 571.18 Td +(End-Use ) Tj +ET +BT +/F10 12 Tf +13.799999999999999 TL +0 g +257.82 571.18 Td +(\(MEU\) ) Tj +ET +BT +/F10 12 Tf +13.799999999999999 TL +0 g +296.88 571.18 Td +(Control) Tj +ET +BT +/F9 12 Tf +13.799999999999999 TL +0 g +82.20 557.01 Td +(If, at any time, you have reason to believe or suspect that your proposed activities will or) Tj +T* (may be used in a weapons of mass destruction program, or may be intended for use in) Tj +T* (military or paramilitary activities, you must advise DECO immediately and not proceed) Tj +T* (with the activity without first discussing the reason for the belief or suspicion.) Tj +ET +BT +/F10 12 Tf +13.799999999999999 TL +0 g +82.20 483.31 Td +(Sanctions) Tj +ET +BT +/F9 12 Tf +13.799999999999999 TL +0 g +82.20 469.13 Td +(You are strongly advised to familiarise yourself with the Australian Government?s) Tj +T* (implementation of sanctions against certain destinations and entities. Information is) Tj +T* (available on the Department of Foreign Affairs and Trade \(DFAT\) website at) Tj +T* (www.dfat.gov.au/sanctions. If sanctions apply, you should seek advice from DFAT) Tj +T* (before continuing with the proposed activity.) Tj +ET +BT +/F10 12 Tf +13.799999999999999 TL +0 g +82.20 381.26 Td +(Foreign Import Approval) Tj +ET +BT +/F9 12 Tf +13.799999999999999 TL +0 g +82.20 367.09 Td +(The government of each foreign country is responsible for import approval to that) Tj +T* (country. You are responsible for ensuring that any necessary approvals are) Tj +T* (obtained and the issue of this advice does not in any way indicate whether such) Tj +T* (approval may or may not be provided.) Tj +ET +BT +/F10 12 Tf +13.799999999999999 TL +0 g +82.20 293.39 Td +(DEFENCE EXPORT CONTROL OFFICE) Tj +ET +BT +/F9 12 Tf +13.799999999999999 TL +0 g +82.20 279.21 Td +(R1-1-A037) Tj +ET +BT +/F9 12 Tf +13.799999999999999 TL +0 g +82.20 265.04 Td +(PO BOX 7901) Tj +ET +BT +/F9 12 Tf +13.799999999999999 TL +0 g +82.20 250.87 Td +(CANBERRA BC ACT 2610) Tj +ET +BT +/F9 12 Tf +13.799999999999999 TL +0 g +82.20 228.19 Td +(TEL: 1800 66 10 66) Tj +ET +BT +/F10 12 Tf +13.799999999999999 TL +0 g +82.20 214.02 Td +(EMAIL: DECO at DEFENCE.GOV.AU) Tj +ET +endstream +endobj +1 0 obj +<> +endobj +13 0 obj +<> +endobj +14 0 obj +<> +endobj +15 0 obj +<> +endobj +16 0 obj +<> +endobj +17 0 obj +<> +endobj +18 0 obj +<> +endobj +19 0 obj +<> +endobj +20 0 obj +<> +endobj +21 0 obj +<> +endobj +22 0 obj +<> +endobj +23 0 obj +<> +endobj +24 0 obj +<> +endobj +25 0 obj +<> +stream +????JFIF????C + + +    ??C   ???6"?? + ???}!1AQa"q2???#B??R??$3br? +%&'()*456789:CDEFGHIJSTUVWXYZcdefghijstuvwxyz??????????????????????????????????????????????????????????????????????????? + ???w!1AQaq"2?B???? #3R?br? +$4?%?&'()*56789:CDEFGHIJSTUVWXYZcdefghijstuvwxyz?????????????????????????????????????????????????????????????????????????? ??S??(??(??(???!????? ?&x??_?4?]??5???Z`wK?\?*?rP??0?????}?P? ??Vm?cH P?? c#8???~.k???2??????????X??EE??P??=??|]???????Z??/"h??K?b?? G*v?|P#??????x??V??d???(??????g??i ?[v%QA?9 ???}??#??:??Ek????1o?? Y?-,?\?n'?g,p*?????? ????? ?????co???N?t??+?G\????I??"@??#01??I?5?????`???????x??_?#?-OB?t??|s:xr?(`??E=? M?W????????[???????E????9????I??l??i??????Eh??x\Xi??o@s??s??&TOU??x?j?????:v??x{P???S{??b)Lv???scj? wg??W?W?k_?W????W?N???>2?k ?''x+a?c*{??????a????_???~+?4MCH[?6?????V(R%??e\?s?]????_?w?e?N?}????EPEPEPEPEPEPEPEPEPEPEPEPEPEPEPEPEPEPEPEPEPEPEPEPEPEPE?? B?I?/?l???sM$v?:?$ gn??~??>W????_??*??g?|Vz???X[A`?}??L??5??I?0?2Wp????x'????C?????;???7??M?#J?A"?I?6e?w?O?? ????s{ ????/?5q?ts???????e???[?? ?Y???1k?????G??#??p??8????>??k??g????F/$?1ff'$?z?I?[~?N??#????h?MSW????9!C; ?(?'?Z???W????T?n??/_?qIq??C]?O?h????%???[v????O?W????^?;?x?%?@???w-???????:B?c??#?5???>(~?????x?}?[?????????'sl?V??S?zUx3?v?????????????}#_???F0BA?????NA/?9d?>??7?4?A???2?^??????V?g?????[??h????li?'??4~/??_ &????W>??????m???n????????v????????{r??o?|3?;05K)??J=]???{?F Z???3#;$?Ii#h'???nM/W????/\L?W??????&?x?(?k Sq?^5??`Ix?]Om??I??j?v??????=R?[G??Z[?3Y???`E`?ae*[??#??????T???.??,?%????,A?X????W?????????5? N???6??zS?w#?@E?fy??????P???%????"???jM???o ?FP?{??}$?#?\??????? +g?????m'X????????}B?a?;?YVH?z????P?>"x1?S?]??BIq??l0?????(O???7???j/??~"???????[?]hw23Z\?B +g?l?k???P??- ?9?>???? d?J?????m??s?yy????U????'?w???S???U????+?F=????????????|A?????E???.?j?9??H??????\?@?~??T5?kO???>??^?????[??V8?_Vbp????`?/????B?????GN???3:????U??????GcEp?_??z??o?i?;????q ?KmV %??????N{b?????5????~1?|?w:???P??G?c?{??????o???_ +??#???;??Z#????$???????a?(?????[??t???>'??&?-???5???4?[PH?V?4?]?2>U?2?????n?\6???????[??w??7?\H"???U?IdrpT>I>????<?????V>,??0???F?O?u? ??#??k[??HOO?A???_???J?z?H???k?gU?M?????m???8?????Y?'?{??U?3?? ?hMo???|9?1-??v?n?|??\$??:??w?????@?}?Eq>5???????>3???2-????Lz?'8?+K???-??]k??#???&0?K???(??????h?Q\F???????(??+?>???'????`?V????'? ??9???????2Xr???nk?<#?[?o?x?G??O+m?{?g?sSi????oZM??'?n?7)-??!fwW??? +zE?x?????{???Y??Wr'??jZ?P;)8 ????O?~'xC?Z~??x?G??t??/.l???;u??2? +0????:?+?????x?k??;??]??w??m?S?????g??a????x?h1??????|?f??FC'????/Z?*+??????'Q!?v??_ mGQ? 6????????U??????l5?_????j??}q?D?\{????s?8?v?W??????S?_???l????n'?????????'???7?:?????#l??K6??J??c?y?????|I??@??K??}?H????#?Y?????????C?~????h??}N*VS?Tm?1?:c????N??? ?????'??g??3??/??/\???9??<?[??-?f???4?Gl?g:e?M??0S????Q\???(?C??PI??i~?F?!iH??I?c???????o ??,?S???r????}['8????rG?UEq_???????????-? sp???!?H #??U?9?< ????f???^.??G5?????????p +s?~???_????6????? ?o?n$??C???E?CpKaq?38??s?P?z?}?_x{?6R??s\???X???}6?.[?,??pG??EPEPEPX?,??4??4 k7?]?z??ie5???9vE%W?y#z???&???q????t?x??]???v???l?,?????H??0e ????|M??m????"?????R1#?[???$?NX???Kk??t_?? ??i?q?f?9???S????=8s^?xC???????$???T?VW??kk ??K+?` }?? +G?? ???^???^?Q???.<e?]??"?O?h??QQd????? +??=??~???+??_?"I??`? 0??????????????|E?/??"???=F???W?}???p~????????T?m?????k]?tj:???_|/????? ii:??i??????76q"F?M?@ +?-?^$???p???bK?[F???t?????G???=?I~ ?[???h????o ??Km??E???!????)!???C?v??li?????ra!b?9??G ?R??|??_G~????+ ??s?$?????1+\;)??????^x??k????cO??M?d7j?|???>"?4?^-KY???5m/O?SY?}6?/mHQV?)m??A?LW?k~&??6?_V??????7?)??*?#$?8??7?? +???????s???k??m????Fw?T???u??:??R ?+m?`a??W????[??Y??x??b????4?X?E*?%?A??q_???K???R??F?P??X??+????$>??Y???????k? ?E?d9{ub1?>X?{c?|??.??/?/????????+5??;m???#???l?Y\ ????_??????*d??Gkn?2??Q(U\?'???????C?6~?1?G??7?-n??%??c???[[? +?p0p??7?g????????:M???[?0?\E??????????;v???5????|%???x????sk?\??????2??6???#?iu???{?37K?O?~???k??m'Q???duH4[?U3hz?v? B????W?????%????F????*????6?-j???w&?m?7??N???=)?a???*??e??}. ??U??4}"Y#h?R?y?d?OQ???|z??&????[??1?2?I&?kmiq?1)?%??Q?p?:tW?~?>2?/?|m???6??w??]Vo??[Y??OT??K??0?i +-?d????? M?^Y???$???T??4;?????Z9???????cY?????i?w?u?x???w??Ikm??|?+????3 {F???1??????k-Lx?B?`????N?mKih??V8 ?1.xP>?W???>8?????Ym?{???4R F???q?` +?????E?=#??????x?/ ???i7????9M?Fx??{????4??? +""?m5-2?? ??Hn-????.?g????6???1^????]???R?^,?\??X????4?T???)?N#?+????m??|;?|;?U_x?D??????!????U??eIk???(v?k?????????? ?? +?h?V*???????=3? ++?Z??>x?B?b?v??A-?????????=?5?p??fbI|????=|+??????u?M???g??z??????`?+9c#g?OJ??a~??*????gX??k?|I??Z?j?Lq??h?(??o????T>4|x??????? ?F?|???.???*_?#=?r??Y7D>` N29?1@?= C?k??'??u?????~\Jl? ???x?;D[?7???g???????????_??@u +?0??E?$v?????h??PMC?qG<^ ???6eb?????> +??c#??M???h??G?a???; .??q? K??????g?[?I.L???.V<0*???W?_?R?????????~??Q?<7{???????@Q?UE?#`g;z?o?????>?1??q? ^??4?x4????.U???S???????@u?^?x?[??> +_x?E???gm}y?]??h?^? +?g?;?? ?h????W?????;?I? E0\Zh???X??#??gk>??zs\???Po~????e$??P??????h?m?1?H?:?q???v??]K?L>"?`??????/???8D?+)lgj??v???b?sN?mu ZO?h?????W? ?y???q??2z?KP;O??D_?l/x??:N??????]??????%2?*?Q?lU???NO'???q??g???}??Q??%?Z?2?Z??skd?$ VD +??g??????????????????]?~I????[? +$LF???m???k? ??????#T?tM:?C?u???>??[?e?fLGol3?0c?7??2M0??>???? +<7?W?????X?ih??d?'Owa ??F??(#z????2??????1???\xsACe???5 )mc?'???????? +?? ??X?O??????L??q????W????gj????? ??/?>?0{??f?e??j???yo??>?`),??????????R|5c??????Z /?Cl?l?,V?U1??]?s??9??o?=????>k +?wK????y?[?v?????U?k?????u???????S?/$?????j??A:I?[???2  q??+?????!?C???[i?V?4?t??c0?w??Q??,7$(n3A,????QEQEq??d?,?0??M<]???7y??{?]?s???????o?5?=#??%k>*Ox?R??)b]"???i??????*p?F?Y??\????{??1~ ?? |Syg?/????S?`?Xb?5Y???Z?3(s>?v????~x?^?????O?????V?WX???v?\??#?????1@?@}'?? ?s??~???U??mE?m9?/???0h?i????wg??y?[?\A???C?A?x???K??Cq}s??y??0???C???$??{??????? ?xy>x?T????R????2???????{?????aI?h?w??????Oxw????? ?I?-???CL??o?9?.w??=OT???_???????}??tK??x??y?[?y?!???$U]?1?q?_?>?????i??oM????/"??#???=$?`??x?_|@??= +?F??t?%?k;K3 +?$?L?I+9?Gr??w#?+???'????o?z?????????c?????w{5`C?!?!h8??????)7???"??S???6?YiS?r? ?n?4W???1h???.???(??t????x{\????P[?z??? ?>?q?"?u|?H?0?-?"???5????????i??wH??]?m`?M:??? b(??!??/????? +????[?????[s?&?k????`??`A>? ]Q???|?o?s????o ????5?????????w???*M??Z'C?@???????,??)?K?n?k????q??Y??c'??.J?/9?_jF?Y?r???j{???xo?~?,|w??_ZIy{u???A??e?5???J $??n??????7|m?u}[?6ZO?`???q?r??yl?D? ?@l?y?^G?/??????????7W?ml?3l??\????P?e??ff?/&?G??????m?Dfx?#?Y{p??p??@jh???g??c?oY??????,????????6 %????G?fl?????7?_?WD?????????Z]Vx???(????GTP0??1?????W????^(?]?g????~&BZY|i ?W'???R1?+???=????=/??????V???h????7W????3???)M+tA?? +?????N??j?V?y??A?????Z?????h?fWYA$.??D?7?? s\??/??>????u?+?:_?M??-???m??`yh????? q?Gj??W??XM????$?g)????*z1?9??{?H?~???~?????'????p????^???#W?L???Y ??W???~?9??;??K??????8?U?E?Ou?O $?b????L???a??\??????O??)?????-?k:??????m^?O???8??X?:g?????????U??~7?k???>????X???????? ?1??6???????>??KX??U??^3?????]u?e????;~??I?????b?$7??O??:??4?n?V???]???W??^?}q??D?'????p hKrr+?'???Ox???8?????B?A{?Z??+?s,p?GH??13?,???|lo??????????Z?H?????!????????A??u?g?|3????|3????????|A?W?[?n??;???g??H +??????????.i3?>?a??????2K????e8??v?u???X???>,?^t?E??*}:?K???R_? ????o?AUs?????E??????4}:}7?:????a??|???Q? ??7??>??|???P??Y?f? ?8C6??\??N;?N??? k +???M????O??x??6????(?O?/?G?6????(?O?/?@???g?>???? +M?VZ??D`??m????Q????_?"??w?o?m+??????j??f?X??9e9??@g?'?"????L-?Y?^@?sB{????o| ?????2???o| ?????R????v}~????? ??3???y$????????EI????(?????EI????(???cP??tP0)?????????????E/?6????(?W??/?@??xWD??6???j-?f??%?O?????~?K [n?m +??^7? ??3??>??|???Q? ??7??>??|???P?Ve????[?{?e ?????d$??k???????G?)????????G?)???*?Z???p"A;.?.???9?}2k???~??F??????O?m????Q???_?"?=??a???o?5?Ze?w???XJ?X?x??6????(?W??/?G?6????(?W??/?@?5???n??)_??@M:Xm??D?g??5???????i_????E'?6????(?W??/?@??m??f????I?JV?m???`f1^-? ??3??>??|???Q? ??3??>??|???P?f?`??G?s?G?m?? X@?7?8b?>???o?Oo ???;?c?L??N>^?W#???????E???W?~?????wo?k5?A(e9r;W??d???k??Z???????%?ifmi??I?p?M???yK??Ic=????[???~?????&????????6?m??h?O.T`>????z?????|??????? jZ???V?aoc?im??!?B?8??ym???/|L???#?,?1?a????i#G?-,#?U +c???????|Y??C^???\?*?M???]????"?R?? \$t,?9,?nk?o< ?j?_????????6?g???t?/l&DE?8?@0 ?X? {?>]?s??^??v???D?~$???/??|Y???4?J?ed9?o?r+???????n??? ?0???UZ{?~E?f}??V8?+?>?j??????|c??xkY???w?6W ?Dg?Y?u? ?????E????Y??t?Eu ?????0x??,?)T?Y?bh????C?x'?????g??6?????Zt3x*)?S?9M?????Y??$????r??O?xM????????;I3I?^??G&?i??er??.T???P?'???.?eO?V~m???????kk??Xfd?`???2??]??CW?s????=??O?kI?}??#????????????? ???7<??y????????F?($????7Eh????'??|?x????[????Q????????k ??h??Z?? r?c??VW?w???k???}???????P???n??gMs? +?B??Q?????+?? ???????k?;??????]i$f= ??h?Q??????%???????S??gs??#???,?,??>??2K?cSt? +Z[.??? ???????~,M#_?'??>??M???r?[???*?'Y??$F?C?J???W?5?gLo??m????8i?,?????"??%#?qA??FW??u\?F???????o?z?W?Z???}?Yt? ?J?"% R?K?&?????rx??????? |;????:?:y?b???$? ????`rp8??~-???m??>;?t?'?> ???5??$)w?^??J??'V>[d????@%???:?~=o?|=???!Y??Km??r???????`???k?t?????&??>?iI?M& ???y????????{e/?.uo??????yy4???s??Ewn?r?i?@Ry?p?e???X_x?????an??????p?o4?nV? ????????C???S??????)???????*?w????|?2?? ^7????????z6??????-???ap???E???vrX?) +>bH'?s6???Q?xsC????{?}zi??u????e??E??? +_??h??????????zo?G??Ec????M??H????C????? ?V???v??@=7?#? +????????$?[P??!???????(??;@????????lQ@???h??????????zo?G??Ec????M??H????C????? ?V???v??@=7?#? +????????$?[P??!???????(??;@????????lQ@???h??????????zo?G??Ec????M??H????C????? ?V???v??@=7?#? +????????$?[?/??????W????zo?G????M??H???xO?'??w????iz????4???1?????????1????????$?G?!???????+b????;@??????????h???????(????zo?G????M??H???(? ?C????? ?Q?v??@=7?#? +???1????????$?G?!???????+b????;@??????????h???????(????zo?G????M??H???(? ?C????? ?Q[P7)$??$Ree!$+?)??k?|??WC??q?'???????????3???B?q?rq?????????U??|L?l|5e{#_Mo{?FO2?@??5??L??????h?uHou???? ?E&?$?^?m?KH,:???]Ms>>?w?????'??U?|??{9X??d9P??????%???!??_???????Q??]????|^Ya?M?a???9?#?GO?~[?????M??????]?z^?/????&T??'f?{.G??+??????@????.??:???s?wP?2??R?5?????u{ ???)??"8??_????7g??mv???V??Aun?e?cw???8`?pk??????-g??/?5k??-9n.4?G????>?????y????#`?x?1??????????hW? +?5??_?DMx?4$y???]? ?7l;???K}??cx?????/???_?wA??X%?,? +????j?py???k?????_c??_???:??sK???V?? ??6?|?????????.?y???????Cg?/?K?*Gmq?h?"?????!2/??8?A? ??QE??h?~???g??????4Q,?x#?`GsZ5?????@??/??~??????g???MU>?w +??Iv|???+??o_???W??9?c??????z4??]2VH|??$l8??7 ??@?????'?O???mc?@??????j???????z??p?rDs9?????+????o????6^3???O?,?KM_??E4@|???e~?n?j?????mZ???[????????+????\?b&9?????V??????????ia???bX?e?v??m>????a_D???h??????<3??M??????? ???????9??z}?????[???2h~,?\Z&???????nS?JBa?Q?H?>??{?o|????"????53?$E)?W?0g ??z??????E?-?m1????9e?9?????h?/x???|7.??Mf?G?? ???@?s?R{??3??l??z??,?0|M.?????,:??wb??8]?4J?1???j??? ????#????.??????x???U?UsaU??UP??? ??<}?x???.?t]GM???%?K??fD??cCn^%?5c?9;??b????O??/?????kOx?4n?|-=??$?P??T???"????k?%??S??? Q??H?H????~h?B(^?/??9??_?Q ?_?_?|7?k???:F?g???????i?Z%c???~????~ +??6?>8????Y?n$?? 0V*?[?? 8??=Y?.??i?v???[???R??V?~ ek+?&??N?b?????_???G???^:_xw??????$PyF?2???G@?p ???j???????P4m#V???N??t??m?IT??a??????K????s???Z????4y6???n?@`? +c???W?? |!?a?<[?A?Aq'?n??????????#??`|1????`?? ?!:??as????iu??????px8w???0???I?H?n????E?u[+8$l???oV??+?n?????W????????h+ z?=N?????bQ ?-2?????n:?? =G??????? ??5?1??`k??=:???KX?????\????x?C????-?z?????.?n??r??????_???Nx?????t? ???[???u+?KT? ????1?p?[w????}M??????[K????4L??q?q\??????|??=:???3?_??Z??rYO?;W??@Vzw???k?????6>?V???W?_???/ +????}?Z~???:?z???fR?^(??y >^?b?? ??????z????????^???.d?hn'B!V9???????2 +??h/?W???3???w???k?4???Z*[??7??g;?????V?P4|'k?|o??>1\????p?!?????N?hI?`T?lYe +???@????k?~??? ?+Q???????????????c??????2??? +?=???I+@??~??z????-Z??e ? +?Ap??77?G??9?_~?? |m3???C?????K5?f???1?Mq????d5D??uK?????#?izk4z|?s%?N?$???????|#?|q??w???[??5v??[?"[?lS? n???$????~?q???;???T??k??RG*[?'?v????????o/?n+???[Y 4?:l?6?9!F9?@??>|?????????u?m +???O?/??.??N?O??Z(?'?RB???+????o?? ??5guu{g????_8y?h6?fg +??WCEQEQE????[M?f?E???R??Vr%??????????9???S??G?????6??????|N???#q??o????[???v?7??GH?7?t?-??\=???}?iw?1?c?}?E>|???!?w?7?????Z ??????Ae?x?a??;??c??'?x???????'????}7?x`?#A??wKrl????r`I,?'8?@h?G???oA>???)???7??&??o?2M; Ws??''?9??????7?B????????5?i?F?r?~'???u?*? s???I;@??i?U?Z???K$???39?g81_W?:?\????"{uX?$????/?`??N?? ???????Y??? |!???????0Kmqiy8??K?7?.w+???????b???<??]W?????Z6??e?-R?-??o1???)?`06??e???m?6?g????=??????>????{? ???"???f?:???W??G??E?_?~?????t?WC??N??,??#@?E`3?Fk?????5????l{/????z .????????!d?!eoU*?rFzS?m?_?7??????{?? ???Z?`?Y?do.(?? P????Z????S????~,|t????:g??? ?G%???l?&???0%??8????8?X???_?/????a???!K??5d0?p?ee?rK8=0k??(?????*???So?w?Yh? ????4}F??\B????7`???=??i?k?Z|???v????2?8??u+??{f?R978?%U?=??????m~??:?? ?????g????:???s|?T????+??$?T?????k??????3I????K??.??ud ?U?ayP9?hq_}Q@?|??|g???K?G???e?????[F??] ????%??a??k??d?R???????H??tK?Y??????;?y?I?HP??I=??Z(??k/??????Kw???[ Z V?M?u??N??0??)*q? ??|??O??V?????/??L? ?I +?r]??::?]? +|$???o?/??i6?? ???_Y?,?'?W?* ?zW??P?|~??F????^?????kZe????m??2?c??X|???????_??????V????? ?"]KO????+????~?:w???(??{?!???%??|m?4?&?V;_ ?~G?V%9?????`2rq?+????c??C?4?,|*m4??lF? ?$@T+ at p>_???o?}ME|O??_?5??t??^0]?>??m???],???GL&9 +????r??????O?E???A?d??G??M?????bk?UD?\??????rs_?TP?????????????im???IG?????h???&?8 d0? ??=*??? ~?????xG?O?O?<7?ykq?X??u{?c?XU???n?V???????P?????W???l?O?^?F?c????g&??Yb?*?N?`???/? ?)|_???VX|M?t-%4?.{37???? b6??????k???/?????]?{?:O???~M???0??J??bo60 +I?wr????{W???h_.???????D??g?-??J?Hp??$??I>??????4?1? |}???8j^!??m?x????H? ???G?f??N??w/2??8????7?????!jv?%?LfM3K/? :4,P?$?w?ybGe??PEP ??(??(??(??(??(??(??(??(??(??(??(??(??(??(??(???W?%???y?????c???;???~??E|??_???u F??????s???x??Han?#k??)?? ?kgO?????????????Z??+i?X??????>??^???????????F?_D???????I?j??????}????2 ????n??T???=?9TWF?2?A?%|%? +????N???????xF?i?:?-??H??????b??/?zo?/????}3?>7?Q????????][?? ?q??B???? n?????/???|Y?K??h?l^d?c,r at UQ???z????????Xx??~???x?X?????c?1???x?v?2?C?? x????Z?????N????.??i????j?Z?<2H??/*3?[??q?}?|f?<?c?|B?L:M?????4? J=J}N?L?H???u???c?G??_/|H???]?&?@????? ?????m_K???H??&??L??lpq??_??D^ ???????>???V????QGI$?M??M????PY??zP3??+?? ???!????|:??????G????_I?Gu??,??I?0??s???{????q???~O????n?C=??,???? e???vE\?$?@?E|??w?????e???? ?????.?[?ui5??L?.? el2?9???j????5??$???????-?????:???^Q?%??G?_?v????@???????C??4???:?4???{k?t??K ???"??t??:??t?}[?5M ?K?-r?????????? u?0???ho????|i??D???yg?[%????n???1?d/?G?3]???uo??7?|??5?WUW??/???????#m???2?????Q_+|???????????:??v?5????Aff\????a?]"?? b?;9K???e`??t?F@>??!????X?I??T`J6?}???9mo?^"???xC?????z??nm??????.[?$Dt? +?b???????????x7V?u] J?V? ?????9?)(??Y%A +??????x???jh?6??~??o?^0?????? A????c??}???)???[??_???#x???X?CuqW??I???n?*;c>?z???P????f?n??_??u?P?(`??^;?f????????d??5;g??9# 1?zH ? W?x?????????????2???i?f?l?:??Zy]?yQ???? =?????_?~????Z??k???????,|K?j?m?I???????Q?s??U>&~???????????:?]MX? ??p?8Aoa?B??~b?A?>??$?????D?R|???g?????_/???G???????/?????32h????wFF?Yj?pv?:?k?<]?k??????? ?'gq???\iZ +?+????e??e?6???M}?E|??~????/i??O????.??y?_E$?3?>\0YY????? +?????????T??5?a??O??????w?????6tO?Ka?} ????????ag?9???w?-cY:??v??D1#?e9;???)?X?j?| ??/>'?;?F???2?????o?!gC |c?2?|??_?S[?}S?O?[?I????????4g*???????}? ?t(??? ???o?/?? |(????|W????6???br??QFY??U?Ce?p?5?U????X????s??5F?G?<"R?]9????B. u?s?????????????h?]?? ??R??????Xe?.?b[??R?? ?f????#??H??????Oi'?}??Da???g),M????k?U?T +?????I?;?D<?M?????mi?Z?????D ???c????@??>,|b?>??[Mm6??k??O?4{VQ5??yc?E,????x???z?? ?q??K???5j???k?hn? AN6?N??3?F2'5????Tn?????%???????u?YLo ??g?@???a???g???j??:????(??;?b?????O?g?.$FTU????????v? u V??_?a?\??y????.$?ex?',???tV?????/Z???????#Y?m???k?4?H,c???=?@??6?_?|????X???j?_ +?I?xau?5??y??Ks ?2\????\??r???????e[o?^>????ok????e????Kt??M???|????s?#?:V???s???7????????I??IT??j??"?n????????????D??w? L???w????=JS5??????dp7!??z???? ?m??????=-t?6?R?o?3???xzV???t??VVF, ;!n?8Pw???-P?????????t+_0?k?c9???O??g? ?G?m!??p/?Kk8Pong21`>??Q}O??xK?c?? ???|cc?XD ??????3@[???;?,A???[???1j????xj?????%ao??????0?X??#x^>V??>)x?E???$?????[?#Q?????????*??)?#???+?&??_d?ki??K?5???w44??r??c???I;?5?Z???????????7??*?/?+??S?jM????2&2??g]??2???T +??Y?[?ps?_??4????|??.4dO?? + Q?|?|??? ??mR????W??????_?????~'k^??ky^?O?????????D?!h?`p ????[?| ????|7??#?????]Z?1v?g?????f?z??`PM?:??????-?Z???i/$?A????O?7??g??]&??<0;Lk=??/?%????_oxg?:??o????|S?M??????*???????;??TC??OL???$~?????}????????j?i?J??2owFl??$?s@? ?'?????(??t??$???[H???7??.|AvH??q???~?5??k?[? +6?}? 2??l?N???????X?"?????^g?s?2???\??V???i??K?=???I?2???)???@????mG?????H??u8`[?{x?-3B??(IP????O? ??'L??????" ?j??4??M???????q^??k?S??????Y???o}??V}1l?? AR__?IQ??=?Q|R???_?<;?y?Q? ??E??}WE?[ina????)>c??6=(??M???J?s???\?[??nFG?SX???'??nO??V?????l?$??B?+#?{??v???J????x????!???[U???/???? +?"?c;??-?KI???S|????#?6????`???tV?];????A?? ??5???/??_???_??s??i3:5?E?R?l*UY?!?*??Q??????Y?N?*???6?f??W^Z]Y?]??tQ????r "?;????m|'?|S??hV*/???$?K????g ?I`|e?? +x???????5????=??????V *,@???*;X~?b?k?/???????y?x??^4??ei?>?q??m"?????;gWK?G??? ???+-r?????*?E?-kJ`??J???`???g?8o?g?Yj?1?}??????8?K????.A???;W>?????????> ???????/^D-??> +/XObject << +/I0 25 0 R +>> +>> +endobj +26 0 obj +<< +/Producer (jsPDF 1.0.272-git 2014-09-29T15:09:diegocr) +/CreationDate (D:20150624175710+10'00') +>> +endobj +27 0 obj +<< +/Type /Catalog +/Pages 1 0 R +/OpenAction [3 0 R /FitH null] +/PageLayout /OneColumn +>> +endobj +xref +0 28 +0000000000 65535 f +0000025735 00000 n +0000056990 00000 n +0000000009 00000 n +0000000117 00000 n +0000008026 00000 n +0000008134 00000 n +0000010635 00000 n +0000010743 00000 n +0000014533 00000 n +0000014642 00000 n +0000021834 00000 n +0000021944 00000 n +0000025817 00000 n +0000025908 00000 n +0000026004 00000 n +0000026103 00000 n +0000026206 00000 n +0000026295 00000 n +0000026389 00000 n +0000026486 00000 n +0000026587 00000 n +0000026680 00000 n +0000026772 00000 n +0000026866 00000 n +0000026964 00000 n +0000057230 00000 n +0000057347 00000 n +trailer +<< +/Size 28 +/Root 27 0 R +/Info 26 0 R +>> +startxref +57451 +%%EOF \ No newline at end of file diff --git a/lang/gpygme/docs/Australian_DCTA_export_DECO_Questionnaire_Results.pdf.sig b/lang/gpygme/docs/Australian_DCTA_export_DECO_Questionnaire_Results.pdf.sig new file mode 100644 index 0000000..04a0ba9 Binary files /dev/null and b/lang/gpygme/docs/Australian_DCTA_export_DECO_Questionnaire_Results.pdf.sig differ commit 40348dad24932daac41a82d38cee4f59455a5bfc Author: Ben McGinnes Date: Wed Jun 24 16:27:34 2015 +1000 Added README * Initial project description and intended outcome. diff --git a/lang/gpygme/docs/README.rst b/lang/gpygme/docs/README.rst new file mode 100644 index 0000000..9228d4e --- /dev/null +++ b/lang/gpygme/docs/README.rst @@ -0,0 +1,34 @@ +====== +GPyGME +====== + +------------ +Project Goal +------------ + +Intended as both a replacement of the older PyME bindings for Python 2 and Python 3, though it will only be implemented in Python 3. Some effort may be made to allow it to work as a module or series of modules in Python 2, but there are no guarantees. + +GPyGME is intended to be the official API for third party (i.e. non-C) languages and bindings. While it should be able to be imported into any Python 3 code as a normal Python module or library, this is not the principal goal. The real value is in providing an API for everyone by providing a pseudo-REST style API. It is not actually a REST API because it is not purely web-based, though could be implemented that way (and almost certainly will be by many). + +GPyGME will accept and respond with JSON data types to provide a method of interaction with GPGME with which most, if not all, modern application developers are familiar. Consequently the bindings ought to be usable by anyone for any purpose for which GPGME could meet the need. + +------------ +Project Name +------------ + +GPyGME, with the first "G" being silent is pronounced the same way as `pygme `_. It could be thought of as a diminutive form of GPGME with the ability to unlock just as much power. + +--------- +Licensing +--------- + +GPyGME utilises the LGPL 2.1+ license, the same as GPGME itself. As it is built on GPGME this is a requirement. Documentation will be covered by both the GPLv3+ as with the GPGME documentation and a Creative Commons license. + +Note that interacting with the GPyGME API as a stand alone interface (i.e. sending and receiving JSON data to it via a socket, command or other connection type) does not require conforming with either the GPL or LGPL licenses. Only when importing or integrating this code into your own application does that become a requirement. + +-------- +Feedback +-------- + +GPyGME is written and maintained by `Ben McGinnes `_, but discussion ought to be conducted on the `gnupg-devel `_ mailing list. + ----------------------------------------------------------------------- hooks/post-receive -- GnuPG Made Easy http://git.gnupg.org From cvs at cvs.gnupg.org Wed Jun 24 14:31:09 2015 From: cvs at cvs.gnupg.org (by Gergely Imreh) Date: Wed, 24 Jun 2015 14:31:09 +0200 Subject: [git] Pinentry - branch, master, updated. pinentry-0.9.4-11-gf0db319 Message-ID: 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 standard pinentry collection". The branch, master has been updated via f0db3192463cccf4541820de36d985629c4df6ee (commit) from 266f1c9e3542627b1cbd191141af4e6f76f706fe (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 f0db3192463cccf4541820de36d985629c4df6ee Author: Gergely Imreh Date: Wed Jun 24 09:52:56 2015 +0000 curses: remove hard-wired ncursesw include path * pinentry/pinentry-curses.c: pkg-config finds the correct include paths so should not hard-wire the path for the ncursesw header file. diff --git a/pinentry/pinentry-curses.c b/pinentry/pinentry-curses.c index 784c770..659fa47 100644 --- a/pinentry/pinentry-curses.c +++ b/pinentry/pinentry-curses.c @@ -22,11 +22,7 @@ #include #endif #include -#ifdef HAVE_NCURSESW -#include -#else #include -#endif #include #include #include ----------------------------------------------------------------------- Summary of changes: pinentry/pinentry-curses.c | 4 ---- 1 file changed, 4 deletions(-) hooks/post-receive -- The standard pinentry collection http://git.gnupg.org From cvs at cvs.gnupg.org Wed Jun 24 18:11:50 2015 From: cvs at cvs.gnupg.org (by Ben McGinnes) Date: Wed, 24 Jun 2015 18:11:50 +0200 Subject: [git] GPGME - branch, ben/gpygme, updated. gpgme-1.5.5-6-g3c5f25f Message-ID: 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 "GnuPG Made Easy". The branch, ben/gpygme has been updated via 3c5f25fb8f699d4aa659781041db419d3e9a1bc5 (commit) from 881a57f8c766e8d0600151456d11c9759162f5b1 (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 3c5f25fb8f699d4aa659781041db419d3e9a1bc5 Author: Ben McGinnes Date: Thu Jun 25 02:08:15 2015 +1000 ITAR update * Removed questions 4, 5 and 6 because I decided they were stupid. * Renumbered question 7 as question 4 and reworded slightly to adjust for removal of preceding questions. This question pretty much addresses all the concerns anyway. diff --git a/lang/gpygme/docs/FAQ.rst b/lang/gpygme/docs/FAQ.rst index cbad050..9161f85 100644 --- a/lang/gpygme/docs/FAQ.rst +++ b/lang/gpygme/docs/FAQ.rst @@ -20,9 +20,9 @@ It might, but chances are these will be negligible for most implementations. Pr Yes, when interacting with GPyGME as a stand alone API it is much the same as using any external API. That is, your code is simply communicating with another system and not integrating that system into your own code. Only when implementing your project in Python and importing the API as a module or library would your code then become subject to the LGPL 2.1+ (which might be fine anyway, consult with a lawyer for issues pertaining to your specific situation). ----------------------- -International Treaties ----------------------- +------------------------------ +Australian Developers and ITAR +------------------------------ **1. The current author/maintainer is in Australia, won't that cause problems with ITAR and the Wassenaar Arrangement?** @@ -38,26 +38,7 @@ If the Minister of Defence makes a specific announcement in Parliament naming me The only other way it could happen is if the Defence definition of "public domain" changes or if exemptions based on something being in the public domain are removed. -**4. What if that happens?** - -This is getting a bit ridiculous, but alright ... should any of those incredibly unlikely events actually occur I will be faced with the following options: - -- Capitulate immediately and cease maintaining the software. -- Capitulate immediately and apply for a permit to continue maintaining the software. -- Ignore the decision and fight it in Court (which would be hideously expensive, but interesting). -- Leave Australia. - -As far as I'm concerned the only really viable options in that scenario would be to either leave the project or to leave my country. In all likelihood this would be a permanent departure in either case. - -**5. Which of those would you do?** - -I'm not a hundred percent sure, it would depend on whatever other factors were in play at such a time as it might occur. If it were to happen now or I were in essentially the same position at such a time as I am now, then the most likely scenario is that I'd tell my government where to go; then emigrate to Europe somewhere. - -**6. Really?** - -Yes, really. It wouldn't mean I'd never be able to visit Australia, it just means I'd never be able to work in Australia. I would lose nothing and the Australian government would lose a tiny amount of income tax revenue. - -**7. What assurances can you give that questions 3 to 6 are just paranoia and everything will be fine?** +**4. What assurances can you give that this will remain the case and everything will be fine?** The Department of Defence's `Defence Export Control Office `_ (DECO) provides numerous resources to address concerns relating to this type of development. Included in this is the `Defence and Strategic Goods List `_ (DSGL) and its accompanying `Activity Questionnaire `_ and `Online DSGL Search Tool `_. ----------------------------------------------------------------------- Summary of changes: lang/gpygme/docs/FAQ.rst | 27 ++++----------------------- 1 file changed, 4 insertions(+), 23 deletions(-) hooks/post-receive -- GnuPG Made Easy http://git.gnupg.org From cvs at cvs.gnupg.org Thu Jun 25 13:06:51 2015 From: cvs at cvs.gnupg.org (by Andre Heinecke) Date: Thu, 25 Jun 2015 13:06:51 +0200 Subject: [git] GnuPG - branch, master, updated. gnupg-2.1.5-26-g5e1a844 Message-ID: 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 5e1a844ae9b6730b4b8a2c9178ea9bc121560c28 (commit) from 54a0ed3d9b10a3c6dfb3d6a4d20b693a3183f8f6 (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 5e1a844ae9b6730b4b8a2c9178ea9bc121560c28 Author: Andre Heinecke Date: Wed Jun 24 18:55:24 2015 +0200 sm: Fix cert storage for ephemeral certs * sm/keydb.c (keydb_store_cert): Clear ephemeral flag for existing certs if store should not be ephemeral. -- Previously keydb_store_cert would ignore ephemeral certificates when asked to store a non ephemeral certificate and insert it again without the flags. This resulted in duplicated certificates in the keybox. GnuPG-bug-id: 1921 Signed-off-by: Andre Heinecke diff --git a/sm/keydb.c b/sm/keydb.c index 974625d..b3363c4 100644 --- a/sm/keydb.c +++ b/sm/keydb.c @@ -1110,8 +1110,9 @@ keydb_store_cert (ksba_cert_t cert, int ephemeral, int *existed) return gpg_error (GPG_ERR_ENOMEM);; } - if (ephemeral) - keydb_set_ephemeral (kh, 1); + /* Set the ephemeral flag so that the search looks at all + records. */ + keydb_set_ephemeral (kh, 1); rc = lock_all (kh); if (rc) @@ -1125,6 +1126,19 @@ keydb_store_cert (ksba_cert_t cert, int ephemeral, int *existed) { if (existed) *existed = 1; + if (!ephemeral) + { + /* Remove ephemeral flags from existing certificate to "store" + it permanently. */ + rc = keydb_set_cert_flags (cert, 1, KEYBOX_FLAG_BLOB, 0, + KEYBOX_FLAG_BLOB_EPHEMERAL, 0); + if (rc) + { + log_error ("clearing ephemeral flag failed: %s\n", + gpg_strerror (rc)); + return rc; + } + } return 0; /* okay */ } log_error (_("problem looking for existing certificate: %s\n"), @@ -1132,6 +1146,10 @@ keydb_store_cert (ksba_cert_t cert, int ephemeral, int *existed) return rc; } + /* Reset the ephemeral flag if not requested. */ + if (!ephemeral) + keydb_set_ephemeral (kh, 0); + rc = keydb_locate_writable (kh, 0); if (rc) { ----------------------------------------------------------------------- Summary of changes: sm/keydb.c | 22 ++++++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) hooks/post-receive -- The GNU Privacy Guard http://git.gnupg.org From cvs at cvs.gnupg.org Fri Jun 26 10:33:21 2015 From: cvs at cvs.gnupg.org (by NIIBE Yutaka) Date: Fri, 26 Jun 2015 10:33:21 +0200 Subject: [git] GnuPG - branch, master, updated. gnupg-2.1.5-27-gd2fdf2e Message-ID: 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 d2fdf2e1b6cd447bb1c36df0ac7d8e669802fa22 (commit) from 5e1a844ae9b6730b4b8a2c9178ea9bc121560c28 (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 d2fdf2e1b6cd447bb1c36df0ac7d8e669802fa22 Author: NIIBE Yutaka Date: Fri Jun 26 15:14:27 2015 +0900 scd: Support button flag and AES key data for OpenPGPcard v3.0. * scd/app-openpgp.c (do_getattr, show_caps, app_select_openpgp): Support button and symmetric decryption. (do_setattr): Support setting AESKEY. diff --git a/scd/app-openpgp.c b/scd/app-openpgp.c index 0e751e0..467389d 100644 --- a/scd/app-openpgp.c +++ b/scd/app-openpgp.c @@ -1,6 +1,6 @@ /* app-openpgp.c - The OpenPGP card application. * Copyright (C) 2003, 2004, 2005, 2007, 2008, - * 2009, 2013, 2014 Free Software Foundation, Inc. + * 2009, 2013, 2014, 2015 Free Software Foundation, Inc. * * This file is part of GnuPG. * @@ -114,6 +114,9 @@ static struct { { 0x0103, 0, 0, 0, 0, 0, 0, 0, "Private DO 3"}, { 0x0104, 0, 0, 0, 0, 0, 0, 0, "Private DO 4"}, { 0x7F21, 1, 0, 1, 0, 0, 0, 1, "Cardholder certificate"}, + /* V3.0 */ + { 0x7F74, 0, 0, 1, 0, 0, 0, 0, "General Feature Management"}, + { 0x00D5, 0, 0, 1, 0, 0, 0, 0, "AES key data"}, { 0 } }; @@ -195,13 +198,15 @@ struct app_local_s { struct { unsigned int is_v2:1; /* This is a v2.0 compatible card. */ + unsigned int sm_supported:1; /* Secure Messaging is supported. */ unsigned int get_challenge:1; unsigned int key_import:1; unsigned int change_force_chv:1; unsigned int private_dos:1; unsigned int algo_attr_change:1; /* Algorithm attributes changeable. */ - unsigned int sm_supported:1; /* Secure Messaging is supported. */ - unsigned int sm_aes128:1; /* Use AES-128 for SM. */ + unsigned int has_decrypt:1; /* Support symmetric decryption. */ + unsigned int has_button:1; + unsigned int sm_algo:2; /* Symmetric crypto algo for SM. */ unsigned int max_certlen_3:16; unsigned int max_get_challenge:16; /* Maximum size for get_challenge. */ unsigned int max_cmd_data:16; /* Maximum data size for a command. */ @@ -1057,7 +1062,8 @@ do_getattr (app_t app, ctrl_t ctrl, const char *name) char tmp[110]; snprintf (tmp, sizeof tmp, - "gc=%d ki=%d fc=%d pd=%d mcl3=%u aac=%d sm=%d si=%u", + "gc=%d ki=%d fc=%d pd=%d mcl3=%u aac=%d " + "sm=%d si=%u dec=%d bt=%d", app->app_local->extcap.get_challenge, app->app_local->extcap.key_import, app->app_local->extcap.change_force_chv, @@ -1065,9 +1071,12 @@ do_getattr (app_t app, ctrl_t ctrl, const char *name) app->app_local->extcap.max_certlen_3, app->app_local->extcap.algo_attr_change, (app->app_local->extcap.sm_supported - ? (app->app_local->extcap.sm_aes128? 7 : 2) + ? (app->app_local->extcap.sm_algo == 0? 2 : + (app->app_local->extcap.sm_algo == 1? 7 : 9)) : 0), - app->app_local->status_indicator); + app->app_local->status_indicator, + app->app_local->extcap.has_decrypt, + app->app_local->extcap.has_button); send_status_info (ctrl, table[idx].name, tmp, strlen (tmp), NULL, 0); return 0; } @@ -2119,6 +2128,7 @@ do_setattr (app_t app, const char *name, { "SM-KEY-ENC", 0x00D1, 3, 0, 1 }, { "SM-KEY-MAC", 0x00D2, 3, 0, 1 }, { "KEY-ATTR", 0, 0, 3, 1 }, + { "AESKEY", 0x00D5, 3, 0, 1 }, { NULL, 0 } }; int exmode; @@ -4302,13 +4312,16 @@ show_caps (struct app_local_s *s) log_info ("Algo-Attr-Change: %s\n", s->extcap.algo_attr_change? "yes":"no"); log_info ("SM-Support .....: %s", s->extcap.sm_supported? "yes":"no"); if (s->extcap.sm_supported) - log_printf (" (%s)", s->extcap.sm_aes128? "AES-128":"3DES"); + log_printf (" (%s)", s->extcap.sm_algo==2? "3DES": + (s->extcap.sm_algo==2? "AES-128" : "AES-256")); log_info ("Max-Cert3-Len ..: %u\n", s->extcap.max_certlen_3); log_info ("Max-Cmd-Data ...: %u\n", s->extcap.max_cmd_data); log_info ("Max-Rsp-Data ...: %u\n", s->extcap.max_rsp_data); log_info ("Cmd-Chaining ...: %s\n", s->cardcap.cmd_chaining?"yes":"no"); log_info ("Ext-Lc-Le ......: %s\n", s->cardcap.ext_lc_le?"yes":"no"); log_info ("Status Indicator: %02X\n", s->status_indicator); + log_info ("Symmetric crypto: %s\n", s->extcap.has_decrypt? "yes":"no"); + log_info ("Button..........: %s\n", s->extcap.has_button? "yes":"no"); log_info ("GnuPG-No-Sync ..: %s\n", s->flags.no_sync? "yes":"no"); log_info ("GnuPG-Def-PW2 ..: %s\n", s->flags.def_chv2? "yes":"no"); @@ -4568,11 +4581,12 @@ app_select_openpgp (app_t app) app->app_local->extcap.change_force_chv = !!(*buffer & 0x10); app->app_local->extcap.private_dos = !!(*buffer & 0x08); app->app_local->extcap.algo_attr_change = !!(*buffer & 0x04); + app->app_local->extcap.has_decrypt = !!(*buffer & 0x02); } if (buflen >= 10) { /* Available with v2 cards. */ - app->app_local->extcap.sm_aes128 = (buffer[1] == 1); + app->app_local->extcap.sm_algo = buffer[1]; app->app_local->extcap.max_get_challenge = (buffer[2] << 8 | buffer[3]); app->app_local->extcap.max_certlen_3 = (buffer[4] << 8 | buffer[5]); @@ -4586,6 +4600,12 @@ app_select_openpgp (app_t app) if (app->card_version <= 0x0100 && manufacturer == 1) app->app_local->extcap.change_force_chv = 1; + /* Check optional DO of "General Feature Management" for button. */ + relptr = get_one_do (app, 0x7f74, &buffer, &buflen, NULL); + if (relptr) + /* It must be: 03 81 01 20 */ + app->app_local->extcap.has_button = 1; + parse_login_data (app); if (opt.verbose) ----------------------------------------------------------------------- Summary of changes: scd/app-openpgp.c | 36 ++++++++++++++++++++++++++++-------- 1 file changed, 28 insertions(+), 8 deletions(-) hooks/post-receive -- The GNU Privacy Guard http://git.gnupg.org From cvs at cvs.gnupg.org Fri Jun 26 11:56:27 2015 From: cvs at cvs.gnupg.org (by Ben McGinnes) Date: Fri, 26 Jun 2015 11:56:27 +0200 Subject: [git] GPGME - branch, ben/gpygme, updated. gpgme-1.5.5-8-g434dd67 Message-ID: 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 "GnuPG Made Easy". The branch, ben/gpygme has been updated via 434dd67170d29aac6f4232a1135cc8b43834d052 (commit) via b2f298e7d03518a2cc93143c24b72e0847d89901 (commit) from 3c5f25fb8f699d4aa659781041db419d3e9a1bc5 (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 434dd67170d29aac6f4232a1135cc8b43834d052 Author: Ben McGinnes Date: Fri Jun 26 19:54:06 2015 +1000 rst2org, part 2 * Converted README.rst to Org-Mode with Pandoc and subsequent paragraph fixes in Emacs. diff --git a/lang/gpygme/docs/FAQ.rst b/lang/gpygme/docs/FAQ.rst deleted file mode 100644 index 9161f85..0000000 --- a/lang/gpygme/docs/FAQ.rst +++ /dev/null @@ -1,53 +0,0 @@ -=========================== -Frequently Asked? Questions -=========================== - -? At this stage these are more like Frequently Anticipated Questions. - ------------------ -Using the Project ------------------ - -**1. Why implement an interactive codebase?** - -For good or ill, modern application development has turned to many web based technologies. As a result there are many more developers who no longer use or know languages like C. Consequently complete APIs like GPGME are not available to them when they may very well need it or benefit greatly from it. Rather than continuing existing systems which utilise wrappers calling command line programs (e.g. `python-gnupg `_), it is best to provide access to GPGME in a manner which can be safely used by newer developers. - -**2. Won't that create bottlenecks or performance issues?** - -It might, but chances are these will be negligible for most implementations. Projects which truly needs greater optimisation should consider utilising the GPGME C code directly. - -**3. I want (or need) to use a proprietary licence with my project, can I use this?** - -Yes, when interacting with GPyGME as a stand alone API it is much the same as using any external API. That is, your code is simply communicating with another system and not integrating that system into your own code. Only when implementing your project in Python and importing the API as a module or library would your code then become subject to the LGPL 2.1+ (which might be fine anyway, consult with a lawyer for issues pertaining to your specific situation). - ------------------------------- -Australian Developers and ITAR ------------------------------- - -**1. The current author/maintainer is in Australia, won't that cause problems with ITAR and the Wassenaar Arrangement?** - -I'm not developing a cryptosystem or any encryption algorithms, I'm developing an API. So I should not be affected one way or the other by the provisions of the `Defence Trade Control Act 2012 `_ (DTCA), particularly with the 2015 amendments which have been passed by the Australian Parliament. - -**2. What if you're wrong about that?** - -That seems somewhat unlikely. The DSGL explicitly cites cryptography and encryption software as being in Part 2 of the `Defence Trade Cooperation Munitions List `_, but neither GPGME nor GPyGME are encryption software directly. Even GPGME simply provides a means of accessing what it refers to as encryption engines; currently the engines it supports are GnuPG and GpgSM. As long as I do not develop any of these encryption engines my work is not affected by the provisions of Australia's export controls, no matter how backward or useless I might consider those controls to be. - -**3. In April 2016 the enforcement provisions of the DTCA come into force, could that change anything here?** - -If the Minister of Defence makes a specific announcement in Parliament naming me and this work as falling under the purview of the DTCA, then yes; otherwise no. - -The only other way it could happen is if the Defence definition of "public domain" changes or if exemptions based on something being in the public domain are removed. - -**4. What assurances can you give that this will remain the case and everything will be fine?** - -The Department of Defence's `Defence Export Control Office `_ (DECO) provides numerous resources to address concerns relating to this type of development. Included in this is the `Defence and Strategic Goods List `_ (DSGL) and its accompanying `Activity Questionnaire `_ and `Online DSGL Search Tool `_. - -I completed the questionaire using the following conservative assumptions: that this work is either or both of supply and publishing of software and technology; and that the entire project really is in the category of Part 2 of the DSGL as a dual-use technology. Even though I am still pretty sure that only GPG itself and GpgSM would be placed in that category. Maybe libassuan, dirmngr and pinentry would too. Still, assuming that it all did, including GPGME and GPyGME, the results are clear that both supply and publication are fine. The `definitions of supply and publishing `_, however, indicate that this work would likely only ever be considered publishing. - -The reason for this is that all the existing software on which this work is built is what Defence classifies as being in the public domain. In this context that is not the same as the term is used for copyright and licensing, it means that the software and information is already freely available to anyone. Thus it would be the same for all or almost all free (libre) and open source software. - -Only Australian cryptographers developing entirely new encryption algortithms are likely to be directly impacted by the provisions of the DCTA. I am very much *not* in that category. Furthermore, any algorithm added to the specifications for GPG would need to pass through an international selection process anyway, by which stage it would be exempt from these types of restrictions because it would already be in the public domain as far as Australia's Department of Defence is concerned. - -The results of my completed questionnaire are available `here `_ (PDF) and a GPG signature of the file is `here `_. The file is signed with my key (ID 0x321E4E2373590E5D). - -With regards to current sanctions by Australia against any entity as referenced in that document and available `here `_, my method of publication consists of uploading information to the GPG git server in Germany. Germany is not currently a sanctioned country by Australia, nor are any of the involved companies sanctioned separately. In fact, the only reference to Germany on Australia's list of sanctioned entities pertains to a number of individuals, mostly members of Al-Qaeda, currently serving time in German prisons or having been deported from Germany. Additional details on those sanctions can be found `here `_ and `here `_. diff --git a/lang/gpygme/docs/README.org b/lang/gpygme/docs/README.org new file mode 100644 index 0000000..6046e83 --- /dev/null +++ b/lang/gpygme/docs/README.org @@ -0,0 +1,45 @@ +* GPyGME + +** Project Goal + +Intended as both a replacement of the older PyME bindings for Python 2 +and Python 3, though it will only be implemented in Python 3. Some +effort may be made to allow it to work as a module or series of modules +in Python 2, but there are no guarantees. + +GPyGME is intended to be the official API for third party (i.e. non-C) +languages and bindings. While it should be able to be imported into any +Python 3 code as a normal Python module or library, this is not the +principal goal. The real value is in providing an API for everyone by +providing a pseudo-REST style API. It is not actually a REST API because +it is not purely web-based, though could be implemented that way (and +almost certainly will be by many). + +GPyGME will accept and respond with JSON data types to provide a method +of interaction with GPGME with which most, if not all, modern +application developers are familiar. Consequently the bindings ought to +be usable by anyone for any purpose for which GPGME could meet the need. + +** Project Name + +GPyGME, with the first "G" being silent is pronounced the same way as +[[https://en.wikipedia.org/wiki/Pygmy_peoples][pygme]]. It could be thought of as a diminutive form of GPGME with the +ability to unlock just as much power. + +** Licensing + +GPyGME utilises the LGPL 2.1+ license, the same as GPGME itself. As it +is built on GPGME this is a requirement. Documentation will be covered +by both the GPLv3+ as with the GPGME documentation and a Creative +Commons license. + +Note that interacting with the GPyGME API as a stand alone interface +(i.e. sending and receiving JSON data to it via a socket, command or +other connection type) does not require conforming with either the GPL +or LGPL licenses. Only when importing or integrating this code into your +own application does that become a requirement. + +** Feedback + +GPyGME is written and maintained by [[mailto:ben at adversary.org][Ben McGinnes]], but discussion ought +to be conducted on the [[https://lists.gnupg.org/mailman/listinfo/gnupg-devel][gnupg-devel]] mailing list. diff --git a/lang/gpygme/docs/README.rst b/lang/gpygme/docs/README.rst deleted file mode 100644 index 9228d4e..0000000 --- a/lang/gpygme/docs/README.rst +++ /dev/null @@ -1,34 +0,0 @@ -====== -GPyGME -====== - ------------- -Project Goal ------------- - -Intended as both a replacement of the older PyME bindings for Python 2 and Python 3, though it will only be implemented in Python 3. Some effort may be made to allow it to work as a module or series of modules in Python 2, but there are no guarantees. - -GPyGME is intended to be the official API for third party (i.e. non-C) languages and bindings. While it should be able to be imported into any Python 3 code as a normal Python module or library, this is not the principal goal. The real value is in providing an API for everyone by providing a pseudo-REST style API. It is not actually a REST API because it is not purely web-based, though could be implemented that way (and almost certainly will be by many). - -GPyGME will accept and respond with JSON data types to provide a method of interaction with GPGME with which most, if not all, modern application developers are familiar. Consequently the bindings ought to be usable by anyone for any purpose for which GPGME could meet the need. - ------------- -Project Name ------------- - -GPyGME, with the first "G" being silent is pronounced the same way as `pygme `_. It could be thought of as a diminutive form of GPGME with the ability to unlock just as much power. - ---------- -Licensing ---------- - -GPyGME utilises the LGPL 2.1+ license, the same as GPGME itself. As it is built on GPGME this is a requirement. Documentation will be covered by both the GPLv3+ as with the GPGME documentation and a Creative Commons license. - -Note that interacting with the GPyGME API as a stand alone interface (i.e. sending and receiving JSON data to it via a socket, command or other connection type) does not require conforming with either the GPL or LGPL licenses. Only when importing or integrating this code into your own application does that become a requirement. - --------- -Feedback --------- - -GPyGME is written and maintained by `Ben McGinnes `_, but discussion ought to be conducted on the `gnupg-devel `_ mailing list. - commit b2f298e7d03518a2cc93143c24b72e0847d89901 Author: Ben McGinnes Date: Fri Jun 26 19:49:10 2015 +1000 rst2org * Converted FAQ.rst to Org-Mode with Pandoc and subsequent paragraph fixes in Emacs. diff --git a/lang/gpygme/docs/FAQ.org b/lang/gpygme/docs/FAQ.org new file mode 100644 index 0000000..37cfb74 --- /dev/null +++ b/lang/gpygme/docs/FAQ.org @@ -0,0 +1,118 @@ +* Frequently Asked? Questions + +? At this stage these are more like Frequently Anticipated Questions. + +** Using the Project + +*1. Why implement an interactive codebase?* + +For good or ill, modern application development has turned to many web +based technologies. As a result there are many more developers who no +longer use or know languages like C. Consequently complete APIs like +GPGME are not available to them when they may very well need it or +benefit greatly from it. Rather than continuing existing systems which +utilise wrappers calling command line programs (e.g. [[https://bitbucket.org/vinay.sajip/python-gnupg][python-gnupg]]), it +is best to provide access to GPGME in a manner which can be safely +used by newer developers. + +*2. Won't that create bottlenecks or performance issues?* + +It might, but chances are these will be negligible for most +implementations. Projects which truly needs greater optimisation should +consider utilising the GPGME C code directly. + +*3. I want (or need) to use a proprietary licence with my project, can I +use this?* + +Yes, when interacting with GPyGME as a stand alone API it is much the +same as using any external API. That is, your code is simply +communicating with another system and not integrating that system into +your own code. Only when implementing your project in Python and +importing the API as a module or library would your code then become +subject to the LGPL 2.1+ (which might be fine anyway, consult with a +lawyer for issues pertaining to your specific situation). + +** Australian Developers and ITAR + +*1. The current author/maintainer is in Australia, won't that cause +problems with ITAR and the Wassenaar Arrangement?* + +I'm not developing a cryptosystem or any encryption algorithms, I'm +developing an API. So I should not be affected one way or the other by +the provisions of the [[http://www.austlii.edu.au/au/legis/cth/num_act/dtca2012207/][Defence Trade Control Act 2012]] (DTCA), +particularly with the 2015 amendments which have been passed by the +Australian Parliament. + +*2. What if you're wrong about that?* + +That seems somewhat unlikely. The DSGL explicitly cites cryptography +and encryption software as being in Part 2 of the [[http://www.austlii.edu.au/au/legis/cth/num_act/dtca2012207/s4.html#defense_trade_cooperation_munitions_list][Defence Trade +Cooperation Munitions List]], but neither GPGME nor GPyGME are +encryption software directly. Even GPGME simply provides a means of +accessing what it refers to as encryption engines; currently the +engines it supports are GnuPG and GpgSM. As long as I do not develop +any of these encryption engines my work is not affected by the +provisions of Australia's export controls, no matter how backward or +useless I might consider those controls to be. + +*3. In April 2016 the enforcement provisions of the DTCA come into +force, could that change anything here?* + +If the Minister of Defence makes a specific announcement in Parliament +naming me and this work as falling under the purview of the DTCA, then +yes; otherwise no. + +The only other way it could happen is if the Defence definition of +"public domain" changes or if exemptions based on something being in the +public domain are removed. + +*4. What assurances can you give that this will remain the case and +everything will be fine?* + +The Department of Defence's [[http://www.defence.gov.au/DECO/Default.asp][Defence Export Control Office]] (DECO) +provides numerous resources to address concerns relating to this type +of development. Included in this is the [[https://dsgl.defence.gov.au/pages/home.aspx][Defence and Strategic Goods +List]] (DSGL) and its accompanying [[https://dsgl.defence.gov.au/pages/questionnaire.aspx][Activity Questionnaire]] and [[https://dsgl.defence.gov.au/pages/search.aspx][Online +DSGL Search Tool]]. + +I completed the questionaire using the following conservative +assumptions: that this work is either or both of supply and publishing +of software and technology; and that the entire project really is in +the category of Part 2 of the DSGL as a dual-use technology. Even +though I am still pretty sure that only GPG itself and GpgSM would be +placed in that category. Maybe libassuan, dirmngr and pinentry would +too. Still, assuming that it all did, including GPGME and GPyGME, the +results are clear that both supply and publication are fine. The +[[http://dfat.gov.au/international-relations/security/sanctions/sanctions-regimes/Pages/sanctions-regimes.aspx][definitions of supply and publishing]], however, indicate that this work +would likely only ever be considered publishing. + +The reason for this is that all the existing software on which this work +is built is what Defence classifies as being in the public domain. In +this context that is not the same as the term is used for copyright and +licensing, it means that the software and information is already freely +available to anyone. Thus it would be the same for all or almost all +free (libre) and open source software. + +Only Australian cryptographers developing entirely new encryption +algortithms are likely to be directly impacted by the provisions of the +DCTA. I am very much /not/ in that category. Furthermore, any algorithm +added to the specifications for GPG would need to pass through an +international selection process anyway, by which stage it would be +exempt from these types of restrictions because it would already be in +the public domain as far as Australia's Department of Defence is +concerned. + +The results of my completed questionnaire are available [[Australian_DCTA_export_DECO_Questionnaire_Results.pdf][here]] (PDF) and +a GPG signature of the file is [[Australian_DCTA_export_DECO_Questionnaire_Results.pdf.sig][here]]. The file is signed with my key +(ID 0x321E4E2373590E5D). + +With regards to current sanctions by Australia against any entity as +referenced in that document and available [[http://dfat.gov.au/international-relations/security/sanctions/pages/sanctions.aspx][here]], my method of +publication consists of uploading information to the GPG git server in +Germany. Germany is not currently a sanctioned country by Australia, +nor are any of the involved companies sanctioned separately. In fact, +the only reference to Germany on Australia's list of sanctioned +entities pertains to a number of individuals, mostly members of +Al-Qaeda, currently serving time in German prisons or having been +deported from Germany. Additional details on those sanctions can be +found [[http://dfat.gov.au/international-relations/security/sanctions/Pages/consolidated-list.aspx][here]] and [[http://dfat.gov.au/international-relations/security/sanctions/sanctions-regimes/Pages/sanctions-regimes.aspx][here]]. ----------------------------------------------------------------------- Summary of changes: lang/gpygme/docs/FAQ.org | 118 ++++++++++++++++++++++++++++++++++++++++++++ lang/gpygme/docs/FAQ.rst | 53 -------------------- lang/gpygme/docs/README.org | 45 +++++++++++++++++ lang/gpygme/docs/README.rst | 34 ------------- 4 files changed, 163 insertions(+), 87 deletions(-) create mode 100644 lang/gpygme/docs/FAQ.org delete mode 100644 lang/gpygme/docs/FAQ.rst create mode 100644 lang/gpygme/docs/README.org delete mode 100644 lang/gpygme/docs/README.rst hooks/post-receive -- GnuPG Made Easy http://git.gnupg.org From cvs at cvs.gnupg.org Fri Jun 26 12:08:36 2015 From: cvs at cvs.gnupg.org (by Werner Koch) Date: Fri, 26 Jun 2015 12:08:36 +0200 Subject: [git] Assuan - branch, master, updated. libassuan-2.2.1-4-gcd8face Message-ID: 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 "IPC library used by GnuPG". The branch, master has been updated via cd8face27cc96cb0092c920e6e5bdee81a61c420 (commit) via 0da6afa864cfd68333941d6332d762c82928946c (commit) from c6b131949bb6c77392af2cbbbeb8ea1bed129b79 (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 cd8face27cc96cb0092c920e6e5bdee81a61c420 Author: Werner Koch Date: Fri Jun 26 12:06:31 2015 +0200 Return GPG_ERR_SOURCE_ASSUAN on errors with no CTX. * src/assuan-defs.h (_assuan_error): Use error source Assuan if no CTX is given. Signed-off-by: Werner Koch diff --git a/src/assuan-defs.h b/src/assuan-defs.h index 3dec3df..68cd810 100644 --- a/src/assuan-defs.h +++ b/src/assuan-defs.h @@ -228,7 +228,7 @@ struct assuan_context_s static GPG_ERR_INLINE gpg_error_t _assuan_error (assuan_context_t ctx, gpg_err_code_t errcode) { - return gpg_err_make (ctx?ctx->err_source:0, errcode); + return gpg_err_make (ctx?ctx->err_source: GPG_ERR_SOURCE_ASSUAN, errcode); } /* Release all resources associated with an engine operation. */ commit 0da6afa864cfd68333941d6332d762c82928946c Author: Werner Koch Date: Fri Jun 26 12:04:20 2015 +0200 Do not segv if NULL is passed for CTX in sendfd and receivefd. * src/assuan-buffer.c (assuan_sendfd): Check that CTX is not NULL. (assuan_receivefd): Ditto. -- This change is to align the behaviour with that of assuan_send_data. Suggested-by: Andre Heinecke. Signed-off-by: Werner Koch diff --git a/doc/assuan.texi b/doc/assuan.texi index 358357c..10b309c 100644 --- a/doc/assuan.texi +++ b/doc/assuan.texi @@ -1205,8 +1205,10 @@ The descriptor must be sent before the command is issued that makes use of the descriptor. Note that calling this function with a @var{ctx} of @code{NULL} and - at var{fd} of @code{-1} can be used as a runtime test to check whether -descriptor passing is available on the platform. If it is, 0 is returned, otherwise an error with the error code @code{GPG_ERR_NOT_IMPLEMENTED}. + at var{fd} of @code{ASSUAN_INVALID_FD} can be used as a runtime test to +check whether descriptor passing is available on the platform: + at code{0} is returned if descriptor passing is available, otherwise an +error with the error code @code{GPG_ERR_NOT_IMPLEMENTED} is returned. @end deftypefun @anchor{function assuan_receivefd} diff --git a/src/assuan-buffer.c b/src/assuan-buffer.c index 04aff5a..b442b3d 100644 --- a/src/assuan-buffer.c +++ b/src/assuan-buffer.c @@ -524,6 +524,9 @@ assuan_sendfd (assuan_context_t ctx, assuan_fd_t fd) return _assuan_error (ctx, GPG_ERR_NOT_IMPLEMENTED); #endif + if (!ctx) + return _assuan_error (ctx, GPG_ERR_ASS_INV_VALUE); + if (! ctx->engine.sendfd) return set_error (ctx, GPG_ERR_NOT_IMPLEMENTED, "server does not support sending and receiving " @@ -534,6 +537,9 @@ assuan_sendfd (assuan_context_t ctx, assuan_fd_t fd) gpg_error_t assuan_receivefd (assuan_context_t ctx, assuan_fd_t *fd) { + if (!ctx) + return _assuan_error (ctx, GPG_ERR_ASS_INV_VALUE); + if (! ctx->engine.receivefd) return set_error (ctx, GPG_ERR_NOT_IMPLEMENTED, "server does not support sending and receiving " diff --git a/src/context.c b/src/context.c index 62b7f57..147edae 100644 --- a/src/context.c +++ b/src/context.c @@ -183,8 +183,8 @@ void assuan_set_io_monitor (assuan_context_t ctx, /* Store the error in the context so that the error sending function - can take out a descriptive text. Inside the assuan code, use the - macro set_error instead of this function. */ + can take out a descriptive text. Inside the assuan code, use the + macro set_error instead of this function. */ gpg_error_t assuan_set_error (assuan_context_t ctx, gpg_error_t err, const char *text) { ----------------------------------------------------------------------- Summary of changes: doc/assuan.texi | 6 ++++-- src/assuan-buffer.c | 6 ++++++ src/assuan-defs.h | 2 +- src/context.c | 4 ++-- 4 files changed, 13 insertions(+), 5 deletions(-) hooks/post-receive -- IPC library used by GnuPG http://git.gnupg.org From cvs at cvs.gnupg.org Fri Jun 26 19:28:38 2015 From: cvs at cvs.gnupg.org (by Ben McGinnes) Date: Fri, 26 Jun 2015 19:28:38 +0200 Subject: [git] GPGME - branch, ben/gpygme, updated. gpgme-1.5.5-9-gbd91d40 Message-ID: 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 "GnuPG Made Easy". The branch, ben/gpygme has been updated via bd91d40ba52f3823c401cfa7dd5515b157c77dbf (commit) from 434dd67170d29aac6f4232a1135cc8b43834d052 (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 bd91d40ba52f3823c401cfa7dd5515b157c77dbf Author: Ben McGinnes Date: Sat Jun 27 03:27:10 2015 +1000 Typesetting * Fixed sentence spacing and paragraph alignment following conversion from reST format. diff --git a/lang/gpygme/docs/FAQ.org b/lang/gpygme/docs/FAQ.org index 37cfb74..12b0ddb 100644 --- a/lang/gpygme/docs/FAQ.org +++ b/lang/gpygme/docs/FAQ.org @@ -7,27 +7,27 @@ *1. Why implement an interactive codebase?* For good or ill, modern application development has turned to many web -based technologies. As a result there are many more developers who no -longer use or know languages like C. Consequently complete APIs like +based technologies. As a result there are many more developers who no +longer use or know languages like C. Consequently complete APIs like GPGME are not available to them when they may very well need it or -benefit greatly from it. Rather than continuing existing systems which -utilise wrappers calling command line programs (e.g. [[https://bitbucket.org/vinay.sajip/python-gnupg][python-gnupg]]), it +benefit greatly from it. Rather than continuing existing systems which +utilise wrappers calling command line programs (e.g. [[https://bitbucket.org/vinay.sajip/python-gnupg][python-gnupg]]), it is best to provide access to GPGME in a manner which can be safely used by newer developers. *2. Won't that create bottlenecks or performance issues?* It might, but chances are these will be negligible for most -implementations. Projects which truly needs greater optimisation should -consider utilising the GPGME C code directly. +implementations. Projects which truly needs greater optimisation +should consider utilising the GPGME C code directly. *3. I want (or need) to use a proprietary licence with my project, can I use this?* Yes, when interacting with GPyGME as a stand alone API it is much the -same as using any external API. That is, your code is simply +same as using any external API. That is, your code is simply communicating with another system and not integrating that system into -your own code. Only when implementing your project in Python and +your own code. Only when implementing your project in Python and importing the API as a module or library would your code then become subject to the LGPL 2.1+ (which might be fine anyway, consult with a lawyer for issues pertaining to your specific situation). @@ -38,19 +38,19 @@ lawyer for issues pertaining to your specific situation). problems with ITAR and the Wassenaar Arrangement?* I'm not developing a cryptosystem or any encryption algorithms, I'm -developing an API. So I should not be affected one way or the other by -the provisions of the [[http://www.austlii.edu.au/au/legis/cth/num_act/dtca2012207/][Defence Trade Control Act 2012]] (DTCA), +developing an API. So I should not be affected one way or the other +by the provisions of the [[http://www.austlii.edu.au/au/legis/cth/num_act/dtca2012207/][Defence Trade Control Act 2012]] (DTCA), particularly with the 2015 amendments which have been passed by the Australian Parliament. *2. What if you're wrong about that?* -That seems somewhat unlikely. The DSGL explicitly cites cryptography +That seems somewhat unlikely. The DSGL explicitly cites cryptography and encryption software as being in Part 2 of the [[http://www.austlii.edu.au/au/legis/cth/num_act/dtca2012207/s4.html#defense_trade_cooperation_munitions_list][Defence Trade Cooperation Munitions List]], but neither GPGME nor GPyGME are -encryption software directly. Even GPGME simply provides a means of +encryption software directly. Even GPGME simply provides a means of accessing what it refers to as encryption engines; currently the -engines it supports are GnuPG and GpgSM. As long as I do not develop +engines it supports are GnuPG and GpgSM. As long as I do not develop any of these encryption engines my work is not affected by the provisions of Australia's export controls, no matter how backward or useless I might consider those controls to be. @@ -63,56 +63,56 @@ naming me and this work as falling under the purview of the DTCA, then yes; otherwise no. The only other way it could happen is if the Defence definition of -"public domain" changes or if exemptions based on something being in the -public domain are removed. +"public domain" changes or if exemptions based on something being in +the public domain are removed. *4. What assurances can you give that this will remain the case and everything will be fine?* The Department of Defence's [[http://www.defence.gov.au/DECO/Default.asp][Defence Export Control Office]] (DECO) provides numerous resources to address concerns relating to this type -of development. Included in this is the [[https://dsgl.defence.gov.au/pages/home.aspx][Defence and Strategic Goods +of development. Included in this is the [[https://dsgl.defence.gov.au/pages/home.aspx][Defence and Strategic Goods List]] (DSGL) and its accompanying [[https://dsgl.defence.gov.au/pages/questionnaire.aspx][Activity Questionnaire]] and [[https://dsgl.defence.gov.au/pages/search.aspx][Online DSGL Search Tool]]. I completed the questionaire using the following conservative assumptions: that this work is either or both of supply and publishing of software and technology; and that the entire project really is in -the category of Part 2 of the DSGL as a dual-use technology. Even +the category of Part 2 of the DSGL as a dual-use technology. Even though I am still pretty sure that only GPG itself and GpgSM would be -placed in that category. Maybe libassuan, dirmngr and pinentry would -too. Still, assuming that it all did, including GPGME and GPyGME, the -results are clear that both supply and publication are fine. The +placed in that category. Maybe libassuan, dirmngr and pinentry would +too. Still, assuming that it all did, including GPGME and GPyGME, the +results are clear that both supply and publication are fine. The [[http://dfat.gov.au/international-relations/security/sanctions/sanctions-regimes/Pages/sanctions-regimes.aspx][definitions of supply and publishing]], however, indicate that this work would likely only ever be considered publishing. -The reason for this is that all the existing software on which this work -is built is what Defence classifies as being in the public domain. In -this context that is not the same as the term is used for copyright and -licensing, it means that the software and information is already freely -available to anyone. Thus it would be the same for all or almost all -free (libre) and open source software. +The reason for this is that all the existing software on which this +work is built is what Defence classifies as being in the public +domain. In this context that is not the same as the term is used for +copyright and licensing, it means that the software and information is +already freely available to anyone. Thus it would be the same for all +or almost all free (libre) and open source software. Only Australian cryptographers developing entirely new encryption -algortithms are likely to be directly impacted by the provisions of the -DCTA. I am very much /not/ in that category. Furthermore, any algorithm -added to the specifications for GPG would need to pass through an -international selection process anyway, by which stage it would be -exempt from these types of restrictions because it would already be in -the public domain as far as Australia's Department of Defence is -concerned. +algortithms are likely to be directly impacted by the provisions of +the DCTA. I am very much /not/ in that category. Furthermore, any +algorithm added to the specifications for GPG would need to pass +through an international selection process anyway, by which stage it +would be exempt from these types of restrictions because it would +already be in the public domain as far as Australia's Department of +Defence is concerned. The results of my completed questionnaire are available [[Australian_DCTA_export_DECO_Questionnaire_Results.pdf][here]] (PDF) and -a GPG signature of the file is [[Australian_DCTA_export_DECO_Questionnaire_Results.pdf.sig][here]]. The file is signed with my key +a GPG signature of the file is [[Australian_DCTA_export_DECO_Questionnaire_Results.pdf.sig][here]]. The file is signed with my key (ID 0x321E4E2373590E5D). With regards to current sanctions by Australia against any entity as referenced in that document and available [[http://dfat.gov.au/international-relations/security/sanctions/pages/sanctions.aspx][here]], my method of publication consists of uploading information to the GPG git server in -Germany. Germany is not currently a sanctioned country by Australia, +Germany. Germany is not currently a sanctioned country by Australia, nor are any of the involved companies sanctioned separately. In fact, the only reference to Germany on Australia's list of sanctioned entities pertains to a number of individuals, mostly members of Al-Qaeda, currently serving time in German prisons or having been -deported from Germany. Additional details on those sanctions can be +deported from Germany. Additional details on those sanctions can be found [[http://dfat.gov.au/international-relations/security/sanctions/Pages/consolidated-list.aspx][here]] and [[http://dfat.gov.au/international-relations/security/sanctions/sanctions-regimes/Pages/sanctions-regimes.aspx][here]]. diff --git a/lang/gpygme/docs/README.org b/lang/gpygme/docs/README.org index 6046e83..284c38f 100644 --- a/lang/gpygme/docs/README.org +++ b/lang/gpygme/docs/README.org @@ -3,41 +3,42 @@ ** Project Goal Intended as both a replacement of the older PyME bindings for Python 2 -and Python 3, though it will only be implemented in Python 3. Some -effort may be made to allow it to work as a module or series of modules -in Python 2, but there are no guarantees. - -GPyGME is intended to be the official API for third party (i.e. non-C) -languages and bindings. While it should be able to be imported into any -Python 3 code as a normal Python module or library, this is not the -principal goal. The real value is in providing an API for everyone by -providing a pseudo-REST style API. It is not actually a REST API because -it is not purely web-based, though could be implemented that way (and -almost certainly will be by many). - -GPyGME will accept and respond with JSON data types to provide a method -of interaction with GPGME with which most, if not all, modern -application developers are familiar. Consequently the bindings ought to -be usable by anyone for any purpose for which GPGME could meet the need. +and Python 3, though it will only be implemented in Python 3. Some +effort may be made to allow it to work as a module or series of +modules in Python 2, but there are no guarantees. + +GPyGME is intended to be the official API for third party (i.e. +non-C) languages and bindings. While it should be able to be imported +into any Python 3 code as a normal Python module or library, this is +not the principal goal. The real value is in providing an API for +everyone by providing a pseudo-REST style API. It is not actually a +REST API because it is not purely web-based, though could be +implemented that way (and almost certainly will be by many). + +GPyGME will accept and respond with JSON data types to provide a +method of interaction with GPGME with which most, if not all, modern +application developers are familiar. Consequently the bindings ought +to be usable by anyone for any purpose for which GPGME could meet the +need. ** Project Name GPyGME, with the first "G" being silent is pronounced the same way as -[[https://en.wikipedia.org/wiki/Pygmy_peoples][pygme]]. It could be thought of as a diminutive form of GPGME with the +[[https://en.wikipedia.org/wiki/Pygmy_peoples][pygme]]. It could be thought of as a diminutive form of GPGME with the ability to unlock just as much power. ** Licensing -GPyGME utilises the LGPL 2.1+ license, the same as GPGME itself. As it -is built on GPGME this is a requirement. Documentation will be covered -by both the GPLv3+ as with the GPGME documentation and a Creative -Commons license. +GPyGME utilises the LGPL 2.1+ license, the same as GPGME itself. As +it is built on GPGME this is a requirement. Documentation will be +covered by both the GPLv3+ as with the GPGME documentation and a +Creative Commons license. Note that interacting with the GPyGME API as a stand alone interface -(i.e. sending and receiving JSON data to it via a socket, command or +(i.e. sending and receiving JSON data to it via a socket, command or other connection type) does not require conforming with either the GPL -or LGPL licenses. Only when importing or integrating this code into your -own application does that become a requirement. +or LGPL licenses. Only when importing or integrating this code into +your own application does that become a requirement. ** Feedback ----------------------------------------------------------------------- Summary of changes: lang/gpygme/docs/FAQ.org | 72 ++++++++++++++++++++++----------------------- lang/gpygme/docs/README.org | 49 +++++++++++++++--------------- 2 files changed, 61 insertions(+), 60 deletions(-) hooks/post-receive -- GnuPG Made Easy http://git.gnupg.org From cvs at cvs.gnupg.org Mon Jun 29 11:10:17 2015 From: cvs at cvs.gnupg.org (by Werner Koch) Date: Mon, 29 Jun 2015 11:10:17 +0200 Subject: [git] GnuPG - branch, master, updated. gnupg-2.1.5-28-g2c9c46e Message-ID: 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 2c9c46e2a2b8f9a1bdc1ef46a135b5fc7d1a8073 (commit) from d2fdf2e1b6cd447bb1c36df0ac7d8e669802fa22 (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 2c9c46e2a2b8f9a1bdc1ef46a135b5fc7d1a8073 Author: Werner Koch Date: Mon Jun 29 11:03:58 2015 +0200 gpgsm: Add command option "offline". * sm/server.c (option_handler): Add "offline". (cmd_getinfo): Ditto. * sm/certchain.c (is_cert_still_valid): (do_validate_chain): * sm/gpgsm.c (gpgsm_init_default_ctrl): Default "offline" to the value of --disable-dirmngr. * sm/call-dirmngr.c (start_dirmngr_ext): Better also check for ctrl->offline. -- Adding this option makes it easier to implement the corresponding feature in gpgme. Signed-off-by: Werner Koch diff --git a/doc/gpgsm.texi b/doc/gpgsm.texi index 21e9372..2bcbec5 100644 --- a/doc/gpgsm.texi +++ b/doc/gpgsm.texi @@ -462,6 +462,7 @@ will not have on your local keybox), the operator can tell both your IP address and the time when you verified the signature. + at anchor{gpgsm-option --validation-model} @item --validation-model @var{name} @opindex validation-model This option changes the default validation model. The only possible @@ -554,6 +555,7 @@ may be given (@pxref{how-to-specify-a-user-id}). Write output to @var{file}. The default is to write it to stdout. + at anchor{gpgsm-option --with-key-data} @item --with-key-data @opindex with-key-data Displays extra information with the @code{--list-keys} commands. Especially @@ -561,6 +563,7 @@ a line tagged @code{grp} is printed which tells you the keygrip of a key. This string is for example used as the file name of the secret key. + at anchor{gpgsm-option --with-validation} @item --with-validation @opindex with-validation When doing a key listing, do a full validation check for each key and @@ -1152,7 +1155,9 @@ Assuan manual for details. * GPGSM EXPORT:: Export certificates. * GPGSM IMPORT:: Import certificates. * GPGSM DELETE:: Delete certificates. +* GPGSM GETAUDITLOG:: Retrieve an audit log. * GPGSM GETINFO:: Information about the process +* GPGSM OPTION:: Session options. @end menu @@ -1342,6 +1347,7 @@ may be issued as a progress indicator. @node GPGSM LISTKEYS @subsection List available keys + at anchor{gpgsm-cmd listkeys} To list the keys in the internal database or using an external key provider, the command: @@ -1441,6 +1447,23 @@ this requires that the usual escape quoting rules are done. The certificates must be specified unambiguously otherwise an error is returned. + at node GPGSM GETAUDITLOG + at subsection Retrieve an audit log. + at anchor{gpgsm-cmd getauditlog} + +This command is used to retrieve an audit log. + + at example +GETAUDITLOG [--data] [--html] + at end example + +If @option{--data} is used, the audit log is send using D-lines +instead of being sent to the file descriptor given by an OUTPUT +command. If @option{--html} is used, the output is formated as an +XHTML block. This is designed to be incorporated into a HTML +document. + + @node GPGSM GETINFO @subsection Return information about the process @@ -1457,10 +1480,113 @@ Return the version of the program. @item pid Return the process id of the process. @item agent-check -Return success if the agent is running. +Return OK if the agent is running. @item cmd_has_option @var{cmd} @var{opt} -Return success if the command @var{cmd} implements the option @var{opt}. +Return OK if the command @var{cmd} implements the option @var{opt}. The leading two dashes usually used with @var{opt} shall not be given. + at item offline +Return OK if the connection is in offline mode. This may be either +due to a @code{OPTION offline=1} or due to @command{gpgsm} being +started with option @option{--disable-dirmngr}. + at end table + + at node GPGSM OPTION + at subsection Session options. + +The standard Assuan option handler supports these options. + + at example +OPTION @var{name}[=@var{value}] + at end example + +These @var{name}s are recognized: + + at table @code + + at item putenv +Change the session's environment to be passed via gpg-agent to +Pinentry. @var{value} is a string of the form + at code{[=[]]}. If only @code{} is given the +environment variable @code{} is removed from the session +environment, if @code{=} is given that environment variable is +set to the empty string, and if @code{} is given it is set to +that string. + + at item display +Set the session environment variable @code{DISPLAY} is set to @var{value}. + at item ttyname +Set the session environment variable @code{GPG_TTY} is set to @var{value}. + at item ttytype +Set the session environment variable @code{TERM} is set to @var{value}. + at item lc-ctype +Set the session environment variable @code{LC_CTYPE} is set to @var{value}. + at item lc-messages +Set the session environment variable @code{LC_MESSAGES} is set to @var{value}. + at item xauthority +Set the session environment variable @code{XAUTHORITY} is set to @var{value}. + at item pinentry-user-data +Set the session environment variable @code{PINENTRY_USER_DATA} is set +to @var{value}. + + at item include-certs +This option overrides the command line option + at option{--include-certs}. A @var{value} of -2 includes all +certificates except for the root certificate, -1 includes all +certicates, 0 does not include any certicates, 1 includes only the +signers certicate and all other positive values include up to + at var{value} certificates starting with the signer cert. + + at item list-mode + at xref{gpgsm-cmd listkeys}. + + at item list-to-output +If @var{value} is true the output of the list commands +(@pxref{gpgsm-cmd listkeys}) is written to the file descriptor set +with the last OUTPUT command. If @var{value} is false the output is +written via data lines; this is the default. + + at item with-validation +If @var{value} is true for each listed certificate the validation +status is printed. This may result in the download of a CRL or the +user being asked about the trustworthiness of a root certificate. The +default is given by a command line option (@pxref{gpgsm-option +--with-validation}). + + + at item with-secret +If @var{value} is true certificates with a corresponding private key +are marked by the list commands. + + at item validation-model +This option overrides the command line option + at option{validation-model} for the session. +(@pxref{gpgsm-option --validation-model}.) + + at item with-key-data +This option globally enables the command line option + at option{--with-key-data}. (@pxref{gpgsm-option --with-key-data}.) + + at item enable-audit-log +If @var{value} is true data to write an audit log is gathered. +(@pxref{gpgsm-cmd getauditlog}.) + + at item allow-pinentry-notify +If this option is used notifications about the launch of a Pinentry +are passed back to the client. + + at item with-ephemeral-keys +If @var{value} is true ephemeral certificates are included in the +output of the list commands. + + at item no-encrypt-to +If this option is used all keys set by the command line option + at option{--encrypt-to} are ignored. + + at item offline +If @var{value} is true or @var{value} is not given all network access +is disabled for this session. This is the same as the command line +option @option{--disable-dirmngr}. + @end table @mansect see also diff --git a/sm/call-dirmngr.c b/sm/call-dirmngr.c index 8e4841b..bfb80fb 100644 --- a/sm/call-dirmngr.c +++ b/sm/call-dirmngr.c @@ -198,7 +198,7 @@ start_dirmngr_ext (ctrl_t ctrl, assuan_context_t *ctx_r) gpg_error_t err; assuan_context_t ctx; - if (opt.disable_dirmngr) + if (opt.disable_dirmngr || ctrl->offline) return gpg_error (GPG_ERR_NO_DIRMNGR); if (*ctx_r) diff --git a/sm/certchain.c b/sm/certchain.c index 5e7121c..579ca9e 100644 --- a/sm/certchain.c +++ b/sm/certchain.c @@ -957,7 +957,7 @@ is_cert_still_valid (ctrl_t ctrl, int force_ocsp, int lm, estream_t fp, { gpg_error_t err; - if (opt.no_crl_check && !ctrl->use_ocsp) + if (ctrl->offline || (opt.no_crl_check && !ctrl->use_ocsp)) { audit_log_ok (ctrl->audit, AUDIT_CRL_CHECK, gpg_error (GPG_ERR_NOT_ENABLED)); @@ -1749,9 +1749,9 @@ do_validate_chain (ctrl_t ctrl, ksba_cert_t cert, ksba_isotime_t checktime_arg, if (opt.no_policy_check) log_info ("policies not checked due to %s option\n", "--disable-policy-checks"); - if (opt.no_crl_check && !ctrl->use_ocsp) + if (ctrl->offline || (opt.no_crl_check && !ctrl->use_ocsp)) log_info ("CRLs not checked due to %s option\n", - "--disable-crl-checks"); + ctrl->offline ? "offline" : "--disable-crl-checks"); } if (!rc) diff --git a/sm/gpgsm.c b/sm/gpgsm.c index 39c3c40..977494c 100644 --- a/sm/gpgsm.c +++ b/sm/gpgsm.c @@ -2067,6 +2067,7 @@ gpgsm_init_default_ctrl (struct server_control_s *ctrl) ctrl->include_certs = default_include_certs; ctrl->use_ocsp = opt.enable_ocsp; ctrl->validation_model = default_validation_model; + ctrl->offline = opt.disable_dirmngr; } diff --git a/sm/gpgsm.h b/sm/gpgsm.h index 187ed83..9fc74c3 100644 --- a/sm/gpgsm.h +++ b/sm/gpgsm.h @@ -201,6 +201,7 @@ struct server_control_s int validation_model; /* 0 := standard model (shell), 1 := chain model, 2 := STEED model. */ + int offline; /* If true gpgsm won't do any network access. */ }; diff --git a/sm/server.c b/sm/server.c index 0bee5b2..571b079 100644 --- a/sm/server.c +++ b/sm/server.c @@ -309,6 +309,16 @@ option_handler (assuan_context_t ctx, const char *key, const char *value) { ctrl->server_local->no_encrypt_to = 1; } + else if (!strcmp (key, "offline")) + { + /* We ignore this option if gpgsm has been started with + --disable-dirmngr (which also sets offline). */ + if (!opt.disable_dirmngr) + { + int i = *value? !!atoi (value) : 1; + ctrl->offline = i; + } + } else err = gpg_error (GPG_ERR_UNKNOWN_OPTION); @@ -1093,10 +1103,12 @@ static const char hlp_getinfo[] = " pid - Return the process id of the server.\n" " agent-check - Return success if the agent is running.\n" " cmd_has_option CMD OPT\n" - " - Returns OK if the command CMD implements the option OPT."; + " - Returns OK if the command CMD implements the option OPT.\n" + " offline - Returns OK if the conenction is in offline mode."; static gpg_error_t cmd_getinfo (assuan_context_t ctx, char *line) { + ctrl_t ctrl = assuan_get_pointer (ctx); int rc = 0; if (!strcmp (line, "version")) @@ -1113,7 +1125,6 @@ cmd_getinfo (assuan_context_t ctx, char *line) } else if (!strcmp (line, "agent-check")) { - ctrl_t ctrl = assuan_get_pointer (ctx); rc = gpgsm_agent_send_nop (ctrl); } else if (!strncmp (line, "cmd_has_option", 14) @@ -1148,6 +1159,10 @@ cmd_getinfo (assuan_context_t ctx, char *line) } } } + else if (!strcmp (line, "offline")) + { + rc = ctrl->offline? 0 : gpg_error (GPG_ERR_GENERAL); + } else rc = set_error (GPG_ERR_ASS_PARAMETER, "unknown value for WHAT"); ----------------------------------------------------------------------- Summary of changes: doc/gpgsm.texi | 130 +++++++++++++++++++++++++++++++++++++++++++++++++++++- sm/call-dirmngr.c | 2 +- sm/certchain.c | 6 +-- sm/gpgsm.c | 1 + sm/gpgsm.h | 1 + sm/server.c | 19 +++++++- 6 files changed, 151 insertions(+), 8 deletions(-) hooks/post-receive -- The GNU Privacy Guard http://git.gnupg.org From cvs at cvs.gnupg.org Mon Jun 29 12:27:09 2015 From: cvs at cvs.gnupg.org (by Werner Koch) Date: Mon, 29 Jun 2015 12:27:09 +0200 Subject: [git] GnuPG - branch, master, updated. gnupg-2.1.5-29-g7a38733 Message-ID: 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 7a387331645736eaeaaef57770beef5fa741bc22 (commit) from 2c9c46e2a2b8f9a1bdc1ef46a135b5fc7d1a8073 (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 7a387331645736eaeaaef57770beef5fa741bc22 Author: Werner Koch Date: Mon Jun 29 12:24:58 2015 +0200 agent,w32: Do not create a useless socket with --enable-putty-support. * agent/agent.h (opt): Remove field ssh_support. * agent/gpg-agent.c (ssh_support): New. Replace all opt.ssh_support by this. (main): Do not set ssh_support along with setting putty_support. Signed-off-by: Werner Koch diff --git a/agent/agent.h b/agent/agent.h index cabb821..fabe99b 100644 --- a/agent/agent.h +++ b/agent/agent.h @@ -140,9 +140,6 @@ struct int keep_tty; /* Don't switch the TTY (for pinentry) on request */ int keep_display; /* Don't switch the DISPLAY (for pinentry) on request */ - /* This global option enables the ssh-agent subsystem. */ - int ssh_support; - /* This global options indicates the use of an extra socket. Note that we use a hack for cleanup handling in gpg-agent.c: If the value is less than 2 the name has not yet been malloced. */ diff --git a/agent/gpg-agent.c b/agent/gpg-agent.c index b27abe3..b4fab4e 100644 --- a/agent/gpg-agent.c +++ b/agent/gpg-agent.c @@ -280,6 +280,9 @@ static struct debug_flags_s debug_flags [] = #endif +/* Flag indicating that the ssh-agent subsystem has been enabled. */ +static int ssh_support; + #ifdef HAVE_W32_SYSTEM /* Flag indicating that support for Putty has been enabled. */ static int putty_support; @@ -935,11 +938,12 @@ main (int argc, char **argv ) case oKeepTTY: opt.keep_tty = 1; break; case oKeepDISPLAY: opt.keep_display = 1; break; - case oSSHSupport: opt.ssh_support = 1; break; + case oSSHSupport: + ssh_support = 1; + break; case oPuttySupport: # ifdef HAVE_W32_SYSTEM putty_support = 1; - opt.ssh_support = 1; # endif break; @@ -1110,10 +1114,9 @@ main (int argc, char **argv ) GC_OPT_FLAG_NONE|GC_OPT_FLAG_RUNTIME); es_printf ("disable-scdaemon:%lu:\n", GC_OPT_FLAG_NONE|GC_OPT_FLAG_RUNTIME); + es_printf ("enable-ssh-support:%lu:\n", GC_OPT_FLAG_NONE); #ifdef HAVE_W32_SYSTEM es_printf ("enable-putty-support:%lu:\n", GC_OPT_FLAG_NONE); -#else - es_printf ("enable-ssh-support:%lu:\n", GC_OPT_FLAG_NONE); #endif es_printf ("allow-loopback-pinentry:%lu:\n", GC_OPT_FLAG_NONE|GC_OPT_FLAG_RUNTIME); @@ -1209,7 +1212,7 @@ main (int argc, char **argv ) &socket_nonce_browser); } - if (opt.ssh_support) + if (ssh_support) { socket_name_ssh = create_socket_name (GPG_AGENT_SSH_SOCK_NAME, 1); fd_ssh = create_server_socket (socket_name_ssh, 0, @@ -1258,7 +1261,7 @@ main (int argc, char **argv ) #endif /*HAVE_SIGPROCMASK*/ /* Create the SSH info string if enabled. */ - if (opt.ssh_support) + if (ssh_support) { if (asprintf (&infostr_ssh_sock, "SSH_AUTH_SOCK=%s", socket_name_ssh) < 0) @@ -1282,13 +1285,13 @@ main (int argc, char **argv ) *socket_name_extra = 0; if (opt.browser_socket) *socket_name_browser = 0; - if (opt.ssh_support) + if (ssh_support) *socket_name_ssh = 0; if (argc) { /* Run the program given on the commandline. */ - if (opt.ssh_support && (putenv (infostr_ssh_sock) - || putenv (infostr_ssh_valid))) + if (ssh_support && (putenv (infostr_ssh_sock) + || putenv (infostr_ssh_valid))) { log_error ("failed to set environment: %s\n", strerror (errno) ); @@ -1314,7 +1317,7 @@ main (int argc, char **argv ) shell's eval to set it */ if (csh_style) { - if (opt.ssh_support) + if (ssh_support) { *strchr (infostr_ssh_sock, '=') = ' '; es_printf ("setenv %s;\n", infostr_ssh_sock); @@ -1322,13 +1325,13 @@ main (int argc, char **argv ) } else { - if (opt.ssh_support) + if (ssh_support) { es_printf ("%s; export SSH_AUTH_SOCK;\n", infostr_ssh_sock); } } - if (opt.ssh_support) + if (ssh_support) { xfree (infostr_ssh_sock); xfree (infostr_ssh_valid); diff --git a/doc/gpg-agent.texi b/doc/gpg-agent.texi index 737b51b..8e0f1ff 100644 --- a/doc/gpg-agent.texi +++ b/doc/gpg-agent.texi @@ -478,7 +478,9 @@ remote machine. @anchor{option --enable-ssh-support} @item --enable-ssh-support + at itemx --enable-putty-support @opindex enable-ssh-support + at opindex enable-putty-support Enable the OpenSSH Agent protocol. @@ -522,6 +524,12 @@ gpg-connect-agent /bye Adding the @option{--verbose} shows the progress of starting the agent. +The @option{--enable-putty-support} is only available under Windows +and allows the use of gpg-agent with the ssh implementation + at command{putty}. This is similar to the regular ssh-agent support but +makes use of Windows message queue as required by @command{putty}. + + @end table All the long options may also be given in the configuration file after ----------------------------------------------------------------------- Summary of changes: agent/agent.h | 3 --- agent/gpg-agent.c | 27 +++++++++++++++------------ doc/gpg-agent.texi | 8 ++++++++ 3 files changed, 23 insertions(+), 15 deletions(-) hooks/post-receive -- The GNU Privacy Guard http://git.gnupg.org From cvs at cvs.gnupg.org Mon Jun 29 12:53:07 2015 From: cvs at cvs.gnupg.org (by Werner Koch) Date: Mon, 29 Jun 2015 12:53:07 +0200 Subject: [git] GnuPG - branch, master, updated. gnupg-2.1.5-30-g9bca96d Message-ID: 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 9bca96dbc5c32bdd00196462fde8c9ab94aeb28d (commit) from 7a387331645736eaeaaef57770beef5fa741bc22 (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 9bca96dbc5c32bdd00196462fde8c9ab94aeb28d Author: Werner Koch Date: Mon Jun 29 12:50:16 2015 +0200 agent: Add --verify to the PASSWD command. * agent/command.c (cmd_passwd): Add option --verify. -- GnuPG-bug-id: 1951 Signed-off-by: Werner Koch diff --git a/agent/command.c b/agent/command.c index ccd5106..a4932ef 100644 --- a/agent/command.c +++ b/agent/command.c @@ -1691,10 +1691,13 @@ cmd_learn (assuan_context_t ctx, char *line) static const char hlp_passwd[] = - "PASSWD [--cache-nonce=] [--passwd-nonce=] [--preset] \n" + "PASSWD [--cache-nonce=] [--passwd-nonce=] [--preset]\n" + " [--verify] \n" "\n" - "Change the passphrase/PIN for the key identified by keygrip in LINE. When\n" - "--preset is used then the new passphrase will be added to the cache.\n"; + "Change the passphrase/PIN for the key identified by keygrip in LINE. If\n" + "--preset is used then the new passphrase will be added to the cache.\n" + "If --verify is used the command asks for the passphrase and verifies\n" + "that the passphrase valid.\n"; static gpg_error_t cmd_passwd (assuan_context_t ctx, char *line) { @@ -1708,13 +1711,14 @@ cmd_passwd (assuan_context_t ctx, char *line) unsigned char *shadow_info = NULL; char *passphrase = NULL; char *pend; - int opt_preset; + int opt_preset, opt_verify; if (ctrl->restricted) return leave_cmd (ctx, gpg_error (GPG_ERR_FORBIDDEN)); opt_preset = has_option (line, "--preset"); cache_nonce = option_value (line, "--cache-nonce"); + opt_verify = has_option (line, "--verify"); if (cache_nonce) { for (pend = cache_nonce; *pend && !spacep (pend); pend++) @@ -1753,7 +1757,9 @@ cmd_passwd (assuan_context_t ctx, char *line) goto leave; ctrl->in_passwd++; - err = agent_key_from_file (ctrl, cache_nonce, ctrl->server_local->keydesc, + err = agent_key_from_file (ctrl, + opt_verify? NULL : cache_nonce, + ctrl->server_local->keydesc, grip, &shadow_info, CACHE_MODE_IGNORE, NULL, &s_skey, &passphrase); if (err) @@ -1763,6 +1769,10 @@ cmd_passwd (assuan_context_t ctx, char *line) log_error ("changing a smartcard PIN is not yet supported\n"); err = gpg_error (GPG_ERR_NOT_IMPLEMENTED); } + else if (opt_verify) + { + /* All done. */ + } else { char *newpass = NULL; ----------------------------------------------------------------------- Summary of changes: agent/command.c | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) hooks/post-receive -- The GNU Privacy Guard http://git.gnupg.org From cvs at cvs.gnupg.org Mon Jun 29 15:54:54 2015 From: cvs at cvs.gnupg.org (by Neal H. Walfield) Date: Mon, 29 Jun 2015 15:54:54 +0200 Subject: [git] GnuPG - branch, master, updated. gnupg-2.1.5-34-g2778c6f Message-ID: 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 2778c6f8f40d73272075ce04c07097f65c94054e (commit) via 0416aed4abf6cea94458d2e38eb4a5e6bfea2d8b (commit) via 60cf69ff9d61a2cd37fc4468f232fd41aa70a651 (commit) via 68c217f457a772984d0afbdd341f18de7c867505 (commit) from 9bca96dbc5c32bdd00196462fde8c9ab94aeb28d (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 2778c6f8f40d73272075ce04c07097f65c94054e Author: Neal H. Walfield Date: Thu Jun 18 00:10:47 2015 -0300 Show passphrase constraints errors as password prompt errors * agent/agent.h (check_passphrase_constraints): Add parameter failed_constraint and remove parameter silent. Update callers. * agent/genkey.c (check_passphrase_constraints): Add parameter failed_constraint and remove parameter silent. If FAILED_CONSTRAINT is not NULL and OPT.ENFORCE_PASSPHRASE_CONSTRAINTS is FALSE, save the error text in *FAILED_CONSTRAINT and don't call take_this_one_anyway or take_this_one_anyway2. If FAILED_CONSTRAINT is NULL, act as if SILENT was set. (agent_ask_new_passphrase): Change initial_errtext's type from a const char * to a char *. Pass it to check_passphrase_constraints. If it contains malloc's memory, free it. -- Signed-off-by: Neal H. Walfield Based on a patch provided by Watson Yuuma Sato in issue 2018. diff --git a/agent/agent.h b/agent/agent.h index fabe99b..407a2bd 100644 --- a/agent/agent.h +++ b/agent/agent.h @@ -1,5 +1,6 @@ /* agent.h - Global definitions for the agent * Copyright (C) 2001, 2002, 2003, 2005, 2011 Free Software Foundation, Inc. + * Copyright (C) 2015 g10 Code GmbH. * * This file is part of GnuPG. * @@ -412,7 +413,8 @@ int agent_pkdecrypt (ctrl_t ctrl, const char *desc_text, membuf_t *outbuf, int *r_padding); /*-- genkey.c --*/ -int check_passphrase_constraints (ctrl_t ctrl, const char *pw, int silent); +int check_passphrase_constraints (ctrl_t ctrl, const char *pw, + char **failed_constraint); gpg_error_t agent_ask_new_passphrase (ctrl_t ctrl, const char *prompt, char **r_passphrase); int agent_genkey (ctrl_t ctrl, const char *cache_nonce, diff --git a/agent/call-pinentry.c b/agent/call-pinentry.c index ba40f4d..6f4c95b 100644 --- a/agent/call-pinentry.c +++ b/agent/call-pinentry.c @@ -675,7 +675,7 @@ inq_quality (void *opaque, const char *line) else { percent = estimate_passphrase_quality (pin); - if (check_passphrase_constraints (NULL, pin, 1)) + if (check_passphrase_constraints (NULL, pin, NULL)) percent = -percent; snprintf (numbuf, sizeof numbuf, "%d", percent); rc = assuan_send_data (ctx, numbuf, strlen (numbuf)); diff --git a/agent/command.c b/agent/command.c index a4932ef..a69abc5 100644 --- a/agent/command.c +++ b/agent/command.c @@ -1,6 +1,7 @@ /* command.c - gpg-agent command handler * Copyright (C) 2001-2011 Free Software Foundation, Inc. * Copyright (C) 2001-2013 Werner Koch + * Copyright (C) 2015 g10 Code GmbH. * * This file is part of GnuPG. * @@ -1438,7 +1439,7 @@ cmd_get_passphrase (assuan_context_t ctx, char *line) char *p; int opt_data, opt_check, opt_no_ask, opt_qualbar; int opt_repeat = 0; - char *repeat_errtext = NULL; + char *entry_errtext = NULL; if (ctrl->restricted) return leave_cmd (ctx, gpg_error (GPG_ERR_FORBIDDEN)); @@ -1522,15 +1523,16 @@ cmd_get_passphrase (assuan_context_t ctx, char *line) next_try: rc = agent_get_passphrase (ctrl, &response, desc, prompt, - repeat_errtext? repeat_errtext:errtext, + entry_errtext? entry_errtext:errtext, opt_qualbar, cacheid, CACHE_MODE_USER); - xfree (repeat_errtext); - repeat_errtext = NULL; + xfree (entry_errtext); + entry_errtext = NULL; if (!rc) { int i; - if (opt_check && check_passphrase_constraints (ctrl, response, 0)) + if (opt_check + && check_passphrase_constraints (ctrl, response, &entry_errtext)) { xfree (response); goto next_try; @@ -1548,9 +1550,9 @@ cmd_get_passphrase (assuan_context_t ctx, char *line) { xfree (response2); xfree (response); - repeat_errtext = try_percent_escape + entry_errtext = try_percent_escape (_("does not match - try again"), NULL); - if (!repeat_errtext) + if (!entry_errtext) { rc = gpg_error_from_syserror (); break; diff --git a/agent/genkey.c b/agent/genkey.c index 30fc44d..85b8aba 100644 --- a/agent/genkey.c +++ b/agent/genkey.c @@ -1,5 +1,6 @@ /* genkey.c - Generate a keypair * Copyright (C) 2002, 2003, 2004, 2007, 2010 Free Software Foundation, Inc. + * Copyright (C) 2015 g10 Code GmbH. * * This file is part of GnuPG. * @@ -174,10 +175,12 @@ take_this_one_anyway (ctrl_t ctrl, const char *desc) /* Check whether the passphrase PW is suitable. Returns 0 if the passphrase is suitable and true if it is not and the user should be - asked to provide a different one. If SILENT is set, no message are - displayed. */ + asked to provide a different one. If FAILED_CONSTRAINT is set, a + message describing the problem is returned in + *FAILED_CONSTRAINT. */ int -check_passphrase_constraints (ctrl_t ctrl, const char *pw, int silent) +check_passphrase_constraints (ctrl_t ctrl, const char *pw, + char **failed_constraint) { gpg_error_t err = 0; unsigned int minlen = opt.min_passphrase_len; @@ -200,11 +203,16 @@ check_passphrase_constraints (ctrl_t ctrl, const char *pw, int silent) "Please confirm that you do not want to " "have any protection on your key.")); - if (silent) - return gpg_error (GPG_ERR_INV_PASSPHRASE); + err = 1; + if (failed_constraint) + { + if (opt.enforce_passphrase_constraints) + *failed_constraint = xstrdup (desc); + else + err = take_this_one_anyway2 (ctrl, desc, + _("Yes, protection is not needed")); + } - err = take_this_one_anyway2 (ctrl, desc, - _("Yes, protection is not needed")); goto leave; } @@ -212,7 +220,7 @@ check_passphrase_constraints (ctrl_t ctrl, const char *pw, int silent) in in silent mode which returns immediately. */ if (utf8_charcount (pw) < minlen ) { - if (silent) + if (!failed_constraint) { err = gpg_error (GPG_ERR_INV_PASSPHRASE); goto leave; @@ -231,7 +239,7 @@ check_passphrase_constraints (ctrl_t ctrl, const char *pw, int silent) if (nonalpha_count (pw) < minnonalpha ) { - if (silent) + if (!failed_constraint) { err = gpg_error (GPG_ERR_INV_PASSPHRASE); goto leave; @@ -257,7 +265,7 @@ check_passphrase_constraints (ctrl_t ctrl, const char *pw, int silent) if (*pw && opt.check_passphrase_pattern && check_passphrase_pattern (ctrl, pw)) { - if (silent) + if (!failed_constraint) { err = gpg_error (GPG_ERR_INV_PASSPHRASE); goto leave; @@ -273,7 +281,7 @@ check_passphrase_constraints (ctrl_t ctrl, const char *pw, int silent) } } - if (msg1 || msg2 || msg3) + if (failed_constraint && (msg1 || msg2 || msg3)) { char *msg; size_t n; @@ -295,9 +303,14 @@ check_passphrase_constraints (ctrl_t ctrl, const char *pw, int silent) if (n > 3 && !strcmp (msg + n - 3, "%0A")) msg[n-3] = 0; - /* Show error messages. */ - err = take_this_one_anyway (ctrl, msg); - xfree (msg); + err = 1; + if (opt.enforce_passphrase_constraints) + *failed_constraint = msg; + else + { + err = take_this_one_anyway (ctrl, msg); + xfree (msg); + } } leave: @@ -333,7 +346,8 @@ agent_ask_new_passphrase (ctrl_t ctrl, const char *prompt, gpg_error_t err; const char *text1 = prompt; const char *text2 = _("Please re-enter this passphrase"); - const char *initial_errtext = NULL; + char *initial_errtext = NULL; + int initial_errtext_do_free = 0; struct pin_entry_info_s *pi, *pi2; *r_passphrase = NULL; @@ -371,11 +385,17 @@ agent_ask_new_passphrase (ctrl_t ctrl, const char *prompt, next_try: err = agent_askpin (ctrl, text1, NULL, initial_errtext, pi, NULL, 0); + if (initial_errtext_do_free) + { + xfree (initial_errtext); + initial_errtext_do_free = 0; + } initial_errtext = NULL; if (!err) { - if (check_passphrase_constraints (ctrl, pi->pin, 0)) + if (check_passphrase_constraints (ctrl, pi->pin, &initial_errtext)) { + initial_errtext_do_free = 1; pi->failed_tries = 0; pi2->failed_tries = 0; goto next_try; commit 0416aed4abf6cea94458d2e38eb4a5e6bfea2d8b Author: Neal H. Walfield Date: Tue Jun 16 16:16:57 2015 +0200 Improve documentation for default-cache-ttl and default-cache-ttl-ssh. * doc/gpg-agent.texi (Agent Options): Improve documentation for default-cache-ttl and default-cache-ttl-ssh. -- Signed-off-by: Neal H. Walfield diff --git a/doc/gpg-agent.texi b/doc/gpg-agent.texi index 8e0f1ff..4c47072 100644 --- a/doc/gpg-agent.texi +++ b/doc/gpg-agent.texi @@ -328,13 +328,17 @@ control this behaviour but this command line option takes precedence. @item --default-cache-ttl @var{n} @opindex default-cache-ttl -Set the time a cache entry is valid to @var{n} seconds. The default is -600 seconds. +Set the time a cache entry is valid to @var{n} seconds. The default +is 600 seconds. Each time a cache entry is accessed, the entry's +timer is reset. To set an entry's maximum lifetime, use + at command{max-cache-ttl}. @item --default-cache-ttl-ssh @var{n} @opindex default-cache-ttl Set the time a cache entry used for SSH keys is valid to @var{n} -seconds. The default is 1800 seconds. +seconds. The default is 1800 seconds. Each time a cache entry is +accessed, the entry's timer is reset. To set an entry's maximum +lifetime, use @command{max-cache-ttl-ssh}. @item --max-cache-ttl @var{n} @opindex max-cache-ttl commit 60cf69ff9d61a2cd37fc4468f232fd41aa70a651 Author: Neal H. Walfield Date: Tue Jun 16 16:13:51 2015 +0200 Don't raise max-cache-ttl to default-cache-ttl. * agent/gpg-agent.c (finalize_rereadable_options): Don't raise max-cache-ttl to default-cache-ttl. Likewise for max-cache-ttl-ssh and default-cache-ttl-ssh. -- Signed-off-by: Neal H. Walfield This closes issue #2009. diff --git a/agent/gpg-agent.c b/agent/gpg-agent.c index b4fab4e..4c2f678 100644 --- a/agent/gpg-agent.c +++ b/agent/gpg-agent.c @@ -677,12 +677,6 @@ parse_rereadable_options (ARGPARSE_ARGS *pargs, int reread) static void finalize_rereadable_options (void) { - /* It would be too surprising if the max-cache-ttl is lower than the - default-cache-ttl - thus we silently correct that. */ - if (opt.def_cache_ttl > opt.max_cache_ttl) - opt.max_cache_ttl = opt.def_cache_ttl; - if (opt.def_cache_ttl_ssh > opt.max_cache_ttl_ssh) - opt.max_cache_ttl_ssh = opt.def_cache_ttl_ssh; } commit 68c217f457a772984d0afbdd341f18de7c867505 Author: Neal H. Walfield Date: Mon Jun 29 15:50:48 2015 +0200 Improve the description of old packets with an indeterminate length. * g10/parse-packet.c (parse): Make the description more accurate when listing packets: old format packets don't support partial lengths, only indeterminate lengths (RFC 4880, Section 4.2). -- Signed-off-by: Neal H. Walfield diff --git a/g10/parse-packet.c b/g10/parse-packet.c index 3cac6f8..5116404 100644 --- a/g10/parse-packet.c +++ b/g10/parse-packet.c @@ -610,7 +610,7 @@ parse (IOBUF inp, PACKET * pkt, int onlykeypkts, off_t * retpos, if (list_mode) es_fprintf (listfp, "# off=%lu ctb=%02x tag=%d hlen=%d plen=%lu%s%s\n", (unsigned long)pos, ctb, pkttype, hdrlen, pktlen, - partial? " partial":"", + partial? (new_ctb ? " partial" : " indeterminate") :"", new_ctb? " new-ctb":""); pkt->pkttype = pkttype; ----------------------------------------------------------------------- Summary of changes: agent/agent.h | 4 +++- agent/call-pinentry.c | 2 +- agent/command.c | 16 +++++++++------- agent/genkey.c | 52 +++++++++++++++++++++++++++++++++++---------------- agent/gpg-agent.c | 6 ------ doc/gpg-agent.texi | 10 +++++++--- g10/parse-packet.c | 2 +- 7 files changed, 57 insertions(+), 35 deletions(-) hooks/post-receive -- The GNU Privacy Guard http://git.gnupg.org From cvs at cvs.gnupg.org Mon Jun 29 21:33:54 2015 From: cvs at cvs.gnupg.org (by Werner Koch) Date: Mon, 29 Jun 2015 21:33:54 +0200 Subject: [git] GnuPG - branch, master, updated. gnupg-2.1.5-35-gb607657 Message-ID: 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 b6076579311029aa76c00377d9a804b1578bf58f (commit) from 2778c6f8f40d73272075ce04c07097f65c94054e (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 b6076579311029aa76c00377d9a804b1578bf58f Author: Werner Koch Date: Mon Jun 29 21:26:09 2015 +0200 agent: Prepare for Libassuan with Cygwin support. * agent/gpg-agent.c (create_server_socket): Add arg "cygwin". Call assuan_sock_set_flag if Assuan version is recent enough. (main): Create ssh server socket with Cygwin flag set. Signed-off-by: Werner Koch diff --git a/agent/gpg-agent.c b/agent/gpg-agent.c index 4c2f678..c3ab175 100644 --- a/agent/gpg-agent.c +++ b/agent/gpg-agent.c @@ -374,7 +374,7 @@ static int active_connections; */ static char *create_socket_name (char *standard_name, int with_homedir); -static gnupg_fd_t create_server_socket (char *name, int primary, +static gnupg_fd_t create_server_socket (char *name, int primary, int cygwin, char **r_redir_name, assuan_sock_nonce_t *nonce); static void create_directories (void); @@ -1185,14 +1185,14 @@ main (int argc, char **argv ) /* Create the sockets. */ socket_name = create_socket_name (GPG_AGENT_SOCK_NAME, 1); - fd = create_server_socket (socket_name, 1, + fd = create_server_socket (socket_name, 1, 0, &redir_socket_name, &socket_nonce); if (opt.extra_socket) { socket_name_extra = create_socket_name (socket_name_extra, 0); opt.extra_socket = 2; /* Indicate that it has been malloced. */ - fd_extra = create_server_socket (socket_name_extra, 0, + fd_extra = create_server_socket (socket_name_extra, 0, 0, &redir_socket_name_extra, &socket_nonce_extra); } @@ -1201,7 +1201,7 @@ main (int argc, char **argv ) { socket_name_browser = create_socket_name (socket_name_browser, 0); opt.browser_socket = 2; /* Indicate that it has been malloced. */ - fd_browser = create_server_socket (socket_name_browser, 0, + fd_browser = create_server_socket (socket_name_browser, 0, 0, &redir_socket_name_browser, &socket_nonce_browser); } @@ -1209,7 +1209,7 @@ main (int argc, char **argv ) if (ssh_support) { socket_name_ssh = create_socket_name (GPG_AGENT_SSH_SOCK_NAME, 1); - fd_ssh = create_server_socket (socket_name_ssh, 0, + fd_ssh = create_server_socket (socket_name_ssh, 0, 1, &redir_socket_name_ssh, &socket_nonce_ssh); } @@ -1645,9 +1645,10 @@ create_socket_name (char *standard_name, int with_homedir) function needs to be used for the regular socket first (indicated by PRIMARY) and only then for the extra and the ssh sockets. If the socket has been redirected the name of the real socket is - stored as a malloced string at R_REDIR_NAME. */ + stored as a malloced string at R_REDIR_NAME. If CYGWIN is set a + Cygwin compatible socket is created (Windows only). */ static gnupg_fd_t -create_server_socket (char *name, int primary, +create_server_socket (char *name, int primary, int cygwin, char **r_redir_name, assuan_sock_nonce_t *nonce) { struct sockaddr *addr; @@ -1667,6 +1668,13 @@ create_server_socket (char *name, int primary, agent_exit (2); } +#if ASSUAN_VERSION_NUMBER >= 0x020300 /* >= 2.3.0 */ + if (cygwin) + assuan_sock_set_flag (fd, "cygwin", 1); +#else + (void)cygwin; +#endif + unaddr = xmalloc (sizeof *unaddr); addr = (struct sockaddr*)unaddr; diff --git a/g10/gpg.c b/g10/gpg.c index f9d9be3..d446e36 100644 --- a/g10/gpg.c +++ b/g10/gpg.c @@ -1109,7 +1109,6 @@ set_debug (const char *level) { int numok = (level && digitp (level)); int numlvl = numok? atoi (level) : 0; - int i; if (!level) ; ----------------------------------------------------------------------- Summary of changes: agent/gpg-agent.c | 22 +++++++++++++++------- g10/gpg.c | 1 - 2 files changed, 15 insertions(+), 8 deletions(-) hooks/post-receive -- The GNU Privacy Guard http://git.gnupg.org From cvs at cvs.gnupg.org Tue Jun 30 10:37:09 2015 From: cvs at cvs.gnupg.org (by Werner Koch) Date: Tue, 30 Jun 2015 10:37:09 +0200 Subject: [git] GnuPG - branch, master, updated. gnupg-2.1.5-36-g8ae683b Message-ID: 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 8ae683bad3267dd69599b7fa0cf73d74836ec3d4 (commit) from b6076579311029aa76c00377d9a804b1578bf58f (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 8ae683bad3267dd69599b7fa0cf73d74836ec3d4 Author: Werner Koch Date: Tue Jun 30 10:34:56 2015 +0200 agent: Improve a comment. -- diff --git a/agent/call-pinentry.c b/agent/call-pinentry.c index 6f4c95b..37fa0bd 100644 --- a/agent/call-pinentry.c +++ b/agent/call-pinentry.c @@ -442,7 +442,8 @@ start_pinentry (ctrl_t ctrl) Pinentries. An underscore indicates that the next letter should be used as an accelerator. Double the underscore for a literal one. The actual to be translated text starts after - the second vertical bar. */ + the second vertical bar. Note that gpg-agent has been set to + utf-8 so that the strings are in the expected encoding. */ { "ok", N_("|pinentry-label|_OK") }, { "cancel", N_("|pinentry-label|_Cancel") }, { "yes", N_("|pinentry-label|_Yes") }, ----------------------------------------------------------------------- Summary of changes: agent/call-pinentry.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) hooks/post-receive -- The GNU Privacy Guard http://git.gnupg.org From cvs at cvs.gnupg.org Tue Jun 30 11:03:42 2015 From: cvs at cvs.gnupg.org (by Werner Koch) Date: Tue, 30 Jun 2015 11:03:42 +0200 Subject: [git] GnuPG - branch, master, updated. gnupg-2.1.5-37-g010e428 Message-ID: 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 010e4281c3e15e2f86589dd1da419531ead519ef (commit) from 8ae683bad3267dd69599b7fa0cf73d74836ec3d4 (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 010e4281c3e15e2f86589dd1da419531ead519ef Author: Werner Koch Date: Tue Jun 30 11:01:16 2015 +0200 gpg: Make show-sig-subpackets work again. * g10/gpg.c (parse_list_options): Fix offset for subpackets. -- Regression-due-to: 7d0492075ea638607309b3ea6a792b0e95ea7d98 GnuPG-bug-id: 2008 Signed-off-by: Werner Koch diff --git a/g10/gpg.c b/g10/gpg.c index d446e36..10d8c20 100644 --- a/g10/gpg.c +++ b/g10/gpg.c @@ -1876,7 +1876,7 @@ parse_list_options(char *str) compile everywhere, so fill in the show-sig-subpackets argument here. Note that if the parse_options array changes, we'll have to change the subscript here. */ - lopts[12].value=&subpackets; + lopts[13].value=&subpackets; if(parse_options(str,&opt.list_options,lopts,1)) { ----------------------------------------------------------------------- Summary of changes: g10/gpg.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) hooks/post-receive -- The GNU Privacy Guard http://git.gnupg.org From cvs at cvs.gnupg.org Tue Jun 30 11:58:27 2015 From: cvs at cvs.gnupg.org (by Werner Koch) Date: Tue, 30 Jun 2015 11:58:27 +0200 Subject: [git] GnuPG - branch, master, updated. gnupg-2.1.5-39-gd8bc89a Message-ID: 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 d8bc89ab885095441147357501f85624feca14fd (commit) via 740c4af7032fc6da075ba7ab9cb4401ed45d5ab8 (commit) from 010e4281c3e15e2f86589dd1da419531ead519ef (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 d8bc89ab885095441147357501f85624feca14fd Author: Werner Koch Date: Tue Jun 30 11:56:01 2015 +0200 Remove obsolete file g10/comment.c. -- diff --git a/g10/comment.c b/g10/comment.c deleted file mode 100644 index 085dbad..0000000 --- a/g10/comment.c +++ /dev/null @@ -1,108 +0,0 @@ -/* comment.c - write comment stuff - * Copyright (C) 1998, 2003 Free Software Foundation, Inc. - * - * This file is part of GnuPG. - * - * GnuPG 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. - * - * GnuPG 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 . - */ - -#include -#include -#include -#include -#include -#include - -#include "options.h" -#include "packet.h" -#include "status.h" -#include "iobuf.h" -#include "util.h" -#include "main.h" -#include "keydb.h" - - - -int -write_comment( iobuf_t out, const char *s ) -{ - PACKET pkt; - size_t n = strlen(s); - int rc=0; - - pkt.pkttype = PKT_COMMENT; - if( *s != '#' ) { - pkt.pkt.comment = xmalloc ( sizeof *pkt.pkt.comment + n ); - pkt.pkt.comment->len = n+1; - *pkt.pkt.comment->data = '#'; - strcpy(pkt.pkt.comment->data+1, s); - } - else { - pkt.pkt.comment = xmalloc ( sizeof *pkt.pkt.comment + n - 1 ); - pkt.pkt.comment->len = n; - strcpy(pkt.pkt.comment->data, s); - } - if( (rc = build_packet( out, &pkt )) ) - log_error("build_packet(comment) failed: %s\n", gpg_strerror (rc) ); - free_packet( &pkt ); - return rc; -} - - -KBNODE -make_comment_node_from_buffer (const char *s, size_t n) -{ - PACKET *pkt; - - pkt = gcry_xcalloc( 1, sizeof *pkt ); - pkt->pkttype = PKT_COMMENT; - pkt->pkt.comment = gcry_xmalloc( sizeof *pkt->pkt.comment + n - 1 ); - pkt->pkt.comment->len = n; - strcpy(pkt->pkt.comment->data, s); - return new_kbnode( pkt ); -} - -KBNODE -make_comment_node( const char *s ) -{ - return make_comment_node_from_buffer (s, strlen (s)); -} - - -KBNODE -make_mpi_comment_node( const char *s, gcry_mpi_t a ) -{ - PACKET *pkt; - byte *buf, *pp; - size_t n1, nb1; - size_t n = strlen(s); - - nb1 = mpi_get_nbits( a ); - if (gcry_mpi_print (GCRYMPI_FMT_PGP, NULL, 0, &n1, a)) - BUG (); - /* fixme: allocate it on the stack */ - buf = xmalloc (n1); - if (gcry_mpi_print (GCRYMPI_FMT_PGP, buf, n1, &n1, a)) - BUG (); - - pkt = xcalloc (1, sizeof *pkt ); - pkt->pkttype = PKT_COMMENT; - pkt->pkt.comment = xmalloc ( sizeof *pkt->pkt.comment + n + 2 + n1 ); - pkt->pkt.comment->len = n+1+2+n1; - pp = pkt->pkt.comment->data; - memcpy(pp, s, n+1); - memcpy(pp+n+1, buf, n1 ); - xfree (buf); - return new_kbnode( pkt ); -} commit 740c4af7032fc6da075ba7ab9cb4401ed45d5ab8 Author: Werner Koch Date: Tue Jun 30 11:55:17 2015 +0200 doc: Updated HACKING. -- Added used commit keywords. Add some comments to the list of files. diff --git a/doc/HACKING b/doc/HACKING index 252bc42..f60f15d 100644 --- a/doc/HACKING +++ b/doc/HACKING @@ -93,6 +93,23 @@ appear in the ChangeLog. need. If you really need to do it, use a separate commit for such a change. +** Commit log keywords + + - GnuPG-bug-id :: Values are comma or space delimited bug numbers + from bug.gnupg.org pertaining to this commit. + - Debian-bug-id :: Same as above but from the Debian bug tracker. + - CVE-id :: CVE id number pertaining to this commit. + - Regression-due-to :: Commit id of the regression fixed by this commit. + - Fixes-commit :: Commit id this commit fixes. + - Reported-by :: Value is a name or mail address of a bug reporte. + - Suggested-by :: Value is a name or mail address of someone how + suggested this change. + - Co-authored-by :: Name or mail address of a co-author + - Some-comments-by :: Name or mail address of the author of + additional comments (commit log or code). + - Proofread-by :: Sometimes used by translation commits. + - Signed-off-by :: Name or mail address of the developer + * Windows ** How to build an installer for Windows @@ -175,13 +192,11 @@ appear in the ChangeLog. ** Detailed Roadmap - This list of file is not up to date! + This list of files is not up to date! - g10/gpg.c :: Main module with option parsing and all the stuff you - have to do on startup. Also has the exout handler - and some helper functions. - - - g10/sign.c :: Create signature and optionally encrypt + have to do on startup. Also has the exit handler and + some helper functions. - g10/parse-packet.c :: - g10/build-packet.c :: @@ -190,22 +205,21 @@ appear in the ChangeLog. - g10/getkey.c :: Key selection code - g10/pkclist.c :: Build a list of public keys - g10/skclist.c :: Build a list of secret keys - - g10/ringedit.c :: Keyring I/O + - g10/keyring.c :: Keyring access functions - g10/keydb.h :: - - g10/keyid.c :: Helper functions to get the keyid, fingerprint etc. - + - g10/keyid.c :: Helper functions to get the keyid, fingerprint etc. - - g10/trustdb.c :: + - g10/trustdb.c :: Web-of-Trust computations - g10/trustdb.h :: - - g10/tdbdump.c :: Management of the trustdb.gpg - - g10/tdbio.c :: - - g10/tdbio.h :: I/O handling for the trustdb.gpg + - g10/tdbdump.c :: Export/import/list the trustdb.gpg + - g10/tdbio.c :: I/O handling for the trustdb.gpg + - g10/tdbio.h :: - g10/compress.c :: Filter to handle compression - g10/filter.h :: Declarations for all filter functions - g10/delkey.c :: Delete a key - - g10/kbnode.c :: Helper for the KBNODE linked list + - g10/kbnode.c :: Helper for the kbnode_t linked list - g10/main.h :: Prototypes and some constants - g10/mainproc.c :: Message processing - g10/armor.c :: Ascii armor filter @@ -216,33 +230,28 @@ appear in the ChangeLog. - g10/options.h :: Structure with all the command line options and related constants - g10/openfile.c :: Create/Open Files - - g10/hkp.h :: Keyserver access - - g10/hkp.c :: Ditto. + - g10/keyserver.h :: Keyserver access dispatcher. - g10/packet.h :: Defintion of OpenPGP structures. - g10/passphrase.c :: Passphrase handling code - - g10/pubkey-enc.c :: - - g10/seckey-cert.c :: - - g10/seskey.c :: - - g10/import.c :: - - g10/export.c :: - - g10/comment.c :: - - g10/status.c :: - - g10/status.h :: - - g10/sign.c :: - - g10/plaintext.c :: - - g10/encr-data.c :: - - g10/encode.c :: - - g10/revoke.c :: - - g10/keylist.c :: - - g10/sig-check.c :: - - g10/signal.c :: - - g10/helptext.c :: - - g10/verify.c :: - - g10/decrypt.c :: - - g10/keyedit.c :: - - g10/dearmor.c :: - - g10/keygen.c :: + - g10/pubkey-enc.c :: Process a public key encoded packet. + - g10/seckey-cert.c :: Not anymore used + - g10/seskey.c :: Make sesssion keys etc. + - g10/import.c :: Import keys into our key storage. + - g10/export.c :: Export keys to the OpenPGP format. + - g10/sign.c :: Create signature and optionally encrypt. + - g10/plaintext.c :: Process plaintext packets. + - g10/decrypt-data.c :: Decrypt an encrypted data packet + - g10/encrypt.c :: Main encryption driver + - g10/revoke.c :: Create recovation certificates. + - g10/keylist.c :: Print information about OpenPGP keys + - g10/sig-check.c :: Check a signature + - g10/helptext.c :: Show online help texts + - g10/verify.c :: Verify signed data. + - g10/decrypt.c :: Decrypt and verify data. + - g10/keyedit.c :: Edit properties of a key. + - g10/dearmor.c :: Armor utility. + - g10/keygen.c :: Generate a key pair ** Memory allocation @@ -263,7 +272,7 @@ Use only the functions: - xfree -The *secure versions allocated memory in the secure memory. That is, +The *secure versions allocate memory in the secure memory. That is, swapping out of this memory is avoided and is gets overwritten on free. Use this for passphrases, session keys and other sensitive material. This memory set aside for secure memory is linited to a few @@ -294,7 +303,7 @@ worry about this. When it sees a compressed packet it pushes the uncompress filter and the next read byte is one which has already been uncompressed by this filter. Same goes for enciphered packet, plaintext packets and so on. The file g10/encode.c might be a good -staring point to see how it is used - actually this is the other way: +starting point to see how it is used - actually this is the other way: constructing messages using pushed filters but it may be easier to understand. diff --git a/g10/keygen.c b/g10/keygen.c index fa5907d..796d18f 100644 --- a/g10/keygen.c +++ b/g10/keygen.c @@ -1,4 +1,4 @@ -/* keygen.c - generate a key pair +/* keygen.c - Generate a key pair * Copyright (C) 1998-2007, 2009-2011 Free Software Foundation, Inc. * Copyright (C) 2014, 2015 Werner Koch * diff --git a/g10/revoke.c b/g10/revoke.c index 6680ac7..6e82187 100644 --- a/g10/revoke.c +++ b/g10/revoke.c @@ -1,4 +1,4 @@ -/* revoke.c +/* revoke.c - Create recovation certificates. * Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, * 2004 Free Software Foundation, Inc. * ----------------------------------------------------------------------- Summary of changes: doc/HACKING | 87 +++++++++++++++++++++++++--------------------- g10/comment.c | 108 ---------------------------------------------------------- g10/keygen.c | 2 +- g10/revoke.c | 2 +- 4 files changed, 50 insertions(+), 149 deletions(-) delete mode 100644 g10/comment.c hooks/post-receive -- The GNU Privacy Guard http://git.gnupg.org From cvs at cvs.gnupg.org Tue Jun 30 16:07:51 2015 From: cvs at cvs.gnupg.org (by Werner Koch) Date: Tue, 30 Jun 2015 16:07:51 +0200 Subject: [git] Assuan - branch, master, updated. libassuan-2.2.1-5-g87def94 Message-ID: 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 "IPC library used by GnuPG". The branch, master has been updated via 87def94c86d5272c23daf2b5ea446c5553aa1d90 (commit) from cd8face27cc96cb0092c920e6e5bdee81a61c420 (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 87def94c86d5272c23daf2b5ea446c5553aa1d90 Author: Werner Koch Date: Tue Jun 30 16:03:57 2015 +0200 Add assuan_sock_set_flag and assuan_sock_get_flag. * src/assuan-socket.c (_assuan_sock_set_flag): New. (assuan_sock_set_flag): New. (_assuan_sock_get_flag, assuan_sock_get_flag): New. * src/assuan.h.in (assuan_sock_set_flag): New. (assuan_sock_get_flag): New. * src/libassuan.def: Add them. * src/libassuan.vers: Add them. -- These new functions are intended for a Cygwin socket emulation. This commit merely introduces a generic framework. Signed-off-by: Werner Koch diff --git a/NEWS b/NEWS index 2125894..8007b29 100644 --- a/NEWS +++ b/NEWS @@ -1,6 +1,11 @@ -Noteworthy changes in version 2.2.2 (unreleased) [C5/A5/R_] +Noteworthy changes in version 2.3.0 (unreleased) [C5/A5/R_] ------------------------------------------------ + * Interface changes relative to the 2.2.1 release: + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + assuan_sock_set_flag NEW. + assuan_sock_get_flag NEW. + Noteworthy changes in version 2.2.1 (2015-05-12) [C5/A5/R1] ------------------------------------------------ diff --git a/configure.ac b/configure.ac index 9727638..78c25ea 100644 --- a/configure.ac +++ b/configure.ac @@ -31,8 +31,8 @@ min_automake_version="1.14" # for the LT versions. m4_define([mym4_package],[libassuan]) m4_define([mym4_major], [2]) -m4_define([mym4_minor], [2]) -m4_define([mym4_micro], [2]) +m4_define([mym4_minor], [3]) +m4_define([mym4_micro], [0]) # To start a new development series, i.e a new major or minor number # you need to mark an arbitrary commit before the first beta release diff --git a/doc/assuan.texi b/doc/assuan.texi index 10b309c..1c3c2ca 100644 --- a/doc/assuan.texi +++ b/doc/assuan.texi @@ -2046,6 +2046,30 @@ code it may be used on POSIX systems as well, where this function is a nop. @end deftypefun +To control certain properties of the wrapper two additional functions +are provided: + + at deftypefun int assuan_sock_set_flag ( @ + @w{assuan_fd_t @var{fd}}, @ + @w{const char *@var{name}}, @ + @w{int @var{value}}) + +Set the flags @var{name} for socket @var{fd} to @var{value}. See +below for a list of valid names. Returns 0 on success; on failure +sets ERRNO and returns -1. + at end deftypefun + + at deftypefun int assuan_sock_get_flag ( @ + @w{assuan_fd_t @var{fd}}, @ + @w{const char *@var{name}}, @ + @w{int *@var{r_value}}) + +Store the current value of the flag @var{name} for socket @var{fd} at + at var{r_value}. See below for a list of valid names. Returns 0 on +success; on failure sets ERRNO and returns -1. + at end deftypefun + +No flags are defined. @c --------------------------------------------------------------------- diff --git a/src/assuan-socket.c b/src/assuan-socket.c index ed6a488..7bca0ae 100644 --- a/src/assuan-socket.c +++ b/src/assuan-socket.c @@ -1,5 +1,6 @@ -/* assuan-socket.c +/* assuan-socket.c - Socket wrapper Copyright (C) 2004, 2005, 2009 Free Software Foundation, Inc. + Copyright (C) 2001-2015 g10 Code GmbH This file is part of Assuan. @@ -78,6 +79,13 @@ + strlen ((ptr)->sun_path)) #endif +/* In the future, we can allow access to sock_ctx, if that context's + hook functions need to be overridden. There can only be one global + assuan_sock_* user (one library or one application) with this + convenience interface, if non-standard hook functions are + needed. */ +static assuan_context_t sock_ctx; + #ifdef HAVE_W32_SYSTEM @@ -375,6 +383,42 @@ _assuan_sock_new (assuan_context_t ctx, int domain, int type, int proto) int +_assuan_sock_set_flag (assuan_context_t ctx, assuan_fd_t sockfd, + const char *name, int value) +{ + if (0) + { + } + else + { + gpg_err_set_errno (EINVAL); + return -1; + } + + return 0; +} + + +int +_assuan_sock_get_flag (assuan_context_t ctx, assuan_fd_t sockfd, + const char *name, int *r_value) +{ + (void)ctx; + + if (0) + { + } + else + { + gpg_err_set_errno (EINVAL); + return -1; + } + + return 0; +} + + +int _assuan_sock_connect (assuan_context_t ctx, assuan_fd_t sockfd, struct sockaddr *addr, int addrlen) { @@ -695,13 +739,6 @@ _assuan_sock_check_nonce (assuan_context_t ctx, assuan_fd_t fd, /* Public API. */ -/* In the future, we can allow access to sock_ctx, if that context's - hook functions need to be overridden. There can only be one global - assuan_sock_* user (one library or one application) with this - convenience interface, if non-standard hook functions are - needed. */ -static assuan_context_t sock_ctx; - gpg_error_t assuan_sock_init () { @@ -752,6 +789,18 @@ assuan_sock_new (int domain, int type, int proto) } int +assuan_sock_set_flag (assuan_fd_t sockfd, const char *name, int value) +{ + return _assuan_sock_set_flag (sock_ctx, sockfd, name, value); +} + +int +assuan_sock_get_flag (assuan_fd_t sockfd, const char *name, int *r_value) +{ + return _assuan_sock_get_flag (sock_ctx, sockfd, name, r_value); +} + +int assuan_sock_connect (assuan_fd_t sockfd, struct sockaddr *addr, int addrlen) { return _assuan_sock_connect (sock_ctx, sockfd, addr, addrlen); diff --git a/src/assuan.h.in b/src/assuan.h.in index f53c26e..14255ea 100644 --- a/src/assuan.h.in +++ b/src/assuan.h.in @@ -467,6 +467,8 @@ gpg_error_t assuan_sock_init (void); void assuan_sock_deinit (void); int assuan_sock_close (assuan_fd_t fd); assuan_fd_t assuan_sock_new (int domain, int type, int proto); +int assuan_sock_set_flag (assuan_fd_t sockfd, const char *name, int value); +int assuan_sock_get_flag (assuan_fd_t sockfd, const char *name, int *r_value); int assuan_sock_connect (assuan_fd_t sockfd, struct sockaddr *addr, int addrlen); int assuan_sock_bind (assuan_fd_t sockfd, struct sockaddr *addr, int addrlen); diff --git a/src/libassuan.def b/src/libassuan.def index d9997e3..9f31c31 100644 --- a/src/libassuan.def +++ b/src/libassuan.def @@ -112,6 +112,8 @@ EXPORTS __assuan_waitpid @91 assuan_check_version @92 assuan_sock_set_sockaddr_un @93 + assuan_sock_set_flag @94 + assuan_sock_get_flag @95 ; END diff --git a/src/libassuan.vers b/src/libassuan.vers index e36c322..2b2389d 100644 --- a/src/libassuan.vers +++ b/src/libassuan.vers @@ -102,6 +102,8 @@ LIBASSUAN_1.0 { assuan_socket_connect_fd; assuan_check_version; assuan_sock_set_sockaddr_un; + assuan_sock_set_flag; + assuan_sock_get_flag; __assuan_close; __assuan_pipe; ----------------------------------------------------------------------- Summary of changes: NEWS | 7 +++++- configure.ac | 4 ++-- doc/assuan.texi | 24 ++++++++++++++++++++ src/assuan-socket.c | 65 ++++++++++++++++++++++++++++++++++++++++++++++------- src/assuan.h.in | 2 ++ src/libassuan.def | 2 ++ src/libassuan.vers | 2 ++ 7 files changed, 95 insertions(+), 11 deletions(-) hooks/post-receive -- IPC library used by GnuPG http://git.gnupg.org From cvs at cvs.gnupg.org Tue Jun 30 22:01:25 2015 From: cvs at cvs.gnupg.org (by Werner Koch) Date: Tue, 30 Jun 2015 22:01:25 +0200 Subject: [git] GnuPG - branch, master, updated. gnupg-2.1.5-40-ge76d4c0 Message-ID: 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 e76d4c05b24211f3981ab69cddb3fccc17d21e0e (commit) from d8bc89ab885095441147357501f85624feca14fd (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 e76d4c05b24211f3981ab69cddb3fccc17d21e0e Author: Werner Koch Date: Tue Jun 30 21:58:02 2015 +0200 agent: Use different translation func for Pinentry strings. * po/Makevars (XGETTEXT_OPTIONS): Add keyword "L_". * common/i18n.c (i18n_localegettext): New stub. * common/i18n.h: Expand the LunderscoreIMPL macro. * agent/agent.h (L_): New. (LunderscoreIMPL): New. * agent/call-pinentry.c (setup_qualitybar): Add arg ctrl anc change caller. * agent/findkey.c (try_unprotect_cb): Add local var ctrl. * agent/genkey.c (check_passphrase_constraints): Replace xtryasprintf by xtrystrdup to avoid gcc warning. Unfortinately this changes the string. (agent_ask_new_passphrase): Cleanup the use of initial_errtext. -- Static strings in gpg-agent need to be translated according to the locale set by the caller. This is required so that a gpg-agent can be started in one locale and a gpg can be run in another. If we don't do this the static strings (prompt, buttons) are not or in the wrong locale translated while dynamic strings (e.g. key description) uses the locale of gpg. This is only the first part of the change the actual local switching still needs to be implemented. Debian-bug-id: 788983 Signed-off-by: Werner Koch diff --git a/agent/agent.h b/agent/agent.h index 407a2bd..70d63cf 100644 --- a/agent/agent.h +++ b/agent/agent.h @@ -295,6 +295,21 @@ cache_mode_t; typedef int (*lookup_ttl_t)(const char *hexgrip); +/* This is a special version of the usual _() gettext macro. It + assumes a server connection control variable with the name "ctrl" + and uses that to translate a string according to the locale set for + the connection. The macro LunderscoreIMPL is used by i18n to + actually define the inline function when needed. */ +#define L_(a) agent_Lunderscore (ctrl, (a)) +#define LunderscoreIMPL \ + static inline const char * \ + agent_Lunderscore (ctrl_t ctrl, const char *string) \ + { \ + return ctrl? i18n_localegettext (ctrl->lc_messages, string) \ + /* */: gettext (string); \ + } + + /*-- gpg-agent.c --*/ void agent_exit (int rc) GPGRT_GCC_A_NR; /* Also implemented in other tools */ gpg_error_t agent_copy_startup_env (ctrl_t ctrl); diff --git a/agent/call-pinentry.c b/agent/call-pinentry.c index 37fa0bd..f584ee0 100644 --- a/agent/call-pinentry.c +++ b/agent/call-pinentry.c @@ -464,7 +464,7 @@ start_pinentry (ctrl_t ctrl) { if (!opt.allow_external_cache && tbl[idx].what == 1) continue; /* No need for it. */ - s = _(tbl[idx].value); + s = L_(tbl[idx].value); if (*s == '|' && (s2=strchr (s+1,'|'))) s = s2+1; if (asprintf (&optstr, "OPTION default-%s=%s", tbl[idx].key, s) < 0 ) @@ -695,7 +695,7 @@ inq_quality (void *opaque, const char *line) /* Helper for agent_askpin and agent_get_passphrase. */ static int -setup_qualitybar (void) +setup_qualitybar (ctrl_t ctrl) { int rc; char line[ASSUAN_LINELENGTH]; @@ -704,7 +704,7 @@ setup_qualitybar (void) /* TRANSLATORS: This string is displayed by Pinentry as the label for the quality bar. */ - tmpstr = try_percent_escape (_("Quality:"), "\t\r\n\f\v"); + tmpstr = try_percent_escape (L_("Quality:"), "\t\r\n\f\v"); snprintf (line, DIM(line)-1, "SETQUALITYBAR %s", tmpstr? tmpstr:""); line[DIM(line)-1] = 0; xfree (tmpstr); @@ -726,7 +726,7 @@ setup_qualitybar (void) tooltip is limited to about 900 characters. If you do not translate this entry, a default english text (see source) will be used. */ - tooltip = _("pinentry.qualitybar.tooltip"); + tooltip = L_("pinentry.qualitybar.tooltip"); if (!strcmp ("pinentry.qualitybar.tooltip", tooltip)) tooltip = ("The quality of the text entered above.\n" "Please ask your administrator for " @@ -836,11 +836,11 @@ agent_askpin (ctrl_t ctrl, if (!pininfo || pininfo->max_length < 1) return gpg_error (GPG_ERR_INV_VALUE); if (!desc_text && pininfo->min_digits) - desc_text = _("Please enter your PIN, so that the secret key " - "can be unlocked for this session"); + desc_text = L_("Please enter your PIN, so that the secret key " + "can be unlocked for this session"); else if (!desc_text) - desc_text = _("Please enter your passphrase, so that the secret key " - "can be unlocked for this session"); + desc_text = L_("Please enter your passphrase, so that the secret key " + "can be unlocked for this session"); if (prompt_text) is_pin = !!strstr (prompt_text, "PIN"); @@ -877,7 +877,7 @@ agent_askpin (ctrl_t ctrl, return unlock_pinentry (rc); snprintf (line, DIM(line)-1, "SETPROMPT %s", - prompt_text? prompt_text : is_pin? "PIN:" : "Passphrase:"); + prompt_text? prompt_text : is_pin? L_("PIN:") : L_("Passphrase:")); line[DIM(line)-1] = 0; rc = assuan_transact (entry_ctx, line, NULL, NULL, NULL, NULL, NULL, NULL); if (rc) @@ -888,7 +888,7 @@ agent_askpin (ctrl_t ctrl, to the pinentry. */ if (pininfo->with_qualitybar && opt.min_passphrase_len ) { - rc = setup_qualitybar (); + rc = setup_qualitybar (ctrl); if (rc) return unlock_pinentry (rc); } @@ -906,7 +906,7 @@ agent_askpin (ctrl_t ctrl, if (pininfo->with_repeat) { snprintf (line, DIM(line)-1, "SETREPEATERROR %s", - _("does not match - try again")); + L_("does not match - try again")); line[DIM(line)-1] = 0; rc = assuan_transact (entry_ctx, line, NULL, NULL, NULL, NULL, NULL, NULL); @@ -927,7 +927,7 @@ agent_askpin (ctrl_t ctrl, /* TRANSLATORS: The string is appended to an error message in the pinentry. The %s is the actual error message, the two %d give the current and maximum number of tries. */ - snprintf (line, DIM(line)-1, _("SETERROR %s (try %d of %d)"), + snprintf (line, DIM(line)-1, L_("SETERROR %s (try %d of %d)"), errtext, pininfo->failed_tries+1, pininfo->max_tries); line[DIM(line)-1] = 0; rc = assuan_transact (entry_ctx, line, @@ -939,7 +939,7 @@ agent_askpin (ctrl_t ctrl, if (pininfo->with_repeat) { - snprintf (line, DIM(line)-1, "SETREPEAT %s", _("Repeat:")); + snprintf (line, DIM(line)-1, "SETREPEAT %s", L_("Repeat:")); line[DIM(line)-1] = 0; rc = assuan_transact (entry_ctx, line, NULL, NULL, NULL, NULL, NULL, NULL); @@ -969,8 +969,8 @@ agent_askpin (ctrl_t ctrl, rc = gpg_err_make (gpg_err_source (rc), GPG_ERR_FULLY_CANCELED); if (gpg_err_code (rc) == GPG_ERR_ASS_TOO_MUCH_DATA) - errtext = is_pin? _("PIN too long") - : _("Passphrase too long"); + errtext = is_pin? L_("PIN too long") + : L_("Passphrase too long"); else if (rc) return unlock_pinentry (rc); @@ -978,12 +978,12 @@ agent_askpin (ctrl_t ctrl, { /* do some basic checks on the entered PIN. */ if (!all_digitsp (pininfo->pin)) - errtext = _("Invalid characters in PIN"); + errtext = L_("Invalid characters in PIN"); else if (pininfo->max_digits && strlen (pininfo->pin) > pininfo->max_digits) - errtext = _("PIN too long"); + errtext = L_("PIN too long"); else if (strlen (pininfo->pin) < pininfo->min_digits) - errtext = _("PIN too short"); + errtext = L_("PIN too short"); } if (!errtext && pininfo->check_cb) @@ -995,8 +995,7 @@ agent_askpin (ctrl_t ctrl, errtext = pininfo->cb_errtext; else if (gpg_err_code (rc) == GPG_ERR_BAD_PASSPHRASE || gpg_err_code (rc) == GPG_ERR_BAD_PIN) - errtext = (is_pin? _("Bad PIN") - : _("Bad Passphrase")); + errtext = (is_pin? L_("Bad PIN") : L_("Bad Passphrase")); else if (rc) return unlock_pinentry (rc); } @@ -1069,7 +1068,7 @@ agent_get_passphrase (ctrl_t ctrl, return rc; if (!prompt) - prompt = desc && strstr (desc, "PIN")? "PIN": _("Passphrase"); + prompt = desc && strstr (desc, "PIN")? L_("PIN:"): L_("Passphrase:"); /* If we have a KEYINFO string and are normal, user, or ssh cache @@ -1109,7 +1108,7 @@ agent_get_passphrase (ctrl_t ctrl, if (with_qualitybar && opt.min_passphrase_len) { - rc = setup_qualitybar (); + rc = setup_qualitybar (ctrl); if (rc) return unlock_pinentry (rc); } diff --git a/agent/command-ssh.c b/agent/command-ssh.c index a517827..2a3037c 100644 --- a/agent/command-ssh.c +++ b/agent/command-ssh.c @@ -2804,14 +2804,14 @@ data_sign (ctrl_t ctrl, ssh_key_type_spec_t *spec, gcry_sexp_release (key); if (err) goto out; - prompt = xtryasprintf (_("An ssh process requested the use of key%%0A" - " %s%%0A" - " (%s)%%0A" - "Do you want to allow this?"), + prompt = xtryasprintf (L_("An ssh process requested the use of key%%0A" + " %s%%0A" + " (%s)%%0A" + "Do you want to allow this?"), fpr, comment? comment:""); xfree (fpr); gcry_free (comment); - err = agent_get_confirmation (ctrl, prompt, _("Allow"), _("Deny"), 0); + err = agent_get_confirmation (ctrl, prompt, L_("Allow"), L_("Deny"), 0); xfree (prompt); if (err) goto out; @@ -2820,8 +2820,8 @@ data_sign (ctrl_t ctrl, ssh_key_type_spec_t *spec, /* Create signature. */ ctrl->use_auth_call = 1; err = agent_pksign_do (ctrl, NULL, - _("Please enter the passphrase " - "for the ssh key%%0A %F%%0A (%c)"), + L_("Please enter the passphrase " + "for the ssh key%%0A %F%%0A (%c)"), &signature_sexp, CACHE_MODE_SSH, ttl_from_sshcontrol, hash, hashlen); @@ -3059,7 +3059,7 @@ ssh_identity_register (ctrl_t ctrl, ssh_key_type_spec_t *spec, unsigned char *buffer = NULL; size_t buffer_n; char *description = NULL; - const char *description2 = _("Please re-enter this passphrase"); + const char *description2 = L_("Please re-enter this passphrase"); char *comment = NULL; char *key_fpr = NULL; const char *initial_errtext = NULL; @@ -3083,11 +3083,11 @@ ssh_identity_register (ctrl_t ctrl, ssh_key_type_spec_t *spec, goto out; if ( asprintf (&description, - _("Please enter a passphrase to protect" - " the received secret key%%0A" - " %s%%0A" - " %s%%0A" - "within gpg-agent's key storage"), + L_("Please enter a passphrase to protect" + " the received secret key%%0A" + " %s%%0A" + " %s%%0A" + "within gpg-agent's key storage"), key_fpr, comment ? comment : "") < 0) { err = gpg_error_from_syserror (); @@ -3123,7 +3123,7 @@ ssh_identity_register (ctrl_t ctrl, ssh_key_type_spec_t *spec, if (err == -1) { /* The re-entered one did not match and the user did not hit cancel. */ - initial_errtext = _("does not match - try again"); + initial_errtext = L_("does not match - try again"); goto next_try; } } diff --git a/agent/divert-scd.c b/agent/divert-scd.c index 0c287b4..a2da9e7 100644 --- a/agent/divert-scd.c +++ b/agent/divert-scd.c @@ -89,9 +89,9 @@ ask_for_card (ctrl_t ctrl, const unsigned char *shadow_info, char **r_kid) "%s:%%0A%%0A" " \"%.*s\"", no_card - ? _("Please insert the card with serial number") - : _("Please remove the current card and " - "insert the one with serial number"), + ? L_("Please insert the card with serial number") + : L_("Please remove the current card and " + "insert the one with serial number"), want_sn_displen, want_sn) < 0) { rc = out_of_core (); @@ -201,19 +201,19 @@ getpin_cb (void *opaque, const char *info, char *buf, size_t maxbuf) for (s=info+1; s < ends; s++) { if (*s == 'A') - prompt = _("Admin PIN"); + prompt = L_("Admin PIN"); else if (*s == 'P') { /* TRANSLATORS: A PUK is the Personal Unblocking Code used to unblock a PIN. */ - prompt = _("PUK"); + prompt = L_("PUK"); is_puk = 1; } else if (*s == 'N') newpin = 1; else if (*s == 'R') { - prompt = _("Reset Code"); + prompt = L_("Reset Code"); resetcode = 1; } } @@ -239,7 +239,7 @@ getpin_cb (void *opaque, const char *info, char *buf, size_t maxbuf) char *desc; if ( asprintf (&desc, - _("%s%%0A%%0AUse the reader's pinpad for input."), + L_("%s%%0A%%0AUse the reader's pinpad for input."), info) < 0 ) rc = gpg_error_from_syserror (); else @@ -288,18 +288,18 @@ getpin_cb (void *opaque, const char *info, char *buf, size_t maxbuf) pi2->max_tries = 1; rc = agent_askpin (ctrl, (resetcode? - _("Repeat this Reset Code"): + L_("Repeat this Reset Code"): is_puk? - _("Repeat this PUK"): - _("Repeat this PIN")), + L_("Repeat this PUK"): + L_("Repeat this PIN")), prompt, NULL, pi2, NULL, 0); if (!rc && strcmp (pi->pin, pi2->pin)) { again_text = (resetcode? - N_("Reset Code not correctly repeated; try again"): + L_("Reset Code not correctly repeated; try again"): is_puk? - N_("PUK not correctly repeated; try again"): - N_("PIN not correctly repeated; try again")); + L_("PUK not correctly repeated; try again"): + L_("PIN not correctly repeated; try again")); xfree (pi2); xfree (pi); goto again; @@ -311,7 +311,7 @@ getpin_cb (void *opaque, const char *info, char *buf, size_t maxbuf) { char *desc; if ( asprintf (&desc, - _("Please enter the PIN%s%s%s to unlock the card"), + L_("Please enter the PIN%s%s%s to unlock the card"), info? " (":"", info? info:"", info? ")":"") < 0) diff --git a/agent/findkey.c b/agent/findkey.c index 699291d..1ca7f04 100644 --- a/agent/findkey.c +++ b/agent/findkey.c @@ -115,6 +115,7 @@ static int try_unprotect_cb (struct pin_entry_info_s *pi) { struct try_unprotect_arg_s *arg = pi->check_cb_arg; + ctrl_t ctrl = arg->ctrl; size_t dummy; gpg_error_t err; gnupg_isotime_t now, protected_at, tmptime; @@ -123,18 +124,18 @@ try_unprotect_cb (struct pin_entry_info_s *pi) assert (!arg->unprotected_key); arg->change_required = 0; - err = agent_unprotect (arg->ctrl, arg->protected_key, pi->pin, protected_at, + err = agent_unprotect (ctrl, arg->protected_key, pi->pin, protected_at, &arg->unprotected_key, &dummy); if (err) return err; - if (!opt.max_passphrase_days || arg->ctrl->in_passwd) + if (!opt.max_passphrase_days || ctrl->in_passwd) return 0; /* No regular passphrase change required. */ if (!*protected_at) { /* No protection date known - must force passphrase change. */ - desc = xtrystrdup (_("Note: This passphrase has never been changed.%0A" - "Please change it now.")); + desc = xtrystrdup (L_("Note: This passphrase has never been changed.%0A" + "Please change it now.")); if (!desc) return gpg_error_from_syserror (); } @@ -149,8 +150,8 @@ try_unprotect_cb (struct pin_entry_info_s *pi) { /* Passphrase "expired". */ desc = xtryasprintf - (_("This passphrase has not been changed%%0A" - "since %.4s-%.2s-%.2s. Please change it now."), + (L_("This passphrase has not been changed%%0A" + "since %.4s-%.2s-%.2s. Please change it now."), protected_at, protected_at+4, protected_at+6); if (!desc) return gpg_error_from_syserror (); @@ -162,16 +163,16 @@ try_unprotect_cb (struct pin_entry_info_s *pi) /* Change required. */ if (opt.enforce_passphrase_constraints) { - err = agent_get_confirmation (arg->ctrl, desc, - _("Change passphrase"), NULL, 0); + err = agent_get_confirmation (ctrl, desc, + L_("Change passphrase"), NULL, 0); if (!err) arg->change_required = 1; } else { - err = agent_get_confirmation (arg->ctrl, desc, - _("Change passphrase"), - _("I'll change it later"), 0); + err = agent_get_confirmation (ctrl, desc, + L_("Change passphrase"), + L_("I'll change it later"), 0); if (!err) arg->change_required = 1; else if (gpg_err_code (err) == GPG_ERR_CANCELED @@ -1257,8 +1258,8 @@ agent_delete_key (ctrl_t ctrl, const char *desc_text, if (!desc_text) { default_desc = xtryasprintf - ("Do you really want to delete the key identified by keygrip%%0A" - " %s%%0A %%C%%0A?", hexgrip); + (L_("Do you really want to delete the key identified by keygrip%%0A" + " %s%%0A %%C%%0A?"), hexgrip); desc_text = default_desc; } @@ -1281,7 +1282,7 @@ agent_delete_key (ctrl_t ctrl, const char *desc_text, goto leave; err = agent_get_confirmation (ctrl, desc_text_final, - _("Delete key"), _("No"), 0); + L_("Delete key"), L_("No"), 0); if (err) goto leave; @@ -1292,10 +1293,10 @@ agent_delete_key (ctrl_t ctrl, const char *desc_text, { err = agent_get_confirmation (ctrl, - _("Warning: This key is also listed for use with SSH!\n" - "Deleting the key might remove your ability to " - "access remote machines."), - _("Delete key"), _("No"), 0); + L_("Warning: This key is also listed for use with SSH!\n" + "Deleting the key might remove your ability to " + "access remote machines."), + L_("Delete key"), L_("No"), 0); if (err) goto leave; } diff --git a/agent/genkey.c b/agent/genkey.c index 85b8aba..b5dee8e 100644 --- a/agent/genkey.c +++ b/agent/genkey.c @@ -155,13 +155,13 @@ take_this_one_anyway2 (ctrl_t ctrl, const char *desc, const char *anyway_btn) if (opt.enforce_passphrase_constraints) { - err = agent_show_message (ctrl, desc, _("Enter new passphrase")); + err = agent_show_message (ctrl, desc, L_("Enter new passphrase")); if (!err) err = gpg_error (GPG_ERR_CANCELED); } else err = agent_get_confirmation (ctrl, desc, - anyway_btn, _("Enter new passphrase"), 0); + anyway_btn, L_("Enter new passphrase"), 0); return err; } @@ -169,7 +169,7 @@ take_this_one_anyway2 (ctrl_t ctrl, const char *desc, const char *anyway_btn) static int take_this_one_anyway (ctrl_t ctrl, const char *desc) { - return take_this_one_anyway2 (ctrl, desc, _("Take this one anyway")); + return take_this_one_anyway2 (ctrl, desc, L_("Take this one anyway")); } @@ -196,12 +196,12 @@ check_passphrase_constraints (ctrl_t ctrl, const char *pw, if (!*pw) { const char *desc = (opt.enforce_passphrase_constraints? - _("You have not entered a passphrase!%0A" - "An empty passphrase is not allowed.") : - _("You have not entered a passphrase - " - "this is in general a bad idea!%0A" - "Please confirm that you do not want to " - "have any protection on your key.")); + L_("You have not entered a passphrase!%0A" + "An empty passphrase is not allowed.") : + L_("You have not entered a passphrase - " + "this is in general a bad idea!%0A" + "Please confirm that you do not want to " + "have any protection on your key.")); err = 1; if (failed_constraint) @@ -210,7 +210,7 @@ check_passphrase_constraints (ctrl_t ctrl, const char *pw, *failed_constraint = xstrdup (desc); else err = take_this_one_anyway2 (ctrl, desc, - _("Yes, protection is not needed")); + L_("Yes, protection is not needed")); } goto leave; @@ -271,9 +271,8 @@ check_passphrase_constraints (ctrl_t ctrl, const char *pw, goto leave; } - msg3 = xtryasprintf - (_("A passphrase may not be a known term or match%%0A" - "certain pattern.")); + msg3 = xtrystrdup (L_("A passphrase may not be a known term or match%0A" + "certain pattern.")); if (!msg3) { err = gpg_error_from_syserror (); @@ -287,7 +286,7 @@ check_passphrase_constraints (ctrl_t ctrl, const char *pw, size_t n; msg = strconcat - (_("Warning: You have entered an insecure passphrase."), + (L_("Warning: You have entered an insecure passphrase."), "%0A%0A", msg1? msg1 : "", msg1? "%0A" : "", msg2? msg2 : "", msg2? "%0A" : "", @@ -345,9 +344,8 @@ agent_ask_new_passphrase (ctrl_t ctrl, const char *prompt, { gpg_error_t err; const char *text1 = prompt; - const char *text2 = _("Please re-enter this passphrase"); + const char *text2 = L_("Please re-enter this passphrase"); char *initial_errtext = NULL; - int initial_errtext_do_free = 0; struct pin_entry_info_s *pi, *pi2; *r_passphrase = NULL; @@ -385,17 +383,12 @@ agent_ask_new_passphrase (ctrl_t ctrl, const char *prompt, next_try: err = agent_askpin (ctrl, text1, NULL, initial_errtext, pi, NULL, 0); - if (initial_errtext_do_free) - { - xfree (initial_errtext); - initial_errtext_do_free = 0; - } + xfree (initial_errtext); initial_errtext = NULL; if (!err) { if (check_passphrase_constraints (ctrl, pi->pin, &initial_errtext)) { - initial_errtext_do_free = 1; pi->failed_tries = 0; pi2->failed_tries = 0; goto next_try; @@ -408,8 +401,10 @@ agent_ask_new_passphrase (ctrl_t ctrl, const char *prompt, if (err == -1) { /* The re-entered one did not match and the user did not hit cancel. */ - initial_errtext = _("does not match - try again"); - goto next_try; + initial_errtext = xtrystrdup (L_("does not match - try again")); + if (initial_errtext) + goto next_try; + err = gpg_error_from_syserror (); } } } @@ -421,6 +416,8 @@ agent_ask_new_passphrase (ctrl_t ctrl, const char *prompt, if (!*r_passphrase) err = gpg_error_from_syserror (); } + + xfree (initial_errtext); xfree (pi); return err; } @@ -467,8 +464,8 @@ agent_genkey (ctrl_t ctrl, const char *cache_nonce, else { rc = agent_ask_new_passphrase (ctrl, - _("Please enter the passphrase to%0A" - "protect your new key"), + L_("Please enter the passphrase to%0A" + "protect your new key"), &passphrase_buffer); if (rc) return rc; @@ -593,7 +590,7 @@ agent_protect_and_store (ctrl_t ctrl, gcry_sexp_t s_skey, *passphrase_addr = NULL; } err = agent_ask_new_passphrase (ctrl, - _("Please enter the new passphrase"), + L_("Please enter the new passphrase"), &pass); if (!err) err = store_key (s_skey, pass, 1, ctrl->s2k_count); diff --git a/agent/trustlist.c b/agent/trustlist.c index e8f8fff..175ebe4 100644 --- a/agent/trustlist.c +++ b/agent/trustlist.c @@ -651,16 +651,16 @@ agent_marktrusted (ctrl_t ctrl, const char *name, const char *fpr, int flag) plain % sign, you need to encode it as "%%25". The "%s" gets replaced by the name as stored in the certificate. */ - _("Do you ultimately trust%%0A" - " \"%s\"%%0A" - "to correctly certify user certificates?"), + L_("Do you ultimately trust%%0A" + " \"%s\"%%0A" + "to correctly certify user certificates?"), nameformatted); if (!desc) { xfree (nameformatted); return out_of_core (); } - err = agent_get_confirmation (ctrl, desc, _("Yes"), _("No"), 1); + err = agent_get_confirmation (ctrl, desc, L_("Yes"), L_("No"), 1); xfree (desc); if (!err) yes_i_trust = 1; @@ -694,10 +694,10 @@ agent_marktrusted (ctrl_t ctrl, const char *name, const char *fpr, int flag) "%%25". The second "%s" gets replaced by a hexdecimal fingerprint string whereas the first one receives the name as stored in the certificate. */ - _("Please verify that the certificate identified as:%%0A" - " \"%s\"%%0A" - "has the fingerprint:%%0A" - " %s"), nameformatted, fprformatted); + L_("Please verify that the certificate identified as:%%0A" + " \"%s\"%%0A" + "has the fingerprint:%%0A" + " %s"), nameformatted, fprformatted); if (!desc) { xfree (fprformatted); @@ -708,7 +708,7 @@ agent_marktrusted (ctrl_t ctrl, const char *name, const char *fpr, int flag) /* TRANSLATORS: "Correct" is the label of a button and intended to be hit if the fingerprint matches the one of the CA. The other button is "the default "Cancel" of the Pinentry. */ - err = agent_get_confirmation (ctrl, desc, _("Correct"), _("Wrong"), 1); + err = agent_get_confirmation (ctrl, desc, L_("Correct"), L_("Wrong"), 1); xfree (desc); if (gpg_err_code (err) == GPG_ERR_NOT_CONFIRMED) yes_i_trust = 0; diff --git a/common/i18n.c b/common/i18n.c index 202d840..e6d3f5e 100644 --- a/common/i18n.c +++ b/common/i18n.c @@ -113,3 +113,15 @@ i18n_utf8 (const char *string) i18n_switchback (saved); return result; } + + +/* A variant of gettext which allows to specify the local to use for + translating the message. The function assumes that utf-8 is used + for the encoding. FIXME: The locale back and forth switching is + likely very expensive, thus we should consider to implement our own + cache here. */ +const char * +i18n_localegettext (const char *lc_messages, const char *string) +{ + return _(string); +} diff --git a/common/i18n.h b/common/i18n.h index 3b02a6b..8507b8f 100644 --- a/common/i18n.h +++ b/common/i18n.h @@ -42,6 +42,12 @@ void i18n_init (void); char *i18n_switchto_utf8 (void); void i18n_switchback (char *saved_codeset); const char *i18n_utf8 (const char *string); +const char *i18n_localegettext (const char *lc_messages, const char *string); + +/* If a module wants a local L_() fucntion we define it here. */ +#ifdef LunderscoreIMPL +LunderscoreIMPL +#endif #endif /*GNUPG_COMMON_I18N_H*/ diff --git a/po/Makevars b/po/Makevars index b99cd46..485c72c 100644 --- a/po/Makevars +++ b/po/Makevars @@ -8,7 +8,7 @@ subdir = po top_builddir = .. # These options get passed to xgettext. -XGETTEXT_OPTIONS = --keyword=_ --keyword=N_ +XGETTEXT_OPTIONS = --keyword=_ --keyword=N_ --keyword=L_ # This is the copyright holder that gets inserted into the header of the # $(DOMAIN).pot file. Set this to the copyright holder of the surrounding ----------------------------------------------------------------------- Summary of changes: agent/agent.h | 15 +++++++++++++++ agent/call-pinentry.c | 43 +++++++++++++++++++++---------------------- agent/command-ssh.c | 28 ++++++++++++++-------------- agent/divert-scd.c | 28 ++++++++++++++-------------- agent/findkey.c | 37 +++++++++++++++++++------------------ agent/genkey.c | 51 ++++++++++++++++++++++++--------------------------- agent/trustlist.c | 18 +++++++++--------- common/i18n.c | 12 ++++++++++++ common/i18n.h | 6 ++++++ po/Makevars | 2 +- 10 files changed, 135 insertions(+), 105 deletions(-) hooks/post-receive -- The GNU Privacy Guard http://git.gnupg.org From cvs at cvs.gnupg.org Tue Jun 30 22:31:03 2015 From: cvs at cvs.gnupg.org (by Werner Koch) Date: Tue, 30 Jun 2015 22:31:03 +0200 Subject: [git] GnuPG - branch, master, updated. gnupg-2.1.5-41-g232af38 Message-ID: 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 232af382e563fcbe15589a3ccae7d6908a17c44d (commit) from e76d4c05b24211f3981ab69cddb3fccc17d21e0e (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 232af382e563fcbe15589a3ccae7d6908a17c44d Author: Werner Koch Date: Tue Jun 30 22:28:41 2015 +0200 Flag the L_() function with attribute format_arg. * agent/agent.h (LunderscorePROTO): New. * common/util.h (GNUPG_GCC_ATTR_FORMAT_ARG): New. * common/i18n.h (GNUPG_GCC_ATTR_FORMAT_ARG): New. Use for i18n_localegettext. Expand LunderscorePROTO. * agent/genkey.c (check_passphrase_constraints): Use xtryasprintf again to keep the old translations. -- Signed-off-by: Werner Koch diff --git a/agent/agent.h b/agent/agent.h index 70d63cf..2948bff 100644 --- a/agent/agent.h +++ b/agent/agent.h @@ -301,6 +301,10 @@ typedef int (*lookup_ttl_t)(const char *hexgrip); the connection. The macro LunderscoreIMPL is used by i18n to actually define the inline function when needed. */ #define L_(a) agent_Lunderscore (ctrl, (a)) +#define LunderscorePROTO \ + static inline const char *agent_Lunderscore (ctrl_t ctrl, \ + const char *string) \ + GNUPG_GCC_ATTR_FORMAT_ARG(2); #define LunderscoreIMPL \ static inline const char * \ agent_Lunderscore (ctrl_t ctrl, const char *string) \ diff --git a/agent/genkey.c b/agent/genkey.c index b5dee8e..df17880 100644 --- a/agent/genkey.c +++ b/agent/genkey.c @@ -271,8 +271,9 @@ check_passphrase_constraints (ctrl_t ctrl, const char *pw, goto leave; } - msg3 = xtrystrdup (L_("A passphrase may not be a known term or match%0A" - "certain pattern.")); + msg3 = xtryasprintf + (L_("A passphrase may not be a known term or match%%0A" + "certain pattern.")); if (!msg3) { err = gpg_error_from_syserror (); diff --git a/common/i18n.h b/common/i18n.h index 8507b8f..45710b2 100644 --- a/common/i18n.h +++ b/common/i18n.h @@ -38,14 +38,24 @@ # endif #endif /*!USE_SIMPLE_GETTEXT*/ +#ifndef GNUPG_GCC_ATTR_FORMAT_ARG +#if __GNUC__ >= 3 /* Actually 2.8 but testing the major is easier. */ +# define GNUPG_GCC_ATTR_FORMAT_ARG(a) __attribute__ ((__format_arg__ (a))) +#else +# define GNUPG_GCC_ATTR_FORMAT_ARG(a) +#endif +#endif + void i18n_init (void); char *i18n_switchto_utf8 (void); void i18n_switchback (char *saved_codeset); const char *i18n_utf8 (const char *string); -const char *i18n_localegettext (const char *lc_messages, const char *string); +const char *i18n_localegettext (const char *lc_messages, const char *string) + GNUPG_GCC_ATTR_FORMAT_ARG(2); /* If a module wants a local L_() fucntion we define it here. */ #ifdef LunderscoreIMPL +LunderscorePROTO LunderscoreIMPL #endif diff --git a/common/util.h b/common/util.h index d5ddc1f..b92d78c 100644 --- a/common/util.h +++ b/common/util.h @@ -153,6 +153,14 @@ /* GCC attributes. */ +#ifndef GNUPG_GCC_ATTR_FORMAT_ARG +#if __GNUC__ >= 3 /* Actually 2.8 but testing the major is easier. */ +# define GNUPG_GCC_ATTR_FORMAT_ARG(a) __attribute__ ((__format_arg__ (a))) +#else +# define GNUPG_GCC_ATTR_FORMAT_ARG(a) +#endif +#endif + #if __GNUC__ >= 4 # define GNUPG_GCC_A_SENTINEL(a) __attribute__ ((sentinel(a))) #else ----------------------------------------------------------------------- Summary of changes: agent/agent.h | 4 ++++ agent/genkey.c | 5 +++-- common/i18n.h | 12 +++++++++++- common/util.h | 8 ++++++++ 4 files changed, 26 insertions(+), 3 deletions(-) hooks/post-receive -- The GNU Privacy Guard http://git.gnupg.org From cvs at cvs.gnupg.org Tue Jun 30 22:43:02 2015 From: cvs at cvs.gnupg.org (by Daniel Kahn Gillmor) Date: Tue, 30 Jun 2015 22:43:02 +0200 Subject: [git] GnuPG - branch, master, updated. gnupg-2.1.5-42-g8168249 Message-ID: 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 816824953c91959c23a57c047bdba6a902ffdde6 (commit) from 232af382e563fcbe15589a3ccae7d6908a17c44d (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 816824953c91959c23a57c047bdba6a902ffdde6 Author: Daniel Kahn Gillmor Date: Tue Jun 30 12:41:29 2015 -0400 Pass DBUS_SESSION_BUS_ADDRESS for gnome3 * common/session-env.c (stdenvnames): Add DBUS_SESSION_BUS_ADDRESS. -- pinentry-gnome3 talks to the gcr prompter via dbus. Without this environment variable, it can't find the correct session to talk to. diff --git a/common/session-env.c b/common/session-env.c index c0500ea..171bf8f 100644 --- a/common/session-env.c +++ b/common/session-env.c @@ -72,6 +72,8 @@ static struct modules (eg "@im=SCIM"). */ { "GTK_IM_MODULE" }, /* Used by gtk to select gtk input modules (eg "scim-bridge"). */ + { "DBUS_SESSION_BUS_ADDRESS" },/* Used by GNOME3 to talk to gcr over + dbus */ { "QT_IM_MODULE" }, /* Used by Qt to select qt input modules (eg "xim"). */ { "INSIDE_EMACS" }, /* Set by Emacs before running a ----------------------------------------------------------------------- Summary of changes: common/session-env.c | 2 ++ 1 file changed, 2 insertions(+) hooks/post-receive -- The GNU Privacy Guard http://git.gnupg.org