From cvs at cvs.gnupg.org Mon Mar 3 15:20:30 2008 From: cvs at cvs.gnupg.org (svn author marcus) Date: Mon, 03 Mar 2008 15:20:30 +0100 Subject: [svn] pinentry - r181 - in trunk: . gtk+-2 Message-ID: Author: marcus Date: 2008-03-03 15:20:29 +0100 (Mon, 03 Mar 2008) New Revision: 181 Modified: trunk/ChangeLog trunk/NEWS trunk/gtk+-2/pinentry-gtk-2.c Log: 2008-03-03 Marcus Brinkmann * gtk+-2/pinentry-gtk-2.c (create_window): Install realize callback. (ungrab_keyboard): Unmake dialog transient. (make_transient): New function. Submitted by Joachim Breitner. Modified: trunk/ChangeLog =================================================================== --- trunk/ChangeLog 2008-02-15 10:48:34 UTC (rev 180) +++ trunk/ChangeLog 2008-03-03 14:20:29 UTC (rev 181) @@ -1,3 +1,10 @@ +2008-03-03 Marcus Brinkmann + + * gtk+-2/pinentry-gtk-2.c (create_window): Install realize callback. + (ungrab_keyboard): Unmake dialog transient. + (make_transient): New function. + Submitted by Joachim Breitner. + 2008-02-15 Werner Koch Release 0.7.4. Modified: trunk/NEWS =================================================================== --- trunk/NEWS 2008-02-15 10:48:34 UTC (rev 180) +++ trunk/NEWS 2008-03-03 14:20:29 UTC (rev 181) @@ -1,6 +1,7 @@ Noteworthy changes in version 0.7.6 ------------------------------------------------ + * Make Gtk+-2 pinentry transient to the root window. Noteworthy changes in version 0.7.5 (2008-02-15) ------------------------------------------------ Modified: trunk/gtk+-2/pinentry-gtk-2.c =================================================================== --- trunk/gtk+-2/pinentry-gtk-2.c 2008-02-15 10:48:34 UTC (rev 180) +++ trunk/gtk+-2/pinentry-gtk-2.c 2008-03-03 14:20:29 UTC (rev 181) @@ -93,23 +93,56 @@ GDK_HINT_MIN_SIZE | GDK_HINT_MAX_SIZE); } + +/* Realize the window as transient if we grab the keyboard. This + makes the window a modal dialog to the root window, which helps the + window manager. See the following quote from: + http://standards.freedesktop.org/wm-spec/wm-spec-1.4.html#id2512420 + Implementing enhanced support for application transient windows + + If the WM_TRANSIENT_FOR property is set to None or Root window, the + window should be treated as a transient for all other windows in + the same group. It has been noted that this is a slight ICCCM + violation, but as this behavior is pretty standard for many + toolkits and window managers, and is extremely unlikely to break + anything, it seems reasonable to document it as standard. */ + +static void +make_transient (GtkWidget *win, GdkEvent *event, gpointer data) +{ + GdkScreen *screen; + GdkWindow *root; + + if (! pinentry->grab) + return; + + /* Make window transient for the root window. */ + screen = gdk_screen_get_default (); + root = gdk_screen_get_root_window (screen); + gdk_window_set_transient_for (win->window, root); +} + + /* Grab the keyboard for maximum security */ static void grab_keyboard (GtkWidget *win, GdkEvent *event, gpointer data) { - if (!pinentry->grab) + if (! pinentry->grab) return; if (gdk_keyboard_grab (win->window, FALSE, gdk_event_get_time (event))) g_error ("could not grab keyboard"); } + /* Remove grab. */ static void ungrab_keyboard (GtkWidget *win, GdkEvent *event, gpointer data) { gdk_keyboard_ungrab (gdk_event_get_time (event)); + /* Unmake window transient for the root window. */ + gdk_window_set_transient_for (win->window, NULL); } @@ -260,6 +293,10 @@ G_CALLBACK (constrain_size), NULL); if (!confirm_mode) { + if (pinentry->grab) + g_signal_connect (G_OBJECT (win), + "realize", G_CALLBACK (make_transient), NULL); + g_signal_connect (G_OBJECT (win), pinentry->grab ? "map-event" : "focus-in-event", G_CALLBACK (grab_keyboard), NULL); From cvs at cvs.gnupg.org Wed Mar 5 11:08:11 2008 From: cvs at cvs.gnupg.org (svn author wk) Date: Wed, 05 Mar 2008 11:08:11 +0100 Subject: [svn] GnuPG - r4702 - in trunk: doc tools Message-ID: Author: wk Date: 2008-03-05 11:08:10 +0100 (Wed, 05 Mar 2008) New Revision: 4702 Modified: trunk/doc/ChangeLog trunk/doc/debugging.texi trunk/doc/gpg.texi trunk/doc/tools.texi trunk/tools/ChangeLog trunk/tools/gpg-connect-agent.c Log: Add IF command and new variable functions to gpg-connect-agent. Modified: trunk/doc/ChangeLog =================================================================== --- trunk/doc/ChangeLog 2008-02-27 17:32:47 UTC (rev 4701) +++ trunk/doc/ChangeLog 2008-03-05 10:08:10 UTC (rev 4702) @@ -2,6 +2,10 @@ * tools.texi (Listing options): Document new types. +2008-02-26 Werner Koch + + * gpg.texi (GPG Configuration Options): Mention rfc4398. + 2008-02-05 David Shaw * gpg.texi (GPG Esoteric Options): Tweak mention of Tempest font Modified: trunk/tools/ChangeLog =================================================================== --- trunk/tools/ChangeLog 2008-02-27 17:32:47 UTC (rev 4701) +++ trunk/tools/ChangeLog 2008-03-05 10:08:10 UTC (rev 4702) @@ -1,3 +1,10 @@ +2008-03-05 Werner Koch + + * gpg-connect-agent.c (arithmetic_op): Add logical not, or and and. + (get_var_ext): Add functions errcode, errsource and errstring. + (read_and_print_response): Store server reply in $? variable. + (main): Implement IF command. + 2008-02-27 Marcus Brinkmann * gpgconf-comp.c (option_check_validity): For now, error out on Modified: trunk/doc/debugging.texi =================================================================== --- trunk/doc/debugging.texi 2008-02-27 17:32:47 UTC (rev 4701) +++ trunk/doc/debugging.texi 2008-03-05 10:08:10 UTC (rev 4702) @@ -16,7 +16,8 @@ @menu -* Debugging Tools:: Description of some useful tools +* Debugging Tools:: Description of some useful tools. +* Debugging Hints:: Various hints on debugging. * Common Problems:: Commonly seen problems. * Architecture Details:: How the whole thing works internally. @end menu @@ -84,10 +85,28 @@ @samp{kbxutil --find-dups ~/.gnupg/pubring.kbx} + at node Debugging Hints + at section Various hints on debugging. + at itemize @bullet + at item How to find the IP address of a keyserver +If a round robin URL of is used for a keyserver +(e.g. subkeys.gnupg.org); it is not easy to see what server is actually +used. Using the keyserver debug option as in + at smallexample + gpg --keyserver-options debug=1 -v --refresh-key 1E42B367 + at end smallexample + +is thus often helpful. Note that the actual output depends on the +backend and may change from release to release. + + + at end itemize + + @node Common Problems @section Commonly Seen Problems Modified: trunk/doc/gpg.texi =================================================================== --- trunk/doc/gpg.texi 2008-02-27 17:32:47 UTC (rev 4701) +++ trunk/doc/gpg.texi 2008-03-05 10:08:10 UTC (rev 4702) @@ -1311,8 +1311,7 @@ @table @asis @item cert -locate a key using DNS CERT, as specified in 2538bis (currently in -draft): http://www.josefsson.org/rfc2538bis/ +locate a key using DNS CERT, as specified in rfc4398. @item pka locate a key using DNS PKA. Modified: trunk/doc/tools.texi =================================================================== --- trunk/doc/tools.texi 2008-02-27 17:32:47 UTC (rev 4701) +++ trunk/doc/tools.texi 2008-03-05 10:08:10 UTC (rev 4702) @@ -1215,15 +1215,30 @@ linefeeds, carriage returns and colons are escaped. @code{percent+} also maps spaces to plus signs. + at item errcode @var{arg} + at itemx errsource @var{arg} + at itemx errstring @var{arg} +Assume @var{arg} is an integer and evaluate it using @code{strtol}. Return +the gpg-error error code, error source or a formatted string with the +error code and error source. + + @item + @itemx - - at item * - at item / - at item % + at itemx * + at itemx / + at itemx % Evaluate all arguments as long integers using @code{strtol} and apply this operator. A division by zero yields an empty string. + at item ! + at itemx | + at itemx & +Evaluate all arguments as long integers using @code{strtol} and apply +the logical oeprators NOT, OR or AND. The NOT operator works on the +last argument only. + @end table Modified: trunk/tools/gpg-connect-agent.c =================================================================== --- trunk/tools/gpg-connect-agent.c 2008-02-27 17:32:47 UTC (rev 4701) +++ trunk/tools/gpg-connect-agent.c 2008-03-05 10:08:10 UTC (rev 4702) @@ -1,5 +1,5 @@ /* gpg-connect-agent.c - Tool to connect to the agent. - * Copyright (C) 2005, 2007 Free Software Foundation, Inc. + * Copyright (C) 2005, 2007, 2008 Free Software Foundation, Inc. * * This file is part of GnuPG. * @@ -416,6 +416,9 @@ result = strtol (operands, NULL, 0); while (*operands && !spacep (operands) ) operands++; + if (operator == '!') + result = !result; + while (*operands) { while ( spacep (operands) ) @@ -440,6 +443,9 @@ return NULL; result %= value; break; + case '!': result = !value; break; + case '|': result = result || value; break; + case '&': result = result && value; break; default: log_error ("unknown arithmetic operator `%c'\n", operator); return NULL; @@ -452,7 +458,7 @@ /* Extended version of get_var. This returns a malloced string and - understand the fucntion syntax: "func args". + understand the function syntax: "func args". Defined functions are @@ -486,6 +492,16 @@ linefeeds and carriage returns are also escaped. "percent+" also maps spaces to plus characters. + errcode ARG + Assuming ARG is an integer, return the gpg-error code. + + errsource ARG + Assuming ARG is an integer, return the gpg-error source. + + errstring ARG + Assuming ARG is an integer return a formatted fpf error string. + + Example: get_var_ext ("get sysconfdir") -> "/etc/gnupg" */ @@ -497,6 +513,7 @@ char *result; char *p; char *free_me = NULL; + int intvalue; if (recursion_count > 50) { @@ -538,11 +555,7 @@ else if (!strcmp (s, "datadir")) result = xstrdup (gnupg_datadir ()); else if (!strcmp (s, "serverpid")) - { - char numbuf[30]; - snprintf (numbuf, sizeof numbuf, "%d", (int)server_pid); - result = xstrdup (numbuf); - } + result = xasprintf ("%d", (int)server_pid); else { log_error ("invalid argument `%s' for variable function `get'\n", s); @@ -579,8 +592,27 @@ if (*p == ' ') *p = '+'; } - else if ( (s - name) == 1 && strchr ("+-*/%", *name)) + else if ( (s - name) == 7 && !strncmp (name, "errcode", 7)) { + s++; + intvalue = (int)strtol (s, NULL, 0); + result = xasprintf ("%d", gpg_err_code (intvalue)); + } + else if ( (s - name) == 9 && !strncmp (name, "errsource", 9)) + { + s++; + intvalue = (int)strtol (s, NULL, 0); + result = xasprintf ("%d", gpg_err_source (intvalue)); + } + else if ( (s - name) == 9 && !strncmp (name, "errstring", 9)) + { + s++; + intvalue = (int)strtol (s, NULL, 0); + result = xasprintf ("%s <%s>", + gpg_strerror (intvalue), gpg_strsource (intvalue)); + } + else if ( (s - name) == 1 && strchr ("+-*/%!|&", *name)) + { result = arithmetic_op (*name, s+1); } else @@ -1098,6 +1130,7 @@ loopline_t *tail; loopline_t current; unsigned int nestlevel; + int oneshot; char *condition; } loopstack[20]; int loopidx; @@ -1523,7 +1556,7 @@ { if (loopidx+2 >= (int)DIM(loopstack)) { - log_error ("loops are nested too deep\n"); + log_error ("blocks are nested too deep\n"); /* We should better die or break all loop in this case as recovering from this error won't be easy. */ @@ -1534,10 +1567,31 @@ loopstack[loopidx+1].tail = &loopstack[loopidx+1].head; loopstack[loopidx+1].current = NULL; loopstack[loopidx+1].nestlevel = 1; + loopstack[loopidx+1].oneshot = 0; loopstack[loopidx+1].condition = xstrdup (p); loopstack[loopidx+1].collecting = 1; } } + else if (!strcmp (cmd, "if")) + { + if (loopidx+2 >= (int)DIM(loopstack)) + { + log_error ("blocks are nested too deep\n"); + } + else + { + /* Note that we need to evaluate the condition right + away and not just at the end of the block as we + do with a WHILE. */ + loopstack[loopidx+1].head = NULL; + loopstack[loopidx+1].tail = &loopstack[loopidx+1].head; + loopstack[loopidx+1].current = NULL; + loopstack[loopidx+1].nestlevel = 1; + loopstack[loopidx+1].oneshot = 1; + loopstack[loopidx+1].condition = substitute_line_copy (p); + loopstack[loopidx+1].collecting = 1; + } + } else if (!strcmp (cmd, "end")) { if (loopidx < 0) @@ -1550,6 +1604,11 @@ /* Evaluate the condition. */ tmpcond = xstrdup (loopstack[loopidx].condition); + if (loopstack[loopidx].oneshot) + { + xfree (loopstack[loopidx].condition); + loopstack[loopidx].condition = xstrdup ("0"); + } tmpline = substitute_line (tmpcond); value = tmpline? tmpline : tmpcond; condition = strtol (value, NULL, 0); @@ -1574,6 +1633,7 @@ loopstack[loopidx].current = NULL; loopstack[loopidx].nestlevel = 0; loopstack[loopidx].collecting = 0; + loopstack[loopidx].oneshot = 0; xfree (loopstack[loopidx].condition); loopstack[loopidx].condition = NULL; loopidx--; @@ -1610,8 +1670,9 @@ "/[no]decode Enable decoding of received data lines.\n" "/[no]subst Enable varibale substitution.\n" "/run FILE Run commands from FILE.\n" +"/if VAR Begin conditional block controlled by VAR.\n" "/while VAR Begin loop controlled by VAR.\n" -"/end End loop.\n" +"/end End loop or condition\n" "/bye Terminate gpg-connect-agent.\n" "/help Print this help."); } @@ -1885,12 +1946,19 @@ { fwrite (line, linelen, 1, stdout); putchar ('\n'); + set_int_var ("?", 0); return 0; } else if (linelen >= 3 && line[0] == 'E' && line[1] == 'R' && line[2] == 'R' && (line[3] == '\0' || line[3] == ' ')) { + int errval; + + errval = strtol (line+3, NULL, 10); + if (!errval) + errval = -1; + set_int_var ("?", errval); fwrite (line, linelen, 1, stdout); putchar ('\n'); *r_goterr = 1; From cvs at cvs.gnupg.org Wed Mar 5 13:01:00 2008 From: cvs at cvs.gnupg.org (svn author marcus) Date: Wed, 05 Mar 2008 13:01:00 +0100 Subject: [svn] gpgme - r1305 - trunk/doc Message-ID: Author: marcus Date: 2008-03-05 13:00:57 +0100 (Wed, 05 Mar 2008) New Revision: 1305 Modified: trunk/doc/ChangeLog trunk/doc/gpgme.texi Log: 2008-03-05 Marcus Brinkmann * gpgme.texi (Library Version Check): Rename snippet function to init_gpgme. (I/O Callback Example): Call it here. Modified: trunk/doc/ChangeLog =================================================================== --- trunk/doc/ChangeLog 2008-02-15 23:07:29 UTC (rev 1304) +++ trunk/doc/ChangeLog 2008-03-05 12:00:57 UTC (rev 1305) @@ -1,3 +1,9 @@ +2008-03-05 Marcus Brinkmann + + * gpgme.texi (Library Version Check): Rename snippet function to + init_gpgme. + (I/O Callback Example): Call it here. + 2008-01-28 Marcus Brinkmann * gpgme.texi: Document that data encoding affects some output data Modified: trunk/doc/gpgme.texi =================================================================== --- trunk/doc/gpgme.texi 2008-02-15 23:07:29 UTC (rev 1304) +++ trunk/doc/gpgme.texi 2008-03-05 12:00:57 UTC (rev 1305) @@ -608,7 +608,7 @@ #include void -init_program (void) +init_gpgme (void) @{ /* Initialize the locale environment. */ setlocale (LC_ALL, ""); @@ -5222,6 +5222,8 @@ &result @}; + init_gpgme (void); + /* Initialize the loop structure. */ loop.lock = PTHREAD_MUTEX_INITIALIZER; for (i = 0; i < MAX_FDS; i++) From cvs at cvs.gnupg.org Wed Mar 5 20:58:43 2008 From: cvs at cvs.gnupg.org (svn author marcus) Date: Wed, 05 Mar 2008 20:58:43 +0100 Subject: [svn] gpgme - r1306 - trunk/gpgme Message-ID: Author: marcus Date: 2008-03-05 20:58:41 +0100 (Wed, 05 Mar 2008) New Revision: 1306 Modified: trunk/gpgme/ChangeLog trunk/gpgme/decrypt.c trunk/gpgme/encrypt.c Log: 2008-03-05 Marcus Brinkmann * decrypt.c (release_op_data): Release OPD->result.recipients. * encrypt.c (release_op_data): Release invalid_recipient. Modified: trunk/gpgme/ChangeLog =================================================================== --- trunk/gpgme/ChangeLog 2008-03-05 12:00:57 UTC (rev 1305) +++ trunk/gpgme/ChangeLog 2008-03-05 19:58:41 UTC (rev 1306) @@ -1,3 +1,8 @@ +2008-03-05 Marcus Brinkmann + + * decrypt.c (release_op_data): Release OPD->result.recipients. + * encrypt.c (release_op_data): Release invalid_recipient. + 2008-02-15 Marcus Brinkmann * engine-gpgconf.c (gpgconf_read): Fix end-of-line handline. Modified: trunk/gpgme/decrypt.c =================================================================== --- trunk/gpgme/decrypt.c 2008-03-05 12:00:57 UTC (rev 1305) +++ trunk/gpgme/decrypt.c 2008-03-05 19:58:41 UTC (rev 1306) @@ -50,12 +50,20 @@ release_op_data (void *hook) { op_data_t opd = (op_data_t) hook; + gpgme_recipient_t recipient = opd->result.recipients; if (opd->result.unsupported_algorithm) free (opd->result.unsupported_algorithm); if (opd->result.file_name) free (opd->result.file_name); + + while (recipient) + { + gpgme_recipient_t next = recipient->next; + free (recipient); + recipient = next; + } } Modified: trunk/gpgme/encrypt.c =================================================================== --- trunk/gpgme/encrypt.c 2008-03-05 12:00:57 UTC (rev 1305) +++ trunk/gpgme/encrypt.c 2008-03-05 19:58:41 UTC (rev 1306) @@ -53,6 +53,7 @@ gpgme_invalid_key_t next = invalid_recipient->next; if (invalid_recipient->fpr) free (invalid_recipient->fpr); + free (invalid_recipient); invalid_recipient = next; } } From cvs at cvs.gnupg.org Thu Mar 6 15:54:12 2008 From: cvs at cvs.gnupg.org (svn author marcus) Date: Thu, 06 Mar 2008 15:54:12 +0100 Subject: [svn] gpgme - r1307 - trunk/gpgme Message-ID: Author: marcus Date: 2008-03-06 15:54:11 +0100 (Thu, 06 Mar 2008) New Revision: 1307 Modified: trunk/gpgme/ChangeLog trunk/gpgme/key.c Log: 2008-03-06 Marcus Brinkmann * key.c (_gpgme_key_add_sig): Terminate UID in case SRC is NULL. Reported by Marc Mutz. Modified: trunk/gpgme/ChangeLog =================================================================== --- trunk/gpgme/ChangeLog 2008-03-05 19:58:41 UTC (rev 1306) +++ trunk/gpgme/ChangeLog 2008-03-06 14:54:11 UTC (rev 1307) @@ -1,3 +1,8 @@ +2008-03-06 Marcus Brinkmann + + * key.c (_gpgme_key_add_sig): Terminate UID in case SRC is NULL. + Reported by Marc Mutz. + 2008-03-05 Marcus Brinkmann * decrypt.c (release_op_data): Release OPD->result.recipients. Modified: trunk/gpgme/key.c =================================================================== --- trunk/gpgme/key.c 2008-03-05 19:58:41 UTC (rev 1306) +++ trunk/gpgme/key.c 2008-03-06 14:54:11 UTC (rev 1307) @@ -252,7 +252,7 @@ assert (uid); /* XXX */ /* We can malloc a buffer of the same length, because the converted - string will never be larger. Actually we allocate it twice the + string will never be larger. Actually we allocate it twice the size, so that we are able to store the parsed stuff there too. */ sig = malloc (sizeof (*sig) + 2 * src_len + 3); if (!sig) @@ -275,6 +275,8 @@ parse_user_id (sig->uid, &sig->name, &sig->email, &sig->comment, dst); } + else + sig->uid = '\0'; if (!uid->signatures) uid->signatures = sig; From cvs at cvs.gnupg.org Thu Mar 6 16:05:51 2008 From: cvs at cvs.gnupg.org (svn author wk) Date: Thu, 06 Mar 2008 16:05:51 +0100 Subject: [svn] GpgOL - r226 - in trunk: . doc src Message-ID: Author: wk Date: 2008-03-06 16:05:48 +0100 (Thu, 06 Mar 2008) New Revision: 226 Modified: trunk/ChangeLog trunk/doc/gpgol.texi trunk/src/ChangeLog trunk/src/engine-assuan.c trunk/src/engine-assuan.h trunk/src/engine.c trunk/src/engine.h trunk/src/main.c trunk/src/mimemaker.c trunk/src/olflange.cpp Log: Implement signing with automatic protocol selection. Modified: trunk/ChangeLog =================================================================== --- trunk/ChangeLog 2008-02-28 17:24:56 UTC (rev 225) +++ trunk/ChangeLog 2008-03-06 15:05:48 UTC (rev 226) @@ -1,3 +1,8 @@ +2008-03-06 Werner Koch + + * doc/gpgol.texi (SIGN): Extend the SIGNER command to allow + suggestion of a protocol. + 2008-02-18 Werner Koch Release 0.10.5 development version. Modified: trunk/src/ChangeLog =================================================================== --- trunk/src/ChangeLog 2008-02-28 17:24:56 UTC (rev 225) +++ trunk/src/ChangeLog 2008-03-06 15:05:48 UTC (rev 226) @@ -1,3 +1,14 @@ +2008-03-06 Werner Koch + + * mimemaker.c (do_mime_sign): Figure out the protocol to use. + * engine.c (engine_sign_start): Add new args SENDER and R_PROTOCOL. + * engine-assuan.c (op_assuan_sign): Ditto. Send SENDER command. + +2008-03-05 Werner Koch + + * main.c (read_options): Insert the debug registry key. + (write_options): More debug output. + 2008-02-28 Werner Koch * olflange-dlgs.cpp (GPGOptionsDlgProc): Fix initial setting of Modified: trunk/doc/gpgol.texi =================================================================== --- trunk/doc/gpgol.texi 2008-02-28 17:24:56 UTC (rev 225) +++ trunk/doc/gpgol.texi 2008-03-06 15:05:48 UTC (rev 226) @@ -232,7 +232,7 @@ @end deffn To support automagically selection of the protocol depending on the -selected keys, the server may implement the follwoing extra command: +selected keys, the server MAY implement the command: @deffn Command PREP_ENCRYPT [- at w{}-protocol=@var{name}] @@ -320,6 +320,9 @@ is valid until a successful @code{SIGN} command or until a @code{RESET} command. A second command overrides the effect of the first one; if @var{email} is not given the server shall use the default signing key. +The server shall also suggest a protocol to use for signing. The client +may use this suggested protocol on its own discretion. The same status +line as with PREP_ENCRYPT is used for this. @end deffn @noindent Modified: trunk/src/engine-assuan.c =================================================================== --- trunk/src/engine-assuan.c 2008-02-28 17:24:56 UTC (rev 225) +++ trunk/src/engine-assuan.c 2008-03-06 15:05:48 UTC (rev 226) @@ -1333,8 +1333,8 @@ } -/* Callback used to get the protocool status line form a PREP_* - command. */ +/* Callback used to get the protocool status line form a PREP_ENCRYPT + or SENDER command. */ static assuan_error_t prep_foo_status_cb (void *opaque, const char *line) { @@ -1496,11 +1496,14 @@ /* Created a detached signature for INDATA and write it to OUTDATA. On termination of the signing command engine_private_finished() is - called with FILTER as the first argument. */ + called with FILTER as the first argument. SENDER is the sender's + mail address (a mailbox). The used protocol wioll be stored at + R_PROTOCOL. */ int op_assuan_sign (protocol_t protocol, gpgme_data_t indata, gpgme_data_t outdata, - engine_filter_t filter, void *hwnd) + engine_filter_t filter, void *hwnd, + const char *sender, protocol_t *r_used_protocol) { gpg_error_t err; closure_data_t cld; @@ -1509,12 +1512,12 @@ HANDLE inpipe[2], outpipe[2]; ULONG cmdid; pid_t pid; + int detect_protocol; const char *protocol_name; + protocol_t suggested_protocol; + detect_protocol = !(protocol_name = get_protocol_name (protocol)); - if (!(protocol_name = get_protocol_name (protocol))) - return gpg_error(GPG_ERR_INV_VALUE); - err = connect_uiserver (&ctx, &pid, &cmdid, hwnd); if (err) return err; @@ -1535,6 +1538,36 @@ if (err) goto leave; + /* We always send the SENDER command becuase it allows us to figure + out the protocol to use. In case the UI server faisl to send the + protocol we fall back to OpenPGP. */ + suggested_protocol = PROTOCOL_UNKNOWN; + if (!sender) + sender = ""; + snprintf (line, sizeof line, "SENDER%s%s", sender? " ":"", sender?sender:""); + err = assuan_transact (ctx, line, NULL, NULL, NULL, NULL, + prep_foo_status_cb, &suggested_protocol); + if (err) + { + if (gpg_err_code (err) == GPG_ERR_ASS_UNKNOWN_CMD) + err = gpg_error (GPG_ERR_INV_VALUE); + goto leave; + } + if (detect_protocol) + { + log_debug ("%s:%s: suggested protocol is %d", + SRCNAME, __func__, suggested_protocol); + protocol = (suggested_protocol == PROTOCOL_UNKNOWN? + PROTOCOL_OPENPGP : suggested_protocol); + if ( !(protocol_name = get_protocol_name (protocol)) ) + { + err = gpg_error (GPG_ERR_INV_VALUE); + goto leave; + } + } + *r_used_protocol = protocol; + log_debug ("%s:%s: using protocol %s", SRCNAME, __func__, protocol_name); + snprintf (line, sizeof line, "INPUT FD=%ld", (unsigned long int)inpipe[0]); err = assuan_transact (ctx, line, NULL, NULL, NULL, NULL, NULL, NULL); if (err) @@ -1544,8 +1577,6 @@ if (err) goto leave; - /* FIXME: Implement the optinonal SENDER command. */ - enqueue_callback (" input", ctx, indata, inpipe[1], 1, finalize_handler, cmdid, NULL, 0); enqueue_callback ("output", ctx, outdata, outpipe[0], 0, finalize_handler, Modified: trunk/src/engine-assuan.h =================================================================== --- trunk/src/engine-assuan.h 2008-02-28 17:24:56 UTC (rev 225) +++ trunk/src/engine-assuan.h 2008-03-06 15:05:48 UTC (rev 226) @@ -41,7 +41,8 @@ char **recipients, protocol_t *r_used_protocol); int op_assuan_sign (protocol_t protocol, gpgme_data_t indata, gpgme_data_t outdata, - engine_filter_t filter, void *hwnd); + engine_filter_t filter, void *hwnd, + const char *sender, protocol_t *r_used_protocol); int op_assuan_decrypt (protocol_t protocol, gpgme_data_t indata, gpgme_data_t outdata, engine_filter_t filter, void *hwnd, Modified: trunk/src/engine.c =================================================================== --- trunk/src/engine.c 2008-02-28 17:24:56 UTC (rev 225) +++ trunk/src/engine.c 2008-03-06 15:05:48 UTC (rev 226) @@ -691,18 +691,30 @@ finish the operation. A filter object may not be reused after having been used through this function. However, the lifetime of the filter object lasts until the final engine_wait or - engine_cancel. */ + engine_cancel. SENDER is the sender's mailbox or NULL. On return + the protocol to be used is stored at R_PROTOCOL. */ int -engine_sign_start (engine_filter_t filter, HWND hwnd, protocol_t protocol) +engine_sign_start (engine_filter_t filter, HWND hwnd, protocol_t protocol, + const char *sender, protocol_t *r_protocol) { gpg_error_t err; + protocol_t used_protocol; if (filter->use_assuan) - err = op_assuan_sign (protocol, filter->indata, filter->outdata, - filter, hwnd); + { + err = op_assuan_sign (protocol, filter->indata, filter->outdata, + filter, hwnd, sender, &used_protocol); + if (!err) + *r_protocol = used_protocol; + } else - err = op_gpgme_sign (protocol, filter->indata, filter->outdata, - filter, hwnd); + { + err = op_gpgme_sign (protocol, filter->indata, filter->outdata, + filter, hwnd); + if (!err) + *r_protocol = (protocol == GPGME_PROTOCOL_UNKNOWN? + GPGME_PROTOCOL_OpenPGP : protocol); + } return err; } Modified: trunk/src/engine.h =================================================================== --- trunk/src/engine.h 2008-02-28 17:24:56 UTC (rev 225) +++ trunk/src/engine.h 2008-03-06 15:05:48 UTC (rev 226) @@ -65,7 +65,9 @@ int engine_encrypt_start (engine_filter_t filter, HWND hwnd, protocol_t req_protocol, char **recipients, protocol_t *r_protocol); -int engine_sign_start (engine_filter_t filter, HWND hwnd, protocol_t protocol); +int engine_sign_start (engine_filter_t filter, HWND hwnd, protocol_t protocol, + const char *sender, protocol_t *r_protocol); + int engine_decrypt_start (engine_filter_t filter, HWND hwnd, protocol_t protocol, int with_verify); int engine_verify_start (engine_filter_t filter, HWND hwnd, Modified: trunk/src/main.c =================================================================== --- trunk/src/main.c 2008-02-28 17:24:56 UTC (rev 225) +++ trunk/src/main.c 2008-03-06 15:05:48 UTC (rev 226) @@ -510,6 +510,13 @@ load_extension_value ("enableDebug", &val); opt.enable_debug = val? strtoul (val, NULL, 0) : 0; + if (!val) + { + /* To help the user enable debugging make sure that the registry + key exists. Note that the other registry keys are stored + after using the configuration dialog. */ + store_extension_value ("enableDebug", "0"); + } xfree (val); val = NULL; load_extension_value ("enableSmime", &val); @@ -640,22 +647,29 @@ }; char buf[32]; int rc, i; + const char *string; for (i=0; table[i].name; i++) { - log_debug ("storing option `%s'\n", table[i].name); switch (table[i].mode) { case 0: - rc = store_extension_value (table[i].name, table[i].value? "1": "0"); + string = table[i].value? "1": "0"; + log_debug ("storing option `%s' value=`%s'\n", + table[i].name, string); + rc = store_extension_value (table[i].name, string); break; case 1: sprintf (buf, "%d", table[i].value); + log_debug ("storing option `%s' value=`%s'\n", + table[i].name, buf); rc = store_extension_value (table[i].name, buf); break; case 2: - rc = store_extension_value (table[i].name, - table[i].s_val? table[i].s_val : ""); + string = table[i].s_val? table[i].s_val : ""; + log_debug ("storing option `%s' value=`%s'\n", + table[i].name, string); + rc = store_extension_value (table[i].name, string); break; case 3: buf[0] = '0'; @@ -666,6 +680,8 @@ case PROTOCOL_OPENPGP: buf[0] = '1'; break; case PROTOCOL_SMIME: buf[0] = '2'; break; } + log_debug ("storing option `%s' value=`%s'\n", + table[i].name, buf); rc = store_extension_value (table[i].name, buf); break; Modified: trunk/src/mimemaker.c =================================================================== --- trunk/src/mimemaker.c 2008-02-28 17:24:56 UTC (rev 225) +++ trunk/src/mimemaker.c 2008-03-06 15:05:48 UTC (rev 226) @@ -1169,10 +1169,6 @@ memset (hashsink, 0, sizeof *hashsink); memset (&sigbuffer, 0, sizeof sigbuffer); - protocol = check_protocol (protocol); - if (protocol == PROTOCOL_UNKNOWN) - return -1; - if (tmpsink) { attach = NULL; @@ -1185,12 +1181,20 @@ return -1; } - /* Prepare the signing. */ + /* Prepare the signing. FIXME: figure out the signer of the mail. */ if (engine_create_filter (&filter, collect_signature, &sigbuffer)) goto failure; - if (engine_sign_start (filter, hwnd, protocol)) + if (engine_sign_start (filter, hwnd, protocol, NULL, &protocol)) goto failure; + protocol = check_protocol (protocol); + if (protocol == PROTOCOL_UNKNOWN) + { + log_error ("%s:%s: no protocol selected", SRCNAME, __func__); + goto failure; + } + + /* Get the attachment info and the body. */ body = mapi_get_body (message, NULL); if (body && !*body) @@ -1726,7 +1730,8 @@ /* Prepare the encryption. We do this early as it is quite common that some recipients are not be available and thus the encryption - will fail early. */ + will fail early. This is also required to allow the UIserver to + figure out the protocol to use if we have not forced one. */ if (engine_create_filter (&filter, write_buffer_for_cb, sink)) goto failure; if ((rc=engine_encrypt_start (filter, hwnd, @@ -1741,7 +1746,8 @@ complete MIME object of the signed message. We can't do the encryption in streaming mode while running the encryption because we need to fix up that ugly micalg parameter after having created - the signature. */ + the signature. Note that the protocol to use is taken from the + encryption operation. */ if (do_mime_sign (message, hwnd, protocol, &att_table, tmpsink)) goto failure; Modified: trunk/src/olflange.cpp =================================================================== --- trunk/src/olflange.cpp 2008-02-28 17:24:56 UTC (rev 225) +++ trunk/src/olflange.cpp 2008-03-06 15:05:48 UTC (rev 226) @@ -179,6 +179,19 @@ RegDeleteValue (hkey, "GPG Exchange"); /* Set outlook update flag. */ + /* Fixme: We have not yet implemented this hint from Microsoft: + + In order for .ecf-based ECEs to be detected by Outlook on Vista, + one needs to delete if present: + + [HKEY_CURRENT_USER\Software\Microsoft\Office\[Office Version]\Outlook] + "Exchange Client Extension"= + "4.0;Outxxx.dll;7;000000000000000;0000000000;OutXXX" + + [Office Version] is 11.0 ( for OL 03 ), 12.0 ( OL 07 )... + + Obviously due to HKCU, that also requires to run this code at + startup. However, we don't use an ECF right now. */ strcpy (szEntry, "4.0;Outxxx.dll;7;000000000000000;0000000000;OutXXX"); dwTemp = lstrlen (szEntry) + 1; RegSetValueEx (hkey, "Outlook Setup Extension", @@ -259,6 +272,8 @@ RegSetValueEx (hkey, "Outlook Setup Extension", 0, REG_SZ, (BYTE*) buf, ntemp); RegCloseKey (hkey); + + /* Fixme: delet CLSIDs. */ return S_OK; } From cvs at cvs.gnupg.org Thu Mar 6 18:19:35 2008 From: cvs at cvs.gnupg.org (svn author dshaw) Date: Thu, 06 Mar 2008 18:19:35 +0100 Subject: [svn] GnuPG - r4703 - branches/STABLE-BRANCH-1-4 Message-ID: Author: dshaw Date: 2008-03-06 18:19:34 +0100 (Thu, 06 Mar 2008) New Revision: 4703 Modified: branches/STABLE-BRANCH-1-4/ChangeLog branches/STABLE-BRANCH-1-4/configure.ac Log: * configure.ac: Post-release update. Modified: branches/STABLE-BRANCH-1-4/ChangeLog =================================================================== --- branches/STABLE-BRANCH-1-4/ChangeLog 2008-03-05 10:08:10 UTC (rev 4702) +++ branches/STABLE-BRANCH-1-4/ChangeLog 2008-03-06 17:19:34 UTC (rev 4703) @@ -1,3 +1,7 @@ +2008-03-06 David Shaw + + * configure.ac: Post-release update. + 2007-12-20 Werner Koch Released 1.4.8. Modified: branches/STABLE-BRANCH-1-4/configure.ac =================================================================== --- branches/STABLE-BRANCH-1-4/configure.ac 2008-03-05 10:08:10 UTC (rev 4702) +++ branches/STABLE-BRANCH-1-4/configure.ac 2008-03-06 17:19:34 UTC (rev 4703) @@ -25,8 +25,8 @@ # Remember to change the version number immediately *after* a release. # Set my_issvn to "yes" for non-released code. Remember to run an # "svn up" and "autogen.sh --force" right before creating a distribution. -m4_define([my_version], [1.4.8]) -m4_define([my_issvn], [no]) +m4_define([my_version], [1.4.9rc1]) +m4_define([my_issvn], [yes]) m4_define([svn_revision], m4_esyscmd([echo -n $((svn info 2>/dev/null \ || echo 'Revision: 0')|sed -n '/^Revision:/ s/[^0-9]//gp'|head -1)])) From cvs at cvs.gnupg.org Thu Mar 6 18:22:42 2008 From: cvs at cvs.gnupg.org (svn author dshaw) Date: Thu, 06 Mar 2008 18:22:42 +0100 Subject: [svn] GnuPG - r4704 - branches/STABLE-BRANCH-1-4/util Message-ID: Author: dshaw Date: 2008-03-06 18:22:41 +0100 (Thu, 06 Mar 2008) New Revision: 4704 Modified: branches/STABLE-BRANCH-1-4/util/ChangeLog branches/STABLE-BRANCH-1-4/util/argparse.c Log: * argparse.c (default_strusage): Update copyright date. Modified: branches/STABLE-BRANCH-1-4/util/ChangeLog =================================================================== --- branches/STABLE-BRANCH-1-4/util/ChangeLog 2008-03-06 17:19:34 UTC (rev 4703) +++ branches/STABLE-BRANCH-1-4/util/ChangeLog 2008-03-06 17:22:41 UTC (rev 4704) @@ -1,3 +1,7 @@ +2008-03-06 David Shaw + + * argparse.c (default_strusage): Update copyright date. + 2007-10-23 Werner Koch Switched entire package to GPLv3+. The parts taken from libassuan Modified: branches/STABLE-BRANCH-1-4/util/argparse.c =================================================================== --- branches/STABLE-BRANCH-1-4/util/argparse.c 2008-03-06 17:19:34 UTC (rev 4703) +++ branches/STABLE-BRANCH-1-4/util/argparse.c 2008-03-06 17:22:41 UTC (rev 4704) @@ -1,6 +1,6 @@ /* [argparse.c wk 17.06.97] Argument Parser for option handling - * Copyright (C) 1998, 1999, 2000, 2001, 2003, 2004, 2005, 2006, - * 2007 Free Software Foundation, Inc. + * Copyright (C) 1998, 1999, 2000, 2001, 2003, 2004, 2005, 2006, 2007, + * 2008 Free Software Foundation, Inc. * * This file is part of GnuPG. * @@ -917,7 +917,7 @@ break; case 11: p = "foo"; break; case 13: p = "0.0"; break; - case 14: p = "Copyright (C) 2007 Free Software Foundation, Inc."; break; + case 14: p = "Copyright (C) 2008 Free Software Foundation, Inc."; break; case 15: p = "This is free software: you are free to change and redistribute it.\n" "There is NO WARRANTY, to the extent permitted by law.\n"; From cvs at cvs.gnupg.org Thu Mar 6 19:28:49 2008 From: cvs at cvs.gnupg.org (svn author wk) Date: Thu, 06 Mar 2008 19:28:49 +0100 Subject: [svn] GnuPG - r4705 - in trunk: common g10 Message-ID: Author: wk Date: 2008-03-06 19:28:47 +0100 (Thu, 06 Mar 2008) New Revision: 4705 Modified: trunk/common/ChangeLog trunk/common/pka.c trunk/common/simple-pwquery.c trunk/g10/ChangeLog trunk/g10/getkey.c Log: Comment fixes. Convey the new envvars when using simple-pwquery. Modified: trunk/common/ChangeLog =================================================================== --- trunk/common/ChangeLog 2008-03-06 17:22:41 UTC (rev 4704) +++ trunk/common/ChangeLog 2008-03-06 18:28:47 UTC (rev 4705) @@ -1,3 +1,8 @@ +2008-03-06 Werner Koch + + * simple-pwquery.c (agent_send_all_options): Add support for + XAUTHORITY and PINENTRY_USER_DATA. + 2008-02-15 Marcus Brinkmann * exechelp.c (gnupg_spawn_process_fd): Add flag DETACHED_PROCESS Modified: trunk/g10/ChangeLog =================================================================== --- trunk/g10/ChangeLog 2008-03-06 17:22:41 UTC (rev 4704) +++ trunk/g10/ChangeLog 2008-03-06 18:28:47 UTC (rev 4705) @@ -1,3 +1,7 @@ +2008-02-26 Werner Koch + + * getkey.c (get_pubkey_byname): Fix comment. + 2008-02-14 Werner Koch * call-agent.c (default_inq_cb): New. Modified: trunk/common/pka.c =================================================================== --- trunk/common/pka.c 2008-03-06 17:22:41 UTC (rev 4704) +++ trunk/common/pka.c 2008-03-06 18:28:47 UTC (rev 4705) @@ -98,7 +98,7 @@ On success the 20 byte SHA-1 fingerprint is stored at FPR and the URI will be returned in an allocated buffer. Note that the URI - might be an zero length string as this information is optiobnal. + might be an zero length string as this information is optional. Caller must xfree the returned string. On error NULL is returned and the 20 bytes at FPR are not Modified: trunk/common/simple-pwquery.c =================================================================== --- trunk/common/simple-pwquery.c 2008-03-06 17:22:41 UTC (rev 4704) +++ trunk/common/simple-pwquery.c 2008-03-06 18:28:47 UTC (rev 4705) @@ -207,6 +207,8 @@ char *dft_display = NULL; char *dft_ttyname = NULL; char *dft_ttytype = NULL; + char *dft_xauthority = NULL; + char *dft_pinentry_user_data = NULL; int rc = 0; dft_display = getenv ("DISPLAY"); @@ -285,6 +287,25 @@ } #endif /*HAVE_SETLOCALE*/ + /* Send the XAUTHORITY variable. */ + dft_xauthority = getenv ("XAUTHORITY"); + if (dft_xauthority) + { + /* We ignore errors here because older gpg-agents don't support + this option. */ + send_one_option (ctx, errsource, "xauthority", dft_xauthority); + } + + /* Send the PINENTRY_USER_DATA variable. */ + dft_pinentry_user_data = getenv ("PINENTRY_USER_DATA"); + if (dft_pinentry_user_data) + { + /* We ignore errors here because older gpg-agents don't support + this option. */ + send_one_option (ctx, errsource, "pinentry-user-data", + opt_pinentry_user_data); + } + return 0; } Modified: trunk/g10/getkey.c =================================================================== --- trunk/g10/getkey.c 2008-03-06 17:22:41 UTC (rev 4704) +++ trunk/g10/getkey.c 2008-03-06 18:28:47 UTC (rev 4705) @@ -912,9 +912,9 @@ /* Find a public key from NAME and return the keyblock or the key. If ret_kdb is not NULL, the KEYDB handle used to locate this keyblock is returned and the caller is responsible for closing it. If a key - was not found and NAME is a valid RFC822 mailbox and PKA retrieval - has been enabled, we try to import the pkea via the PKA - mechanism. */ + was not found and NAME is a valid RFC822 mailbox and --auto-key-locate + has been enabled, we try to import the key via the online mechanisms + defined by --auto-key-locate. */ int get_pubkey_byname (PKT_public_key *pk, const char *name, KBNODE *ret_keyblock, From cvs at cvs.gnupg.org Fri Mar 7 11:31:55 2008 From: cvs at cvs.gnupg.org (svn author wk) Date: Fri, 07 Mar 2008 11:31:55 +0100 Subject: [svn] GpgOL - r227 - trunk/src Message-ID: Author: wk Date: 2008-03-07 11:31:54 +0100 (Fri, 07 Mar 2008) New Revision: 227 Modified: trunk/src/ChangeLog trunk/src/common.h trunk/src/engine.c trunk/src/engine.h trunk/src/ext-commands.cpp trunk/src/message.cpp trunk/src/mimeparser.c trunk/src/mimeparser.h trunk/src/user-events.cpp Log: Fix a problem with plain PGP messages. Decryption works now. Modified: trunk/src/ChangeLog =================================================================== --- trunk/src/ChangeLog 2008-03-06 15:05:48 UTC (rev 226) +++ trunk/src/ChangeLog 2008-03-07 10:31:54 UTC (rev 227) @@ -1,3 +1,17 @@ +2008-03-07 Werner Koch + + * engine.c (struct engine_filter_s): Add field ADD_EXTRA_LF. + (engine_request_exra_lf): New. + (engine_wait): Implement that. + * mimeparser.c (mime_decrypt): Add arg SIMPLE_PGP and call + engine_request_exra_lf. + (struct mime_context): Add field NO_MAIL_HEADER. + (message_cb): Implement it. + * message.cpp (message_decrypt): Set that flag for old style PGP. + + * common.h (DBG_COMMANDS, debug_commands): New. + * ext-commands.cpp: Use it. + 2008-03-06 Werner Koch * mimemaker.c (do_mime_sign): Figure out the protocol to use. Modified: trunk/src/common.h =================================================================== --- trunk/src/common.h 2008-03-06 15:05:48 UTC (rev 226) +++ trunk/src/common.h 2008-03-07 10:31:54 UTC (rev 227) @@ -150,8 +150,12 @@ #define DBG_FILTER 8 #define DBG_FILTER_EXTRA 16 #define DBG_MEMORY 32 +#define DBG_COMMANDS 64 +/* Macros to used in conditionals to enabel debug output. */ +#define debug_commands (opt.enable_debug & DBG_COMMANDS) + /* Type and constants used with parse_tlv. */ struct tlvinfo_s { Modified: trunk/src/engine.c =================================================================== --- trunk/src/engine.c 2008-03-06 15:05:48 UTC (rev 226) +++ trunk/src/engine.c 2008-03-07 10:31:54 UTC (rev 227) @@ -88,6 +88,9 @@ char buffer[FILTER_BUFFER_SIZE]; } out; + /* Flag to push an extra LF out. */ + int add_extra_lf; + /* The data sink as set by engine_create_filter. */ int (*outfnc) (void *, const void *, size_t); void *outfncdata; @@ -544,7 +547,14 @@ } +/* Set the FILTER in a mode which pushes an extra lineffed out. */ +void +engine_request_exra_lf (engine_filter_t filter) +{ + filter->add_extra_lf = 1; +} + /* Wait for FILTER to finish. Returns 0 on success. FILTER is not valid after the function has returned success. */ int @@ -552,6 +562,7 @@ { gpg_error_t err; int more; + int nbytes; if (!filter || !filter->outfnc) return gpg_error (GPG_ERR_INV_VALUE); @@ -568,8 +579,6 @@ take_out_lock (filter, __func__); if (filter->out.length) { - int nbytes; - nbytes = filter->outfnc (filter->outfncdata, filter->out.buffer, filter->out.length); if (nbytes < 0) @@ -604,6 +613,49 @@ } while (more); + /* If requested write an extra LF, so that the MIME parser sees a + complete line. */ + if (filter->add_extra_lf) + { + int extra_written = 0; + do + { + more = 0; + take_out_lock (filter, __func__); + if (!extra_written) + { + nbytes = filter->outfnc (filter->outfncdata, "\n", 1); + if (nbytes < 0) + { + log_error ("%s:%s: error writing extra lf\n", + SRCNAME, __func__); + release_out_lock (filter, __func__); + return gpg_error (GPG_ERR_EIO); + } + if (!nbytes) + { + if (debug_filter_extra) + log_debug ("%s:%s: extra lf still pending for outfnc\n", + SRCNAME, __func__); + more = 1; + } + else + extra_written = 1; + } + if (!PulseEvent (filter->out.condvar)) + log_error_w32 (-1, "%s:%s: PulseEvent(out) failed", + SRCNAME, __func__); + release_out_lock (filter, __func__); + take_in_lock (filter, __func__); + if (!filter->in.ready) + more = 1; + release_in_lock (filter, __func__); + if (more) + Sleep (50); + } + while (more); + } + if (WaitForSingleObject (filter->in.ready_event, INFINITE) != WAIT_OBJECT_0) { log_error_w32 (-1, "%s:%s: WFSO failed", SRCNAME, __func__); Modified: trunk/src/engine.h =================================================================== --- trunk/src/engine.h 2008-03-06 15:05:48 UTC (rev 226) +++ trunk/src/engine.h 2008-03-07 10:31:54 UTC (rev 227) @@ -59,6 +59,7 @@ int engine_create_filter (engine_filter_t *r_filter, int (*outfnc) (void *, const void *, size_t), void *outfncdata); +void engine_request_exra_lf (engine_filter_t filter); int engine_wait (engine_filter_t filter); void engine_cancel (engine_filter_t filter); Modified: trunk/src/ext-commands.cpp =================================================================== --- trunk/src/ext-commands.cpp 2008-03-06 15:05:48 UTC (rev 226) +++ trunk/src/ext-commands.cpp 2008-03-07 10:31:54 UTC (rev 227) @@ -204,8 +204,9 @@ HMENU menu; eecb->GetMenuPos (EECMDID_ToolsCustomizeToolbar, &menu, NULL, NULL, 0); - log_debug ("check_menu: eecb=%p menu_id=%u checked=%d -> menu=%p\n", - eecb, menu_id, checked, menu); + if (debug_commands) + log_debug ("check_menu: eecb=%p menu_id=%u checked=%d -> menu=%p\n", + eecb, menu_id, checked, menu); CheckMenuItem (menu, menu_id, MF_BYCOMMAND | (checked?MF_CHECKED:MF_UNCHECKED)); } @@ -263,9 +264,10 @@ tb_info->next = m_toolbar_info; m_toolbar_info = tb_info; - log_debug ("%s:%s: ctx=%lx button_id=%d cmd_id=%d '%s'\n", - SRCNAME, __func__, m_lContext, - tb_info->button_id, tb_info->cmd_id, tb_info->desc); + if (debug_commands) + log_debug ("%s:%s: ctx=%lx button_id=%d cmd_id=%d '%s'\n", + SRCNAME, __func__, m_lContext, + tb_info->button_id, tb_info->cmd_id, tb_info->desc); } } @@ -298,8 +300,9 @@ int force_encrypt = 0; - log_debug ("%s:%s: context=%s flags=0x%lx\n", SRCNAME, __func__, - ext_context_name (m_lContext), lFlags); + if (debug_commands) + log_debug ("%s:%s: context=%s flags=0x%lx\n", SRCNAME, __func__, + ext_context_name (m_lContext), lFlags); /* Outlook 2003 sometimes displays the plaintext and sometimes the @@ -521,9 +524,10 @@ if (FAILED (eecb->GetWindow (&hwnd))) hwnd = NULL; - log_debug ("%s:%s: commandID=%u (%#x) context=%s hwnd=%p\n", - SRCNAME, __func__, nCommandID, nCommandID, - ext_context_name (m_lContext), hwnd); + if (debug_commands) + log_debug ("%s:%s: commandID=%u (%#x) context=%s hwnd=%p\n", + SRCNAME, __func__, nCommandID, nCommandID, + ext_context_name (m_lContext), hwnd); if (nCommandID == SC_CLOSE && m_lContext == EECONTEXT_READNOTEMESSAGE) { @@ -536,7 +540,8 @@ DISPPARAMS dispparams; VARIANT aVariant; - log_debug ("%s:%s: command Close called\n", SRCNAME, __func__); + if (debug_commands) + log_debug ("%s:%s: command Close called\n", SRCNAME, __func__); pDisp = find_outlook_property (eecb, "Close", &dispid); if (pDisp) { @@ -574,7 +579,8 @@ } else if (nCommandID == EECMDID_ComposeReplyToSender) { - log_debug ("%s:%s: command Reply called\n", SRCNAME, __func__); + if (debug_commands) + log_debug ("%s:%s: command Reply called\n", SRCNAME, __func__); /* What we might want to do is to call Reply, then GetInspector and then Activate - this allows us to get full control over the quoted message and avoids the ugly msgcache. */ @@ -582,12 +588,14 @@ } else if (nCommandID == EECMDID_ComposeReplyToAll) { - log_debug ("%s:%s: command ReplyAll called\n", SRCNAME, __func__); + if (debug_commands) + log_debug ("%s:%s: command ReplyAll called\n", SRCNAME, __func__); return S_FALSE; /* Pass it on. */ } else if (nCommandID == EECMDID_ComposeForward) { - log_debug ("%s:%s: command Forward called\n", SRCNAME, __func__); + if (debug_commands) + log_debug ("%s:%s: command Forward called\n", SRCNAME, __func__); return S_FALSE; /* Pass it on. */ } else if (nCommandID == m_nCmdDecrypt @@ -641,7 +649,7 @@ else if (nCommandID == m_nCmdProtoPgpmime && m_lContext == EECONTEXT_SENDNOTEMESSAGE) { - log_debug ("%s:%s: command ProroPggmime called\n", SRCNAME, __func__); + log_debug ("%s:%s: command ProtoPgpmime called\n", SRCNAME, __func__); check_menu (eecb, m_nCmdProtoAuto, FALSE); check_menu (eecb, m_nCmdProtoPgpmime, TRUE); check_menu (eecb, m_nCmdProtoSmime, FALSE); @@ -712,7 +720,8 @@ } else { - log_debug ("%s:%s: command passed on\n", SRCNAME, __func__); + if (debug_commands) + log_debug ("%s:%s: command passed on\n", SRCNAME, __func__); return S_FALSE; /* Pass on unknown command. */ } @@ -912,9 +921,11 @@ if (!tb_info) return S_FALSE; /* Not one of our toolbar buttons. */ - log_debug ("%s:%s: ctx=%lx tbid=%ld button_id(req)=%d got=%d cmd_id=%d '%s'\n", - SRCNAME, __func__, m_lContext, toolbarid, buttonid, - tb_info->button_id, tb_info->cmd_id, tb_info->desc); + if (debug_commands) + log_debug ("%s:%s: ctx=%lx tbid=%ld button_id(req)=%d got=%d" + " cmd_id=%d '%s'\n", + SRCNAME, __func__, m_lContext, toolbarid, buttonid, + tb_info->button_id, tb_info->cmd_id, tb_info->desc); pTBB->iBitmap = tb_info->bitmap; pTBB->idCommand = tb_info->cmd_id; Modified: trunk/src/message.cpp =================================================================== --- trunk/src/message.cpp 2008-03-06 15:05:48 UTC (rev 226) +++ trunk/src/message.cpp 2008-03-07 10:31:54 UTC (rev 227) @@ -843,6 +843,8 @@ LPATTACH saved_attach = NULL; int need_saved_attach = 0; int need_rfc822_parser = 0; + int is_simple_pgp = 0; + switch (msgtype) { @@ -922,6 +924,8 @@ goto leave; /* Problem getting the attachment. */ protocol = PROTOCOL_OPENPGP; need_rfc822_parser = 1; + is_simple_pgp = 1; + } else { @@ -1064,7 +1068,7 @@ } err = mime_decrypt (protocol, cipherstream, message, - need_rfc822_parser, hwnd, 0); + need_rfc822_parser, is_simple_pgp, hwnd, 0); log_debug ("mime_decrypt returned %d (%s)", err, gpg_strerror (err)); if (err) { Modified: trunk/src/mimeparser.c =================================================================== --- trunk/src/mimeparser.c 2008-03-06 15:05:48 UTC (rev 226) +++ trunk/src/mimeparser.c 2008-03-07 10:31:54 UTC (rev 227) @@ -88,6 +88,7 @@ int protect_mode; /* Encrypt all attachments etc. (cf. SYMENC). */ int verify_mode; /* True if we want to verify a signature. */ + int no_mail_header; /* True if we want to bypass all MIME parsing. */ int nesting_level; /* Current MIME nesting level. */ int in_data; /* We are currently in data (body or attachment). */ @@ -919,6 +920,39 @@ mime_context_t ctx = opaque; debug_message_event (ctx, event); + if (ctx->no_mail_header) + { + /* Assume that this is not a regular mail but plain text. */ + if (!ctx->body_seen) + { +#ifdef DEBUG_PARSER + log_debug ("%s:%s: assuming this is plain text without headers\n", + SRCNAME, __func__); +#endif + ctx->in_data = 1; + ctx->collect_attachment = 2; /* 2 so we don't skip the first line. */ + ctx->body_seen = 1; + /* Create a fake MIME structure. */ + /* Fixme: We might want to take it from the enclosing message. */ + { + const char ctmain[] = "text"; + const char ctsub[] = "plain"; + mimestruct_item_t ms; + + ms = xmalloc (sizeof *ms + strlen (ctmain) + 1 + strlen (ctsub)); + ctx->mimestruct_cur = ms; + *ctx->mimestruct_tail = ms; + ctx->mimestruct_tail = &ms->next; + ms->next = NULL; + strcpy (stpcpy (stpcpy (ms->content_type, ctmain), "/"), ctsub); + ms->level = 0; + } + if (start_attachment (ctx, 1)) + return -1; + assert (ctx->outstream); + } + return 0; + } if (event == RFC822PARSE_BEGIN_HEADER || event == RFC822PARSE_T2BODY) { @@ -1012,6 +1046,8 @@ if (pos && ctx->linebuf[pos-1] == '\r') pos--; +/* log_debug ("%s:%s: ctx=%p, line=`%.*s'\n", */ +/* SRCNAME, __func__, ctx, (int)pos, ctx->linebuf); */ if (rfc822parse_insert (ctx->msg, ctx->linebuf, pos)) { log_error ("%s: ctx=%p, rfc822 parser failed: %s\n", @@ -1493,6 +1529,8 @@ if (pos && ctx->linebuf[pos-1] == '\r') pos--; +/* log_debug ("%s:%s: ctx=%p, line=`%.*s'\n", */ +/* SRCNAME, __func__, ctx, (int)pos, ctx->linebuf); */ if (rfc822parse_insert (ctx->msg, ctx->linebuf, pos)) { log_error ("%s:%s: ctx=%p, rfc822 parser failed: %s\n", @@ -1547,10 +1585,11 @@ window to be used for message box and such. In PREVIEW_MODE no verification will be done, no messages saved and no messages boxes will pop up. If IS_RFC822 is set, the message is expected to be in - rfc822 format. */ + rfc822 format. The caller should send SIMPLE_PGP is the input + message is a simple PGP message. */ int mime_decrypt (protocol_t protocol, LPSTREAM instream, LPMESSAGE mapi_message, - int is_rfc822, HWND hwnd, int preview_mode) + int is_rfc822, int simple_pgp, HWND hwnd, int preview_mode) { gpg_error_t err; mime_context_t decctx, ctx; @@ -1575,6 +1614,7 @@ ctx->preview = preview_mode; ctx->mapi_message = mapi_message; ctx->mimestruct_tail = &ctx->mimestruct; + ctx->no_mail_header = simple_pgp; if (decctx) { @@ -1602,6 +1642,8 @@ /* title = native_to_utf8 (_("[Encrypted PGP/MIME message]")); */ if ((err=engine_create_filter (&filter, plaintext_handler, ctx))) goto leave; + if (simple_pgp) + engine_request_exra_lf (filter); if ((err=engine_decrypt_start (filter, hwnd, protocol, !preview_mode))) goto leave; Modified: trunk/src/mimeparser.h =================================================================== --- trunk/src/mimeparser.h 2008-03-06 15:05:48 UTC (rev 226) +++ trunk/src/mimeparser.h 2008-03-07 10:31:54 UTC (rev 227) @@ -35,7 +35,7 @@ LPMESSAGE mapi_message, HWND hwnd, int preview_mode); int mime_decrypt (protocol_t protocol, LPSTREAM instream, LPMESSAGE mapi_message, int is_rfc822, - HWND hwnd, int preview_mode); + int simple_pgp, HWND hwnd, int preview_mode); #ifdef __cplusplus Modified: trunk/src/user-events.cpp =================================================================== --- trunk/src/user-events.cpp 2008-03-06 15:05:48 UTC (rev 226) +++ trunk/src/user-events.cpp 2008-03-07 10:31:54 UTC (rev 227) @@ -101,7 +101,8 @@ LPENTRYID entryid = NULL; ULONG entryidlen; - log_debug ("%s:%s: received\n", SRCNAME, __func__); + if (debug_commands) + log_debug ("%s:%s: received\n", SRCNAME, __func__); hr = eecb->GetSelectionCount (&count); if (SUCCEEDED (hr) && count > 0) @@ -112,8 +113,9 @@ &msgflags, 0L); if (SUCCEEDED(hr) && objtype == MAPI_MESSAGE) { - log_debug ("%s:%s: message class: %s\n", - SRCNAME, __func__, msgclass); + if (debug_commands) + log_debug ("%s:%s: message class: %s\n", + SRCNAME, __func__, msgclass); /* If SMIME has been enabled and the current message is of class SMIME or in the past processed by CryptoEx, we @@ -163,8 +165,9 @@ } else if (SUCCEEDED(hr) && objtype == MAPI_FOLDER) { - log_debug ("%s:%s: objtype: %lu\n", - SRCNAME, __func__, objtype); + if (debug_commands) + log_debug ("%s:%s: objtype: %lu\n", + SRCNAME, __func__, objtype); } } @@ -179,7 +182,7 @@ STDMETHODIMP_ (VOID) GpgolUserEvents::OnObjectChange (LPEXCHEXTCALLBACK eecb) { - log_debug ("%s:%s: received\n", SRCNAME, __func__); - + if (debug_commands) + log_debug ("%s:%s: received\n", SRCNAME, __func__); } From cvs at cvs.gnupg.org Fri Mar 7 12:30:34 2008 From: cvs at cvs.gnupg.org (svn author wk) Date: Fri, 07 Mar 2008 12:30:34 +0100 Subject: [svn] GpgOL - r228 - in trunk: . doc src Message-ID: Author: wk Date: 2008-03-07 12:30:33 +0100 (Fri, 07 Mar 2008) New Revision: 228 Modified: trunk/ChangeLog trunk/configure.ac trunk/doc/gpgol.texi trunk/src/ChangeLog trunk/src/common.h trunk/src/main.c trunk/src/olflange-dlgs.cpp trunk/src/olflange.cpp Log: Print a note after a software upgrade. Modified: trunk/ChangeLog =================================================================== --- trunk/ChangeLog 2008-03-07 10:31:54 UTC (rev 227) +++ trunk/ChangeLog 2008-03-07 11:30:33 UTC (rev 228) @@ -1,3 +1,7 @@ +2008-03-07 Werner Koch + + * configure.ac (SVN_REVISION): New AC_DEFINE. + 2008-03-06 Werner Koch * doc/gpgol.texi (SIGN): Extend the SIGNER command to allow Modified: trunk/src/ChangeLog =================================================================== --- trunk/src/ChangeLog 2008-03-07 10:31:54 UTC (rev 227) +++ trunk/src/ChangeLog 2008-03-07 11:30:33 UTC (rev 228) @@ -1,5 +1,9 @@ 2008-03-07 Werner Koch + * common.h (opt): Add field SVN_REVISION. + * main.c (read_options, write_options): Set it. + * olflange.cpp (GpgolExt): Print a warning on program update. + * engine.c (struct engine_filter_s): Add field ADD_EXTRA_LF. (engine_request_exra_lf): New. (engine_wait): Implement that. Modified: trunk/configure.ac =================================================================== --- trunk/configure.ac 2008-03-07 10:31:54 UTC (rev 227) +++ trunk/configure.ac 2008-03-07 11:30:33 UTC (rev 228) @@ -57,6 +57,7 @@ [Bug report address]) AC_DEFINE_UNQUOTED(NEED_GPGME_VERSION, "$NEED_GPGME_VERSION", [Required version of GPGME]) +AC_DEFINE_UNQUOTED(SVN_REVISION, ${SVN_REVISION}, [Current SVN revision]) BUILD_TIMESTAMP=`date --iso-8601=minutes` Modified: trunk/doc/gpgol.texi =================================================================== --- trunk/doc/gpgol.texi 2008-03-07 10:31:54 UTC (rev 227) +++ trunk/doc/gpgol.texi 2008-03-07 11:30:33 UTC (rev 228) @@ -671,6 +671,8 @@ Tell how the filter I/O locks the resources. @item 32 (0x0020) Tell about resource allocation. + at item 64 (0x0040) +Tell about command events. @end table You may use the regular C-syntax for entering the value. @@ -696,6 +698,12 @@ @itemx HKCU\Software\GNU\GpgOL:preferHtml These registry keys store the values from the configuration dialog. + at item HKCU\Software\GNU\GpgOL:svnRevision +When leaving GpgOL's options dialog, the SVN revision number of the current +version will be stored in this entry. This is used to display a note +after software upgrades. + + @end table Modified: trunk/src/common.h =================================================================== --- trunk/src/common.h 2008-03-07 10:31:54 UTC (rev 227) +++ trunk/src/common.h 2008-03-07 11:30:33 UTC (rev 228) @@ -130,6 +130,9 @@ unsigned int auto_decrypt: 1; /* Try to decrypt when clicked. */ unsigned int no_attestation: 1; /* Don't create an attestation. */ } compat; + + /* The SVN revision as stored in the registry. */ + int svn_revision; } opt; Modified: trunk/src/main.c =================================================================== --- trunk/src/main.c 2008-03-07 10:31:54 UTC (rev 227) +++ trunk/src/main.c 2008-03-07 11:30:33 UTC (rev 228) @@ -571,6 +571,10 @@ opt.prefer_html = val == NULL || *val != '1'? 0 : 1; xfree (val); val = NULL; + load_extension_value ("svnRevision", &val); + opt.svn_revision = val? atol (val) : 0; + xfree (val); val = NULL; + /* Note, that on purpose these flags are only Registry changeable. The format of the entry is a string of of "0" and "1" digits; see the switch below for a description. */ @@ -643,6 +647,7 @@ {"defaultKey", 2, 0, opt.default_key}, {"enableDefaultKey", 0, opt.enable_default_key}, {"preferHtml", 0, opt.prefer_html}, + {"svnRevision", 1, opt.svn_revision}, {NULL, 0} }; char buf[32]; Modified: trunk/src/olflange-dlgs.cpp =================================================================== --- trunk/src/olflange-dlgs.cpp 2008-03-07 10:31:54 UTC (rev 227) +++ trunk/src/olflange-dlgs.cpp 2008-03-07 11:30:33 UTC (rev 228) @@ -1,6 +1,6 @@ /* olflange-dlgs.cpp - New dialogs for Outlook. * Copyright (C) 2001 G Data Software AG, http://www.gdata.de - * Copyright (C) 2004, 2005, 2006, 2007 g10 Code GmbH + * Copyright (C) 2004, 2005, 2006, 2007, 2008 g10 Code GmbH * * This file is part of GpgOL. * @@ -298,6 +298,10 @@ opt.prefer_html = !!SendDlgItemMessage (hDlg, IDC_PREFER_HTML, BM_GETCHECK, 0, 0L); + /* Now that the user has confirmed the options dialog, we + mark the Registry with revision of this build. */ + opt.svn_revision = SVN_REVISION; + write_options (); bMsgResult = PSNRET_NOERROR; break; } Modified: trunk/src/olflange.cpp =================================================================== --- trunk/src/olflange.cpp 2008-03-07 10:31:54 UTC (rev 227) +++ trunk/src/olflange.cpp 2008-03-07 11:30:33 UTC (rev 228) @@ -334,6 +334,15 @@ g_initdll = TRUE; log_debug ("%s:%s: first time initialization done\n", SRCNAME, __func__); + if ( SVN_REVISION > opt.svn_revision ) + MessageBox (NULL, + _("You have installed a new version of GpgOL.\n" + "\n" + "Please open the option dialog and check that" + " the settings are correct for your needs. The option" + " dialog can be found in the main menu at:" + " Extras->Options->GpgOL.\n"), + "GpgOL", MB_ICONHAND|MB_OK); } } From cvs at cvs.gnupg.org Fri Mar 7 13:53:30 2008 From: cvs at cvs.gnupg.org (svn author wk) Date: Fri, 07 Mar 2008 13:53:30 +0100 Subject: [svn] GpgOL - r229 - in trunk: . po src Message-ID: Author: wk Date: 2008-03-07 13:53:28 +0100 (Fri, 07 Mar 2008) New Revision: 229 Modified: trunk/NEWS trunk/po/de.po trunk/po/sv.po trunk/src/ChangeLog trunk/src/mapihelp.cpp trunk/src/mapihelp.h trunk/src/message-events.cpp trunk/src/mimemaker.c trunk/src/mymapitags.h Log: Pass the sender address to the UI server. Modified: trunk/src/ChangeLog =================================================================== --- trunk/src/ChangeLog 2008-03-07 11:30:33 UTC (rev 228) +++ trunk/src/ChangeLog 2008-03-07 12:53:28 UTC (rev 229) @@ -1,5 +1,9 @@ 2008-03-07 Werner Koch + * mapihelp.cpp (mapi_get_sender): New. + * mymapitags.h (PR_PRIMARY_SEND_ACCT): New. + * mimemaker.c (do_mime_sign): Pass the sender to the engine. + * common.h (opt): Add field SVN_REVISION. * main.c (read_options, write_options): Set it. * olflange.cpp (GpgolExt): Print a warning on program update. Modified: trunk/NEWS =================================================================== --- trunk/NEWS 2008-03-07 11:30:33 UTC (rev 228) +++ trunk/NEWS 2008-03-07 12:53:28 UTC (rev 229) @@ -13,7 +13,12 @@ * Soft line breaks in QP encoded messages are now correctly processed. + * The sender's address is send to the UI server to allow it to select + an appropriate signing key. + * Automatic protocol selection works now also with signing. + + Noteworthy changes for version 0.10.5 (2008-02-18) ================================================== Modified: trunk/po/de.po [not shown] Modified: trunk/po/sv.po [not shown] Modified: trunk/src/mapihelp.cpp =================================================================== --- trunk/src/mapihelp.cpp 2008-03-07 11:30:33 UTC (rev 228) +++ trunk/src/mapihelp.cpp 2008-03-07 12:53:28 UTC (rev 229) @@ -948,6 +948,66 @@ +/* Return teh sender of the message. According to the specs this is + an UTF-8 string; we rely on that the UI server handles + internationalized domain names. */ +char * +mapi_get_sender (LPMESSAGE message) +{ + HRESULT hr; + LPSPropValue propval = NULL; + char *buf; + char *p0, *p; + + if (!message) + return NULL; /* No message: Nop. */ + + hr = HrGetOneProp ((LPMAPIPROP)message, PR_PRIMARY_SEND_ACCT, &propval); + if (FAILED (hr)) + { + log_debug ("%s:%s: HrGetOneProp failed: hr=%#lx\n", + SRCNAME, __func__, hr); + return NULL; + } + + if (PROP_TYPE (propval->ulPropTag) != PT_UNICODE) + { + log_debug ("%s:%s: HrGetOneProp returns invalid type %lu\n", + SRCNAME, __func__, PROP_TYPE (propval->ulPropTag) ); + MAPIFreeBuffer (propval); + return NULL; + } + + buf = wchar_to_utf8 (propval->Value.lpszW); + MAPIFreeBuffer (propval); + if (!buf) + { + log_error ("%s:%s: error converting to utf8\n", SRCNAME, __func__); + return NULL; + } + /* The PR_PRIMARY_SEND_ACCT property seems to be divided into fields + using Ctrl-A as delimiter. The first field looks like the ascii + formatted number of fields to follow, the second field like the + email account and the third seems to be a textual description of + that account. We return the second field. */ + p = strchr (buf, '\x01'); + if (!p) + { + log_error ("%s:%s: unknown format of the value `%s'\n", + SRCNAME, __func__, buf); + xfree (buf); + return NULL; + } + for (p0=buf, p++; *p && *p != '\x01';) + *p0++ = *p++; + *p0 = 0; + log_debug ("%s:%s: address is `%s'\n", SRCNAME, __func__, buf); + return buf; +} + + + + /* Return the message type. This function knows only about our own message types. Returns MSGTYPE_UNKNOWN for any MESSAGE we have no special support for. */ Modified: trunk/src/mapihelp.h =================================================================== --- trunk/src/mapihelp.h 2008-03-07 11:30:33 UTC (rev 228) +++ trunk/src/mapihelp.h 2008-03-07 12:53:28 UTC (rev 229) @@ -1,5 +1,5 @@ /* mapihelp.h - Helper functions for MAPI - * Copyright (C) 2005, 2007 g10 Code GmbH + * Copyright (C) 2005, 2007, 2008 g10 Code GmbH * * This file is part of GpgOL. * @@ -103,6 +103,7 @@ int mapi_change_message_class (LPMESSAGE message, int sync_override); char *mapi_get_message_class (LPMESSAGE message); +char *mapi_get_sender (LPMESSAGE message); msgtype_t mapi_get_message_type (LPMESSAGE message); int mapi_to_mime (LPMESSAGE message, const char *filename); Modified: trunk/src/message-events.cpp =================================================================== --- trunk/src/message-events.cpp 2008-03-07 11:30:33 UTC (rev 228) +++ trunk/src/message-events.cpp 2008-03-07 12:53:28 UTC (rev 229) @@ -276,7 +276,7 @@ if (SUCCEEDED (hr)) { protocol_t proto = m_pExchExt->m_protoSelection; - + if (m_pExchExt->m_gpgEncrypt && m_pExchExt->m_gpgSign) rc = message_sign_encrypt (msg, proto, hWnd); else if (m_pExchExt->m_gpgEncrypt && !m_pExchExt->m_gpgSign) Modified: trunk/src/mimemaker.c =================================================================== --- trunk/src/mimemaker.c 2008-03-07 11:30:33 UTC (rev 228) +++ trunk/src/mimemaker.c 2008-03-07 12:53:28 UTC (rev 229) @@ -1184,7 +1184,8 @@ /* Prepare the signing. FIXME: figure out the signer of the mail. */ if (engine_create_filter (&filter, collect_signature, &sigbuffer)) goto failure; - if (engine_sign_start (filter, hwnd, protocol, NULL, &protocol)) + if (engine_sign_start (filter, hwnd, protocol, + mapi_get_sender (message), &protocol)) goto failure; protocol = check_protocol (protocol); Modified: trunk/src/mymapitags.h =================================================================== --- trunk/src/mymapitags.h 2008-03-07 11:30:33 UTC (rev 228) +++ trunk/src/mymapitags.h 2008-03-07 12:53:28 UTC (rev 229) @@ -381,6 +381,7 @@ #define PR_PREPROCESS PROP_TAG( PT_BOOLEAN, 0x0E22) #define PR_ORIGINATING_MTA_CERTIFICATE PROP_TAG( PT_BINARY, 0x0E25) #define PR_PROOF_OF_SUBMISSION PROP_TAG( PT_BINARY, 0x0E26) +#define PR_PRIMARY_SEND_ACCT PROP_TAG( PT_UNICODE, 0x0E28) #define PR_ENTRYID PROP_TAG( PT_BINARY, 0x0FFF) #define PR_OBJECT_TYPE PROP_TAG( PT_LONG, 0x0FFE) #define PR_ICON PROP_TAG( PT_BINARY, 0x0FFD) From cvs at cvs.gnupg.org Fri Mar 7 20:08:32 2008 From: cvs at cvs.gnupg.org (svn author dshaw) Date: Fri, 07 Mar 2008 20:08:32 +0100 Subject: [svn] GnuPG - r4706 - branches/STABLE-BRANCH-1-4 Message-ID: Author: dshaw Date: 2008-03-07 20:08:31 +0100 (Fri, 07 Mar 2008) New Revision: 4706 Modified: branches/STABLE-BRANCH-1-4/ChangeLog branches/STABLE-BRANCH-1-4/configure.ac Log: * configure.ac: Darwin's /bin/sh has a builtin echo that doesn't understand '-n'. Use tr to trim the carriage return instead. Modified: branches/STABLE-BRANCH-1-4/ChangeLog =================================================================== --- branches/STABLE-BRANCH-1-4/ChangeLog 2008-03-06 18:28:47 UTC (rev 4705) +++ branches/STABLE-BRANCH-1-4/ChangeLog 2008-03-07 19:08:31 UTC (rev 4706) @@ -1,3 +1,8 @@ +2008-03-07 David Shaw + + * configure.ac: Darwin's /bin/sh has a builtin echo that doesn't + understand '-n'. Use tr to trim the carriage return instead. + 2008-03-06 David Shaw * configure.ac: Post-release update. Modified: branches/STABLE-BRANCH-1-4/configure.ac =================================================================== --- branches/STABLE-BRANCH-1-4/configure.ac 2008-03-06 18:28:47 UTC (rev 4705) +++ branches/STABLE-BRANCH-1-4/configure.ac 2008-03-07 19:08:31 UTC (rev 4706) @@ -1,6 +1,6 @@ # configure.ac script for GnuPG -# Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, -# 2007 Free Software Foundation, Inc. +# Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, +# 2008 Free Software Foundation, Inc. # # This file is part of GnuPG. # @@ -28,8 +28,9 @@ m4_define([my_version], [1.4.9rc1]) m4_define([my_issvn], [yes]) -m4_define([svn_revision], m4_esyscmd([echo -n $((svn info 2>/dev/null \ - || echo 'Revision: 0')|sed -n '/^Revision:/ s/[^0-9]//gp'|head -1)])) +m4_define([svn_revision], m4_esyscmd([echo $((svn info 2>/dev/null \ + || echo 'Revision: 0')|sed -n '/^Revision:/ s/[^0-9]//gp'|head -1)| \ + tr -d '\n'])) AC_INIT([gnupg], my_version[]m4_if(my_issvn,[yes],[-svn[]svn_revision]), [bug-gnupg at gnu.org]) # Set development_version to yes if the minor number is odd or you From cvs at cvs.gnupg.org Mon Mar 10 10:13:53 2008 From: cvs at cvs.gnupg.org (svn author wk) Date: Mon, 10 Mar 2008 10:13:53 +0100 Subject: [svn] GpgOL - r230 - in trunk: . src Message-ID: Author: wk Date: 2008-03-10 10:13:52 +0100 (Mon, 10 Mar 2008) New Revision: 230 Modified: trunk/ChangeLog trunk/NEWS trunk/README trunk/configure.ac trunk/src/ChangeLog trunk/src/engine-assuan.c trunk/src/engine.c Log: Performance fixes. Modified: trunk/ChangeLog =================================================================== --- trunk/ChangeLog 2008-03-07 12:53:28 UTC (rev 229) +++ trunk/ChangeLog 2008-03-10 09:13:52 UTC (rev 230) @@ -1,3 +1,7 @@ +2008-03-10 Werner Koch + + * Release 0.10.6. + 2008-03-07 Werner Koch * configure.ac (SVN_REVISION): New AC_DEFINE. Modified: trunk/src/ChangeLog =================================================================== --- trunk/src/ChangeLog 2008-03-07 12:53:28 UTC (rev 229) +++ trunk/src/ChangeLog 2008-03-10 09:13:52 UTC (rev 230) @@ -1,3 +1,12 @@ +2008-03-10 Werner Koch + + * engine.c (FILTER_BUFFER_SIZE): Increase to 4k. + (engine_filter, engine_wait, engine_wait): Replace Sleep by + SwitchToThread. + * engine-assuan.c (struct work_item_s): Increase buffer to 1k. + (worker_start_write, async_worker_thread): Replace Sleep by + SwitchToThread. + 2008-03-07 Werner Koch * mapihelp.cpp (mapi_get_sender): New. Modified: trunk/NEWS =================================================================== --- trunk/NEWS 2008-03-07 12:53:28 UTC (rev 229) +++ trunk/NEWS 2008-03-10 09:13:52 UTC (rev 230) @@ -1,9 +1,6 @@ -Noteworthy changes for version 0.10.6 +Noteworthy changes for version 0.10.6 (2008-03-10) ================================================== - UNDER HEAVY DEVELOPMENT - DO NOT USE FOR PRODUCTION! - - Under OL2007 some menu entries are missing. - * More tweaks to allow processing of opaque encrypted or signed S/MIME. @@ -18,7 +15,9 @@ * Automatic protocol selection works now also with signing. + * Processing large messages is faster. + Noteworthy changes for version 0.10.5 (2008-02-18) ================================================== Modified: trunk/README =================================================================== --- trunk/README 2008-03-07 12:53:28 UTC (rev 229) +++ trunk/README 2008-03-10 09:13:52 UTC (rev 230) @@ -1,11 +1,6 @@ GpgOL is a GnuPG plugin for MS Outlook. - UNDER HEAVY DEVELOPMENT - DO NOT USE FOR PRODUCTION! - UNDER HEAVY DEVELOPMENT - DO NOT USE FOR PRODUCTION! - UNDER HEAVY DEVELOPMENT - DO NOT USE FOR PRODUCTION! - UNDER HEAVY DEVELOPMENT - DO NOT USE FOR PRODUCTION! - UNDER HEAVY DEVELOPMENT - DO NOT USE FOR PRODUCTION! - UNDER HEAVY DEVELOPMENT - DO NOT USE FOR PRODUCTION! +WARNING: This version requires the latest Kleopatra software. . Top directory with build scripts and information files. @@ -31,8 +26,3 @@ select "query" and there category "gpgol") if you did not found any information there please send a report, including all relevant version numbers to the address given at the top of this AUTHORS file. - - - - - Modified: trunk/configure.ac =================================================================== --- trunk/configure.ac 2008-03-07 12:53:28 UTC (rev 229) +++ trunk/configure.ac 2008-03-10 09:13:52 UTC (rev 230) @@ -17,7 +17,7 @@ # Set my_issvn to "yes" for non-released code. Remember to run an # "svn up" and "autogen.sh" right before creating a distribution. m4_define([my_version], [0.10.6]) -m4_define([my_issvn], [yes]) +m4_define([my_issvn], [no]) m4_define([svn_revision], m4_esyscmd([echo -n $( (svn info 2>/dev/null \ || echo 'Revision: 0')|sed -n '/^Revision:/ {s/[^0-9]//gp;q;}')])) Modified: trunk/src/engine-assuan.c =================================================================== --- trunk/src/engine-assuan.c 2008-03-07 12:53:28 UTC (rev 229) +++ trunk/src/engine-assuan.c 2008-03-10 09:13:52 UTC (rev 230) @@ -110,7 +110,7 @@ the item is removed from the queue. */ OVERLAPPED ov; /* The overlapped info structure. */ - char buffer[128]; /* The buffer used by ReadFile or WriteFile. */ + char buffer[1024]; /* The buffer used by ReadFile or WriteFile. */ }; @@ -726,7 +726,7 @@ { /* log_debug ("%s:%s: [%s:%p] ignoring EAGAIN from callback", */ /* SRCNAME, __func__, item->name, item->hd); */ - Sleep (10); + SwitchToThread (); retval = 1; } else @@ -990,7 +990,7 @@ } LeaveCriticalSection (&work_queue_lock); - Sleep (0); + SwitchToThread (); EnterCriticalSection (&work_queue_lock); if (debug_ioworker_extra) Modified: trunk/src/engine.c =================================================================== --- trunk/src/engine.c 2008-03-07 12:53:28 UTC (rev 229) +++ trunk/src/engine.c 2008-03-10 09:13:52 UTC (rev 230) @@ -34,7 +34,7 @@ #include "engine-assuan.h" -#define FILTER_BUFFER_SIZE 128 /* FIXME: Increase it after testing */ +#define FILTER_BUFFER_SIZE 4096 #define TRACEPOINT() do { log_debug ("%s:%s:%d: tracepoint\n", \ @@ -486,7 +486,7 @@ if (!PulseEvent (filter->in.condvar)) log_error_w32 (-1, "%s:%s: PulseEvent(in) failed", SRCNAME, __func__); release_in_lock (filter, __func__); - Sleep (50); + SwitchToThread (); } if (debug_filter) @@ -609,7 +609,7 @@ more = 1; release_in_lock (filter, __func__); if (more) - Sleep (50); + SwitchToThread (); } while (more); @@ -651,7 +651,7 @@ more = 1; release_in_lock (filter, __func__); if (more) - Sleep (50); + SwitchToThread (); } while (more); } From cvs at cvs.gnupg.org Mon Mar 10 10:25:52 2008 From: cvs at cvs.gnupg.org (svn author wk) Date: Mon, 10 Mar 2008 10:25:52 +0100 Subject: [svn] GpgOL - r231 - tags Message-ID: Author: wk Date: 2008-03-10 10:25:51 +0100 (Mon, 10 Mar 2008) New Revision: 231 Added: tags/gpgol-0.10.6/ Log: From cvs at cvs.gnupg.org Tue Mar 11 11:56:45 2008 From: cvs at cvs.gnupg.org (svn author wk) Date: Tue, 11 Mar 2008 11:56:45 +0100 Subject: [svn] GpgOL - r232 - in trunk: . po src Message-ID: Author: wk Date: 2008-03-11 11:56:44 +0100 (Tue, 11 Mar 2008) New Revision: 232 Modified: trunk/NEWS trunk/configure.ac trunk/po/de.po trunk/po/sv.po trunk/src/ChangeLog trunk/src/engine-assuan.c trunk/src/engine-assuan.h trunk/src/engine.c trunk/src/engine.h trunk/src/mimemaker.c Log: Changed the way sign+encrypt works. Modified: trunk/src/ChangeLog =================================================================== --- trunk/src/ChangeLog 2008-03-10 09:25:51 UTC (rev 231) +++ trunk/src/ChangeLog 2008-03-11 10:56:44 UTC (rev 232) @@ -1,3 +1,15 @@ +2008-03-11 Werner Koch + + * engine-assuan.c (op_assuan_encrypt): Factor some code out to .. + (op_assuan_encrypt_bottom): .. new. + (engine_assuan_encstate_s): New. + * engine.c (engine_encrypt_start): Split some code into .. + (engine_encrypt_prepare): .. new. + (engine_cancel): Cancel prepared encryption. + * mimemaker.c (mime_encrypt): Use engine_encrypt_prepare and _start. + (mime_sign_encrypt): Likewise, but do the _start only after + completing the signing. + 2008-03-10 Werner Koch * engine.c (FILTER_BUFFER_SIZE): Increase to 4k. Modified: trunk/NEWS =================================================================== --- trunk/NEWS 2008-03-10 09:25:51 UTC (rev 231) +++ trunk/NEWS 2008-03-11 10:56:44 UTC (rev 232) @@ -1,3 +1,9 @@ +Noteworthy changes for version 0.10.7 +================================================== + + * Changed the way sign+encrypt works to help the UI-server. + + Noteworthy changes for version 0.10.6 (2008-03-10) ================================================== Modified: trunk/configure.ac =================================================================== --- trunk/configure.ac 2008-03-10 09:25:51 UTC (rev 231) +++ trunk/configure.ac 2008-03-11 10:56:44 UTC (rev 232) @@ -16,8 +16,8 @@ # Remember to change the version number immediately *after* a release. # Set my_issvn to "yes" for non-released code. Remember to run an # "svn up" and "autogen.sh" right before creating a distribution. -m4_define([my_version], [0.10.6]) -m4_define([my_issvn], [no]) +m4_define([my_version], [0.10.7]) +m4_define([my_issvn], [yes]) m4_define([svn_revision], m4_esyscmd([echo -n $( (svn info 2>/dev/null \ || echo 'Revision: 0')|sed -n '/^Revision:/ {s/[^0-9]//gp;q;}')])) Modified: trunk/po/de.po [not shown] Modified: trunk/po/sv.po [not shown] Modified: trunk/src/engine-assuan.c =================================================================== --- trunk/src/engine-assuan.c 2008-03-10 09:25:51 UTC (rev 231) +++ trunk/src/engine-assuan.c 2008-03-11 10:56:44 UTC (rev 232) @@ -114,6 +114,20 @@ }; +/* A helper context used to convey information from op_assuan_encrypt + to op_assuan_encrypt_bottom. */ +struct engine_assuan_encstate_s +{ + engine_filter_t filter; + const char *protocol_name; + HANDLE inpipe[2]; + HANDLE outpipe[2]; + closure_data_t cld; + assuan_context_t ctx; + ULONG cmdid; +}; + + /* The queue of all outstandig I/O operations. Protected by the work_queue_lock. */ static work_item_t work_queue; @@ -1372,12 +1386,15 @@ the window handle of the current window and used to maintain the correct relationship between a popups and the active window. If this function returns success, the data objects may only be - destroyed after an engine_wait or engine_cancel. */ + destroyed after an engine_wait or engine_cancel. On success the + fucntion returns a pojunter to the encryption state and thus + requires that op_assuan_encrypt_bottom will be run later. */ int op_assuan_encrypt (protocol_t protocol, gpgme_data_t indata, gpgme_data_t outdata, engine_filter_t filter, void *hwnd, - char **recipients, protocol_t *r_used_protocol) + char **recipients, protocol_t *r_used_protocol, + struct engine_assuan_encstate_s **r_encstate) { gpg_error_t err; closure_data_t cld; @@ -1390,9 +1407,12 @@ char *p; int detect_protocol; const char *protocol_name; + struct engine_assuan_encstate_s *encstate; + *r_encstate = NULL; + detect_protocol = !(protocol_name = get_protocol_name (protocol)); - + err = connect_uiserver (&ctx, &pid, &cmdid, hwnd); if (err) return err; @@ -1462,12 +1482,19 @@ cmdid, NULL, 0); enqueue_callback ("output", ctx, outdata, outpipe[0], 0, finalize_handler, cmdid, NULL, 1 /* Wait on success */); - snprintf (line, sizeof line, "ENCRYPT --protocol=%s", protocol_name); - err = start_command (ctx, cld, cmdid, line); - cld = NULL; /* Now owned by start_command. */ - if (err) - goto leave; + encstate = xcalloc (1, sizeof *encstate); + encstate->filter = filter; + encstate->protocol_name = protocol_name; + encstate->inpipe[0] = inpipe[0]; + encstate->inpipe[1] = inpipe[1]; + encstate->outpipe[0] = outpipe[0]; + encstate->outpipe[1] = outpipe[1]; + encstate->cld = cld; + encstate->ctx = ctx; + encstate->cmdid = cmdid; + *r_encstate = encstate; + return 0; leave: if (err) @@ -1483,7 +1510,44 @@ return err; } +/* Continue and actually start the encryption or cancel it with CANCEL + set to TRUE. The fucntion takes ownvership of ENCSTATE. */ +int +op_assuan_encrypt_bottom (struct engine_assuan_encstate_s *encstate, + int cancel) +{ + char line[1024]; + gpg_error_t err; + if (!encstate) + return 0; + if (cancel) + err = gpg_error (GPG_ERR_CANCELED); + else + { + snprintf (line, sizeof line, "ENCRYPT --protocol=%s", + encstate->protocol_name); + err = start_command (encstate->ctx, encstate->cld, + encstate->cmdid, line); + encstate->cld = NULL; /* Now owned by start_command. */ + } + + if (err) + { + /* Fixme: Cancel stuff in the work_queue. */ + close_pipe (encstate->inpipe); + close_pipe (encstate->outpipe); + xfree (encstate->cld); + assuan_disconnect (encstate->ctx); + } + else + engine_private_set_cancel (encstate->filter, encstate->ctx); + xfree (encstate); + return err; +} + + + /* Note that this closure is called in the context of the async_worker_thread. */ Modified: trunk/src/engine-assuan.h =================================================================== --- trunk/src/engine-assuan.h 2008-03-10 09:25:51 UTC (rev 231) +++ trunk/src/engine-assuan.h 2008-03-11 10:56:44 UTC (rev 232) @@ -1,5 +1,5 @@ /* engine-assuan.h - Assuan server based crypto engine - * Copyright (C) 2007 g10 Code GmbH + * Copyright (C) 2007, 2008 g10 Code GmbH * * This file is part of GpgOL. * @@ -31,6 +31,8 @@ #include "engine.h" +struct engine_assuan_encstate_s; + int op_assuan_init (void); void op_assuan_deinit (void); void engine_assuan_cancel (void *cancel_data); @@ -38,7 +40,10 @@ int op_assuan_encrypt (protocol_t protocol, gpgme_data_t indata, gpgme_data_t outdata, engine_filter_t notify_data, void *hwnd, - char **recipients, protocol_t *r_used_protocol); + char **recipients, protocol_t *r_used_protocol, + struct engine_assuan_encstate_s **r_encstate); +int op_assuan_encrypt_bottom (struct engine_assuan_encstate_s *encstate, + int cancel); int op_assuan_sign (protocol_t protocol, gpgme_data_t indata, gpgme_data_t outdata, engine_filter_t filter, void *hwnd, Modified: trunk/src/engine.c =================================================================== --- trunk/src/engine.c 2008-03-10 09:25:51 UTC (rev 231) +++ trunk/src/engine.c 2008-03-11 10:56:44 UTC (rev 232) @@ -101,6 +101,10 @@ gpgme_data_t indata; /* Input data. */ gpgme_data_t outdata; /* Output data. */ void *cancel_data; /* Used by engine_cancel. */ + + /* A pointer used convey information from engine_encrypt_prepare to + engine_encrypt_start. */ + struct engine_assuan_encstate_s *encstate; }; @@ -680,6 +684,9 @@ if (!filter) return; + /* First we need to cancel a possible prepared encrypt operation. */ + engine_encrypt_start (filter, 1); + take_in_lock (filter, __func__); cancel_data = filter->cancel_data; filter->cancel_data = NULL; @@ -713,11 +720,14 @@ be reused after having been used through this function. However, the lifetime of the filter object lasts until the final engine_wait or engine_cancel. On return the protocol to be used is stored at - R_PROTOCOL. */ + R_PROTOCOL. This is a two part fucntion. engine_encrypt_prepare + needs to be called first followed by engine_encrypt_start. The + latter command has just one argument CANCEL which can be set to + true to cancel the prepared command. */ int -engine_encrypt_start (engine_filter_t filter, HWND hwnd, - protocol_t req_protocol, char **recipients, - protocol_t *r_protocol) +engine_encrypt_prepare (engine_filter_t filter, HWND hwnd, + protocol_t req_protocol, char **recipients, + protocol_t *r_protocol) { gpg_error_t err; protocol_t used_protocol; @@ -726,7 +736,8 @@ if (filter->use_assuan) { err = op_assuan_encrypt (req_protocol, filter->indata, filter->outdata, - filter, hwnd, recipients, &used_protocol); + filter, hwnd, recipients, &used_protocol, + &filter->encstate); if (!err) *r_protocol = used_protocol; } @@ -737,7 +748,24 @@ return err; } +/* See engine_encrypt_prepare. */ +int +engine_encrypt_start (engine_filter_t filter, int cancel) +{ + gpg_error_t err; + if (filter->use_assuan) + { + err = op_assuan_encrypt_bottom (filter->encstate, cancel); + filter->encstate = NULL; + } + else + err = 0; /* This is a dummy here. */ + + return err; +} + + /* Start an detached signing operation. FILTER is an object created by engine_create_filter. The caller needs to call engine_wait to finish the operation. A filter object may not be reused after Modified: trunk/src/engine.h =================================================================== --- trunk/src/engine.h 2008-03-10 09:25:51 UTC (rev 231) +++ trunk/src/engine.h 2008-03-11 10:56:44 UTC (rev 232) @@ -63,9 +63,10 @@ int engine_wait (engine_filter_t filter); void engine_cancel (engine_filter_t filter); -int engine_encrypt_start (engine_filter_t filter, HWND hwnd, - protocol_t req_protocol, char **recipients, - protocol_t *r_protocol); +int engine_encrypt_prepare (engine_filter_t filter, HWND hwnd, + protocol_t req_protocol, char **recipients, + protocol_t *r_protocol); +int engine_encrypt_start (engine_filter_t filter, int cancel); int engine_sign_start (engine_filter_t filter, HWND hwnd, protocol_t protocol, const char *sender, protocol_t *r_protocol); Modified: trunk/src/mimemaker.c =================================================================== --- trunk/src/mimemaker.c 2008-03-10 09:25:51 UTC (rev 231) +++ trunk/src/mimemaker.c 2008-03-11 10:56:44 UTC (rev 232) @@ -1593,8 +1593,10 @@ will fail early. */ if (engine_create_filter (&filter, write_buffer_for_cb, sink)) goto failure; - if (engine_encrypt_start (filter, hwnd, protocol, recipients, &protocol)) + if (engine_encrypt_prepare (filter, hwnd, protocol, recipients, &protocol)) goto failure; + if (engine_encrypt_start (filter, 0)) + goto failure; protocol = check_protocol (protocol); if (protocol == PROTOCOL_UNKNOWN) @@ -1730,13 +1732,13 @@ /* Prepare the encryption. We do this early as it is quite common - that some recipients are not be available and thus the encryption + that some recipients are not available and thus the encryption will fail early. This is also required to allow the UIserver to figure out the protocol to use if we have not forced one. */ if (engine_create_filter (&filter, write_buffer_for_cb, sink)) goto failure; - if ((rc=engine_encrypt_start (filter, hwnd, - protocol, recipients, &protocol))) + if ((rc=engine_encrypt_prepare (filter, hwnd, + protocol, recipients, &protocol))) goto failure; protocol = check_protocol (protocol); @@ -1752,6 +1754,18 @@ if (do_mime_sign (message, hwnd, protocol, &att_table, tmpsink)) goto failure; + /* Now send the actual ENCRYPT command. This split up between + prepare and start is necessary to help with the implementarion of + the UI-server. If we would send the ENCRYPT command immediately + the UI-server might block while reading from the input stream + because we are first going to do a sign operation which in trun + needs the attention of the UI server. A more robust but + complicated approach to the UI-server would be to delay the + reading (and thus the start of the underlying encrypt operation) + until the first byte has been received. */ + if ((rc=engine_encrypt_start (filter, 0))) + goto failure; + /* Write the top header. */ rc = create_top_encryption_header (sink, protocol, boundary); if (rc) From cvs at cvs.gnupg.org Tue Mar 11 11:57:55 2008 From: cvs at cvs.gnupg.org (svn author wk) Date: Tue, 11 Mar 2008 11:57:55 +0100 Subject: [svn] GpgOL - r233 - trunk Message-ID: Author: wk Date: 2008-03-11 11:57:54 +0100 (Tue, 11 Mar 2008) New Revision: 233 Modified: trunk/NEWS trunk/configure.ac Log: Preparing 0.10.7 Modified: trunk/NEWS =================================================================== --- trunk/NEWS 2008-03-11 10:56:44 UTC (rev 232) +++ trunk/NEWS 2008-03-11 10:57:54 UTC (rev 233) @@ -1,4 +1,4 @@ -Noteworthy changes for version 0.10.7 +Noteworthy changes for version 0.10.7 (2008-03-11) ================================================== * Changed the way sign+encrypt works to help the UI-server. Modified: trunk/configure.ac =================================================================== --- trunk/configure.ac 2008-03-11 10:56:44 UTC (rev 232) +++ trunk/configure.ac 2008-03-11 10:57:54 UTC (rev 233) @@ -17,7 +17,7 @@ # Set my_issvn to "yes" for non-released code. Remember to run an # "svn up" and "autogen.sh" right before creating a distribution. m4_define([my_version], [0.10.7]) -m4_define([my_issvn], [yes]) +m4_define([my_issvn], [no]) m4_define([svn_revision], m4_esyscmd([echo -n $( (svn info 2>/dev/null \ || echo 'Revision: 0')|sed -n '/^Revision:/ {s/[^0-9]//gp;q;}')])) From cvs at cvs.gnupg.org Tue Mar 11 12:00:21 2008 From: cvs at cvs.gnupg.org (svn author wk) Date: Tue, 11 Mar 2008 12:00:21 +0100 Subject: [svn] GpgOL - r234 - tags Message-ID: Author: wk Date: 2008-03-11 12:00:21 +0100 (Tue, 11 Mar 2008) New Revision: 234 Added: tags/gpgol-0.10.7/ Log: From cvs at cvs.gnupg.org Tue Mar 11 17:05:42 2008 From: cvs at cvs.gnupg.org (svn author marcus) Date: Tue, 11 Mar 2008 17:05:42 +0100 Subject: [svn] gpgme - r1308 - in trunk: . doc gpgme Message-ID: Author: marcus Date: 2008-03-11 17:05:40 +0100 (Tue, 11 Mar 2008) New Revision: 1308 Modified: trunk/TODO trunk/doc/ChangeLog trunk/doc/gpgme.texi trunk/gpgme/ChangeLog trunk/gpgme/data.c Log: doc/ 2008-03-11 Marcus Brinkmann * gpgme.texi (File Based Data Buffers): Document the need for blocking operations. (Callback Based Data Buffers): Likewise. gpgme/ 2008-03-11 Marcus Brinkmann * data.c (gpgme_data_read, gpgme_data_write): Retry on EINTR. Modified: trunk/doc/ChangeLog =================================================================== --- trunk/doc/ChangeLog 2008-03-06 14:54:11 UTC (rev 1307) +++ trunk/doc/ChangeLog 2008-03-11 16:05:40 UTC (rev 1308) @@ -1,3 +1,9 @@ +2008-03-11 Marcus Brinkmann + + * gpgme.texi (File Based Data Buffers): Document the need for + blocking operations. + (Callback Based Data Buffers): Likewise. + 2008-03-05 Marcus Brinkmann * gpgme.texi (Library Version Check): Rename snippet function to Modified: trunk/gpgme/ChangeLog =================================================================== --- trunk/gpgme/ChangeLog 2008-03-06 14:54:11 UTC (rev 1307) +++ trunk/gpgme/ChangeLog 2008-03-11 16:05:40 UTC (rev 1308) @@ -1,3 +1,7 @@ +2008-03-11 Marcus Brinkmann + + * data.c (gpgme_data_read, gpgme_data_write): Retry on EINTR. + 2008-03-06 Marcus Brinkmann * key.c (_gpgme_key_add_sig): Terminate UID in case SRC is NULL. Modified: trunk/TODO =================================================================== --- trunk/TODO 2008-03-06 14:54:11 UTC (rev 1307) +++ trunk/TODO 2008-03-11 16:05:40 UTC (rev 1308) @@ -41,6 +41,15 @@ There is a configure time warning, though. * New features: +** Flow control for data objects. + Currently, gpgme_data_t objects are assumed to be blocking. To + break this assumption, we need either (A) a way for an user I/O + callback to store the current operation in a continuation that can + be resumed later. While the continuation exists, file descriptors + associated with this operation must be removed from their + respective event loop. or (B) a way for gpgme data objects to be + associated with a waitable object, that can be registered with the + user event loop. Neither is particularly simple. ** Extended notation support. When gpg supports arbitrary binary notation data, provide a user interface for that. ** notification system Modified: trunk/doc/gpgme.texi =================================================================== --- trunk/doc/gpgme.texi 2008-03-06 14:54:11 UTC (rev 1307) +++ trunk/doc/gpgme.texi 2008-03-11 16:05:40 UTC (rev 1308) @@ -1464,6 +1464,14 @@ data, which is used by @acronym{GPGME} to exchange data with the user. @end deftp + at code{gpgme_data_t} objects do not provide notifications on events. +It is assumed that read and write operations are blocking until data +is available. If this is undesirable, the application must ensure +that all GPGME data operations always have data available, for example +by using memory buffers or files rather than pipes or sockets. This +might be relevant, for example, if the external event loop mechanism +is used. + @menu * Creating Data Buffers:: Creating new data buffers. * Destroying Data Buffers:: Releasing data buffers. @@ -1575,6 +1583,10 @@ a bit more from the file descriptor than is actually needed by the crypto engine in the desired operation because of internal buffering. +Note that GPGME assumes that the file descriptor is set to blocking +mode. Errors during I/O operations, except for EINTR, are usually +fatal for crypto operations. + The function returns the error code @code{GPG_ERR_NO_ERROR} if the data object was successfully created, and @code{GPG_ERR_ENOMEM} if not enough memory is available. @@ -1590,6 +1602,10 @@ a bit more from the stream than is actually needed by the crypto engine in the desired operation because of internal buffering. +Note that GPGME assumes that the stream is in blocking mode. Errors +during I/O operations, except for EINTR, are usually fatal for crypto +operations. + The function returns the error code @code{GPG_ERR_NO_ERROR} if the data object was successfully created, and @code{GPG_ERR_ENOMEM} if not enough memory is available. @@ -1611,6 +1627,10 @@ current read position into the space starting at @var{buffer}. The @var{handle} is provided by the user at data object creation time. +Note that GPGME assumes that the read blocks until data is available. +Errors during I/O operations, except for EINTR, are usually fatal for +crypto operations. + The function should return the number of bytes read, 0 on EOF, and -1 on error. If an error occurs, @var{errno} should be set to describe the type of the error. @@ -1624,6 +1644,10 @@ current write position from the space starting at @var{buffer}. The @var{handle} is provided by the user at data object creation time. +Note that GPGME assumes that the write blocks until data is available. +Errors during I/O operations, except for EINTR, are usually fatal for +crypto operations. + The function should return the number of bytes written, and -1 on error. If an error occurs, @var{errno} should be set to describe the type of the error. Modified: trunk/gpgme/data.c =================================================================== --- trunk/gpgme/data.c 2008-03-06 14:54:11 UTC (rev 1307) +++ trunk/gpgme/data.c 2008-03-11 16:05:40 UTC (rev 1308) @@ -87,7 +87,10 @@ errno = ENOSYS; return TRACE_SYSRES (-1); } - res = (*dh->cbs->read) (dh, buffer, size); + do + res = (*dh->cbs->read) (dh, buffer, size); + while (res < 0 && errno == EINTR); + return TRACE_SYSRES (res); } @@ -112,7 +115,10 @@ errno = ENOSYS; return TRACE_SYSRES (-1); } - res = (*dh->cbs->write) (dh, buffer, size); + do + res = (*dh->cbs->write) (dh, buffer, size); + while (res < 0 && errno == EINTR); + return TRACE_SYSRES (res); } From cvs at cvs.gnupg.org Wed Mar 12 10:20:34 2008 From: cvs at cvs.gnupg.org (svn author wk) Date: Wed, 12 Mar 2008 10:20:34 +0100 Subject: [svn] gcry - r1282 - trunk/tests Message-ID: Author: wk Date: 2008-03-12 10:20:33 +0100 (Wed, 12 Mar 2008) New Revision: 1282 Modified: trunk/tests/ChangeLog trunk/tests/benchmark.c Log: Add a non-blinding test Modified: trunk/tests/ChangeLog =================================================================== --- trunk/tests/ChangeLog 2008-01-21 17:17:54 UTC (rev 1281) +++ trunk/tests/ChangeLog 2008-03-12 09:20:33 UTC (rev 1282) @@ -1,3 +1,8 @@ +2008-03-12 Werner Koch + + * benchmark.c (rsa_bench): Add arg NO_BLINDING. + (main): Add option --no-blinding. + 2007-12-05 Werner Koch * pubkey.c (sample_private_key_1_1,sample_private_key_1_2): New. Modified: trunk/tests/benchmark.c =================================================================== --- trunk/tests/benchmark.c 2008-01-21 17:17:54 UTC (rev 1281) +++ trunk/tests/benchmark.c 2008-03-12 09:20:33 UTC (rev 1282) @@ -1,5 +1,5 @@ /* benchmark.c - for libgcrypt - * Copyright (C) 2002, 2004, 2005, 2006 Free Software Foundation, Inc. + * Copyright (C) 2002, 2004, 2005, 2006, 2008 Free Software Foundation, Inc. * * This file is part of Libgcrypt. * @@ -580,7 +580,7 @@ static void -rsa_bench (int iterations, int print_header) +rsa_bench (int iterations, int print_header, int no_blinding) { gpg_error_t err; int p_sizes[] = { 1024, 2048, 3072, 4096 }; @@ -627,7 +627,8 @@ x = gcry_mpi_new (p_sizes[testno]); gcry_mpi_randomize (x, p_sizes[testno]-8, GCRY_WEAK_RANDOM); - err = gcry_sexp_build (&data, NULL, "(data (flags raw) (value %m))", x); + err = gcry_sexp_build (&data, NULL, + "(data (flags raw) (value %m))", x); gcry_mpi_release (x); if (err) die ("converting data failed: %s\n", gcry_strerror (err)); @@ -658,7 +659,33 @@ } } stop_timer (); - printf (" %s\n", elapsed_time ()); + printf (" %s", elapsed_time ()); + + if (no_blinding) + { + fflush (stdout); + x = gcry_mpi_new (p_sizes[testno]); + gcry_mpi_randomize (x, p_sizes[testno]-8, GCRY_WEAK_RANDOM); + err = gcry_sexp_build (&data, NULL, + "(data (flags no-blinding) (value %m))", x); + gcry_mpi_release (x); + if (err) + die ("converting data failed: %s\n", gcry_strerror (err)); + + start_timer (); + for (count=0; count < iterations; count++) + { + gcry_sexp_release (sig); + err = gcry_pk_sign (&sig, data, sec_key); + if (err) + die ("signing failed (%d): %s\n", count, gpg_strerror (err)); + } + stop_timer (); + printf (" %s", elapsed_time ()); + fflush (stdout); + } + + putchar ('\n'); fflush (stdout); gcry_sexp_release (sig); @@ -932,6 +959,7 @@ main( int argc, char **argv ) { int last_argc = -1; + int no_blinding = 0; if (argc) { argc--; argv++; } @@ -973,6 +1001,11 @@ gcry_control (GCRYCTL_USE_RANDOM_DAEMON, 1); argc--; argv++; } + else if (!strcmp (*argv, "--no-blinding")) + { + no_blinding = 1; + argc--; argv++; + } } gcry_control (GCRYCTL_INITIALIZATION_FINISHED, 0); @@ -984,7 +1017,7 @@ putchar ('\n'); cipher_bench (NULL); putchar ('\n'); - rsa_bench (100, 1); + rsa_bench (100, 1, no_blinding); dsa_bench (100, 0); ecc_bench (100, 0); putchar ('\n'); @@ -1028,7 +1061,7 @@ else if ( !strcmp (*argv, "rsa")) { gcry_control (GCRYCTL_ENABLE_QUICK_RANDOM, 0); - rsa_bench (100, 1); + rsa_bench (100, 1, no_blinding); } else if ( !strcmp (*argv, "dsa")) { From cvs at cvs.gnupg.org Thu Mar 13 09:46:27 2008 From: cvs at cvs.gnupg.org (svn author wk) Date: Thu, 13 Mar 2008 09:46:27 +0100 Subject: [svn] GnuPG - r4707 - in trunk: g10 kbx po sm Message-ID: Author: wk Date: 2008-03-13 09:46:08 +0100 (Thu, 13 Mar 2008) New Revision: 4707 Modified: trunk/g10/ChangeLog trunk/g10/passphrase.c trunk/kbx/ChangeLog trunk/kbx/keybox-blob.c trunk/po/be.po trunk/po/ca.po trunk/po/cs.po trunk/po/da.po trunk/po/de.po trunk/po/el.po trunk/po/eo.po trunk/po/es.po trunk/po/et.po trunk/po/fi.po trunk/po/fr.po trunk/po/gl.po trunk/po/hu.po trunk/po/id.po trunk/po/it.po trunk/po/ja.po trunk/po/nb.po trunk/po/pl.po trunk/po/pt.po trunk/po/pt_BR.po trunk/po/ro.po trunk/po/ru.po trunk/po/sk.po trunk/po/sv.po trunk/po/tr.po trunk/po/zh_CN.po trunk/po/zh_TW.po trunk/sm/ChangeLog trunk/sm/certdump.c trunk/sm/keylist.c Log: Fixed an email/DN bug. Changed pinentry prompts. Modified: trunk/g10/ChangeLog =================================================================== --- trunk/g10/ChangeLog 2008-03-07 19:08:31 UTC (rev 4706) +++ trunk/g10/ChangeLog 2008-03-13 08:46:08 UTC (rev 4707) @@ -1,3 +1,8 @@ +2008-03-13 Werner Koch + + * passphrase.c (PROMPTSTRING): Change string to me more similar to + the X.509 prompt. + 2008-02-26 Werner Koch * getkey.c (get_pubkey_byname): Fix comment. Modified: trunk/kbx/ChangeLog =================================================================== --- trunk/kbx/ChangeLog 2008-03-07 19:08:31 UTC (rev 4706) +++ trunk/kbx/ChangeLog 2008-03-13 08:46:08 UTC (rev 4707) @@ -1,3 +1,9 @@ +2008-03-13 Werner Koch + + * keybox-blob.c (x509_email_kludge): Use the same code as in + ..sm/keylist.c so that email parts are not only detected at the + start of the DN. Reported by Yoshiaki Kasahara. + 2007-08-24 Werner Koch * keybox-init.c (keybox_register_file): Use same_file_p. Modified: trunk/sm/ChangeLog =================================================================== --- trunk/sm/ChangeLog 2008-03-07 19:08:31 UTC (rev 4706) +++ trunk/sm/ChangeLog 2008-03-13 08:46:08 UTC (rev 4707) @@ -1,3 +1,10 @@ +2008-03-13 Werner Koch + + * certdump.c (gpgsm_fpr_and_name_for_status): Fix signed/unsigned + char issue. + (gpgsm_format_keydesc): Remove superfluous test. Add expire date + to the prompt. + 2008-02-18 Werner Koch * certchain.c (gpgsm_is_root_cert): Factor code out to ... Modified: trunk/g10/passphrase.c =================================================================== --- trunk/g10/passphrase.c 2008-03-07 19:08:31 UTC (rev 4706) +++ trunk/g10/passphrase.c 2008-03-13 08:46:08 UTC (rev 4707) @@ -306,10 +306,11 @@ #undef KEYIDSTRING -#define PROMPTSTRING _("You need a passphrase to unlock the secret" \ - " key for user:\n" \ +#define PROMPTSTRING _("Please enter the passphrase to unlock the" \ + " secret key for the OpenPGP certificate:\n" \ "\"%.*s\"\n" \ - "%u-bit %s key, ID %s, created %s%s\n" ) + "%u-bit %s key, ID %s,\n" \ + "created %s%s.\n" ) atext = xmalloc ( 100 + strlen (PROMPTSTRING) + uidlen + 15 + strlen(algo_name) + keystrlen() @@ -448,7 +449,8 @@ { if (strchr (description, '%')) { - char *tmp = unescape_percent_string (description); + char *tmp = unescape_percent_string + ((const unsigned char*)description); tty_printf ("\n%s\n", tmp); xfree (tmp); } Modified: trunk/kbx/keybox-blob.c =================================================================== --- trunk/kbx/keybox-blob.c 2008-03-07 19:08:31 UTC (rev 4706) +++ trunk/kbx/keybox-blob.c 2008-03-13 08:46:08 UTC (rev 4707) @@ -1,5 +1,5 @@ /* keybox-blob.c - KBX Blob handling - * Copyright (C) 2000, 2001, 2002, 2003 Free Software Foundation, Inc. + * Copyright (C) 2000, 2001, 2002, 2003, 2008 Free Software Foundation, Inc. * * This file is part of GnuPG. * @@ -778,34 +778,46 @@ #ifdef KEYBOX_WITH_X509 -/* return an allocated string with the email address extracted from a - DN */ +/* Return an allocated string with the email address extracted from a + DN. Note hat we use this code also in ../sm/keylist.c. */ static char * x509_email_kludge (const char *name) { - const char *p; + const char *p, *string; unsigned char *buf; int n; - if (strncmp (name, "1.2.840.113549.1.9.1=#", 22)) - return NULL; + string = name; + for (;;) + { + p = strstr (string, "1.2.840.113549.1.9.1=#"); + if (!p) + return NULL; + if (p == name || (p > string+1 && p[-1] == ',' && p[-2] != '\\')) + { + name = p + 22; + break; + } + string = p + 22; + } + + /* This looks pretty much like an email address in the subject's DN we use this to add an additional user ID entry. This way, - openSSL generated keys get a nicer and usable listing */ - name += 22; + OpenSSL generated keys get a nicer and usable listing. */ for (n=0, p=name; hexdigitp (p) && hexdigitp (p+1); p +=2, n++) ; - if (*p != '#' || !n) + if (!n) return NULL; buf = xtrymalloc (n+3); if (!buf) return NULL; /* oops, out of core */ *buf = '<'; - for (n=1, p=name; *p != '#'; p +=2, n++) + for (n=1, p=name; hexdigitp (p); p +=2, n++) buf[n] = xtoi_2 (p); buf[n++] = '>'; buf[n] = 0; - return (char *)buf; + return (char*)buf; } Modified: trunk/po/be.po [not shown] Modified: trunk/po/ca.po [not shown] Modified: trunk/po/cs.po [not shown] Modified: trunk/po/da.po [not shown] Modified: trunk/po/de.po [not shown] Modified: trunk/po/el.po [not shown] Modified: trunk/po/eo.po [not shown] Modified: trunk/po/es.po [not shown] Modified: trunk/po/et.po [not shown] Modified: trunk/po/fi.po [not shown] Modified: trunk/po/fr.po [not shown] Modified: trunk/po/gl.po [not shown] Modified: trunk/po/hu.po [not shown] Modified: trunk/po/id.po [not shown] Modified: trunk/po/it.po [not shown] Modified: trunk/po/ja.po [not shown] Modified: trunk/po/nb.po [not shown] Modified: trunk/po/pl.po [not shown] Modified: trunk/po/pt.po [not shown] Modified: trunk/po/pt_BR.po [not shown] Modified: trunk/po/ro.po [not shown] Modified: trunk/po/ru.po [not shown] Modified: trunk/po/sk.po [not shown] Modified: trunk/po/sv.po [not shown] Modified: trunk/po/tr.po [not shown] Modified: trunk/po/zh_CN.po [not shown] Modified: trunk/po/zh_TW.po [not shown] Modified: trunk/sm/certdump.c =================================================================== --- trunk/sm/certdump.c 2008-03-07 19:08:31 UTC (rev 4706) +++ trunk/sm/certdump.c 2008-03-13 08:46:08 UTC (rev 4707) @@ -890,14 +890,14 @@ buffer = xtrymalloc (strlen (fpr) + 1 + 3*strlen (name) + 1); if (buffer) { - const unsigned char *s; + const char *s; p = stpcpy (stpcpy (buffer, fpr), " "); for (s = name; *s; s++) { if (*s < ' ') { - sprintf (p, "%%%02X", *s); + sprintf (p, "%%%02X", *(const unsigned char*)s); p += 3; } else @@ -922,6 +922,7 @@ const char *s; ksba_isotime_t t; char created[20]; + char expires[20]; char *sn; ksba_sexp_t sexp; char *orig_codeset; @@ -935,22 +936,28 @@ ksba_free (sexp); ksba_cert_get_validity (cert, 0, t); - if (t && *t) + if (*t) sprintf (created, "%.4s-%.2s-%.2s", t, t+4, t+6); else *created = 0; + ksba_cert_get_validity (cert, 1, t); + if (*t) + sprintf (expires, "%.4s-%.2s-%.2s", t, t+4, t+6); + else + *expires = 0; orig_codeset = i18n_switchto_utf8 (); rc = asprintf (&name, _("Please enter the passphrase to unlock the" - " secret key for:\n" + " secret key for the X.509 certificate:\n" "\"%s\"\n" - "S/N %s, ID 0x%08lX, created %s" ), + "S/N %s, ID 0x%08lX,\n" + "created %s, expires %s.\n" ), subject? subject:"?", sn? sn: "?", gpgsm_get_short_fingerprint (cert), - created); + created, expires); i18n_switchback (orig_codeset); Modified: trunk/sm/keylist.c =================================================================== --- trunk/sm/keylist.c 2008-03-07 19:08:31 UTC (rev 4706) +++ trunk/sm/keylist.c 2008-03-13 08:46:08 UTC (rev 4707) @@ -286,7 +286,7 @@ /* Return an allocated string with the email address extracted from a - DN */ + DN. Note hat we use this code also in ../kbx/keybox-blob.c. */ static char * email_kludge (const char *name) { @@ -311,7 +311,7 @@ /* This looks pretty much like an email address in the subject's DN we use this to add an additional user ID entry. This way, - openSSL generated keys get a nicer and usable listing */ + OpenSSL generated keys get a nicer and usable listing. */ for (n=0, p=name; hexdigitp (p) && hexdigitp (p+1); p +=2, n++) ; if (!n) From cvs at cvs.gnupg.org Mon Mar 17 10:55:53 2008 From: cvs at cvs.gnupg.org (svn author wk) Date: Mon, 17 Mar 2008 10:55:53 +0100 Subject: [svn] ksba - r291 - trunk/src Message-ID: Author: wk Date: 2008-03-17 10:55:50 +0100 (Mon, 17 Mar 2008) New Revision: 291 Modified: trunk/src/ChangeLog trunk/src/cert.c Log: Printf arg fix. Modified: trunk/src/ChangeLog =================================================================== --- trunk/src/ChangeLog 2008-02-25 12:58:55 UTC (rev 290) +++ trunk/src/ChangeLog 2008-03-17 09:55:50 UTC (rev 291) @@ -1,3 +1,8 @@ +2008-03-17 Werner Koch + + * cert.c (ksba_cert_get_image): Fix size_t/int format mismatch. + Reported by St?phane Corth?sy. + 2008-02-25 Werner Koch * visibility.h, visibility.c: New. Modified: trunk/src/cert.c =================================================================== --- trunk/src/cert.c 2008-02-25 12:58:55 UTC (rev 290) +++ trunk/src/cert.c 2008-03-17 09:55:50 UTC (rev 291) @@ -348,8 +348,8 @@ if ( !(n->nhdr + n->len + n->off <= cert->imagelen) ) { fprintf (stderr,"\nOops, ksba_cert_get_image failed: " - "imagelen=%d hdr=%d len=%d off=%d\n", - cert->imagelen, n->nhdr, (int)n->len, n->off); + "imagelen=%lu hdr=%d len=%d off=%d\n", + (unsigned long)cert->imagelen, n->nhdr, (int)n->len, n->off); return NULL; } /*assert (n->nhdr + n->len + n->off <= cert->imagelen);*/ From cvs at cvs.gnupg.org Mon Mar 17 19:08:18 2008 From: cvs at cvs.gnupg.org (svn author wk) Date: Mon, 17 Mar 2008 19:08:18 +0100 Subject: [svn] gcry - r1283 - in trunk: . cipher src tests Message-ID: Author: wk Date: 2008-03-17 19:08:15 +0100 (Mon, 17 Mar 2008) New Revision: 1283 Modified: trunk/ChangeLog trunk/NEWS trunk/cipher/ChangeLog trunk/cipher/cipher.c trunk/cipher/ecc.c trunk/cipher/rijndael.c trunk/cipher/rsa.c trunk/configure.ac trunk/src/ChangeLog trunk/src/cipher.h trunk/src/gcrypt.h.in trunk/tests/ChangeLog trunk/tests/benchmark.c Log: Better AES performance. [The diff below has been truncated] Modified: trunk/ChangeLog =================================================================== --- trunk/ChangeLog 2008-03-12 09:20:33 UTC (rev 1282) +++ trunk/ChangeLog 2008-03-17 18:08:15 UTC (rev 1283) @@ -1,3 +1,7 @@ +2008-02-18 Werner Koch + + * configure.ac (IS_DEVELOPMENT_VERSION): Set depending on the my_svn. + 2007-12-11 Werner Koch * configure.ac: We actually require libgpg-error 1.4. Reported by Modified: trunk/cipher/ChangeLog =================================================================== --- trunk/cipher/ChangeLog 2008-03-12 09:20:33 UTC (rev 1282) +++ trunk/cipher/ChangeLog 2008-03-17 18:08:15 UTC (rev 1283) @@ -1,3 +1,29 @@ +2008-03-17 Werner Koch + + * rijndael.c (_gcry_aes_cfb_dec): New. + (do_encrypt): Factor code out to .. + (do_encrypt_aligned): .. New. + (_gcry_aes_cfb_enc, _gcry_aes_cfb_dec): Use new function. + (do_decrypt): Factor code out to .. + (do_decrypt_aligned): .. new. + (_gcry_aes_cbc_enc, _gcry_aes_cbc_dec): New. + * cipher.c (struct gcry_cipher_handle): Put field IV into new + union U_IV to enforce proper alignment. Change all users. + (do_cfb_decrypt): Optimize. + (do_cbc_encrypt, do_cbc_decrypt): Optimize. + +2008-03-15 Werner Koch + + * rijndael.c (_gcry_aes_cfb_enc): New. + * cipher.c (struct gcry_cipher_handle): Add field ALGO and BULK. + (gcry_cipher_open): Set ALGO and BULK. + (do_cfb_encrypt): Optimize. + +2008-02-18 Werner Koch + + * rsa.c (_gcry_rsa_verify) [IS_DEVELOPMENT_VERSION]: Print + intermediate results. + 2008-01-08 Werner Koch * random.c (add_randomness): Do not just increment @@ -3471,7 +3497,7 @@ Copyright 1998,1999,2000,2001,2002,2003,2004,2005,2006 - 2007 Free Software Foundation, Inc. + 2007, 2008 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 Modified: trunk/src/ChangeLog =================================================================== --- trunk/src/ChangeLog 2008-03-12 09:20:33 UTC (rev 1282) +++ trunk/src/ChangeLog 2008-03-17 18:08:15 UTC (rev 1283) @@ -1,3 +1,8 @@ +2008-03-11 Werner Koch + + * gcrypt.h.in (gcry_ac_em_t, gcry_ac_scheme_t): Remove trailing + comma for full C-89 compatibility. + 2008-01-21 Marcus Brinkmann * hwfeatures.c (detect_ia32_gnuc): Fix inline asm. Modified: trunk/tests/ChangeLog =================================================================== --- trunk/tests/ChangeLog 2008-03-12 09:20:33 UTC (rev 1282) +++ trunk/tests/ChangeLog 2008-03-17 18:08:15 UTC (rev 1283) @@ -1,3 +1,8 @@ +2008-03-17 Werner Koch + + * benchmark.c (main): Add option --cipher-repetition. + (cipher_bench): Use it. + 2008-03-12 Werner Koch * benchmark.c (rsa_bench): Add arg NO_BLINDING. Modified: trunk/NEWS =================================================================== --- trunk/NEWS 2008-03-12 09:20:33 UTC (rev 1282) +++ trunk/NEWS 2008-03-17 18:08:15 UTC (rev 1283) @@ -1,10 +1,12 @@ Noteworthy changes in version 1.4.1 ------------------------------------------------ - * Fixed a bug introduced by 1.3.1 led to the comsumption of far too - much entropy for the intial seeding. + * Fixed a bug introduced by 1.3.1 which led to the comsumption of far + too much entropy for the intial seeding. + * Improved AES performance for CFB and CBS modes. + Noteworthy changes in version 1.4.0 (2007-12-10) ------------------------------------------------ Modified: trunk/cipher/cipher.c =================================================================== --- trunk/cipher/cipher.c 2008-03-12 09:20:33 UTC (rev 1282) +++ trunk/cipher/cipher.c 2008-03-17 18:08:15 UTC (rev 1283) @@ -60,9 +60,9 @@ { &_gcry_cipher_spec_cast5, GCRY_CIPHER_CAST5 }, #endif #if USE_AES - { &_gcry_cipher_spec_aes, GCRY_CIPHER_AES }, - { &_gcry_cipher_spec_aes192, GCRY_CIPHER_AES192 }, - { &_gcry_cipher_spec_aes256, GCRY_CIPHER_AES256 }, + { &_gcry_cipher_spec_aes, GCRY_CIPHER_AES}, + { &_gcry_cipher_spec_aes192, GCRY_CIPHER_AES192}, + { &_gcry_cipher_spec_aes256, GCRY_CIPHER_AES256}, #endif #if USE_TWOFISH { &_gcry_cipher_spec_twofish, GCRY_CIPHER_TWOFISH }, @@ -137,12 +137,49 @@ size_t handle_offset; /* Offset to the malloced block. */ gcry_cipher_spec_t *cipher; gcry_module_t module; + + /* The algorithm id. This is a hack required because the module + interface does not easily allow to retrieve this value. */ + int algo; + + /* A structure with function pointers for bulk operations. Due to + limitations of the module system (we don't want to change the + API) we need to keep these function pointers here. The cipher + open function intializes them and the actual encryption routines + use them if they are not NULL. */ + struct { + void (*cfb_enc)(void *context, unsigned char *iv, + void *outbuf_arg, const void *inbuf_arg, + unsigned int nblocks); + void (*cfb_dec)(void *context, unsigned char *iv, + void *outbuf_arg, const void *inbuf_arg, + unsigned int nblocks); + void (*cbc_enc)(void *context, unsigned char *iv, + void *outbuf_arg, const void *inbuf_arg, + unsigned int nblocks, int cbc_mac); + void (*cbc_dec)(void *context, unsigned char *iv, + void *outbuf_arg, const void *inbuf_arg, + unsigned int nblocks); + } bulk; + + int mode; unsigned int flags; - unsigned char iv[MAX_BLOCKSIZE]; /* (this should be ulong aligned) */ + + /* The initialization vector. To help code optimization we make + sure that it is aligned on an unsigned long and u32 boundary. */ + union { + unsigned long dummy_iv; + u32 dummy_u32_iv; + unsigned char iv[MAX_BLOCKSIZE]; + } u_iv; + unsigned char lastiv[MAX_BLOCKSIZE]; - int unused; /* in IV */ + int unused; /* Number of unused bytes in the IV. */ + unsigned char ctr[MAX_BLOCKSIZE]; /* For Counter (CTR) mode. */ + + /* What follows are two contexts of the cipher in use. The first one needs to be aligned well enough for the cipher operation whereas the second one is a copy created by cipher_setkey and @@ -151,6 +188,7 @@ cipher_context_alignment_t context; }; + /* These dummy functions are used in case a cipher implementation refuses to provide it's own functions. */ @@ -705,8 +743,25 @@ h->handle_offset = off; h->cipher = cipher; h->module = module; + h->algo = algo; h->mode = mode; h->flags = flags; + + /* Setup bulk encryption routines. */ + switch (algo) + { + case GCRY_CIPHER_AES128: + case GCRY_CIPHER_AES192: + case GCRY_CIPHER_AES256: + h->bulk.cfb_enc = _gcry_aes_cfb_enc; + h->bulk.cfb_dec = _gcry_aes_cfb_dec; + h->bulk.cbc_enc = _gcry_aes_cbc_enc; + h->bulk.cbc_dec = _gcry_aes_cbc_dec; + break; + + default: + break; + } } } @@ -787,16 +842,17 @@ static void cipher_setiv( gcry_cipher_hd_t c, const byte *iv, unsigned ivlen ) { - memset( c->iv, 0, c->cipher->blocksize ); - if( iv ) { - if( ivlen != c->cipher->blocksize ) - log_info("WARNING: cipher_setiv: ivlen=%u blklen=%u\n", - ivlen, (unsigned) c->cipher->blocksize ); - if (ivlen > c->cipher->blocksize) - ivlen = c->cipher->blocksize; - memcpy( c->iv, iv, ivlen ); + memset (c->u_iv.iv, 0, c->cipher->blocksize); + if (iv) + { + if (ivlen != c->cipher->blocksize) + log_info ("WARNING: cipher_setiv: ivlen=%u blklen=%u\n", + ivlen, (unsigned int)c->cipher->blocksize); + if (ivlen > c->cipher->blocksize) + ivlen = c->cipher->blocksize; + memcpy (c->u_iv.iv, iv, ivlen); } - c->unused = 0; + c->unused = 0; } @@ -808,7 +864,7 @@ memcpy (&c->context.c, (char *) &c->context.c + c->cipher->contextsize, c->cipher->contextsize); - memset (c->iv, 0, c->cipher->blocksize); + memset (c->u_iv.iv, 0, c->cipher->blocksize); memset (c->lastiv, 0, c->cipher->blocksize); memset (c->ctr, 0, c->cipher->blocksize); } @@ -840,221 +896,313 @@ } } + static void -do_cbc_encrypt( gcry_cipher_hd_t c, byte *outbuf, const byte *inbuf, - unsigned int nbytes ) +do_cbc_encrypt (gcry_cipher_hd_t c, unsigned char *outbuf, + const unsigned char *inbuf, unsigned int nbytes ) { - unsigned int n; - byte *ivp; - int i; - size_t blocksize = c->cipher->blocksize; - unsigned nblocks = nbytes / blocksize; + unsigned int n; + unsigned char *ivp; + int i; + size_t blocksize = c->cipher->blocksize; + unsigned nblocks = nbytes / blocksize; - if ((c->flags & GCRY_CIPHER_CBC_CTS) && nbytes > blocksize) { + if ((c->flags & GCRY_CIPHER_CBC_CTS) && nbytes > blocksize) + { if ((nbytes % blocksize) == 0) nblocks--; } - for(n=0; n < nblocks; n++ ) { - /* fixme: the xor should work on words and not on - * bytes. Maybe it is a good idea to enhance the cipher backend - * API to allow for CBC handling direct in the backend */ - for(ivp=c->iv,i=0; i < blocksize; i++ ) - outbuf[i] = inbuf[i] ^ *ivp++; - c->cipher->encrypt ( &c->context.c, outbuf, outbuf ); - memcpy(c->iv, outbuf, blocksize ); - inbuf += blocksize; - if (!(c->flags & GCRY_CIPHER_CBC_MAC)) - outbuf += blocksize; + if (c->bulk.cbc_enc) + { + c->bulk.cbc_enc (&c->context.c, c->u_iv.iv, outbuf, inbuf, nblocks, + (c->flags & GCRY_CIPHER_CBC_MAC)); + inbuf += nblocks * blocksize; + if (!(c->flags & GCRY_CIPHER_CBC_MAC)) + outbuf += nblocks * blocksize; } + else + { + for (n=0; n < nblocks; n++ ) + { + for (ivp=c->u_iv.iv,i=0; i < blocksize; i++ ) + outbuf[i] = inbuf[i] ^ *ivp++; + c->cipher->encrypt ( &c->context.c, outbuf, outbuf ); + memcpy (c->u_iv.iv, outbuf, blocksize ); + inbuf += blocksize; + if (!(c->flags & GCRY_CIPHER_CBC_MAC)) + outbuf += blocksize; + } + } - if ((c->flags & GCRY_CIPHER_CBC_CTS) && nbytes > blocksize) - { - /* We have to be careful here, since outbuf might be equal to - inbuf. */ + if ((c->flags & GCRY_CIPHER_CBC_CTS) && nbytes > blocksize) + { + /* We have to be careful here, since outbuf might be equal to + inbuf. */ + int restbytes; + unsigned char b; - int restbytes; - byte b; + if ((nbytes % blocksize) == 0) + restbytes = blocksize; + else + restbytes = nbytes % blocksize; - if ((nbytes % blocksize) == 0) - restbytes = blocksize; - else - restbytes = nbytes % blocksize; + outbuf -= blocksize; + for (ivp = c->u_iv.iv, i = 0; i < restbytes; i++) + { + b = inbuf[i]; + outbuf[blocksize + i] = outbuf[i]; + outbuf[i] = b ^ *ivp++; + } + for (; i < blocksize; i++) + outbuf[i] = 0 ^ *ivp++; + + c->cipher->encrypt (&c->context.c, outbuf, outbuf); + memcpy (c->u_iv.iv, outbuf, blocksize); + } +} - outbuf -= blocksize; - for (ivp = c->iv, i = 0; i < restbytes; i++) - { - b = inbuf[i]; - outbuf[blocksize + i] = outbuf[i]; - outbuf[i] = b ^ *ivp++; - } - for (; i < blocksize; i++) - outbuf[i] = 0 ^ *ivp++; - c->cipher->encrypt (&c->context.c, outbuf, outbuf); - memcpy (c->iv, outbuf, blocksize); - } -} - static void -do_cbc_decrypt( gcry_cipher_hd_t c, byte *outbuf, const byte *inbuf, - unsigned int nbytes ) +do_cbc_decrypt (gcry_cipher_hd_t c, unsigned char *outbuf, + const unsigned char *inbuf, unsigned int nbytes) { - unsigned int n; - byte *ivp; - int i; - size_t blocksize = c->cipher->blocksize; - unsigned int nblocks = nbytes / blocksize; + unsigned int n; + unsigned char *ivp; + int i; + size_t blocksize = c->cipher->blocksize; + unsigned int nblocks = nbytes / blocksize; - if ((c->flags & GCRY_CIPHER_CBC_CTS) && nbytes > blocksize) { + if ((c->flags & GCRY_CIPHER_CBC_CTS) && nbytes > blocksize) + { nblocks--; if ((nbytes % blocksize) == 0) nblocks--; - memcpy(c->lastiv, c->iv, blocksize ); + memcpy (c->lastiv, c->u_iv.iv, blocksize); } - for(n=0; n < nblocks; n++ ) { - /* Because outbuf and inbuf might be the same, we have - * to save the original ciphertext block. We use lastiv - * for this here because it is not used otherwise. */ - memcpy(c->lastiv, inbuf, blocksize ); - c->cipher->decrypt ( &c->context.c, outbuf, inbuf ); - for(ivp=c->iv,i=0; i < blocksize; i++ ) + if (c->bulk.cbc_dec) + { + c->bulk.cbc_dec (&c->context.c, c->u_iv.iv, outbuf, inbuf, nblocks); + inbuf += nblocks * blocksize; + outbuf += nblocks * blocksize; + } + else + { + for (n=0; n < nblocks; n++ ) + { + /* Because outbuf and inbuf might be the same, we have to + * save the original ciphertext block. We use lastiv for + * this here because it is not used otherwise. */ + memcpy (c->lastiv, inbuf, blocksize); + c->cipher->decrypt ( &c->context.c, outbuf, inbuf ); + for (ivp=c->u_iv.iv,i=0; i < blocksize; i++ ) outbuf[i] ^= *ivp++; - memcpy(c->iv, c->lastiv, blocksize ); - inbuf += c->cipher->blocksize; - outbuf += c->cipher->blocksize; + memcpy(c->u_iv.iv, c->lastiv, blocksize ); + inbuf += c->cipher->blocksize; + outbuf += c->cipher->blocksize; + } } - if ((c->flags & GCRY_CIPHER_CBC_CTS) && nbytes > blocksize) { - int restbytes; + if ((c->flags & GCRY_CIPHER_CBC_CTS) && nbytes > blocksize) + { + int restbytes; + + if ((nbytes % blocksize) == 0) + restbytes = blocksize; + else + restbytes = nbytes % blocksize; + + memcpy (c->lastiv, c->u_iv.iv, blocksize ); /* Save Cn-2. */ + memcpy (c->u_iv.iv, inbuf + blocksize, restbytes ); /* Save Cn. */ - if ((nbytes % blocksize) == 0) - restbytes = blocksize; - else - restbytes = nbytes % blocksize; - - memcpy(c->lastiv, c->iv, blocksize ); /* save Cn-2 */ - memcpy(c->iv, inbuf + blocksize, restbytes ); /* save Cn */ - - c->cipher->decrypt ( &c->context.c, outbuf, inbuf ); - for(ivp=c->iv,i=0; i < restbytes; i++ ) - outbuf[i] ^= *ivp++; - - memcpy(outbuf + blocksize, outbuf, restbytes); - for(i=restbytes; i < blocksize; i++) - c->iv[i] = outbuf[i]; - c->cipher->decrypt ( &c->context.c, outbuf, c->iv ); - for(ivp=c->lastiv,i=0; i < blocksize; i++ ) - outbuf[i] ^= *ivp++; - /* c->lastiv is now really lastlastiv, does this matter? */ + c->cipher->decrypt ( &c->context.c, outbuf, inbuf ); + for (ivp=c->u_iv.iv,i=0; i < restbytes; i++ ) + outbuf[i] ^= *ivp++; + + memcpy(outbuf + blocksize, outbuf, restbytes); + for(i=restbytes; i < blocksize; i++) + c->u_iv.iv[i] = outbuf[i]; + c->cipher->decrypt (&c->context.c, outbuf, c->u_iv.iv); + for(ivp=c->lastiv,i=0; i < blocksize; i++ ) + outbuf[i] ^= *ivp++; + /* c->lastiv is now really lastlastiv, does this matter? */ } } static void -do_cfb_encrypt( gcry_cipher_hd_t c, - byte *outbuf, const byte *inbuf, unsigned nbytes ) +do_cfb_encrypt( gcry_cipher_hd_t c, unsigned char *outbuf, + const unsigned char *inbuf, unsigned int nbytes ) { - byte *ivp; - size_t blocksize = c->cipher->blocksize; + unsigned char *ivp; + size_t blocksize = c->cipher->blocksize; + size_t blocksize_x_2 = blocksize + blocksize; + + if ( nbytes <= c->unused ) + { + /* Short enough to be encoded by the remaining XOR mask. */ + /* XOR the input with the IV and store input into IV. */ + for (ivp=c->u_iv.iv+c->cipher->blocksize - c->unused; + nbytes; + nbytes--, c->unused-- ) + *outbuf++ = (*ivp++ ^= *inbuf++); + return; + } - if( nbytes <= c->unused ) { - /* Short enough to be encoded by the remaining XOR mask. */ - /* XOR the input with the IV and store input into IV. */ - for (ivp=c->iv+c->cipher->blocksize - c->unused; - nbytes; - nbytes--, c->unused-- ) - *outbuf++ = (*ivp++ ^= *inbuf++); - return; + if ( c->unused ) + { + /* XOR the input with the IV and store input into IV */ + nbytes -= c->unused; + for(ivp=c->u_iv.iv+blocksize - c->unused; c->unused; c->unused-- ) + *outbuf++ = (*ivp++ ^= *inbuf++); } - if( c->unused ) { - /* XOR the input with the IV and store input into IV */ - nbytes -= c->unused; - for(ivp=c->iv+blocksize - c->unused; c->unused; c->unused-- ) - *outbuf++ = (*ivp++ ^= *inbuf++); + /* Now we can process complete blocks. We use a loop as long as we + have at least 2 blocks and use conditions for the rest. This + also allows to use a bulk encryption function if available. */ + if (nbytes >= blocksize_x_2 && c->bulk.cfb_enc) + { + unsigned int nblocks = nbytes / blocksize; + c->bulk.cfb_enc (&c->context.c, c->u_iv.iv, outbuf, inbuf, nblocks); + outbuf += nblocks * blocksize; + inbuf += nblocks * blocksize; + nbytes -= nblocks * blocksize; } + else + { + while ( nbytes >= blocksize_x_2 ) + { + int i; + /* Encrypt the IV. */ + c->cipher->encrypt ( &c->context.c, c->u_iv.iv, c->u_iv.iv ); + /* XOR the input with the IV and store input into IV. */ + for(ivp=c->u_iv.iv,i=0; i < blocksize; i++ ) + *outbuf++ = (*ivp++ ^= *inbuf++); + nbytes -= blocksize; + } + } - /* Now we can process complete blocks. */ - while( nbytes >= blocksize ) { - int i; - /* Encrypt the IV (and save the current one). */ - memcpy( c->lastiv, c->iv, blocksize ); - c->cipher->encrypt ( &c->context.c, c->iv, c->iv ); - /* XOR the input with the IV and store input into IV */ - for(ivp=c->iv,i=0; i < blocksize; i++ ) - *outbuf++ = (*ivp++ ^= *inbuf++); - nbytes -= blocksize; + if ( nbytes >= blocksize ) + { + int i; + /* Save the current IV and then encrypt the IV. */ + memcpy( c->lastiv, c->u_iv.iv, blocksize ); + c->cipher->encrypt ( &c->context.c, c->u_iv.iv, c->u_iv.iv ); + /* XOR the input with the IV and store input into IV */ + for(ivp=c->u_iv.iv,i=0; i < blocksize; i++ ) + *outbuf++ = (*ivp++ ^= *inbuf++); + nbytes -= blocksize; } - if( nbytes ) { /* process the remaining bytes */ - /* encrypt the IV (and save the current one) */ - memcpy( c->lastiv, c->iv, blocksize ); - c->cipher->encrypt ( &c->context.c, c->iv, c->iv ); - c->unused = blocksize; - /* and apply the xor */ - c->unused -= nbytes; - for(ivp=c->iv; nbytes; nbytes-- ) - *outbuf++ = (*ivp++ ^= *inbuf++); + if ( nbytes ) + { + /* Save the current IV and then encrypt the IV. */ + memcpy( c->lastiv, c->u_iv.iv, blocksize ); + c->cipher->encrypt ( &c->context.c, c->u_iv.iv, c->u_iv.iv ); + c->unused = blocksize; + /* Apply the XOR. */ + c->unused -= nbytes; + for(ivp=c->u_iv.iv; nbytes; nbytes-- ) + *outbuf++ = (*ivp++ ^= *inbuf++); } } + static void -do_cfb_decrypt( gcry_cipher_hd_t c, - byte *outbuf, const byte *inbuf, unsigned int nbytes ) +do_cfb_decrypt( gcry_cipher_hd_t c, unsigned char *outbuf, + const unsigned char *inbuf, unsigned int nbytes ) { From cvs at cvs.gnupg.org Mon Mar 17 19:20:41 2008 From: cvs at cvs.gnupg.org (svn author dshaw) Date: Mon, 17 Mar 2008 19:20:41 +0100 Subject: [svn] GnuPG - r4708 - branches/STABLE-BRANCH-1-4/g10 Message-ID: Author: dshaw Date: 2008-03-17 19:20:39 +0100 (Mon, 17 Mar 2008) New Revision: 4708 Modified: branches/STABLE-BRANCH-1-4/g10/ChangeLog branches/STABLE-BRANCH-1-4/g10/parse-packet.c Log: * parse-packet.c (parse_key): Parse a secret key encrypted with Camellia. Modified: branches/STABLE-BRANCH-1-4/g10/ChangeLog =================================================================== --- branches/STABLE-BRANCH-1-4/g10/ChangeLog 2008-03-13 08:46:08 UTC (rev 4707) +++ branches/STABLE-BRANCH-1-4/g10/ChangeLog 2008-03-17 18:20:39 UTC (rev 4708) @@ -1,3 +1,8 @@ +2008-03-17 David Shaw + + * parse-packet.c (parse_key): Parse a secret key encrypted with + Camellia. + 2008-02-09 Marcus Brinkmann * gpg.c (main): New variable default_configname. Use it if Modified: branches/STABLE-BRANCH-1-4/g10/parse-packet.c =================================================================== --- branches/STABLE-BRANCH-1-4/g10/parse-packet.c 2008-03-13 08:46:08 UTC (rev 4707) +++ branches/STABLE-BRANCH-1-4/g10/parse-packet.c 2008-03-17 18:20:39 UTC (rev 4708) @@ -1854,8 +1854,9 @@ * enlarge temp. */ switch( sk->protect.algo ) { - case 7: case 8: case 9: /* reserved for AES */ + case 7: case 8: case 9: /* AES */ case 10: /* Twofish */ + case 11: case 12: /* Camellia */ sk->protect.ivlen = 16; break; default: From cvs at cvs.gnupg.org Tue Mar 18 12:04:45 2008 From: cvs at cvs.gnupg.org (svn author wk) Date: Tue, 18 Mar 2008 12:04:45 +0100 Subject: [svn] GpgOL - r235 - trunk/src Message-ID: Author: wk Date: 2008-03-18 12:04:43 +0100 (Tue, 18 Mar 2008) New Revision: 235 Modified: trunk/src/ChangeLog trunk/src/engine-assuan.c trunk/src/mimeparser.c trunk/src/rfc822parse.c Log: Fixed a segv in the mime parser. Modified: trunk/src/ChangeLog =================================================================== --- trunk/src/ChangeLog 2008-03-11 11:00:21 UTC (rev 234) +++ trunk/src/ChangeLog 2008-03-18 11:04:43 UTC (rev 235) @@ -1,3 +1,16 @@ +2008-03-18 Werner Koch + + * mimeparser.c (message_cb): Clear all mimestruct fields. Fixes + segv introduced 2008-03-07. + + * engine-assuan.c (async_worker_thread): Handle broken pipe. + +2008-03-13 Werner Koch + + * mimeparser.c (message_cb): Skip the OPEN event in non-MIME mode. + + * rfc822parse.c (rfc822parse_open): Reset ERRNO. + 2008-03-11 Werner Koch * engine-assuan.c (op_assuan_encrypt): Factor some code out to .. Modified: trunk/src/engine-assuan.c =================================================================== --- trunk/src/engine-assuan.c 2008-03-11 11:00:21 UTC (rev 234) +++ trunk/src/engine-assuan.c 2008-03-18 11:04:43 UTC (rev 235) @@ -839,7 +839,8 @@ for (;;) { /* Process our queue and fire up async I/O requests. */ -/* log_debug ("%s:%s: processing work queue", SRCNAME, __func__); */ + if (debug_ioworker_extra) + log_debug ("%s:%s: processing work queue", SRCNAME, __func__); EnterCriticalSection (&work_queue_lock); hdarraylen = 0; hdarray[hdarraylen++] = work_queue_event; @@ -930,10 +931,16 @@ } else if (n >= 0 && n < hdarraylen) { -/* log_debug ("%s:%s: WFMO succeeded (res=%d)",SRCNAME,__func__, n); */ + if (debug_ioworker_extra) + log_debug ("%s:%s: WFMO succeeded (res=%d)", + SRCNAME,__func__, n); } else if (n == hdarraylen) - ; /* Message event. */ + { + if (debug_ioworker_extra) + log_debug ("%s:%s: WFMO succeeded - MSGEVENT (res=%d)", + SRCNAME,__func__, n); + } else { log_error ("%s:%s: WFMO returned: %d", SRCNAME, __func__, n); @@ -984,6 +991,15 @@ item->io_pending = 0; item->got_ready = 1; } + else if (!item->writing && syserr == ERROR_BROKEN_PIPE) + { + /* Got EOF. */ + if (debug_ioworker) + log_debug ("%s:%s: [%s:%p] EOF (broken pipe) received", + SRCNAME, __func__, item->name, item->hd); + item->io_pending = 0; + item->got_ready = 1; + } else { log_error_w32 (syserr, Modified: trunk/src/mimeparser.c =================================================================== --- trunk/src/mimeparser.c 2008-03-11 11:00:21 UTC (rev 234) +++ trunk/src/mimeparser.c 2008-03-18 11:04:43 UTC (rev 235) @@ -70,7 +70,7 @@ mimestruct_item_t next; unsigned int level; /* Level in the hierarchy of that part. 0 indicates the outer body. */ - char *filename; /* Malloced fileanme or NULL. */ + char *filename; /* Malloced filename or NULL. */ char *charset; /* Malloced charset or NULL. */ char content_type[1]; /* String with the content type. */ }; @@ -253,7 +253,7 @@ symenc_close (ctx->symenc); ctx->symenc = NULL; } - + /* Before we start with the first attachment we need to delete all attachments which might have been created already by a past parser run. */ @@ -923,6 +923,8 @@ if (ctx->no_mail_header) { /* Assume that this is not a regular mail but plain text. */ + if (event == RFC822PARSE_OPEN) + return 0; /* We need to skip the OPEN event. */ if (!ctx->body_seen) { #ifdef DEBUG_PARSER @@ -946,6 +948,8 @@ ms->next = NULL; strcpy (stpcpy (stpcpy (ms->content_type, ctmain), "/"), ctsub); ms->level = 0; + ms->filename = NULL; + ms->charset = NULL; } if (start_attachment (ctx, 1)) return -1; Modified: trunk/src/rfc822parse.c =================================================================== --- trunk/src/rfc822parse.c 2008-03-11 11:00:21 UTC (rev 234) +++ trunk/src/rfc822parse.c 2008-03-18 11:04:43 UTC (rev 235) @@ -250,6 +250,7 @@ { release_handle_data (msg); free (msg); + errno = 0;/* Not meaningful after the callback. */ msg = NULL; } } From cvs at cvs.gnupg.org Tue Mar 18 12:15:39 2008 From: cvs at cvs.gnupg.org (svn author wk) Date: Tue, 18 Mar 2008 12:15:39 +0100 Subject: [svn] GpgOL - r236 - in trunk: . doc po Message-ID: Author: wk Date: 2008-03-18 12:15:37 +0100 (Tue, 18 Mar 2008) New Revision: 236 Modified: trunk/ChangeLog trunk/NEWS trunk/configure.ac trunk/doc/gpgol.texi trunk/po/de.po trunk/po/sv.po Log: Preparing a release Modified: trunk/ChangeLog =================================================================== --- trunk/ChangeLog 2008-03-18 11:04:43 UTC (rev 235) +++ trunk/ChangeLog 2008-03-18 11:15:37 UTC (rev 236) @@ -1,3 +1,11 @@ +2008-03-18 Werner Koch + + * Release 0.10.8. + +2008-03-11 Werner Koch + + * Release 0.10.7. + 2008-03-10 Werner Koch * Release 0.10.6. Modified: trunk/NEWS =================================================================== --- trunk/NEWS 2008-03-18 11:04:43 UTC (rev 235) +++ trunk/NEWS 2008-03-18 11:15:37 UTC (rev 236) @@ -1,3 +1,9 @@ +Noteworthy changes for version 0.10.8 (2008-03-18) +================================================= + + * Fixed a segv introduced with 0.10.6. + + Noteworthy changes for version 0.10.7 (2008-03-11) ================================================== Modified: trunk/configure.ac =================================================================== --- trunk/configure.ac 2008-03-18 11:04:43 UTC (rev 235) +++ trunk/configure.ac 2008-03-18 11:15:37 UTC (rev 236) @@ -16,7 +16,7 @@ # Remember to change the version number immediately *after* a release. # Set my_issvn to "yes" for non-released code. Remember to run an # "svn up" and "autogen.sh" right before creating a distribution. -m4_define([my_version], [0.10.7]) +m4_define([my_version], [0.10.8]) m4_define([my_issvn], [no]) m4_define([svn_revision], m4_esyscmd([echo -n $( (svn info 2>/dev/null \ Modified: trunk/doc/gpgol.texi =================================================================== --- trunk/doc/gpgol.texi 2008-03-18 11:04:43 UTC (rev 235) +++ trunk/doc/gpgol.texi 2008-03-18 11:15:37 UTC (rev 236) @@ -290,7 +290,7 @@ @section Sign a Message The server needs to implement opaque signing as well as detached -signing. Due to the nature of OpenPGP message it is always required to +signing. Due to the nature of OpenPGP messages it is always required to send the entire message to the server; sending just the hash is not possible. The following two commands are required to set the input and output file descriptors: Modified: trunk/po/de.po [not shown] Modified: trunk/po/sv.po [not shown] From cvs at cvs.gnupg.org Tue Mar 18 12:24:27 2008 From: cvs at cvs.gnupg.org (svn author wk) Date: Tue, 18 Mar 2008 12:24:27 +0100 Subject: [svn] GpgOL - r237 - tags Message-ID: Author: wk Date: 2008-03-18 12:24:27 +0100 (Tue, 18 Mar 2008) New Revision: 237 Added: tags/gpgol-0.10.8/ Log: Release. From cvs at cvs.gnupg.org Tue Mar 18 18:09:47 2008 From: cvs at cvs.gnupg.org (svn author wk) Date: Tue, 18 Mar 2008 18:09:47 +0100 Subject: [svn] GnuPG - r4709 - trunk/g10 Message-ID: Author: wk Date: 2008-03-18 18:09:45 +0100 (Tue, 18 Mar 2008) New Revision: 4709 Modified: trunk/g10/ChangeLog trunk/g10/seckey-cert.c Log: Fix for v3 keys. Modified: trunk/g10/ChangeLog =================================================================== --- trunk/g10/ChangeLog 2008-03-17 18:20:39 UTC (rev 4708) +++ trunk/g10/ChangeLog 2008-03-18 17:09:45 UTC (rev 4709) @@ -1,3 +1,8 @@ +2008-03-18 Werner Koch + + * seckey-cert.c (do_check): Use GCRYMPI_FMT_PGP for v3 keys. + Reported by Petr Cerny. + 2008-03-13 Werner Koch * passphrase.c (PROMPTSTRING): Change string to me more similar to Modified: trunk/g10/seckey-cert.c =================================================================== --- trunk/g10/seckey-cert.c 2008-03-17 18:20:39 UTC (rev 4708) +++ trunk/g10/seckey-cert.c 2008-03-18 17:09:45 UTC (rev 4709) @@ -209,7 +209,7 @@ csum += checksum (buffer, ndata); gcry_mpi_release (sk->skey[i]); - err = gcry_mpi_scan( &sk->skey[i], GCRYMPI_FMT_USG, + err = gcry_mpi_scan( &sk->skey[i], GCRYMPI_FMT_PGP, buffer, ndata, &ndata ); xfree (buffer); if (err) From cvs at cvs.gnupg.org Wed Mar 19 19:30:16 2008 From: cvs at cvs.gnupg.org (svn author wk) Date: Wed, 19 Mar 2008 19:30:16 +0100 Subject: [svn] GpgOL - r238 - in trunk: . doc po src Message-ID: Author: wk Date: 2008-03-19 19:30:14 +0100 (Wed, 19 Mar 2008) New Revision: 238 Modified: trunk/ChangeLog trunk/NEWS trunk/autogen.sh trunk/configure.ac trunk/doc/gpgol.texi trunk/po/de.po trunk/po/sv.po trunk/src/ChangeLog trunk/src/common.h trunk/src/mapihelp.cpp trunk/src/mapihelp.h trunk/src/message.cpp trunk/src/mimemaker.c trunk/src/mimeparser.c trunk/src/mimeparser.h Log: Implemented opaque signed+encrypted. Implemented old-style PGP with attachments. [The diff below has been truncated] Modified: trunk/ChangeLog =================================================================== --- trunk/ChangeLog 2008-03-18 11:24:27 UTC (rev 237) +++ trunk/ChangeLog 2008-03-19 18:30:14 UTC (rev 238) @@ -1,3 +1,7 @@ +2008-03-19 Werner Koch + + * Release 0.10.9. + 2008-03-18 Werner Koch * Release 0.10.8. Modified: trunk/src/ChangeLog =================================================================== --- trunk/src/ChangeLog 2008-03-18 11:24:27 UTC (rev 237) +++ trunk/src/ChangeLog 2008-03-19 18:30:14 UTC (rev 238) @@ -1,3 +1,19 @@ +2008-03-19 Werner Koch + + * mapihelp.cpp (mapi_change_message_class): Look into + multipart/mixed for PGP messages. + + * mapihelp.cpp (mapi_get_attach): Add arg UNPROTECT and changed + all callers. + * common.h (DBG_MIME_PARSER, DBG_MIME_DATA): New. + * mimeparser.c (debug_mime_parser, debug_mime_data): New to + replace DEBUG_PARSER. + (struct mime_context): Add field is_opaque_signed. + (t2body): Set it. + (mime_decrypt): Handle an embedded opaque signed S/MIME part. + (mime_verify_opaque): Add arg INBUFER, INBUFFERLEN and + START_PART_COUNTER. + 2008-03-18 Werner Koch * mimeparser.c (message_cb): Clear all mimestruct fields. Fixes Modified: trunk/NEWS =================================================================== --- trunk/NEWS 2008-03-18 11:24:27 UTC (rev 237) +++ trunk/NEWS 2008-03-19 18:30:14 UTC (rev 238) @@ -1,3 +1,12 @@ +Noteworthy changes for version 0.10.9 (2008-03-19) +================================================= + + * Decrypt opaque signed and encrypted S/MIME mails. + + * Handle old-style PGP message with attachments. Note that the + signature verification currently may indicate a bad signature. + + Noteworthy changes for version 0.10.8 (2008-03-18) ================================================= Modified: trunk/autogen.sh =================================================================== --- trunk/autogen.sh 2008-03-18 11:24:27 UTC (rev 237) +++ trunk/autogen.sh 2008-03-19 18:30:14 UTC (rev 238) @@ -160,4 +160,4 @@ echo "Running autoconf${FORCE} ..." $AUTOCONF${FORCE} -echo "You may now run \"./configure --enable-maintainer-mode && make\"." +echo "You may now run \"./autogen.sh --build-w32 && make\"." Modified: trunk/configure.ac =================================================================== --- trunk/configure.ac 2008-03-18 11:24:27 UTC (rev 237) +++ trunk/configure.ac 2008-03-19 18:30:14 UTC (rev 238) @@ -16,7 +16,7 @@ # Remember to change the version number immediately *after* a release. # Set my_issvn to "yes" for non-released code. Remember to run an # "svn up" and "autogen.sh" right before creating a distribution. -m4_define([my_version], [0.10.8]) +m4_define([my_version], [0.10.9]) m4_define([my_issvn], [no]) m4_define([svn_revision], m4_esyscmd([echo -n $( (svn info 2>/dev/null \ Modified: trunk/doc/gpgol.texi =================================================================== --- trunk/doc/gpgol.texi 2008-03-18 11:24:27 UTC (rev 237) +++ trunk/doc/gpgol.texi 2008-03-19 18:30:14 UTC (rev 238) @@ -673,6 +673,10 @@ Tell about resource allocation. @item 64 (0x0040) Tell about command events. + at item 128 (0x0080) +Tell what the MIME parser is doing + at item 256 (0x0100) +Print data lines while parsing MIME. @end table You may use the regular C-syntax for entering the value. Modified: trunk/po/de.po [not shown] Modified: trunk/po/sv.po [not shown] Modified: trunk/src/common.h =================================================================== --- trunk/src/common.h 2008-03-18 11:24:27 UTC (rev 237) +++ trunk/src/common.h 2008-03-19 18:30:14 UTC (rev 238) @@ -148,14 +148,16 @@ /* Bit values used for extra log file verbosity. Value 1 is reserved to enable debug menu options. */ -#define DBG_IOWORKER 2 -#define DBG_IOWORKER_EXTRA 4 -#define DBG_FILTER 8 -#define DBG_FILTER_EXTRA 16 -#define DBG_MEMORY 32 -#define DBG_COMMANDS 64 +#define DBG_IOWORKER (1<<1) +#define DBG_IOWORKER_EXTRA (1<<2) +#define DBG_FILTER (1<<3) +#define DBG_FILTER_EXTRA (1<<4) +#define DBG_MEMORY (1<<5) +#define DBG_COMMANDS (1<<6) +#define DBG_MIME_PARSER (1<<7) +#define DBG_MIME_DATA (1<<8) -/* Macros to used in conditionals to enabel debug output. */ +/* Macros to used in conditionals to enable debug output. */ #define debug_commands (opt.enable_debug & DBG_COMMANDS) Modified: trunk/src/mapihelp.cpp =================================================================== --- trunk/src/mapihelp.cpp 2008-03-18 11:24:27 UTC (rev 237) +++ trunk/src/mapihelp.cpp 2008-03-19 18:30:14 UTC (rev 238) @@ -384,8 +384,8 @@ /* Look at the body of the MESSAGE and try to figure out whether this - is a supported PGP message. Returns the new message class on - return or NULL if not. */ + is a supported PGP message. Returns the new message class or NULL + if it does not look like a PGP message. */ static char * get_msgcls_from_pgp_lines (LPMESSAGE message) { @@ -720,6 +720,13 @@ { newvalue = get_msgcls_from_pgp_lines (message); } + else if (!strcmp (ct, "multipart/mixed")) + { + /* It is quite common to have a multipart/mixed mail + with separate encrypted PGP parts. Look at the + body to decide. */ + newvalue = get_msgcls_from_pgp_lines (message); + } xfree (ct); } @@ -1600,9 +1607,11 @@ /* Return an attachment as a malloced buffer. The size of the buffer - will be stored at R_NBYTES. Returns NULL on failure. */ + will be stored at R_NBYTES. If unprotect is true, the atatchment + will be unprotected. Returns NULL on failure. */ char * -mapi_get_attach (LPMESSAGE message, mapi_attach_item_t *item, size_t *r_nbytes) +mapi_get_attach (LPMESSAGE message, int unprotect, + mapi_attach_item_t *item, size_t *r_nbytes) { HRESULT hr; LPATTACH att; @@ -1625,7 +1634,7 @@ return NULL; } - buffer = attach_to_buffer (att, r_nbytes, 0, NULL); + buffer = attach_to_buffer (att, r_nbytes, unprotect, NULL); att->Release (); return buffer; Modified: trunk/src/mapihelp.h =================================================================== --- trunk/src/mapihelp.h 2008-03-18 11:24:27 UTC (rev 237) +++ trunk/src/mapihelp.h 2008-03-19 18:30:14 UTC (rev 238) @@ -117,7 +117,7 @@ LPSTREAM mapi_get_attach_as_stream (LPMESSAGE message, mapi_attach_item_t *item, LPATTACH *r_attach); -char *mapi_get_attach (LPMESSAGE message, +char *mapi_get_attach (LPMESSAGE message, int unprotect, mapi_attach_item_t *item, size_t *r_nbytes); int mapi_mark_moss_attach (LPMESSAGE message, mapi_attach_item_t *item); int mapi_has_sig_status (LPMESSAGE msg); Modified: trunk/src/message.cpp =================================================================== --- trunk/src/message.cpp 2008-03-18 11:24:27 UTC (rev 237) +++ trunk/src/message.cpp 2008-03-19 18:30:14 UTC (rev 238) @@ -330,7 +330,7 @@ /* Convert the clear signed message from INPUT into a PGP/MIME signed message and return it in a new allocated buffer. OUTPUTLEN - received the valid length of that buffer; the buffer is guarnateed + received the valid length of that buffer; the buffer is guaranteed to be Nul terminated. */ static char * pgp_mime_from_clearsigned (LPSTREAM input, size_t *outputlen) @@ -649,7 +649,7 @@ return -1; /* No original attachment - this should not happen. */ } - inbuf = mapi_get_attach (message, table+0, &inbuflen); + inbuf = mapi_get_attach (message, 0, table+0, &inbuflen); if (!inbuf) { mapi_release_attach_table (table); @@ -658,7 +658,8 @@ } if (opaquestream) - err = mime_verify_opaque (protocol, opaquestream, message, hwnd, 0); + err = mime_verify_opaque (protocol, opaquestream, + NULL, 0, message, hwnd, 0, 0); else err = mime_verify (protocol, inbuf, inbuflen, message, hwnd, 0); log_debug ("mime_verify%s returned %d", opaquestream? "_opaque":"", err); @@ -877,7 +878,7 @@ However, due to problems with Outlook overwriting the body of the message after decryption, we need to save the body away before decrypting it. We then always look for that original - body atatchment and create one if it does not exist. */ + body attachment or create one if it does not exist. */ part1_idx = -1; table = mapi_create_attach_table (message, 0); if (!table) Modified: trunk/src/mimemaker.c =================================================================== --- trunk/src/mimemaker.c 2008-03-18 11:24:27 UTC (rev 237) +++ trunk/src/mimemaker.c 2008-03-19 18:30:14 UTC (rev 238) @@ -903,7 +903,7 @@ if (table[idx].attach_type == ATTACHTYPE_UNKNOWN && table[idx].method == ATTACH_BY_VALUE) { - buffer = mapi_get_attach (message, table+idx, &buflen); + buffer = mapi_get_attach (message, 0, table+idx, &buflen); if (!buffer) log_debug ("Attachment at index %d not found\n", idx); else Modified: trunk/src/mimeparser.c =================================================================== --- trunk/src/mimeparser.c 2008-03-18 11:24:27 UTC (rev 237) +++ trunk/src/mimeparser.c 2008-03-19 18:30:14 UTC (rev 238) @@ -43,13 +43,15 @@ #include "serpent.h" #include "mimeparser.h" -/* Define the next to get extra debug message for the MIME parser. */ -#define DEBUG_PARSER 1 #define TRACEPOINT() do { log_debug ("%s:%s:%d: tracepoint\n", \ SRCNAME, __func__, __LINE__); \ } while (0) +#define debug_mime_parser (opt.enable_debug & (DBG_MIME_PARSER|DBG_MIME_DATA)) +#define debug_mime_data (opt.enable_debug & DBG_MIME_DATA) + + static const char oid_mimetag[] = {0x2A, 0x86, 0x48, 0x86, 0xf7, 0x14, 0x03, 0x0a, 0x04}; @@ -112,6 +114,7 @@ int is_qp_encoded; /* Current part is QP encoded. */ int is_base64_encoded; /* Current part is base 64 encoded. */ int is_body; /* The current part belongs to the body. */ + int is_opaque_signed; /* Flag indicating opaque signed S/MIME. */ protocol_t protocol; /* The detected crypto protocol. */ int part_counter; /* Counts the number of processed parts. */ @@ -213,9 +216,8 @@ case RFC822PARSE_EPILOGUE: s= "Epilogue"; break; default: s= "[unknown event]"; break; } -#ifdef DEBUG_PARSER - log_debug ("%s: ctx=%p, rfc822 event %s\n", SRCNAME, ctx, s); -#endif + if (debug_mime_parser) + log_debug ("%s: ctx=%p, rfc822 event %s\n", SRCNAME, ctx, s); } @@ -233,9 +235,8 @@ LPSTREAM to = NULL; LPUNKNOWN punk; -#ifdef DEBUG_PARSER - log_debug ("%s:%s: for ctx=%p is_body=%d", SRCNAME, __func__, ctx, is_body); -#endif + if (debug_mime_parser) + log_debug ("%s:%s: for ctx=%p is_body=%d", SRCNAME, __func__, ctx,is_body); /* Just in case something has not been finished, do it here. */ if (ctx->outstream) @@ -480,9 +481,8 @@ HRESULT hr; int retval = -1; -#ifdef DEBUG_PARSER - log_debug ("%s:%s: for ctx=%p cancel=%d", SRCNAME, __func__, ctx, cancel); -#endif + if (debug_mime_parser) + log_debug ("%s:%s: for ctx=%p cancel=%d", SRCNAME, __func__, ctx, cancel); if (ctx->outstream && ctx->is_body && !ctx->body_saved.outstream) { @@ -755,10 +755,9 @@ ctsub = "plain"; } -#ifdef DEBUG_PARSER - log_debug ("%s:%s: ctx=%p, ct=`%s/%s'\n", - SRCNAME, __func__, ctx, ctmain, ctsub); -#endif + if (debug_mime_parser) + log_debug ("%s:%s: ctx=%p, ct=`%s/%s'\n", + SRCNAME, __func__, ctx, ctmain, ctsub); s = rfc822parse_query_parameter (field, "charset", 0); if (s) @@ -830,17 +829,30 @@ } else /* Other type. */ { + /* Check whether this attachment is an opaque signed S/MIME + part. We use a counter to later check that tehre is only one + such part. */ + if (!strcmp (ctmain, "application") && !strcmp (ctsub, "pkcs7-mime")) + { + const char *smtype = rfc822parse_query_parameter (field, + "smime-type", 0); + if (smtype && !strcmp (smtype, "signed-data")) + ctx->is_opaque_signed++; + } + if (!ctx->preview) ctx->collect_attachment = 1; } rfc822parse_release_field (field); /* (Content-type) */ ctx->in_data = 1; -#ifdef DEBUG_PARSER - log_debug ("%s: this body: nesting=%d partno=%d is_text=%d charset=\"%s\"\n", - SRCNAME, ctx->nesting_level, ctx->part_counter, is_text, - ctx->mimestruct_cur->charset?ctx->mimestruct_cur->charset:""); -#endif + if (debug_mime_parser) + log_debug ("%s:%s: this body: nesting=%d partno=%d is_text=%d, is_opq=%d" + " charset=\"%s\"\n", + SRCNAME, __func__, + ctx->nesting_level, ctx->part_counter, is_text, + ctx->is_opaque_signed, + ctx->mimestruct_cur->charset?ctx->mimestruct_cur->charset:""); /* If this is a text part, decide whether we treat it as our body. */ if (is_text) @@ -884,9 +896,8 @@ { /* We already got one body and thus we can continue that last attachment. */ -#ifdef DEBUG_PARSER - log_debug ("%s:%s: continuing body part\n", SRCNAME, __func__); -#endif + if (debug_mime_parser) + log_debug ("%s:%s: continuing body part\n", SRCNAME, __func__); ctx->is_body = 1; ctx->outstream = ctx->body_saved.outstream; ctx->mapi_attach = ctx->body_saved.mapi_attach; @@ -927,10 +938,9 @@ return 0; /* We need to skip the OPEN event. */ if (!ctx->body_seen) { -#ifdef DEBUG_PARSER - log_debug ("%s:%s: assuming this is plain text without headers\n", - SRCNAME, __func__); -#endif + if (debug_mime_parser) + log_debug ("%s:%s: assuming this is plain text without headers\n", + SRCNAME, __func__); ctx->in_data = 1; ctx->collect_attachment = 2; /* 2 so we don't skip the first line. */ ctx->body_seen = 1; @@ -1050,8 +1060,9 @@ if (pos && ctx->linebuf[pos-1] == '\r') pos--; -/* log_debug ("%s:%s: ctx=%p, line=`%.*s'\n", */ -/* SRCNAME, __func__, ctx, (int)pos, ctx->linebuf); */ + if (debug_mime_data) + log_debug ("%s:%s: ctx=%p, line=`%.*s'\n", + SRCNAME, __func__, ctx, (int)pos, ctx->linebuf); if (rfc822parse_insert (ctx->msg, ctx->linebuf, pos)) { log_error ("%s: ctx=%p, rfc822 parser failed: %s\n", @@ -1191,7 +1202,9 @@ while ( (s = memchr (message, '\n', messagelen)) ) { len = s - message + 1; -/* log_debug ("passing '%.*s'\n", (int)len, message); */ + if (debug_mime_data) + log_debug ("%s:%s: passing '%.*s'\n", + SRCNAME, __func__, (int)len, message); plaintext_handler (ctx, message, len); if (ctx->parser_error || ctx->line_too_long) { @@ -1284,13 +1297,17 @@ /* A special version of mime_verify which works only for S/MIME opaque - signed messages. The message is expected to be a binary data - stream with a CMS signature. This function passes the entire - message to the crypto engine and then parses the (cleartext) output - for rendering the data. */ + signed messages. The message is expected to be a binary CMS + signature eityher as an ISTREAM (if instream is not NULL) or + provided in a buffer (INBUFFER and INBUFERLEN). This function + passes the entire message to the crypto engine and then parses the + (cleartext) output for rendering the data. START_PART_COUNTER + should normally be set to 0. */ int mime_verify_opaque (protocol_t protocol, LPSTREAM instream, - LPMESSAGE mapi_message, HWND hwnd, int preview_mode) + const char *inbuffer, size_t inbufferlen, + LPMESSAGE mapi_message, HWND hwnd, int preview_mode, + int start_part_counter) { gpg_error_t err = 0; mime_context_t ctx; @@ -1298,6 +1315,10 @@ log_debug ("%s:%s: enter (protocol=%d)", SRCNAME, __func__, protocol); + if ((instream && (inbuffer || inbufferlen)) + || (!instream && !inbuffer)) + return gpg_error (GPG_ERR_INV_VALUE); + if (protocol != PROTOCOL_SMIME) return gpg_error (GPG_ERR_INV_VALUE); @@ -1308,6 +1329,7 @@ ctx->verify_mode = 0; ctx->mapi_message = mapi_message; ctx->mimestruct_tail = &ctx->mimestruct; + ctx->part_counter = start_part_counter; ctx->msg = rfc822parse_open (message_cb, ctx); if (!ctx->msg) @@ -1323,28 +1345,36 @@ if ((err=engine_verify_start (filter, hwnd, NULL, 0, protocol))) goto leave; - /* Filter the stream. */ - do + if (instream) { - HRESULT hr; - ULONG nread; - char buffer[4096]; + /* Filter the stream. */ + do + { + HRESULT hr; + ULONG nread; + char buffer[4096]; - hr = IStream_Read (instream, buffer, sizeof buffer, &nread); - if (hr) - { - log_error ("%s:%s: IStream::Read failed: hr=%#lx", - SRCNAME, __func__, hr); - err = gpg_error (GPG_ERR_EIO); + hr = IStream_Read (instream, buffer, sizeof buffer, &nread); + if (hr) + { + log_error ("%s:%s: IStream::Read failed: hr=%#lx", + SRCNAME, __func__, hr); + err = gpg_error (GPG_ERR_EIO); + } + else if (nread) + { + err = engine_filter (filter, buffer, nread); + } + else + break; /* EOF */ } - else if (nread) - { - err = engine_filter (filter, buffer, nread); - } - else - break; /* EOF */ + while (!err); } - while (!err); + else + { + /* Filter the buffer. */ + err = engine_filter (filter, inbuffer, inbufferlen); + } if (err) goto leave; @@ -1437,18 +1467,17 @@ ctsub = "plain"; } -#ifdef DEBUG_PARSER - log_debug ("%s:%s: ctx=%p, ct=`%s/%s'\n", - SRCNAME, __func__, ctx, ctmain, ctsub); -#endif + if (debug_mime_parser) + log_debug ("%s:%s: ctx=%p, ct=`%s/%s'\n", + SRCNAME, __func__, ctx, ctmain, ctsub); + rfc822parse_release_field (field); /* (Content-type) */ ctx->in_data = 1; -#ifdef DEBUG_PARSER - log_debug ("%s:%s: this body: nesting=%d part_counter=%d is_text=%d\n", - SRCNAME, __func__, - ctx->nesting_level, ctx->part_counter, is_text); -#endif + if (debug_mime_parser) + log_debug ("%s:%s: this body: nesting=%d part_counter=%d is_text=%d\n", + SRCNAME, __func__, + ctx->nesting_level, ctx->part_counter, is_text); From cvs at cvs.gnupg.org Wed Mar 19 19:40:09 2008 From: cvs at cvs.gnupg.org (svn author wk) Date: Wed, 19 Mar 2008 19:40:09 +0100 Subject: [svn] GpgOL - r239 - tags Message-ID: Author: wk Date: 2008-03-19 19:40:09 +0100 (Wed, 19 Mar 2008) New Revision: 239 Added: tags/gpgol-0.10.9/ Log: tag, ta, t. From cvs at cvs.gnupg.org Thu Mar 20 16:32:03 2008 From: cvs at cvs.gnupg.org (svn author wk) Date: Thu, 20 Mar 2008 16:32:03 +0100 Subject: [svn] GnuPG - r4710 - in trunk: . agent common jnlib po sm tests/openpgp Message-ID: Author: wk Date: 2008-03-20 16:31:43 +0100 (Thu, 20 Mar 2008) New Revision: 4710 Added: trunk/tests/openpgp/bug894-test.asc trunk/tests/openpgp/import.test Modified: trunk/NEWS trunk/THANKS trunk/agent/ChangeLog trunk/agent/agent.h trunk/agent/call-pinentry.c trunk/agent/command.c trunk/common/ChangeLog trunk/common/iobuf.c trunk/common/simple-pwquery.c trunk/jnlib/ChangeLog trunk/jnlib/dotlock.c trunk/jnlib/logging.c trunk/po/be.po trunk/po/ca.po trunk/po/cs.po trunk/po/da.po trunk/po/de.po trunk/po/el.po trunk/po/eo.po trunk/po/es.po trunk/po/et.po trunk/po/fi.po trunk/po/fr.po trunk/po/gl.po trunk/po/hu.po trunk/po/id.po trunk/po/it.po trunk/po/ja.po trunk/po/nb.po trunk/po/pl.po trunk/po/pt.po trunk/po/pt_BR.po trunk/po/ro.po trunk/po/ru.po trunk/po/sk.po trunk/po/sv.po trunk/po/tr.po trunk/po/zh_CN.po trunk/po/zh_TW.po trunk/sm/ChangeLog trunk/sm/certdump.c trunk/sm/certlist.c trunk/tests/openpgp/ChangeLog trunk/tests/openpgp/Makefile.am Log: Fix a bug in the ambigious name detection. Minor cleanups. [The diff below has been truncated] Modified: trunk/agent/ChangeLog =================================================================== --- trunk/agent/ChangeLog 2008-03-18 17:09:45 UTC (rev 4709) +++ trunk/agent/ChangeLog 2008-03-20 15:31:43 UTC (rev 4710) @@ -1,3 +1,9 @@ +2008-03-17 Werner Koch + + * agent.h (agent_inq_pinentry_launched): New prototype. + + * call-pinentry.c: Include sys/types.h and signal.h. + 2008-02-14 Werner Koch * command.c (agent_inq_pinentry_launched): New. Modified: trunk/common/ChangeLog =================================================================== --- trunk/common/ChangeLog 2008-03-18 17:09:45 UTC (rev 4709) +++ trunk/common/ChangeLog 2008-03-20 15:31:43 UTC (rev 4710) @@ -1,3 +1,9 @@ +2008-03-17 Werner Koch + + * iobuf.c (IOBUF_BUFFER_SIZE): Actually use this macro. + + * simple-pwquery.c (agent_send_all_options): Fix last change. + 2008-03-06 Werner Koch * simple-pwquery.c (agent_send_all_options): Add support for Modified: trunk/jnlib/ChangeLog =================================================================== --- trunk/jnlib/ChangeLog 2008-03-18 17:09:45 UTC (rev 4709) +++ trunk/jnlib/ChangeLog 2008-03-20 15:31:43 UTC (rev 4710) @@ -1,3 +1,10 @@ +2008-03-17 Werner Koch + + * logging.c (my_funopen_hook_size_t): New. + (fun_writer): Use it to cope with fopencookie/funopen differences. + * dotlock.c (read_lockfile): Initialize PID. Reported by St?phane + Corth?sy. + 2008-02-22 Werner Koch * argparse.c (strusage): Set copyright year to 2008. Modified: trunk/sm/ChangeLog =================================================================== --- trunk/sm/ChangeLog 2008-03-18 17:09:45 UTC (rev 4709) +++ trunk/sm/ChangeLog 2008-03-20 15:31:43 UTC (rev 4710) @@ -1,3 +1,15 @@ +2008-03-20 Werner Koch + + * certlist.c (gpgsm_add_to_certlist): Always save the first + subject and issuer. Initialize issuer with issuer and not with + subject. + (same_subject_issuer): Set issuer2 to issuer and not to subject. + +2008-03-17 Werner Koch + + * certdump.c (my_funopen_hook_size_t): New. + (format_name_writer): Use it. + 2008-03-13 Werner Koch * certdump.c (gpgsm_fpr_and_name_for_status): Fix signed/unsigned Modified: trunk/tests/openpgp/ChangeLog =================================================================== --- trunk/tests/openpgp/ChangeLog 2008-03-18 17:09:45 UTC (rev 4709) +++ trunk/tests/openpgp/ChangeLog 2008-03-20 15:31:43 UTC (rev 4710) @@ -1,3 +1,7 @@ +2008-03-19 Werner Koch + + * import.test, bug894-test.asc: New. + 2007-12-14 Werner Koch * Makefile.am (./gpg_dearmor): Reverted last change because the Modified: trunk/NEWS =================================================================== --- trunk/NEWS 2008-03-18 17:09:45 UTC (rev 4709) +++ trunk/NEWS 2008-03-20 15:31:43 UTC (rev 4710) @@ -10,6 +10,8 @@ * Extended the PKITS framework. + * Fixed a bug in the ambigious name detection. + * Minor bug fixes. Modified: trunk/THANKS =================================================================== --- trunk/THANKS 2008-03-18 17:09:45 UTC (rev 4709) +++ trunk/THANKS 2008-03-20 15:31:43 UTC (rev 4710) @@ -180,6 +180,7 @@ Pascal Scheffers Pascal at scheffers.net Paul D. Smith psmith at baynetworks.com Per Cederqvist ceder at lysator.liu.se +Petr Cerny pcerny at suse.cz Phil Blundell pb at debian.org Philippe Laliberte arsphl at oeil.qc.ca Peter Fales psfales at lucent.com Modified: trunk/agent/agent.h =================================================================== --- trunk/agent/agent.h 2008-03-18 17:09:45 UTC (rev 4709) +++ trunk/agent/agent.h 2008-03-20 15:31:43 UTC (rev 4710) @@ -211,6 +211,7 @@ void agent_sighup_action (void); /*-- command.c --*/ +gpg_error_t agent_inq_pinentry_launched (ctrl_t ctrl, unsigned long pid); gpg_error_t agent_write_status (ctrl_t ctrl, const char *keyword, ...); void bump_key_eventcounter (void); void bump_card_eventcounter (void); Modified: trunk/agent/call-pinentry.c =================================================================== --- trunk/agent/call-pinentry.c 2008-03-18 17:09:45 UTC (rev 4709) +++ trunk/agent/call-pinentry.c 2008-03-20 15:31:43 UTC (rev 4710) @@ -27,7 +27,9 @@ #include #include #ifndef HAVE_W32_SYSTEM -#include +# include +# include +# include #endif #include #include Modified: trunk/agent/command.c =================================================================== --- trunk/agent/command.c 2008-03-18 17:09:45 UTC (rev 4709) +++ trunk/agent/command.c 2008-03-20 15:31:43 UTC (rev 4710) @@ -320,9 +320,9 @@ } -/* Helper to notify the client about a lauchned Pinentry. Because - that might disturb some older clients, this is only done when - enabled via an option. Returns an gpg error code. */ +/* Helper to notify the client about a launched Pinentry. Because + that might disturb some older clients, this is only done if enabled + via an option. Returns an gpg error code. */ gpg_error_t agent_inq_pinentry_launched (ctrl_t ctrl, unsigned long pid) { Modified: trunk/common/iobuf.c =================================================================== --- trunk/common/iobuf.c 2008-03-18 17:09:45 UTC (rev 4709) +++ trunk/common/iobuf.c 2008-03-20 15:31:43 UTC (rev 4710) @@ -1139,7 +1139,7 @@ { iobuf_t a; - a = iobuf_alloc (3, 8192); + a = iobuf_alloc (3, IOBUF_BUFFER_SIZE); return a; } @@ -1220,7 +1220,7 @@ return iobuf_fdopen (translate_file_handle (fd, 0), "rb"); else if ((fp = my_fopen_ro (fname, "rb")) == INVALID_FP) return NULL; - a = iobuf_alloc (1, 8192); + a = iobuf_alloc (1, IOBUF_BUFFER_SIZE); fcx = xmalloc (sizeof *fcx + strlen (fname)); fcx->fp = fp; fcx->print_only_name = print_only; @@ -1256,7 +1256,7 @@ #else fp = (fp_or_fd_t) fd; #endif - a = iobuf_alloc (strchr (mode, 'w') ? 2 : 1, 8192); + a = iobuf_alloc (strchr (mode, 'w') ? 2 : 1, IOBUF_BUFFER_SIZE); fcx = xmalloc (sizeof *fcx + 20); fcx->fp = fp; fcx->print_only_name = 1; @@ -1280,7 +1280,7 @@ sock_filter_ctx_t *scx; size_t len; - a = iobuf_alloc (strchr (mode, 'w') ? 2 : 1, 8192); + a = iobuf_alloc (strchr (mode, 'w') ? 2 : 1, IOBUF_BUFFER_SIZE); scx = xmalloc (sizeof *scx + 25); scx->sock = fd; scx->print_only_name = 1; @@ -1324,7 +1324,7 @@ return iobuf_fdopen (translate_file_handle (fd, 1), "wb"); else if ((fp = my_fopen (fname, "wb")) == INVALID_FP) return NULL; - a = iobuf_alloc (2, 8192); + a = iobuf_alloc (2, IOBUF_BUFFER_SIZE); fcx = xmalloc (sizeof *fcx + strlen (fname)); fcx->fp = fp; fcx->print_only_name = print_only; @@ -1359,7 +1359,7 @@ return NULL; else if (!(fp = my_fopen (fname, "ab"))) return NULL; - a = iobuf_alloc (2, 8192); + a = iobuf_alloc (2, IOBUF_BUFFER_SIZE); fcx = m_alloc (sizeof *fcx + strlen (fname)); fcx->fp = fp; strcpy (fcx->fname, fname); @@ -1387,7 +1387,7 @@ return NULL; else if ((fp = my_fopen (fname, "r+b")) == INVALID_FP) return NULL; - a = iobuf_alloc (2, 8192); + a = iobuf_alloc (2, IOBUF_BUFFER_SIZE); fcx = xmalloc (sizeof *fcx + strlen (fname)); fcx->fp = fp; strcpy (fcx->fname, fname); @@ -1777,7 +1777,7 @@ if (a->use == 3) { /* increase the temp buffer */ unsigned char *newbuf; - size_t newsize = a->d.size + 8192; + size_t newsize = a->d.size + IOBUF_BUFFER_SIZE; if (DBG_IOBUF) log_debug ("increasing temp iobuf from %lu to %lu\n", Modified: trunk/common/simple-pwquery.c =================================================================== --- trunk/common/simple-pwquery.c 2008-03-18 17:09:45 UTC (rev 4709) +++ trunk/common/simple-pwquery.c 2008-03-20 15:31:43 UTC (rev 4710) @@ -293,7 +293,7 @@ { /* We ignore errors here because older gpg-agents don't support this option. */ - send_one_option (ctx, errsource, "xauthority", dft_xauthority); + agent_send_option (fd, "xauthority", dft_xauthority); } /* Send the PINENTRY_USER_DATA variable. */ @@ -302,8 +302,7 @@ { /* We ignore errors here because older gpg-agents don't support this option. */ - send_one_option (ctx, errsource, "pinentry-user-data", - opt_pinentry_user_data); + agent_send_option (fd, "pinentry-user-data", dft_pinentry_user_data); } return 0; Modified: trunk/jnlib/dotlock.c =================================================================== --- trunk/jnlib/dotlock.c 2008-03-18 17:09:45 UTC (rev 4709) +++ trunk/jnlib/dotlock.c 2008-03-20 15:31:43 UTC (rev 4710) @@ -454,7 +454,8 @@ #else char buffer_space[10+1+70+1]; /* 70 is just an estimated value; node name are usually shorter. */ - int fd, pid; + int fd; + int pid = -1; char *buffer, *p; size_t expected_len; int res, nread; Modified: trunk/jnlib/logging.c =================================================================== --- trunk/jnlib/logging.c 2008-03-18 17:09:45 UTC (rev 4709) +++ trunk/jnlib/logging.c 2008-03-20 15:31:43 UTC (rev 4710) @@ -48,8 +48,10 @@ #ifdef HAVE_FOPENCOOKIE typedef ssize_t my_funopen_hook_ret_t; +typedef size_t my_funopen_hook_size_t; #else typedef int my_funopen_hook_ret_t; +typedef int my_funopen_hook_size_t; #endif @@ -117,7 +119,7 @@ static my_funopen_hook_ret_t -fun_writer (void *cookie_arg, const char *buffer, size_t size) +fun_writer (void *cookie_arg, const char *buffer, my_funopen_hook_size_t size) { struct fun_cookie_s *cookie = cookie_arg; @@ -188,7 +190,7 @@ log_socket = cookie->fd; if (cookie->fd != -1 && !writen (cookie->fd, buffer, size)) - return size; /* Okay. */ + return (my_funopen_hook_ret_t)size; /* Okay. */ if (!running_detached && cookie->fd != -1 && isatty (fileno (stderr))) @@ -207,7 +209,7 @@ log_socket = -1; } - return size; + return (my_funopen_hook_ret_t)size; } static int Modified: trunk/po/be.po [not shown] Modified: trunk/po/ca.po [not shown] Modified: trunk/po/cs.po [not shown] Modified: trunk/po/da.po [not shown] Modified: trunk/po/de.po [not shown] Modified: trunk/po/el.po [not shown] Modified: trunk/po/eo.po [not shown] Modified: trunk/po/es.po [not shown] Modified: trunk/po/et.po [not shown] Modified: trunk/po/fi.po [not shown] Modified: trunk/po/fr.po [not shown] Modified: trunk/po/gl.po [not shown] Modified: trunk/po/hu.po [not shown] Modified: trunk/po/id.po [not shown] Modified: trunk/po/it.po [not shown] Modified: trunk/po/ja.po [not shown] Modified: trunk/po/nb.po [not shown] Modified: trunk/po/pl.po [not shown] Modified: trunk/po/pt.po [not shown] Modified: trunk/po/pt_BR.po [not shown] Modified: trunk/po/ro.po [not shown] Modified: trunk/po/ru.po [not shown] Modified: trunk/po/sk.po [not shown] Modified: trunk/po/sv.po [not shown] Modified: trunk/po/tr.po [not shown] Modified: trunk/po/zh_CN.po [not shown] Modified: trunk/po/zh_TW.po [not shown] Modified: trunk/sm/certdump.c =================================================================== --- trunk/sm/certdump.c 2008-03-18 17:09:45 UTC (rev 4709) +++ trunk/sm/certdump.c 2008-03-20 15:31:43 UTC (rev 4710) @@ -41,8 +41,10 @@ #ifdef HAVE_FOPENCOOKIE typedef ssize_t my_funopen_hook_ret_t; +typedef size_t my_funopen_hook_size_t; #else typedef int my_funopen_hook_ret_t; +typedef int my_funopen_hook_size_t; #endif @@ -778,7 +780,8 @@ /* The writer function for the memory stream. */ static my_funopen_hook_ret_t -format_name_writer (void *cookie, const char *buffer, size_t size) +format_name_writer (void *cookie, const char *buffer, + my_funopen_hook_size_t size) { struct format_name_cookie *c = cookie; char *p; @@ -792,14 +795,14 @@ c->error = errno; xfree (c->buffer); errno = c->error; - return -1; + return (my_funopen_hook_ret_t)(-1); } c->buffer = p; memcpy (p + c->len, buffer, size); c->len += size; p[c->len] = 0; /* Terminate string. */ - return size; + return (my_funopen_hook_ret_t)size; } #endif /*HAVE_FOPENCOOKIE || HAVE_FUNOPEN*/ Modified: trunk/sm/certlist.c =================================================================== --- trunk/sm/certlist.c 2008-03-18 17:09:45 UTC (rev 4709) +++ trunk/sm/certlist.c 2008-03-20 15:31:43 UTC (rev 4710) @@ -1,5 +1,6 @@ /* certlist.c - build list of certificates - * Copyright (C) 2001, 2003, 2004, 2005, 2007 Free Software Foundation, Inc. + * Copyright (C) 2001, 2003, 2004, 2005, 2007, + * 2008 Free Software Foundation, Inc. * * This file is part of GnuPG. * @@ -213,7 +214,7 @@ same_subject_issuer (const char *subject, const char *issuer, ksba_cert_t cert) { char *subject2 = ksba_cert_get_subject (cert, 0); - char *issuer2 = ksba_cert_get_subject (cert, 0); + char *issuer2 = ksba_cert_get_issuer (cert, 0); int tmp; tmp = (subject && subject2 @@ -307,8 +308,8 @@ else { int wrong_usage = 0; - char *subject = NULL; - char *issuer = NULL; + char *first_subject = NULL; + char *first_issuer = NULL; get_next: rc = keydb_search (kh, &desc, 1); @@ -316,6 +317,13 @@ rc = keydb_get_cert (kh, &cert); if (!rc) { + if (!first_subject) + { + /* Save the the subject and the issuer for key usage + and ambiguous name tests. */ + first_subject = ksba_cert_get_subject (cert, 0); + first_issuer = ksba_cert_get_issuer (cert, 0); + } rc = secret? gpgsm_cert_use_sign_p (cert) : gpgsm_cert_use_encrypt_p (cert); if (gpg_err_code (rc) == GPG_ERR_WRONG_KEY_USAGE) @@ -325,13 +333,12 @@ if (!wrong_usage) { /* save the first match */ wrong_usage = rc; - subject = ksba_cert_get_subject (cert, 0); - issuer = ksba_cert_get_subject (cert, 0); ksba_cert_release (cert); cert = NULL; goto get_next; } - else if (same_subject_issuer (subject, issuer, cert)) + else if (same_subject_issuer (first_subject, first_issuer, + cert)) { wrong_usage = rc; ksba_cert_release (cert); @@ -375,7 +382,9 @@ keybox). */ if (!keydb_get_cert (kh, &cert2)) { - int tmp = (same_subject_issuer (subject, issuer, cert2) + int tmp = (same_subject_issuer (first_subject, + first_issuer, + cert2) && ((gpg_err_code ( secret? gpgsm_cert_use_sign_p (cert2) : gpgsm_cert_use_encrypt_p (cert2) @@ -398,8 +407,10 @@ } gpgsm_release_certlist (dup_certs); } - xfree (subject); - xfree (issuer); + xfree (first_subject); + xfree (first_issuer); + first_subject = NULL; + first_issuer = NULL; if (!rc && !is_cert_in_certlist (cert, *listaddr)) { @@ -441,6 +452,7 @@ return rc == -1? gpg_error (GPG_ERR_NO_PUBKEY): rc; } + void gpgsm_release_certlist (certlist_t list) { Modified: trunk/tests/openpgp/Makefile.am =================================================================== --- trunk/tests/openpgp/Makefile.am 2008-03-18 17:09:45 UTC (rev 4709) +++ trunk/tests/openpgp/Makefile.am 2008-03-20 15:31:43 UTC (rev 4710) @@ -29,13 +29,14 @@ armsignencrypt.test armdetach.test \ armdetachm.test detachm.test genkey1024.test \ conventional.test conventional-mdc.test \ - multisig.test verify.test armor.test + multisig.test verify.test armor.test \ + import.test TEST_FILES = pubring.asc secring.asc plain-1o.asc plain-2o.asc plain-3o.asc \ plain-1.asc plain-2.asc plain-3.asc plain-1-pgp.asc \ pubring.pkr.asc secring.skr.asc secdemo.asc pubdemo.asc \ - gpg.conf.tmpl bug537-test.data.asc + gpg.conf.tmpl bug537-test.data.asc bug894-test.asc DATA_FILES = data-500 data-9000 data-32000 data-80000 plain-large Added: trunk/tests/openpgp/bug894-test.asc =================================================================== --- trunk/tests/openpgp/bug894-test.asc 2008-03-18 17:09:45 UTC (rev 4709) +++ trunk/tests/openpgp/bug894-test.asc 2008-03-20 15:31:43 UTC (rev 4710) @@ -0,0 +1,565 @@ +Test key for bug 894. segv when importing certain keys with duplicated +user id. + + +-----BEGIN PGP PUBLIC KEY BLOCK----- +Version: PGP Key Server 0.9.6 + +mQGiBD2CgM0RBACJLGH4VS1F+MEyE3hEDk580pmeLZl32nLUTGtGc0YBtfjiBkjD +XnPHF1sbp3FLAYdKOZHY/4efGmGE86L9L5y1Uxuqgzi7c3jze27bp9bBKSQWMVIT +iIXGnjNXNuZUCkhhKXCHBy/2x7J5jYdZYigU+a4vrhXgTdLJNpamEx7uRwCgnHFd +8pImqdGJMUhGH5qJ8tdOZP0D+wSgY5U6f3GyC98c7HgtHoIHwTBR4DGmdHEZ2w9W +xAsZhu34PsmVqWmkzzFQdzkjQq8Bxorrjn8MYRUZDhd/dYU+Xyk49IAdZVFnMOEO +v2VyZLVwfjbIJK73g8otU3W538XXFhkUR9/cnuXTBWiUfizmIpzkbjaSpqMl1i99 +KY1YA/4+DX/nlFLemtZh4AH3RSeo5RQ6WJhFtuL5Vy7jWPFmInHktfx7Tpkq0qa2 +8oUK8pisNywZySd+iClgS+gkTNmPwbwTI6EGAznUgZB8bQpHgNMN+ENBPDYVhzdM +OYmYr1WCKsFK5DYUp4iZLmyrvojOH47ZdbW7TXnzyUI7459AnLQdS3VydCBMaWVi +ZXIgPGt1cnRAbGllYmVyLm9yZz6JASIEEAECAAwFAkHLzREFAwASdQAACgkQlxC4 +m8pXrXx0rggAw7ibX85WpgzNMqPHGbJ3ZBVgSdGwDM8J/ucklREzX7HVoGe5XYld +6aHklODEJa/ng7Y+8fASDgdszgaNjUwD508EufNkC8rlUrFb89GGSqe2cEIOAfXs ++gcD3u8EkhJnzaGHmaeMSNLsmTuMVR6yN+M9olIdLO5ZZca4uhqmaOtIWSBmkHI1 +CxWRhE0HUzmZRY3tQYnujUDlDa5NIUJieVLBOKlnb+VXAIZDfgRvKM4MTZFv4o31 +G0Op7/7MvKz/rI26kjPkwWSn9O8oZ3HvYv/mghdova2Gg2GmWaRN3Q3IZmQHY7cf +cC25NKoEyFO85fP5SnaoKev2Fr0F1m/ApYkBIgQQAQIADAUCQdzzzgUDABJ1AAAK +CRCXELibyletfOrrB/4h3TJERSzaDFHi7d3q/gKC5oOxziMCYjrn8lQfDsg9ge8u +1haKq1VfrmpntY26G7iJ9yS63/Vt08/4ZL1R8pMZryHtcrSXMW9uYp8BPf+QlWDU +P4jk5JeAnpQ95r3SSE8YOAnGWDp0PpT00i4hGwgm+gCT/x0qXJhKvoElGZpUztUO +uSNMb32XwZmE68RFDQybcXHzPc/MPp+AzFhhjjL3PutYagpzRoO4PzfTure2XkGY +JcOteJj/TLtmSqBOPUgIx7H+H/3vCwA+pR1iiBSQFsyftpFsaFFuXg7YGXezVw68 +UC0UImP83L7RmBrqOCNQ8wcd4ecyUxFfCy7itPitiQEiBBABAgAMBQJB7r0RBQMA +EnUAAAoJEJcQuJvKV618gg4H/20TTjWQta0HjYAK3H5xNSogkZyBg4eQT/5xW4/K +QKNwBSAV4belVJ4tkVw57mOm5f1VzKf+efm5TR80g94R/wMsAkKsgxAr6pHE4h10 +fVmX+IFc2Ba3NNWWAda5dugGA5NT2QM6vo657uN9Lhy0yaRcEvcjYjGPghCq8L99 +qoRzKK1wdAOsE/3vbpG6vxPvjxJD+BkkwCEGefwWtHs//xFOUJUPddTd1yqrikaV +BbuTpFhUmRIQmpuAIQWaBxusKR+Om/puUpsHvcj2jBSXR96vMPyV66F6eRGk4H50 +MtevNGGlxrLKhQjP139PEcwA/JT65NZfpqKiv4wmaaWpv+aJASIEEAECAAwFAkIA +iWUFAwASdQAACgkQlxC4m8pXrXy2dggAmaK7DuKFWTpq0SV3UpZJxV1lFykxiTlj +TnFdHH9KJtB8nPAKUc9xeAjhpuJmJRwUXDdpVOEPdpi/AHz0YCQI8wTosWroZQLL +tSWFlrCLVDqYvlS5ushMvEl3HtnO7Foe2LynEplb7NDcGTlLUSldSHJ8I8q0Bppa +dBNaV94xPxBTIn8PXU1EvJ3fCL+FuA3M0tWqPCn5A4xRCJEFwbahsry0jrR4z2T+ +YvvW4o6wvsKVpBonbqp7bNA0qnk+pqL3xYDuw47YRHi1tfYCZvJjEcs9M/ZhSHNB +MfHB5wkHrPC/1JFDAdQpTCxKEDT3LQLSUzxOuQmn6GPQ5iSMDBtqIIkBIgQQAQIA +DAUCQhJVMAUDABJ1AAAKCRCXELibyletfIysCADCgXmHxaTTbrq2ut9ShOzeNMiy +9jX69O9eDaADteQyWY9CeLy/XtUPorLS0fmdq1igf8u0e6mLUAzgzLKG5UXzcc2D +Slabinr6SXaVcmmR8wc63uUZaNasYoG6xjuSiABMJvnwUwQGPkGSct1Ne1O65r5m +JYswxO/ou+sZNBHt+uCgDmAquocw6T1KFHXm6WBLfZMv1y0pca9rhaM8N8AG8AeE +9Dwvi5ObIOWgzUE5k//F29Ynq4AKANAl69N7xoACn8SyKMr/XNhioq+jbHcgx0LN +nx/xl40uOvOsQJ3xxG7lhaTMcgYpldadluckzNvEva3SqcvW+UQQstFivbVliQEi +BBABAgAMBQJCE7kMBQMAEnUAAAoJEJcQuJvKV618eVwH/j2fAhyzUzWREWxSQsHD +JQZWRCR1Bm7gX5RhuYrFWfLmHdEua9TdOl5z+DCJoXJyJcPfhj+N0gzfs+mLx2j6 +QyN6xVAMKLAy1lwxbVxwqnUhWnHTKMgDQkLs+WSzM6ZGGFdg0aoOZtuw/mPe9I25 +ARhCDRgClzT1YLQmcuueNohOfU5uXEDrJPQii7El1hpzenfLimBluE8r2MhZJZxO +vNuub2TDbJir54N/cu6GV3jYEFCOXj3cW2JalyEiewbwEN1ZfChym3TLCevP5ItY +90jKIdUR3EN1CrUzbPWF6Q0RsUbwlWYaXXDUfmojKUelcY5CQhkkaZ9CcPe6sVgs +ZrCJASIEEAECAAwFAkIWrQgFAwASdQAACgkQlxC4m8pXrXySOQf/YsZiUyM4PfDy +e9ZTNeC2KCK6xpvGW7suxMfZFHVMpV5J0ZtKWqUsPNDx/6f/SiroK/3/TGz+eACn +CZXPpgraGwwwHn7nvtekYkX03ozO+XGY7QRlMf4sYHV6JsCxR14q8BBrjcUQpwnt +dBQYQQV6OddwxqnCzGdWKSebSRE30xRRzYyPZsGuDmTZXuH1kaLS+qxGst0O8vS/ +Ht5PLI3BYbIoCU5H0tMiQoQrAeqSoZmaipVu65iXSeXCpR82wVgqqlyXDt+Euho2 +dW8ib3ilKa5oB8QJ3NicM7wYZd+lipvcGuX7iLtHi+iSCRrYhJDaTQVFsbSclYsv +jWJolCuwoYkBIgQQAQIADAUCQilwqgUDABJ1AAAKCRCXELibyletfNJEB/9AGg0Q +mH4iYNL3KeVx+0U6j9D82spXWUPHaacXnjj8k93FmwcO4qW8WaNuFZlOaayitCJ2 +QsxwYV1Etonu92RPbTQqYAvKjAx8NcXYBj6zG5PbgHIGE8NOKdLIgkqsJgSDn47/ +2IjGGwxrrECYlKn6aLcRKlD3t/zd5XgLz8mIUkXPOfeCmzlCZkarf2n+/5OaTyKV +nxu9wJrQykQ7PbbiK6/oG9ZYhjk6zN7tW7ZM8eYQjn4L3x3Ht06XdLMFb1nCHSrn +BK34FnBO19k4CDZLtD7zeLf1asYrNvX1ij2KvzFCW9KQoA2MIYB1LDsn4nuE/2Bv +tkLxU+BMjCfMZ9GniQEiBBABAgAMBQJCPTR1BQMAEnUAAAoJEJcQuJvKV618byEH +/3D/z5vcgXyNrkqfmhACLv0qM2w3Df3t9+b5zDRTQC/QB+tY250Ylg/5tamqYhKi +QvOm4fMvmDOFEngSxcv3aDEtrfZf/SBX/AGdOKlDOtLLcaV3r1wZzCNEb4NrOpEq +/zQkUETUrahwLXEt3H3gJoDIcU/uRKswGXdrl1SjjCVjrgupYet8hqP8Xd6MjEef +U5xrtYQIee19K2Fx2UcfVATyoGapqnCFnqBfM8QXvQHwmFMmk5nZMED1oN0hn/qu +1BKCb9xjsXk0VoVz0vFOM7ICHjbJrwbaaFjGBkIgI0GmGCJbPjCW6qqBYlGSb1zp +VoPJn/Gauq+ypYyA1E+W4qSJASIEEAECAAwFAkJPqcgFAwASdQAACgkQlxC4m8pX +rXzIuQgAySTWpeSv7PQ8wiXpeFTJnAhqC/gEIBdoRxOYMvcvJCWmMynDrymM0AU3 +A3aF/Mb95UaVb+A7co+fdlkcA/cge1ksQ1FmeoN141nQ7u2NknPaGwNSwQ1t1DRL +9U2O+0VKtk2TowR4Ado4bzwgVsFvCm9Tfpa6IDip/BGdpjfLDN5XBBhJRIl0DYjT From cvs at cvs.gnupg.org Fri Mar 21 05:23:25 2008 From: cvs at cvs.gnupg.org (svn author marcus) Date: Fri, 21 Mar 2008 05:23:25 +0100 Subject: [svn] w32pth - r21 - trunk Message-ID: Author: marcus Date: 2008-03-21 05:23:25 +0100 (Fri, 21 Mar 2008) New Revision: 21 Modified: trunk/ChangeLog trunk/TODO trunk/libw32pth.def trunk/pth.h trunk/w32-pth.c Log: 2008-03-21 Marcus Brinkmann * pth.h (pth_mutex_destroy): New prototype. * w32-pth.c (pth_mutex_destroy): New function. * libw32pth.def: Add pth_mutex_destroy. Modified: trunk/ChangeLog =================================================================== --- trunk/ChangeLog 2008-02-15 19:05:23 UTC (rev 20) +++ trunk/ChangeLog 2008-03-21 04:23:25 UTC (rev 21) @@ -1,3 +1,9 @@ +2008-03-21 Marcus Brinkmann + + * pth.h (pth_mutex_destroy): New prototype. + * w32-pth.c (pth_mutex_destroy): New function. + * libw32pth.def: Add pth_mutex_destroy. + 2008-02-15 Marcus Brinkmann * w32-pth.c (map_wsa_to_errno, map_w32_to_errno): New functions. Modified: trunk/TODO =================================================================== --- trunk/TODO 2008-02-15 19:05:23 UTC (rev 20) +++ trunk/TODO 2008-03-21 04:23:25 UTC (rev 21) @@ -10,7 +10,7 @@ * Speaking of signals, that needs to be properly implemented and tested. -* Dirmngr still leaks some events under load. Find out if this is a - bug in dirmngr or in w32pth or a combination of both. +* We can support static initializers for mutexes, because we can check + the initialization flag (or some other marker, like invalid handle) + before we call enter_pth. - Modified: trunk/libw32pth.def =================================================================== --- trunk/libw32pth.def 2008-02-15 19:05:23 UTC (rev 20) +++ trunk/libw32pth.def 2008-03-21 04:23:25 UTC (rev 21) @@ -69,3 +69,4 @@ pth_pipe @39 pth_close @40 + pth_mutex_destroy @41 Modified: trunk/pth.h =================================================================== --- trunk/pth.h 2008-02-15 19:05:23 UTC (rev 20) +++ trunk/pth.h 2008-03-21 04:23:25 UTC (rev 21) @@ -240,6 +240,8 @@ int pth_mutex_release (pth_mutex_t *hd); int pth_mutex_acquire(pth_mutex_t *hd, int try_only, pth_event_t ev_extra); int pth_mutex_init (pth_mutex_t *hd); +/* We need this under windows, otherwise we would leak handles. */ +int pth_mutex_destroy (pth_mutex_t *hd); int pth_rwlock_init (pth_rwlock_t *rwlock); int pth_rwlock_acquire (pth_rwlock_t *rwlock, int op, int try, pth_event_t ev); Modified: trunk/w32-pth.c =================================================================== --- trunk/w32-pth.c 2008-02-15 19:05:23 UTC (rev 20) +++ trunk/w32-pth.c 2008-03-21 04:23:25 UTC (rev 21) @@ -1037,7 +1037,21 @@ } +/* Destroy the mutex MUTEX. */ int +pth_mutex_destroy (pth_mutex_t *mutex) +{ + implicit_init (); + enter_pth (__FUNCTION__); + + CloseHandle (*mutex); + + leave_pth (__FUNCTION__); + return TRUE; +} + + +int pth_rwlock_init (pth_rwlock_t *rwlock) { /* FIXME */ From cvs at cvs.gnupg.org Fri Mar 21 05:27:14 2008 From: cvs at cvs.gnupg.org (svn author marcus) Date: Fri, 21 Mar 2008 05:27:14 +0100 Subject: [svn] dirmngr - r295 - trunk/src Message-ID: Author: marcus Date: 2008-03-21 05:27:13 +0100 (Fri, 21 Mar 2008) New Revision: 295 Modified: trunk/src/ChangeLog trunk/src/estream.c Log: 2008-03-21 Marcus Brinkmann * estream.c (ESTREAM_MUTEX_DESTROY): New macro. (es_create, es_destroy): Use it. Modified: trunk/src/ChangeLog =================================================================== --- trunk/src/ChangeLog 2008-02-21 18:45:11 UTC (rev 294) +++ trunk/src/ChangeLog 2008-03-21 04:27:13 UTC (rev 295) @@ -1,3 +1,8 @@ +2008-03-21 Marcus Brinkmann + + * estream.c (ESTREAM_MUTEX_DESTROY): New macro. + (es_create, es_destroy): Use it. + 2008-02-21 Werner Koch * validate.c (check_cert_sig) [HAVE_GCRY_MD_DEBUG]: Use new debug Modified: trunk/src/estream.c =================================================================== --- trunk/src/estream.c 2008-02-21 18:45:11 UTC (rev 294) +++ trunk/src/estream.c 2008-03-21 04:27:13 UTC (rev 295) @@ -1,5 +1,5 @@ /* estream.c - Extended Stream I/O Library - * Copyright (C) 2004, 2005, 2006, 2007 g10 Code GmbH + * Copyright (C) 2004, 2005, 2006, 2007, 2008 g10 Code GmbH * * This file is part of Libestream. * @@ -111,9 +111,13 @@ pth_mutex_release (&(mutex)) # define ESTREAM_MUTEX_TRYLOCK(mutex) \ ((pth_mutex_acquire (&(mutex), 1, NULL) == TRUE) ? 0 : -1) -# define ESTREAM_MUTEX_INITIALIZE(mutex) \ - pth_mutex_init (&(mutex)) +# define ESTREAM_MUTEX_INITIALIZE(mutex) pth_mutex_init (&(mutex)) +#if HAVE_W32_SYSTEM +# define ESTREAM_MUTEX_DESTROY(mutex) pth_mutex_destroy (&(mutex)) #else +# define ESTREAM_MUTEX_DESTROY(mutex) (void) 0 +#endif +#else typedef void *estream_mutex_t; # define ESTREAM_MUTEX_INITIALIZER NULL @@ -121,6 +125,7 @@ # define ESTREAM_MUTEX_UNLOCK(mutex) (void) 0 # define ESTREAM_MUTEX_TRYLOCK(mutex) 0 # define ESTREAM_MUTEX_INITIALIZE(mutex) (void) 0 +# define ESTREAM_MUTEX_DESTROY(mutex) (void) 0 #endif /* Memory allocator functions. */ @@ -1180,7 +1185,10 @@ err = es_list_add (stream_new); if (err) - goto out; + { + ESTREAM_MUTEX_DESTROY (stream_new->intern->lock); + goto out; + } *stream = stream_new; @@ -1208,6 +1216,7 @@ { es_list_remove (stream); err = es_deinitialize (stream); + ESTREAM_MUTEX_DESTROY (stream->intern->lock); ES_MEM_FREE (stream->intern); ES_MEM_FREE (stream); } From cvs at cvs.gnupg.org Fri Mar 21 05:30:51 2008 From: cvs at cvs.gnupg.org (svn author marcus) Date: Fri, 21 Mar 2008 05:30:51 +0100 Subject: [svn] dirmngr - r296 - trunk/src Message-ID: Author: marcus Date: 2008-03-21 05:30:50 +0100 (Fri, 21 Mar 2008) New Revision: 296 Modified: trunk/src/ldap.c Log: Fix small buglet. Modified: trunk/src/ldap.c =================================================================== --- trunk/src/ldap.c 2008-03-21 04:27:13 UTC (rev 295) +++ trunk/src/ldap.c 2008-03-21 04:30:50 UTC (rev 296) @@ -36,7 +36,7 @@ #include "dirmngr.h" #include "misc.h" -#if HAVE_W32_SYSTEM +#ifdef HAVE_W32_SYSTEM #define setenv(a,b,c) SetEnvironmentVariable ((a),(b)) #else #define pth_close(fd) close(fd) From cvs at cvs.gnupg.org Fri Mar 21 05:32:38 2008 From: cvs at cvs.gnupg.org (svn author marcus) Date: Fri, 21 Mar 2008 05:32:38 +0100 Subject: [svn] dirmngr - r297 - trunk/src Message-ID: Author: marcus Date: 2008-03-21 05:32:37 +0100 (Fri, 21 Mar 2008) New Revision: 297 Modified: trunk/src/dirmngr.c trunk/src/estream.c trunk/src/get-path.c Log: Fix small buglets. Modified: trunk/src/dirmngr.c =================================================================== --- trunk/src/dirmngr.c 2008-03-21 04:30:50 UTC (rev 296) +++ trunk/src/dirmngr.c 2008-03-21 04:32:37 UTC (rev 297) @@ -123,7 +123,7 @@ { aServer, "server", 256, N_("run in server mode (foreground)") }, { aDaemon, "daemon", 256, N_("run in daemon mode (background)") }, -#if HAVE_W32_SYSTEM +#ifdef HAVE_W32_SYSTEM { aService, "service", 256, N_("run as windows service (background)") }, #endif { aListCRLs, "list-crls", 256, N_("list the contents of the CRL cache")}, Modified: trunk/src/estream.c =================================================================== --- trunk/src/estream.c 2008-03-21 04:30:50 UTC (rev 296) +++ trunk/src/estream.c 2008-03-21 04:32:37 UTC (rev 297) @@ -112,7 +112,7 @@ # define ESTREAM_MUTEX_TRYLOCK(mutex) \ ((pth_mutex_acquire (&(mutex), 1, NULL) == TRUE) ? 0 : -1) # define ESTREAM_MUTEX_INITIALIZE(mutex) pth_mutex_init (&(mutex)) -#if HAVE_W32_SYSTEM +#ifdef HAVE_W32_SYSTEM # define ESTREAM_MUTEX_DESTROY(mutex) pth_mutex_destroy (&(mutex)) #else # define ESTREAM_MUTEX_DESTROY(mutex) (void) 0 Modified: trunk/src/get-path.c =================================================================== --- trunk/src/get-path.c 2008-03-21 04:30:50 UTC (rev 296) +++ trunk/src/get-path.c 2008-03-21 04:32:37 UTC (rev 297) @@ -32,7 +32,7 @@ #include #include #include -#if HAVE_W32_SYSTEM +#ifdef HAVE_W32_SYSTEM #include #include #include @@ -57,7 +57,7 @@ #endif -#if HAVE_W32_SYSTEM +#ifdef HAVE_W32_SYSTEM #define RTLD_LAZY 0 static __inline__ void * From cvs at cvs.gnupg.org Fri Mar 21 05:34:08 2008 From: cvs at cvs.gnupg.org (svn author marcus) Date: Fri, 21 Mar 2008 05:34:08 +0100 Subject: [svn] assuan - r282 - trunk/src Message-ID: Author: marcus Date: 2008-03-21 05:34:08 +0100 (Fri, 21 Mar 2008) New Revision: 282 Modified: trunk/src/ChangeLog trunk/src/mkerrors Log: 2008-03-21 Marcus Brinkmann * mkerrors [HAVE_W32_SYSTEM]: Include (_assuan_error_is_eagain) [HAVE_W32_SYSTEM]: Wait the tenth of a second. Modified: trunk/src/ChangeLog =================================================================== --- trunk/src/ChangeLog 2007-12-12 16:35:28 UTC (rev 281) +++ trunk/src/ChangeLog 2008-03-21 04:34:08 UTC (rev 282) @@ -1,3 +1,9 @@ +2008-03-21 Marcus Brinkmann + + * mkerrors [HAVE_W32_SYSTEM]: Include + (_assuan_error_is_eagain) [HAVE_W32_SYSTEM]: Wait the tenth of a + second. + 2007-11-23 Marcus Brinkmann * assuan-inquire.c (_assuan_inquire_ext_cb): Pass through return Modified: trunk/src/mkerrors =================================================================== --- trunk/src/mkerrors 2007-12-12 16:35:28 UTC (rev 281) +++ trunk/src/mkerrors 2008-03-21 04:34:08 UTC (rev 282) @@ -28,6 +28,9 @@ #include #include #include +#ifdef HAVE_W32_SYSTEM +#include +#endif #undef _ASSUAN_IN_LIBASSUAN /* undef to get all error codes. */ #include "assuan.h" @@ -148,7 +151,12 @@ { if ((!err_source && err == ASSUAN_Read_Error && errno == EAGAIN) || (err_source && (err & ((1 << 24) - 1)) == (6 | (1 << 15)))) - return 1; + { +#ifdef HAVE_W32_SYSTEM + Sleep (100); +#endif + return 1; + } else return 0; } From cvs at cvs.gnupg.org Fri Mar 21 15:14:43 2008 From: cvs at cvs.gnupg.org (svn author marcus) Date: Fri, 21 Mar 2008 15:14:43 +0100 Subject: [svn] w32pth - r22 - trunk Message-ID: Author: marcus Date: 2008-03-21 15:14:43 +0100 (Fri, 21 Mar 2008) New Revision: 22 Modified: trunk/ChangeLog trunk/libw32pth.def trunk/pth.h trunk/w32-pth.c Log: 2008-03-21 Marcus Brinkmann * pth.h (pth_usleep): New prototype. * w32-pth.c (pth_usleep): New function. * libw32pth.def: Add pth_usleep. Modified: trunk/ChangeLog =================================================================== --- trunk/ChangeLog 2008-03-21 04:23:25 UTC (rev 21) +++ trunk/ChangeLog 2008-03-21 14:14:43 UTC (rev 22) @@ -1,5 +1,9 @@ 2008-03-21 Marcus Brinkmann + * pth.h (pth_usleep): New prototype. + * w32-pth.c (pth_usleep): New function. + * libw32pth.def: Add pth_usleep. + * pth.h (pth_mutex_destroy): New prototype. * w32-pth.c (pth_mutex_destroy): New function. * libw32pth.def: Add pth_mutex_destroy. Modified: trunk/libw32pth.def =================================================================== --- trunk/libw32pth.def 2008-03-21 04:23:25 UTC (rev 21) +++ trunk/libw32pth.def 2008-03-21 14:14:43 UTC (rev 22) @@ -70,3 +70,5 @@ pth_pipe @39 pth_close @40 pth_mutex_destroy @41 + + pth_usleep @42 Modified: trunk/pth.h =================================================================== --- trunk/pth.h 2008-03-21 04:23:25 UTC (rev 21) +++ trunk/pth.h 2008-03-21 14:14:43 UTC (rev 22) @@ -262,6 +262,7 @@ int pth_wait (pth_event_t hd); int pth_sleep (int n); +int pth_usleep (unsigned int usec); pth_time_t pth_timeout (long sec, long usec); Modified: trunk/w32-pth.c =================================================================== --- trunk/w32-pth.c 2008-03-21 04:23:25 UTC (rev 21) +++ trunk/w32-pth.c 2008-03-21 14:14:43 UTC (rev 22) @@ -2088,6 +2088,38 @@ int +pth_usleep (unsigned int usec) +{ + static pth_key_t ev_key = PTH_KEY_INIT; + pth_event_t ev; + + implicit_init (); + enter_pth (__FUNCTION__); + + if (usec == 0) + { + leave_pth (__FUNCTION__); + return 0; + } + + ev = do_pth_event (PTH_EVENT_TIME | PTH_MODE_STATIC, &ev_key, + pth_timeout (0, usec)); + if (ev == NULL) + { + leave_pth (__FUNCTION__); + return -1; + } + do_pth_wait (ev); +#ifdef NO_PTH_MODE_STATIC + do_pth_event_free (ev, PTH_FREE_THIS); +#endif + + leave_pth (__FUNCTION__); + return 0; +} + + +int pth_sigmask (int how, const sigset_t *set, sigset_t *old) { From cvs at cvs.gnupg.org Fri Mar 21 15:15:41 2008 From: cvs at cvs.gnupg.org (svn author marcus) Date: Fri, 21 Mar 2008 15:15:41 +0100 Subject: [svn] w32pth - r23 - trunk Message-ID: Author: marcus Date: 2008-03-21 15:15:41 +0100 (Fri, 21 Mar 2008) New Revision: 23 Modified: trunk/NEWS Log: Update. Modified: trunk/NEWS =================================================================== --- trunk/NEWS 2008-03-21 14:14:43 UTC (rev 22) +++ trunk/NEWS 2008-03-21 14:15:41 UTC (rev 23) @@ -1,8 +1,14 @@ Noteworthy changes in version 2.0.2 ------------------------------------------------ - * Support pipes created with pth_pipe and closed with pth_close. + * Support pipes created with non-standard extensions pth_pipe and + closed with pth_close. + * Allow destruction of mutexes with non-standard extension + pth_mutex_destroy. + + * Support pth_usleep. + * Bug fixes. Noteworthy changes in version 2.0.1 (2007-08-16) From cvs at cvs.gnupg.org Fri Mar 21 15:18:23 2008 From: cvs at cvs.gnupg.org (svn author marcus) Date: Fri, 21 Mar 2008 15:18:23 +0100 Subject: [svn] assuan - r283 - trunk/src Message-ID: Author: marcus Date: 2008-03-21 15:18:22 +0100 (Fri, 21 Mar 2008) New Revision: 283 Modified: trunk/src/ChangeLog trunk/src/assuan-defs.h trunk/src/assuan-io-pth.c trunk/src/assuan-io.c trunk/src/mkerrors Log: 2008-03-21 Marcus Brinkmann * assuan-defs.h (_assuan_usleep): New prototype. * assuan-io.c (_assuan_usleep): New function. * assuan-io-pth.c (_assuan_usleep): New function. * mkerrors: Do not incude , but assuan-defs.h. (_assuan_error_is_eagain): Call _assuan_usleep. Modified: trunk/src/ChangeLog =================================================================== --- trunk/src/ChangeLog 2008-03-21 04:34:08 UTC (rev 282) +++ trunk/src/ChangeLog 2008-03-21 14:18:22 UTC (rev 283) @@ -1,5 +1,11 @@ 2008-03-21 Marcus Brinkmann + * assuan-defs.h (_assuan_usleep): New prototype. + * assuan-io.c (_assuan_usleep): New function. + * assuan-io-pth.c (_assuan_usleep): New function. + * mkerrors: Do not incude , but assuan-defs.h. + (_assuan_error_is_eagain): Call _assuan_usleep. + * mkerrors [HAVE_W32_SYSTEM]: Include (_assuan_error_is_eagain) [HAVE_W32_SYSTEM]: Wait the tenth of a second. Modified: trunk/src/assuan-defs.h =================================================================== --- trunk/src/assuan-defs.h 2008-03-21 04:34:08 UTC (rev 282) +++ trunk/src/assuan-defs.h 2008-03-21 14:18:22 UTC (rev 283) @@ -1,5 +1,5 @@ /* assuan-defs.c - Internal definitions to Assuan - * Copyright (C) 2001, 2002, 2004, 2005, 2007 Free Software Foundation, Inc. + * Copyright (C) 2001, 2002, 2004, 2005, 2007, 2008 Free Software Foundation, Inc. * * This file is part of Assuan. * @@ -302,6 +302,9 @@ ssize_t _assuan_simple_recvmsg (assuan_context_t ctx, struct msghdr *msg); #endif +void _assuan_usleep (unsigned int usec); + + /*-- assuan-socket.c --*/ int _assuan_close (assuan_fd_t fd); assuan_fd_t _assuan_sock_new (int domain, int type, int proto); Modified: trunk/src/assuan-io-pth.c =================================================================== --- trunk/src/assuan-io-pth.c 2008-03-21 04:34:08 UTC (rev 282) +++ trunk/src/assuan-io-pth.c 2008-03-21 14:18:22 UTC (rev 283) @@ -1,5 +1,5 @@ /* assuan-io-pth.c - Pth version of assua-io.c. - * Copyright (C) 2002, 2004, 2006, 2007 Free Software Foundation, Inc. + * Copyright (C) 2002, 2004, 2006, 2007, 2008 Free Software Foundation, Inc. * * This file is part of Assuan. * @@ -182,3 +182,10 @@ return ret; #endif } + + +void +_assuan_usleep (unsigned int usec) +{ + pth_usleep (usec); +} Modified: trunk/src/assuan-io.c =================================================================== --- trunk/src/assuan-io.c 2008-03-21 04:34:08 UTC (rev 282) +++ trunk/src/assuan-io.c 2008-03-21 14:18:22 UTC (rev 283) @@ -1,5 +1,5 @@ /* assuan-io.c - Wraps the read and write functions. - * Copyright (C) 2002, 2004, 2006, 2007 Free Software Foundation, Inc. + * Copyright (C) 2002, 2004, 2006, 2007, 2008 Free Software Foundation, Inc. * * This file is part of Assuan. * @@ -213,3 +213,25 @@ return ret; #endif } + + +void +_assuan_usleep (unsigned int usec) +{ +#ifdef HAVE_W32_SYSTEM + /* FIXME. */ + Sleep (usec / 1000); +#else + struct timespec req; + struct timespec rem; + + if (usec == 0) + return; + + req.tv_sec = 0; + req.tv_nsec = usec * 1000; + + while (nanosleep (&req, &rem) < 0 && errno == EINTR) + req = rem; +#endif +} Modified: trunk/src/mkerrors =================================================================== --- trunk/src/mkerrors 2008-03-21 04:34:08 UTC (rev 282) +++ trunk/src/mkerrors 2008-03-21 14:18:22 UTC (rev 283) @@ -28,12 +28,10 @@ #include #include #include -#ifdef HAVE_W32_SYSTEM -#include -#endif #undef _ASSUAN_IN_LIBASSUAN /* undef to get all error codes. */ #include "assuan.h" +#include "assuan-defs.h" /* If true the modern gpg-error style error codes are used in the API. */ @@ -152,9 +150,8 @@ if ((!err_source && err == ASSUAN_Read_Error && errno == EAGAIN) || (err_source && (err & ((1 << 24) - 1)) == (6 | (1 << 15)))) { -#ifdef HAVE_W32_SYSTEM - Sleep (100); -#endif + /* Avoid spinning by sleeping for one tenth of a second. */ + _assuan_usleep (100000); return 1; } else From cvs at cvs.gnupg.org Sat Mar 22 18:01:40 2008 From: cvs at cvs.gnupg.org (svn author wk) Date: Sat, 22 Mar 2008 18:01:40 +0100 Subject: [svn] GnuPG - r4711 - in branches/STABLE-BRANCH-1-4: . cipher doc scripts Message-ID: Author: wk Date: 2008-03-22 18:01:37 +0100 (Sat, 22 Mar 2008) New Revision: 4711 Modified: branches/STABLE-BRANCH-1-4/NEWS branches/STABLE-BRANCH-1-4/cipher/ChangeLog branches/STABLE-BRANCH-1-4/cipher/algorithms.h branches/STABLE-BRANCH-1-4/cipher/cipher.c branches/STABLE-BRANCH-1-4/cipher/rijndael.c branches/STABLE-BRANCH-1-4/configure.ac branches/STABLE-BRANCH-1-4/doc/ChangeLog branches/STABLE-BRANCH-1-4/doc/README.W32 branches/STABLE-BRANCH-1-4/scripts/ChangeLog branches/STABLE-BRANCH-1-4/scripts/w32installer.nsi Log: Improved AES performance. [The diff below has been truncated] Modified: branches/STABLE-BRANCH-1-4/cipher/ChangeLog =================================================================== --- branches/STABLE-BRANCH-1-4/cipher/ChangeLog 2008-03-20 15:31:43 UTC (rev 4710) +++ branches/STABLE-BRANCH-1-4/cipher/ChangeLog 2008-03-22 17:01:37 UTC (rev 4711) @@ -1,3 +1,13 @@ +2008-03-22 Werner Koch + + * cipher.c (struct cipher_handle_s): Make sure IV is u32 + aligned. Change all users of IV. + (do_cfb_encrypt): Optimize and use bulk code for AES. + (do_cfb_decrypt): Ditto. + * rijndael.c (do_encrypt): Remove. + (do_encrypt_aligned, do_encrypt): New. Taken from libgcrypt. + (rijndael_cfb_enc, rijndael_cfb_dec): New. + 2007-12-12 Werner Koch * pubkey.c (pubkey_encrypt, pubkey_decrypt): Allow type 20 keys. Modified: branches/STABLE-BRANCH-1-4/doc/ChangeLog =================================================================== --- branches/STABLE-BRANCH-1-4/doc/ChangeLog 2008-03-20 15:31:43 UTC (rev 4710) +++ branches/STABLE-BRANCH-1-4/doc/ChangeLog 2008-03-22 17:01:37 UTC (rev 4711) @@ -1,3 +1,9 @@ +2007-12-21 Werner Koch + + * README.W32: Tell that Vista is supported and that at least NT-4 + is required. It might still work on older systems, but I don't + know for sure. + 2007-12-12 Werner Koch * gpg.texi, specify-user-id.texi: Update from gnupg-2. Modified: branches/STABLE-BRANCH-1-4/scripts/ChangeLog =================================================================== --- branches/STABLE-BRANCH-1-4/scripts/ChangeLog 2008-03-20 15:31:43 UTC (rev 4710) +++ branches/STABLE-BRANCH-1-4/scripts/ChangeLog 2008-03-22 17:01:37 UTC (rev 4711) @@ -1,3 +1,7 @@ +2008-01-30 Werner Koch + + * w32installer.nsi: Set the OutPath back. + 2007-12-12 Werner Koch * config.sub, config.guess: Update to version 2007-11-19. Modified: branches/STABLE-BRANCH-1-4/NEWS =================================================================== --- branches/STABLE-BRANCH-1-4/NEWS 2008-03-20 15:31:43 UTC (rev 4710) +++ branches/STABLE-BRANCH-1-4/NEWS 2008-03-22 17:01:37 UTC (rev 4711) @@ -1,3 +1,11 @@ +Noteworthy changes in version 1.4.9 (unreleased) +------------------------------------------------ + + * Improved AES encryption performance by more than 20% (on ia32). + Decryption is also a bit faster. + + + Noteworthy changes in version 1.4.8 (2007-12-20) ------------------------------------------------ Modified: branches/STABLE-BRANCH-1-4/cipher/algorithms.h =================================================================== --- branches/STABLE-BRANCH-1-4/cipher/algorithms.h 2008-03-20 15:31:43 UTC (rev 4710) +++ branches/STABLE-BRANCH-1-4/cipher/algorithms.h 2008-03-22 17:01:37 UTC (rev 4711) @@ -118,8 +118,6 @@ void (**decryptf)( void *c, byte *outbuf, const byte *inbuf ) ); -/* this is just a kludge for the time we have not yet changed the cipher - * stuff to the scheme we use for random and digests */ const char * rijndael_get_info( int algo, size_t *keylen, size_t *blocksize, size_t *contextsize, @@ -127,6 +125,12 @@ void (**encryptf)(void *c, byte *outbuf, const byte *inbuf), void (**decryptf)(void *c, byte *outbuf, const byte *inbuf) ); +void rijndael_cfb_enc (void *context, unsigned char *iv, + void *outbuf_arg, const void *inbuf_arg, + unsigned int nblocks); +void rijndael_cfb_dec (void *context, unsigned char *iv, + void *outbuf_arg, const void *inbuf_arg, + unsigned int nblocks); const char * idea_get_info( int algo, size_t *keylen, Modified: branches/STABLE-BRANCH-1-4/cipher/cipher.c =================================================================== --- branches/STABLE-BRANCH-1-4/cipher/cipher.c 2008-03-20 15:31:43 UTC (rev 4710) +++ branches/STABLE-BRANCH-1-4/cipher/cipher.c 2008-03-22 17:01:37 UTC (rev 4711) @@ -1,6 +1,6 @@ /* cipher.c - cipher dispatcher * Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005 - * 2007 Free Software Foundation, Inc. + * 2007, 2008 Free Software Foundation, Inc. * * This file is part of GnuPG. * @@ -52,17 +52,26 @@ static int disabled_algos[TABLE_SIZE]; -struct cipher_handle_s { - int algo; - int mode; - size_t blocksize; - byte iv[MAX_BLOCKSIZE]; /* (this should be ulong aligned) */ - byte lastiv[MAX_BLOCKSIZE]; - int unused; /* in IV */ - int (*setkey)( void *c, const byte *key, unsigned keylen ); - void (*encrypt)( void *c, byte *outbuf, const byte *inbuf ); - void (*decrypt)( void *c, byte *outbuf, const byte *inbuf ); - PROPERLY_ALIGNED_TYPE context; +struct cipher_handle_s +{ + int algo; + int mode; + size_t blocksize; + + /* The initialization vector. To help code optimization we make + sure that it is aligned on an unsigned long and u32 boundary. */ + union { + unsigned long dummy_ul_iv; + u32 dummy_u32_iv; + unsigned char iv[MAX_BLOCKSIZE]; + } u_iv; + + byte lastiv[MAX_BLOCKSIZE]; + int unused; /* in IV */ + int (*setkey)( void *c, const byte *key, unsigned keylen ); + void (*encrypt)( void *c, byte *outbuf, const byte *inbuf ); + void (*decrypt)( void *c, byte *outbuf, const byte *inbuf ); + PROPERLY_ALIGNED_TYPE context; }; @@ -459,14 +468,14 @@ void cipher_setiv( CIPHER_HANDLE c, const byte *iv, unsigned ivlen ) { - memset( c->iv, 0, c->blocksize ); + memset( c->u_iv.iv, 0, c->blocksize ); if( iv ) { if( ivlen != c->blocksize ) log_info("WARNING: cipher_setiv: ivlen=%u blklen=%u\n", ivlen, (unsigned)c->blocksize ); if( ivlen > c->blocksize ) ivlen = c->blocksize; - memcpy( c->iv, iv, ivlen ); + memcpy( c->u_iv.iv, iv, ivlen ); } c->unused = 0; } @@ -507,10 +516,10 @@ /* fixme: the xor should works on words and not on * bytes. Maybe it is a good idea to enhance the cipher backend * API to allow for CBC handling in the backend */ - for(ivp=c->iv,i=0; i < blocksize; i++ ) + for(ivp=c->u_iv.iv,i=0; i < blocksize; i++ ) outbuf[i] = inbuf[i] ^ *ivp++; (*c->encrypt)( &c->context.c, outbuf, outbuf ); - memcpy(c->iv, outbuf, blocksize ); + memcpy(c->u_iv.iv, outbuf, blocksize ); inbuf += c->blocksize; outbuf += c->blocksize; } @@ -530,9 +539,9 @@ * for this here because it is not used otherwise */ memcpy(c->lastiv, inbuf, blocksize ); (*c->decrypt)( &c->context.c, outbuf, inbuf ); - for(ivp=c->iv,i=0; i < blocksize; i++ ) + for(ivp=c->u_iv.iv,i=0; i < blocksize; i++ ) outbuf[i] ^= *ivp++; - memcpy(c->iv, c->lastiv, blocksize ); + memcpy(c->u_iv.iv, c->lastiv, blocksize ); inbuf += c->blocksize; outbuf += c->blocksize; } @@ -542,120 +551,182 @@ static void do_cfb_encrypt( CIPHER_HANDLE c, byte *outbuf, byte *inbuf, unsigned nbytes ) { - byte *ivp; - size_t blocksize = c->blocksize; + byte *ivp; + size_t blocksize = c->blocksize; + size_t blocksize_x_2 = blocksize + blocksize; - if( nbytes <= c->unused ) { - /* short enough to be encoded by the remaining XOR mask */ - /* XOR the input with the IV and store input into IV */ - for(ivp=c->iv+c->blocksize - c->unused; nbytes; nbytes--, c->unused-- ) + if ( nbytes <= c->unused ) + { + /* Short enough to be encoded by the remaining XOR mask. XOR + the input with the IV and store input into IV. */ + for (ivp=c->u_iv.iv+c->blocksize - c->unused; nbytes; + nbytes--, c->unused-- ) *outbuf++ = (*ivp++ ^= *inbuf++); return; } + + if ( c->unused ) + { + /* XOR the input with the IV and store input into IV. */ + nbytes -= c->unused; + for (ivp=c->u_iv.iv+blocksize - c->unused; c->unused; c->unused-- ) + *outbuf++ = (*ivp++ ^= *inbuf++); + } - if( c->unused ) { - /* XOR the input with the IV and store input into IV */ - nbytes -= c->unused; - for(ivp=c->iv+blocksize - c->unused; c->unused; c->unused-- ) - *outbuf++ = (*ivp++ ^= *inbuf++); + /* Now we can process complete blocks. We use a loop as long as we + have at least 2 blocks and use conditions for the rest. This + also allows to use a bulk encryption function if available. */ +#ifdef USE_AES + if (nbytes >= blocksize_x_2 + && (c->algo == CIPHER_ALGO_AES + || c->algo == CIPHER_ALGO_AES256 + || c->algo == CIPHER_ALGO_AES192)) + { + unsigned int nblocks = nbytes / blocksize; + rijndael_cfb_enc (&c->context.c, c->u_iv.iv, outbuf, inbuf, nblocks); + outbuf += nblocks * blocksize; + inbuf += nblocks * blocksize; + nbytes -= nblocks * blocksize; } + else +#endif /*USE_AES*/ + { + while ( nbytes >= blocksize_x_2 ) + { + int i; + /* Encrypt the IV. */ + c->encrypt ( &c->context.c, c->u_iv.iv, c->u_iv.iv ); + /* XOR the input with the IV and store input into IV. */ + for(ivp=c->u_iv.iv,i=0; i < blocksize; i++ ) + *outbuf++ = (*ivp++ ^= *inbuf++); + nbytes -= blocksize; + } + } - /* Now we can process complete blocks. */ -#if 0 - /* Experimental code. We may only use this for standard CFB - because for Phil's mode we need to save the IV of before the - last encryption - we don't want to do this in tghe fasf CFB - encryption routine. */ - if (c->algo == CIPHER_ALGO_AES - && nbytes >= blocksize - && c->mode != CIPHER_MODE_PHILS_CFB) { - size_t n; - - memcpy( c->lastiv, c->iv, blocksize ); - n = (nbytes / blocksize) * blocksize; - rijndael_cfb_encrypt (&c->context.c, c->iv, outbuf, inbuf, n); - inbuf += n; - outbuf += n; - nbytes -= n; + if ( nbytes >= blocksize ) + { + int i; + /* Save the current IV and then encrypt the IV. */ + memcpy( c->lastiv, c->u_iv.iv, blocksize ); + c->encrypt ( &c->context.c, c->u_iv.iv, c->u_iv.iv ); + /* XOR the input with the IV and store input into IV */ + for(ivp=c->u_iv.iv,i=0; i < blocksize; i++ ) + *outbuf++ = (*ivp++ ^= *inbuf++); + nbytes -= blocksize; } -#endif - while( nbytes >= blocksize ) { - int i; - /* encrypt the IV (and save the current one) */ - memcpy( c->lastiv, c->iv, blocksize ); - (*c->encrypt)( &c->context.c, c->iv, c->iv ); - /* XOR the input with the IV and store input into IV */ - for(ivp=c->iv,i=0; i < blocksize; i++ ) - *outbuf++ = (*ivp++ ^= *inbuf++); - nbytes -= blocksize; + if ( nbytes ) + { + /* Save the current IV and then encrypt the IV. */ + memcpy (c->lastiv, c->u_iv.iv, blocksize ); + c->encrypt ( &c->context.c, c->u_iv.iv, c->u_iv.iv ); + c->unused = blocksize; + /* Apply the XOR. */ + c->unused -= nbytes; + for(ivp=c->u_iv.iv; nbytes; nbytes-- ) + *outbuf++ = (*ivp++ ^= *inbuf++); } - if( nbytes ) { /* process the remaining bytes */ - /* encrypt the IV (and save the current one) */ - memcpy( c->lastiv, c->iv, blocksize ); - (*c->encrypt)( &c->context.c, c->iv, c->iv ); - c->unused = blocksize; - /* and apply the xor */ - c->unused -= nbytes; - for(ivp=c->iv; nbytes; nbytes-- ) - *outbuf++ = (*ivp++ ^= *inbuf++); - } } + static void do_cfb_decrypt( CIPHER_HANDLE c, byte *outbuf, byte *inbuf, unsigned nbytes ) { - byte *ivp; - ulong temp; - size_t blocksize = c->blocksize; - - if( nbytes <= c->unused ) { - /* short enough to be encoded by the remaining XOR mask */ - /* XOR the input with the IV and store input into IV */ - for(ivp=c->iv+blocksize - c->unused; nbytes; nbytes--,c->unused--){ - temp = *inbuf++; - *outbuf++ = *ivp ^ temp; - *ivp++ = temp; - } - return; + unsigned char *ivp; + unsigned long temp; + int i; + size_t blocksize = c->blocksize; + size_t blocksize_x_2 = blocksize + blocksize; + + if (nbytes <= c->unused) + { + /* Short enough to be encoded by the remaining XOR mask. */ + /* XOR the input with the IV and store input into IV. */ + for (ivp=c->u_iv.iv+blocksize - c->unused; + nbytes; + nbytes--, c->unused--) + { + temp = *inbuf++; + *outbuf++ = *ivp ^ temp; + *ivp++ = temp; + } + return; } + + if (c->unused) + { + /* XOR the input with the IV and store input into IV. */ + nbytes -= c->unused; + for (ivp=c->u_iv.iv+blocksize - c->unused; c->unused; c->unused-- ) + { + temp = *inbuf++; + *outbuf++ = *ivp ^ temp; + *ivp++ = temp; + } + } + + /* Now we can process complete blocks. We use a loop as long as we + have at least 2 blocks and use conditions for the rest. This + also allows to use a bulk encryption function if available. */ +#ifdef USE_AES + if (nbytes >= blocksize_x_2 + && (c->algo == CIPHER_ALGO_AES + || c->algo == CIPHER_ALGO_AES256 + || c->algo == CIPHER_ALGO_AES192)) + { + unsigned int nblocks = nbytes / blocksize; + rijndael_cfb_dec (&c->context.c, c->u_iv.iv, outbuf, inbuf, nblocks); + outbuf += nblocks * blocksize; + inbuf += nblocks * blocksize; + nbytes -= nblocks * blocksize; + } + else +#endif /*USE_AES*/ + { + while (nbytes >= blocksize_x_2 ) + { + /* Encrypt the IV. */ + c->encrypt ( &c->context.c, c->u_iv.iv, c->u_iv.iv ); + /* XOR the input with the IV and store input into IV. */ + for (ivp=c->u_iv.iv,i=0; i < blocksize; i++ ) + { + temp = *inbuf++; + *outbuf++ = *ivp ^ temp; + *ivp++ = temp; + } + nbytes -= blocksize; + } + } - if( c->unused ) { - /* XOR the input with the IV and store input into IV */ - nbytes -= c->unused; - for(ivp=c->iv+blocksize - c->unused; c->unused; c->unused-- ) { - temp = *inbuf++; - *outbuf++ = *ivp ^ temp; - *ivp++ = temp; - } + if (nbytes >= blocksize ) + { + /* Save the current IV and then encrypt the IV. */ + memcpy ( c->lastiv, c->u_iv.iv, blocksize); + c->encrypt ( &c->context.c, c->u_iv.iv, c->u_iv.iv ); + /* XOR the input with the IV and store input into IV */ + for (ivp=c->u_iv.iv,i=0; i < blocksize; i++ ) + { + temp = *inbuf++; + *outbuf++ = *ivp ^ temp; + *ivp++ = temp; + } + nbytes -= blocksize; } - /* now we can process complete blocks */ - while( nbytes >= blocksize ) { - int i; - /* encrypt the IV (and save the current one) */ - memcpy( c->lastiv, c->iv, blocksize ); - (*c->encrypt)( &c->context.c, c->iv, c->iv ); - /* XOR the input with the IV and store input into IV */ - for(ivp=c->iv,i=0; i < blocksize; i++ ) { - temp = *inbuf++; - *outbuf++ = *ivp ^ temp; - *ivp++ = temp; - } - nbytes -= blocksize; + if (nbytes) + { + /* Save the current IV and then encrypt the IV. */ + memcpy ( c->lastiv, c->u_iv.iv, blocksize ); + c->encrypt ( &c->context.c, c->u_iv.iv, c->u_iv.iv ); + c->unused = blocksize; + /* Apply the XOR. */ + c->unused -= nbytes; + for (ivp=c->u_iv.iv; nbytes; nbytes-- ) + { + temp = *inbuf++; + *outbuf++ = *ivp ^ temp; + *ivp++ = temp; + } } - if( nbytes ) { /* process the remaining bytes */ - /* encrypt the IV (and save the current one) */ - memcpy( c->lastiv, c->iv, blocksize ); - (*c->encrypt)( &c->context.c, c->iv, c->iv ); - c->unused = blocksize; - /* and apply the xor */ - c->unused -= nbytes; - for(ivp=c->iv; nbytes; nbytes-- ) { - temp = *inbuf++; - *outbuf++ = *ivp ^ temp; - *ivp++ = temp; - } - } } @@ -732,8 +803,8 @@ cipher_sync( CIPHER_HANDLE c ) { if( c->mode == CIPHER_MODE_PHILS_CFB && c->unused ) { - memmove(c->iv + c->unused, c->iv, c->blocksize - c->unused ); - memcpy(c->iv, c->lastiv + c->blocksize - c->unused, c->unused); + memmove(c->u_iv.iv + c->unused, c->u_iv.iv, c->blocksize - c->unused ); + memcpy(c->u_iv.iv, c->lastiv + c->blocksize - c->unused, c->unused); c->unused = 0; } } Modified: branches/STABLE-BRANCH-1-4/cipher/rijndael.c =================================================================== --- branches/STABLE-BRANCH-1-4/cipher/rijndael.c 2008-03-20 15:31:43 UTC (rev 4710) +++ branches/STABLE-BRANCH-1-4/cipher/rijndael.c 2008-03-22 17:01:37 UTC (rev 4711) @@ -1,5 +1,5 @@ /* Rijndael (AES) for GnuPG - * Copyright (C) 2000, 2001 Free Software Foundation, Inc. + * Copyright (C) 2000, 2001, 2008 Free Software Foundation, Inc. * * This file is part of GnuPG. * @@ -1866,144 +1866,127 @@ -/* Encrypt one block. A and B may be the same. */ +/* Encrypt one block. A and B need to be aligned on a 4 byte + boundary. A and B may be the same. */ static void -do_encrypt (const RIJNDAEL_context *ctx, byte *b, const byte *a) +do_encrypt_aligned (const RIJNDAEL_context *ctx, + unsigned char *b, const unsigned char *a) { - int r; +#define rk (ctx->keySched) + int ROUNDS = ctx->ROUNDS; + int r; + union + { + u32 tempu32[4]; /* Force correct alignment. */ byte temp[4][4]; - int ROUNDS = ctx->ROUNDS; -#define rk (ctx->keySched) + } u; - *((u32*)temp[0]) = *((u32*)(a )) ^ *((u32*)rk[0][0]); - *((u32*)temp[1]) = *((u32*)(a+ 4)) ^ *((u32*)rk[0][1]); - *((u32*)temp[2]) = *((u32*)(a+ 8)) ^ *((u32*)rk[0][2]); - *((u32*)temp[3]) = *((u32*)(a+12)) ^ *((u32*)rk[0][3]); - *((u32*)(b )) = *((u32*)T1[temp[0][0]]) - ^ *((u32*)T2[temp[1][1]]) - ^ *((u32*)T3[temp[2][2]]) - ^ *((u32*)T4[temp[3][3]]); - *((u32*)(b + 4)) = *((u32*)T1[temp[1][0]]) - ^ *((u32*)T2[temp[2][1]]) - ^ *((u32*)T3[temp[3][2]]) - ^ *((u32*)T4[temp[0][3]]); - *((u32*)(b + 8)) = *((u32*)T1[temp[2][0]]) - ^ *((u32*)T2[temp[3][1]]) - ^ *((u32*)T3[temp[0][2]]) - ^ *((u32*)T4[temp[1][3]]); - *((u32*)(b +12)) = *((u32*)T1[temp[3][0]]) - ^ *((u32*)T2[temp[0][1]]) - ^ *((u32*)T3[temp[1][2]]) - ^ *((u32*)T4[temp[2][3]]); - for (r = 1; r < ROUNDS-1; r++) { - *((u32*)temp[0]) = *((u32*)(b )) ^ *((u32*)rk[r][0]); - *((u32*)temp[1]) = *((u32*)(b+ 4)) ^ *((u32*)rk[r][1]); - *((u32*)temp[2]) = *((u32*)(b+ 8)) ^ *((u32*)rk[r][2]); - *((u32*)temp[3]) = *((u32*)(b+12)) ^ *((u32*)rk[r][3]); + *((u32*)u.temp[0]) = *((u32*)(a )) ^ *((u32*)rk[0][0]); + *((u32*)u.temp[1]) = *((u32*)(a+ 4)) ^ *((u32*)rk[0][1]); + *((u32*)u.temp[2]) = *((u32*)(a+ 8)) ^ *((u32*)rk[0][2]); + *((u32*)u.temp[3]) = *((u32*)(a+12)) ^ *((u32*)rk[0][3]); + *((u32*)(b )) = (*((u32*)T1[u.temp[0][0]]) + ^ *((u32*)T2[u.temp[1][1]]) + ^ *((u32*)T3[u.temp[2][2]]) + ^ *((u32*)T4[u.temp[3][3]])); + *((u32*)(b + 4)) = (*((u32*)T1[u.temp[1][0]]) + ^ *((u32*)T2[u.temp[2][1]]) + ^ *((u32*)T3[u.temp[3][2]]) + ^ *((u32*)T4[u.temp[0][3]])); + *((u32*)(b + 8)) = (*((u32*)T1[u.temp[2][0]]) + ^ *((u32*)T2[u.temp[3][1]]) From cvs at cvs.gnupg.org Mon Mar 24 03:28:42 2008 From: cvs at cvs.gnupg.org (svn author dshaw) Date: Mon, 24 Mar 2008 03:28:42 +0100 Subject: [svn] GnuPG - r4712 - branches/STABLE-BRANCH-1-4/g10 Message-ID: Author: dshaw Date: 2008-03-24 03:28:40 +0100 (Mon, 24 Mar 2008) New Revision: 4712 Modified: branches/STABLE-BRANCH-1-4/g10/ChangeLog branches/STABLE-BRANCH-1-4/g10/import.c Log: * import.c (collapse_uids): Fix bug 894: possible memory corruption around deduplication of user IDs. Modified: branches/STABLE-BRANCH-1-4/g10/ChangeLog =================================================================== --- branches/STABLE-BRANCH-1-4/g10/ChangeLog 2008-03-22 17:01:37 UTC (rev 4711) +++ branches/STABLE-BRANCH-1-4/g10/ChangeLog 2008-03-24 02:28:40 UTC (rev 4712) @@ -1,3 +1,8 @@ +2008-03-23 David Shaw + + * import.c (collapse_uids): Fix bug 894: possible memory + corruption around deduplication of user IDs. + 2008-03-17 David Shaw * parse-packet.c (parse_key): Parse a secret key encrypted with Modified: branches/STABLE-BRANCH-1-4/g10/import.c =================================================================== --- branches/STABLE-BRANCH-1-4/g10/import.c 2008-03-22 17:01:37 UTC (rev 4711) +++ branches/STABLE-BRANCH-1-4/g10/import.c 2008-03-24 02:28:40 UTC (rev 4712) @@ -1654,11 +1654,17 @@ { KBNODE uid2; + if(is_deleted_kbnode(uid1)) + continue; + if(uid1->pkt->pkttype!=PKT_USER_ID) continue; for(uid2=uid1->next;uid2;uid2=uid2->next) { + if(is_deleted_kbnode(uid2)) + continue; + if(uid2->pkt->pkttype!=PKT_USER_ID) continue; @@ -1674,6 +1680,9 @@ uid1 */ for(last=uid2;last->next;last=last->next) { + if(is_deleted_kbnode(last)) + continue; + if(last->next->pkt->pkttype==PKT_USER_ID || last->next->pkt->pkttype==PKT_PUBLIC_SUBKEY || last->next->pkt->pkttype==PKT_SECRET_SUBKEY) @@ -1686,13 +1695,16 @@ /* Now put uid2 in place as part of uid1 */ last->next=uid1->next; uid1->next=uid2; - remove_kbnode(keyblock,uid2); + delete_kbnode(uid2); /* Now dedupe uid1 */ for(sig1=uid1->next;sig1;sig1=sig1->next) { KBNODE sig2; + if(is_deleted_kbnode(sig1)) + continue; + if(sig1->pkt->pkttype==PKT_USER_ID || sig1->pkt->pkttype==PKT_PUBLIC_SUBKEY || sig1->pkt->pkttype==PKT_SECRET_SUBKEY) @@ -1703,6 +1715,9 @@ for(sig2=sig1->next,last=sig1;sig2;last=sig2,sig2=sig2->next) { + if(is_deleted_kbnode(sig2)) + continue; + if(sig2->pkt->pkttype==PKT_USER_ID || sig2->pkt->pkttype==PKT_PUBLIC_SUBKEY || sig2->pkt->pkttype==PKT_SECRET_SUBKEY) @@ -1716,7 +1731,7 @@ { /* We have a match, so delete the second signature */ - remove_kbnode(&uid1,sig2); + delete_kbnode(sig2); sig2=last; } } @@ -1725,6 +1740,8 @@ } } + commit_kbnode(keyblock); + if(any && !opt.quiet) { const char *key="???"; From cvs at cvs.gnupg.org Tue Mar 25 04:45:47 2008 From: cvs at cvs.gnupg.org (svn author marcus) Date: Tue, 25 Mar 2008 04:45:47 +0100 Subject: [svn] w32pth - r24 - trunk Message-ID: Author: marcus Date: 2008-03-25 04:45:46 +0100 (Tue, 25 Mar 2008) New Revision: 24 Modified: trunk/ChangeLog trunk/debug.h trunk/w32-io.c trunk/w32-pth.c Log: 2008-03-25 Marcus Brinkmann * debug.h (DEBUG_INFO, DEBUG_CALLS): New macros. * w32-io.c (pth_pipe): Fix debug trace message. * w32-pth.c (fd_is_socket, do_pth_read, do_pth_write): Test for pipes first. (do_pth_event_body): Print spec debug in hex. (do_pth_wait): Use new debug interface, which uses EV as a tag. Catch unhandled event type. Modified: trunk/ChangeLog =================================================================== --- trunk/ChangeLog 2008-03-21 14:15:41 UTC (rev 23) +++ trunk/ChangeLog 2008-03-25 03:45:46 UTC (rev 24) @@ -1,3 +1,13 @@ +2008-03-25 Marcus Brinkmann + + * debug.h (DEBUG_INFO, DEBUG_CALLS): New macros. + * w32-io.c (pth_pipe): Fix debug trace message. + * w32-pth.c (fd_is_socket, do_pth_read, do_pth_write): Test for + pipes first. + (do_pth_event_body): Print spec debug in hex. + (do_pth_wait): Use new debug interface, which uses EV as a tag. + Catch unhandled event type. + 2008-03-21 Marcus Brinkmann * pth.h (pth_usleep): New prototype. Modified: trunk/debug.h =================================================================== --- trunk/debug.h 2008-03-21 14:15:41 UTC (rev 23) +++ trunk/debug.h 2008-03-25 03:45:46 UTC (rev 24) @@ -31,6 +31,10 @@ #define DBG_INFO (debug_level >= 2) #define DBG_CALLS (debug_level >= 3) +#define DEBUG_ERROR 1 +#define DEBUG_INFO 2 +#define DEBUG_CALLS 3 + /* Indirect stringification, requires __STDC__ to work. */ #define STRINGIFY(v) #v Modified: trunk/w32-io.c =================================================================== --- trunk/w32-io.c 2008-03-21 14:15:41 UTC (rev 23) +++ trunk/w32-io.c 2008-03-25 03:45:46 UTC (rev 24) @@ -920,7 +920,7 @@ HANDLE rh; HANDLE wh; SECURITY_ATTRIBUTES sec_attr; - TRACE_BEG2 (DEBUG_SYSIO, "_pth_io_pipe", filedes, + TRACE_BEG2 (DEBUG_SYSIO, "_pth_pipe", filedes, "inherit_idx=%i (used for %s)", inherit_idx, inherit_idx ? "reading" : "writing"); Modified: trunk/w32-pth.c =================================================================== --- trunk/w32-pth.c 2008-03-21 14:15:41 UTC (rev 23) +++ trunk/w32-pth.c 2008-03-25 03:45:46 UTC (rev 24) @@ -253,12 +253,21 @@ int optval; int optlen; - optlen = sizeof (optval); - is_socket = (getsockopt (fd, SOL_SOCKET, SO_TYPE, - (char *) &optval, &optlen) != SOCKET_ERROR); + if (_pth_get_reader_ev (fd) != INVALID_HANDLE_VALUE + || _pth_get_writer_ev (fd) != INVALID_HANDLE_VALUE) + is_socket = 0; + else + { + /* This implemenation strategy is taken from glib. + Unfortunately, it does not work with pipes, as getsockopt can + block on those. So we test for pipes above first. */ + optlen = sizeof (optval); + is_socket = (getsockopt (fd, SOL_SOCKET, SO_TYPE, + (char *) &optval, &optlen) != SOCKET_ERROR); + } if (DBG_INFO) - fprintf (dbgfp, "%s: fd_is_socket: fd %i is a %s.\n", + fprintf (dbgfp, "%s: fd_is_socket: fd %i is a %s.\n", log_get_prefix (NULL), fd, is_socket ? "socket" : "file"); return is_socket; @@ -513,14 +522,17 @@ do_pth_read (int fd, void * buffer, size_t size) { int n; + HANDLE hd; - n = recv (fd, buffer, size, 0); - if (n == -1 && WSAGetLastError () == WSAENOTSOCK) + /* We have to check for internal pipes first, as socket operations + can block on these. */ + hd = _pth_get_reader_ev (fd); + if (hd != INVALID_HANDLE_VALUE) + n = _pth_io_read (fd, buffer, size); + else { - HANDLE hd = _pth_get_reader_ev (fd); - if (hd != INVALID_HANDLE_VALUE) - n = _pth_io_read (fd, buffer, size); - else + n = recv (fd, buffer, size, 0); + if (n == -1 && WSAGetLastError () == WSAENOTSOCK) { DWORD nread = 0; n = ReadFile ((HANDLE)fd, buffer, size, &nread, NULL); @@ -538,9 +550,9 @@ else n = (int) nread; } + else if (n == -1) + errno = map_wsa_to_errno (WSAGetLastError ()); } - else if (n == -1) - errno = map_wsa_to_errno (WSAGetLastError ()); return n; } @@ -614,14 +626,17 @@ do_pth_write (int fd, const void *buffer, size_t size) { int n; + HANDLE hd; - n = send (fd, buffer, size, 0); - if (n == -1 && WSAGetLastError () == WSAENOTSOCK) + /* We have to check for internal pipes first, as socket operations + can block on these. */ + hd = _pth_get_writer_ev (fd); + if (hd != INVALID_HANDLE_VALUE) + n = _pth_io_write (fd, buffer, size); + else { - HANDLE hd = _pth_get_writer_ev (fd); - if (hd != INVALID_HANDLE_VALUE) - n = _pth_io_write (fd, buffer, size); - else + n = send (fd, buffer, size, 0); + if (n == -1 && WSAGetLastError () == WSAENOTSOCK) { DWORD nwrite; char strerr[256]; @@ -642,13 +657,14 @@ else n = (int) nwrite; } + else if (n == -1) + errno = map_wsa_to_errno (WSAGetLastError ()); } - else if (n == -1) - errno = map_wsa_to_errno (WSAGetLastError ()); return n; } + int pth_write_ev (int fd, const void *buffer, size_t size, pth_event_t ev_extra) { @@ -1383,13 +1399,13 @@ if ((spec & (PTH_MODE_CHAIN|PTH_MODE_REUSE))) { if (DBG_ERROR) - fprintf (dbgfp, "%s: pth_event spec=%lu - not supported\n", + fprintf (dbgfp, "%s: pth_event spec=%lx - not supported\n", log_get_prefix (NULL), spec); return NULL; /* Not supported. */ } if (DBG_INFO) - fprintf (dbgfp, "%s: pth_event spec=%lu\n", log_get_prefix (NULL), spec); + fprintf (dbgfp, "%s: pth_event spec=%lx\n", log_get_prefix (NULL), spec); ev = calloc (1, sizeof *ev); if (!ev) @@ -1436,7 +1452,7 @@ ev->u_type = PTH_EVENT_FD; ev->u.fd = va_arg (arg, int); if (DBG_INFO) - fprintf (dbgfp, "%s: pth_event: fd=%d\n", + fprintf (dbgfp, "%s: pth_event: fd=0x%x\n", log_get_prefix (NULL), ev->u.fd); } else if (spec & PTH_EVENT_TIME) @@ -1730,15 +1746,16 @@ pth_event_t r; int count; + TRACE_BEG (DEBUG_INFO, "do_pth_wait", ev); + if (!ev) - return 0; + return TRACE_SYSRES (0); n = event_count (ev); if (n > MAXIMUM_WAIT_OBJECTS/2) - return -1; + return TRACE_SYSRES (-1); - if (DBG_INFO) - fprintf (dbgfp, "%s: pth_wait: cnt %lu\n", log_get_prefix (NULL), n); + TRACE_LOG1 ("cnt %lu", n); /* Set all events to pending. */ r = ev; @@ -1747,7 +1764,7 @@ r->status = PTH_STATUS_PENDING; r = r->next; } - while ( r != ev); + while (r != ev); /* Prepare all events which requires to launch helper threads for some types. This creates an array of handles which are lates @@ -1759,8 +1776,7 @@ switch (r->u_type) { case PTH_EVENT_SIGS: - if (DBG_INFO) - fprintf (dbgfp, "pth_wait: add signal event\n"); + TRACE_LOG ("add signal event"); /* Register the global signal event. */ evarray[pos] = r; waitbuf[pos++] = pth_signo_ev; @@ -1770,6 +1786,8 @@ { int res; int fd = r->u.fd; + /* FIXME: Could be optimised a bit, as we call + _pth_get_reader_ev twice in the reader case. */ int is_socket = fd_is_socket (fd); if (is_socket) @@ -1794,6 +1812,7 @@ } else { + TRACE_LOG2 ("socket event for FD 0x%x is %p", fd, sockevent); evarray[pos] = r; waitbuf[pos++] = sockevent; } @@ -1813,7 +1832,8 @@ } else { - evarray[pos] = r; + TRACE_LOG2 ("reader for FD 0x%x is %p", fd, reader_ev); + evarray[pos] = r; waitbuf[pos++] = reader_ev; } } @@ -1829,6 +1849,7 @@ } else { + TRACE_LOG2 ("writer for FD 0x%x is %p", fd, writer_ev); evarray[pos] = r; waitbuf[pos++] = writer_ev; } @@ -1838,8 +1859,7 @@ break; case PTH_EVENT_TIME: - if (DBG_INFO) - fprintf (dbgfp, "pth_wait: adding timer event\n"); + TRACE_LOG ("adding timer event"); { LARGE_INTEGER ll; @@ -1851,7 +1871,7 @@ fprintf (dbgfp,"%s: %s: SetWaitableTimer failed: %s\n", log_get_prefix (NULL), __func__, w32_strerror (strerr, sizeof strerr)); - return -1; + return TRACE_SYSRES (-1); } evarray[pos] = r; waitbuf[pos++] = r->hd; @@ -1859,8 +1879,7 @@ break; case PTH_EVENT_SELECT: - if (DBG_INFO) - fprintf (dbgfp, "pth_wait: adding select event\n"); + TRACE_LOG ("adding select event"); evarray[pos] = r; waitbuf[pos++] = r->hd; break; @@ -1869,23 +1888,27 @@ if (DBG_ERROR) fprintf (dbgfp, "pth_wait: ignoring mutex event.\n"); break; + + default: + if (DBG_ERROR) + fprintf (dbgfp, "pth_wait: unhandled event type 0x%x.\n", + r->u_type); + break; } r = r->next; } - while ( r != ev ); + while (r != ev); - if (DBG_INFO) + TRACE_LOG ("dump list"); + if (_pth_debug_trace ()) { - fprintf (dbgfp, "%s: pth_wait: WFMO n=%d\n", - log_get_prefix (NULL), pos); - for (i=0; i < pos; i++) - fprintf (dbgfp, "%s: pth_wait: %d=%p\n", - log_get_prefix (NULL), i, waitbuf[i]); + TRACE_LOG1 ("WFMO n=%d", pos); + for (i = 0; i < pos; i++) + TRACE_LOG2 (" %d=%p", i, waitbuf[i]); } + TRACE_LOG ("now wait"); n = WaitForMultipleObjects (pos, waitbuf, FALSE, INFINITE); - if (DBG_INFO) - fprintf (dbgfp, "%s: pth_wait: WFMO returned %ld\n", - log_get_prefix (NULL), n); + TRACE_LOG1 ("WFMO returned %ld", n); count = 0; /* Walk over all events with an assigned handle and update the @@ -1896,9 +1919,7 @@ if (WaitForSingleObject (waitbuf[idx], 0) == WAIT_OBJECT_0) { - if (DBG_INFO) - fprintf (dbgfp, "%s: pth_wait: setting %d ev=%p\n", - __func__, idx, r); + TRACE_LOG2 ("setting %d ev=%p", idx, r); r->status = PTH_STATUS_OCCURRED; count++; @@ -2029,16 +2050,12 @@ } } - if (DBG_INFO) - fprintf (dbgfp, "%s: pth_wait: %d events have been signalled\n", - log_get_prefix (NULL), count); - if (count) - return count; + return TRACE_SYSRES (count); else if (n == WAIT_TIMEOUT) - return 0; + return TRACE_SYSRES (0); else - return -1; + return TRACE_SYSRES (-1); } From cvs at cvs.gnupg.org Tue Mar 25 04:47:42 2008 From: cvs at cvs.gnupg.org (svn author marcus) Date: Tue, 25 Mar 2008 04:47:42 +0100 Subject: [svn] dirmngr - r298 - trunk/src Message-ID: Author: marcus Date: 2008-03-25 04:47:41 +0100 (Tue, 25 Mar 2008) New Revision: 298 Modified: trunk/src/ChangeLog trunk/src/dirmngr_ldap.c Log: 2008-03-25 Marcus Brinkmann * dirmngr_ldap.c (print_ldap_entries): Add code alternative for W32 console stdout (unused at this point). Modified: trunk/src/ChangeLog =================================================================== --- trunk/src/ChangeLog 2008-03-21 04:32:37 UTC (rev 297) +++ trunk/src/ChangeLog 2008-03-25 03:47:41 UTC (rev 298) @@ -1,3 +1,8 @@ +2008-03-25 Marcus Brinkmann + + * dirmngr_ldap.c (print_ldap_entries): Add code alternative for + W32 console stdout (unused at this point). + 2008-03-21 Marcus Brinkmann * estream.c (ESTREAM_MUTEX_DESTROY): New macro. Modified: trunk/src/dirmngr_ldap.c =================================================================== --- trunk/src/dirmngr_ldap.c 2008-03-21 04:32:37 UTC (rev 297) +++ trunk/src/dirmngr_ldap.c 2008-03-25 03:47:41 UTC (rev 298) @@ -435,8 +435,12 @@ return -1; } } - if (fwrite (values[0]->bv_val, values[0]->bv_len, - 1, stdout) != 1) +#if 1 + /* Note: this does not work for STDOUT on a Windows + console, where it fails with "Not enough space" for + CRLs which are 52 KB or larger. */ + if (fwrite (values[0]->bv_val, values[0]->bv_len, + 1, stdout) != 1) { log_error (_("error writing to stdout: %s\n"), strerror (errno)); @@ -445,6 +449,33 @@ ber_free (berctx, 0); return -1; } +#else + /* On Windows console STDOUT, we have to break up the + writes into small parts. */ + { + int n = 0; + while (n < values[0]->bv_len) + { + int cnt = values[0]->bv_len - n; + /* The actual limit is (52 * 1024 - 1) on Windows XP SP2. */ +#define MAX_CNT (32*1024) + if (cnt > MAX_CNT) + cnt = MAX_CNT; + + if (fwrite (((char *) values[0]->bv_val) + n, cnt, 1, + stdout) != 1) + { + log_error (_("error writing to stdout: %s\n"), + strerror (errno)); + ldap_value_free_len (values); + ldap_memfree (attr); + ber_free (berctx, 0); + return -1; + } + n += cnt; + } + } +#endif any = 1; if (!opt.multi) break; /* Print only the first value. */ From cvs at cvs.gnupg.org Tue Mar 25 09:33:35 2008 From: cvs at cvs.gnupg.org (svn author wk) Date: Tue, 25 Mar 2008 09:33:35 +0100 Subject: [svn] GnuPG - r4713 - in trunk: . g10 Message-ID: Author: wk Date: 2008-03-25 09:33:31 +0100 (Tue, 25 Mar 2008) New Revision: 4713 Modified: trunk/NEWS trunk/g10/ChangeLog trunk/g10/import.c trunk/g10/options.skel trunk/g10/parse-packet.c Log: Fix bug 894. Change default keyserver. Allow key protection with Camellia. Modified: trunk/g10/ChangeLog =================================================================== --- trunk/g10/ChangeLog 2008-03-24 02:28:40 UTC (rev 4712) +++ trunk/g10/ChangeLog 2008-03-25 08:33:31 UTC (rev 4713) @@ -1,3 +1,15 @@ +2008-03-25 David Shaw (wk) + + * import.c (collapse_uids): Fix bug 894: possible memory + corruption around deduplication of user IDs. + +2008-03-25 Werner Koch + + * parse-packet.c (parse_key): Parse a secret key encrypted with + Camellia. + + * options.skel: Make the default keyserver keys.gnupg.net. + 2008-03-18 Werner Koch * seckey-cert.c (do_check): Use GCRYMPI_FMT_PGP for v3 keys. Modified: trunk/NEWS =================================================================== --- trunk/NEWS 2008-03-24 02:28:40 UTC (rev 4712) +++ trunk/NEWS 2008-03-25 08:33:31 UTC (rev 4713) @@ -12,6 +12,8 @@ * Fixed a bug in the ambigious name detection. + * Fixed possible memory corruption while importing OpenPGP keys. + * Minor bug fixes. Modified: trunk/g10/import.c =================================================================== --- trunk/g10/import.c 2008-03-24 02:28:40 UTC (rev 4712) +++ trunk/g10/import.c 2008-03-25 08:33:31 UTC (rev 4713) @@ -1661,11 +1661,17 @@ { KBNODE uid2; + if(is_deleted_kbnode(uid1)) + continue; + if(uid1->pkt->pkttype!=PKT_USER_ID) continue; for(uid2=uid1->next;uid2;uid2=uid2->next) { + if(is_deleted_kbnode(uid2)) + continue; + if(uid2->pkt->pkttype!=PKT_USER_ID) continue; @@ -1681,6 +1687,9 @@ uid1 */ for(last=uid2;last->next;last=last->next) { + if(is_deleted_kbnode(last)) + continue; + if(last->next->pkt->pkttype==PKT_USER_ID || last->next->pkt->pkttype==PKT_PUBLIC_SUBKEY || last->next->pkt->pkttype==PKT_SECRET_SUBKEY) @@ -1693,13 +1702,16 @@ /* Now put uid2 in place as part of uid1 */ last->next=uid1->next; uid1->next=uid2; - remove_kbnode(keyblock,uid2); + delete_kbnode(uid2); /* Now dedupe uid1 */ for(sig1=uid1->next;sig1;sig1=sig1->next) { KBNODE sig2; + if(is_deleted_kbnode(sig1)) + continue; + if(sig1->pkt->pkttype==PKT_USER_ID || sig1->pkt->pkttype==PKT_PUBLIC_SUBKEY || sig1->pkt->pkttype==PKT_SECRET_SUBKEY) @@ -1710,6 +1722,9 @@ for(sig2=sig1->next,last=sig1;sig2;last=sig2,sig2=sig2->next) { + if(is_deleted_kbnode(sig2)) + continue; + if(sig2->pkt->pkttype==PKT_USER_ID || sig2->pkt->pkttype==PKT_PUBLIC_SUBKEY || sig2->pkt->pkttype==PKT_SECRET_SUBKEY) @@ -1723,7 +1738,7 @@ { /* We have a match, so delete the second signature */ - remove_kbnode(&uid1,sig2); + delete_kbnode(sig2); sig2=last; } } @@ -1732,6 +1747,8 @@ } } + commit_kbnode(keyblock); + if(any && !opt.quiet) { const char *key="???"; Modified: trunk/g10/options.skel =================================================================== --- trunk/g10/options.skel 2008-03-24 02:28:40 UTC (rev 4712) +++ trunk/g10/options.skel 2008-03-25 08:33:31 UTC (rev 4713) @@ -98,7 +98,8 @@ # servers can be HKP, email, or LDAP (if GnuPG is built with LDAP # support). # -# Example HKP keyserver: +# Example HKP keyservers: +# hkp://keys.gnupg.net # hkp://subkeys.pgp.net # # Example email keyserver: @@ -121,11 +122,12 @@ # Note that most servers (with the notable exception of # ldap://keyserver.pgp.com) synchronize changes with each other. Note # also that a single server name may actually point to multiple -# servers via DNS round-robin. hkp://subkeys.pgp.net is an example of +# servers via DNS round-robin. hkp://keys.gnupg.net is an example of # such a "server", which spreads the load over a number of physical -# servers. +# servers. To see the IP address of the server actually used, you may use +# the "--keyserver-options debug". -keyserver hkp://subkeys.pgp.net +keyserver hkp://keys.gnupg.net #keyserver mailto:pgp-public-keys at keys.nl.pgp.net #keyserver ldap://pgp.surfnet.nl:11370 #keyserver ldap://keyserver.pgp.com Modified: trunk/g10/parse-packet.c =================================================================== --- trunk/g10/parse-packet.c 2008-03-24 02:28:40 UTC (rev 4712) +++ trunk/g10/parse-packet.c 2008-03-25 08:33:31 UTC (rev 4713) @@ -1906,8 +1906,9 @@ * enlarge temp. */ switch( sk->protect.algo ) { - case 7: case 8: case 9: /* reserved for AES */ + case 7: case 8: case 9: /* AES */ case 10: /* Twofish */ + case 11: case 12: /* Camellia */ sk->protect.ivlen = 16; break; default: From cvs at cvs.gnupg.org Tue Mar 25 09:34:05 2008 From: cvs at cvs.gnupg.org (svn author wk) Date: Tue, 25 Mar 2008 09:34:05 +0100 Subject: [svn] GnuPG - r4714 - in branches/STABLE-BRANCH-1-4: . g10 Message-ID: Author: wk Date: 2008-03-25 09:34:02 +0100 (Tue, 25 Mar 2008) New Revision: 4714 Modified: branches/STABLE-BRANCH-1-4/NEWS branches/STABLE-BRANCH-1-4/g10/ChangeLog branches/STABLE-BRANCH-1-4/g10/options.skel Log: Change default keyserver. Modified: branches/STABLE-BRANCH-1-4/g10/ChangeLog =================================================================== --- branches/STABLE-BRANCH-1-4/g10/ChangeLog 2008-03-25 08:33:31 UTC (rev 4713) +++ branches/STABLE-BRANCH-1-4/g10/ChangeLog 2008-03-25 08:34:02 UTC (rev 4714) @@ -1,3 +1,7 @@ +2008-03-25 Werner Koch + + * options.skel: Make the default keyserver keys.gnupg.net. + 2008-03-23 David Shaw * import.c (collapse_uids): Fix bug 894: possible memory Modified: branches/STABLE-BRANCH-1-4/NEWS =================================================================== --- branches/STABLE-BRANCH-1-4/NEWS 2008-03-25 08:33:31 UTC (rev 4713) +++ branches/STABLE-BRANCH-1-4/NEWS 2008-03-25 08:34:02 UTC (rev 4714) @@ -4,6 +4,7 @@ * Improved AES encryption performance by more than 20% (on ia32). Decryption is also a bit faster. + * Fixed possible memory corruption while importing OpenPGP keys. Noteworthy changes in version 1.4.8 (2007-12-20) Modified: branches/STABLE-BRANCH-1-4/g10/options.skel =================================================================== --- branches/STABLE-BRANCH-1-4/g10/options.skel 2008-03-25 08:33:31 UTC (rev 4713) +++ branches/STABLE-BRANCH-1-4/g10/options.skel 2008-03-25 08:34:02 UTC (rev 4714) @@ -93,6 +93,7 @@ # support). # # Example HKP keyserver: +# hkp://keys.gnupg.net # hkp://subkeys.pgp.net # # Example email keyserver: @@ -109,11 +110,12 @@ # Note that most servers (with the notable exception of # ldap://keyserver.pgp.com) synchronize changes with each other. Note # also that a single server name may actually point to multiple -# servers via DNS round-robin. hkp://subkeys.pgp.net is an example of +# servers via DNS round-robin. hkp://keys.gnupg.net is an example of # such a "server", which spreads the load over a number of physical -# servers. +# servers. To see the IP address of the server actually used, you may use +# the "--keyserver-options debug". -keyserver hkp://subkeys.pgp.net +keyserver hkp://keys.pgp.net #keyserver mailto:pgp-public-keys at keys.nl.pgp.net #keyserver ldap://keyserver.pgp.com From cvs at cvs.gnupg.org Wed Mar 26 11:56:50 2008 From: cvs at cvs.gnupg.org (svn author wk) Date: Wed, 26 Mar 2008 11:56:50 +0100 Subject: [svn] GnuPG - r4721 - tags Message-ID: Author: wk Date: 2008-03-26 11:56:49 +0100 (Wed, 26 Mar 2008) New Revision: 4721 Added: tags/gnupg-2.0.9/ Log: Release! From cvs at cvs.gnupg.org Wed Mar 26 12:01:06 2008 From: cvs at cvs.gnupg.org (svn author wk) Date: Wed, 26 Mar 2008 12:01:06 +0100 Subject: [svn] GnuPG - r4722 - trunk Message-ID: Author: wk Date: 2008-03-26 12:01:06 +0100 (Wed, 26 Mar 2008) New Revision: 4722 Modified: trunk/ChangeLog trunk/NEWS trunk/configure.ac Log: Post release update Modified: trunk/ChangeLog =================================================================== --- trunk/ChangeLog 2008-03-26 10:56:49 UTC (rev 4721) +++ trunk/ChangeLog 2008-03-26 11:01:06 UTC (rev 4722) @@ -1,3 +1,7 @@ +2008-03-26 Werner Koch + + Release 2.0.9. + 2008-02-19 Werner Koch * configure.ac: Remove --with-pkits-tests. Modified: trunk/NEWS =================================================================== --- trunk/NEWS 2008-03-26 10:56:49 UTC (rev 4721) +++ trunk/NEWS 2008-03-26 11:01:06 UTC (rev 4722) @@ -1,3 +1,8 @@ +Noteworthy changes in version 2.0.10 (unreleased) +------------------------------------------------- + + + Noteworthy changes in version 2.0.9 (2008-03-26) ------------------------------------------------ Modified: trunk/configure.ac =================================================================== --- trunk/configure.ac 2008-03-26 10:56:49 UTC (rev 4721) +++ trunk/configure.ac 2008-03-26 11:01:06 UTC (rev 4722) @@ -24,8 +24,8 @@ # Remember to change the version number immediately *after* a release. # Set my_issvn to "yes" for non-released code. Remember to run an # "svn up" and "autogen.sh" right before creating a distribution. -m4_define([my_version], [2.0.9]) -m4_define([my_issvn], [no]) +m4_define([my_version], [2.0.10]) +m4_define([my_issvn], [yes]) m4_define([svn_revision], m4_esyscmd([echo -n $( (svn info 2>/dev/null \ From cvs at cvs.gnupg.org Wed Mar 26 17:14:15 2008 From: cvs at cvs.gnupg.org (svn author wk) Date: Wed, 26 Mar 2008 17:14:15 +0100 Subject: [svn] GpgOL - r240 - trunk/src Message-ID: Author: wk Date: 2008-03-26 17:14:14 +0100 (Wed, 26 Mar 2008) New Revision: 240 Modified: trunk/src/ChangeLog trunk/src/engine-assuan.c trunk/src/engine-gpgme.c Log: Fix crash due to the gpgme backend. Fallback to GPA if Kleopatra is not installed. Modified: trunk/src/ChangeLog =================================================================== --- trunk/src/ChangeLog 2008-03-19 18:40:09 UTC (rev 239) +++ trunk/src/ChangeLog 2008-03-26 16:14:14 UTC (rev 240) @@ -1,3 +1,11 @@ +2008-03-26 Werner Koch + + * engine-gpgme.c (cleanup): Implement. + (op_gpgme_init): Save thread handle. + (waiter_thread): Check shutdown flags. + + * engine-assuan.c (get_uiserver_name): Fallback to GPA. + 2008-03-19 Werner Koch * mapihelp.cpp (mapi_change_message_class): Look into Modified: trunk/src/engine-assuan.c =================================================================== --- trunk/src/engine-assuan.c 2008-03-19 18:40:09 UTC (rev 239) +++ trunk/src/engine-assuan.c 2008-03-26 16:14:14 UTC (rev 240) @@ -324,6 +324,7 @@ { char *name = NULL; char *dir, *uiserver, *p; + int extra_arglen = 0; dir = read_w32_registry_string ("HKEY_LOCAL_MACHINE", GNUPG_REGKEY, "Install Directory"); @@ -332,15 +333,43 @@ uiserver = read_w32_registry_string (NULL, GNUPG_REGKEY, "UI Server"); if (!uiserver) - uiserver = xstrdup ("kleopatra.exe --daemon"); + { + uiserver = xstrdup ("kleopatra.exe"); + extra_arglen = 9; /* Space required for " --daemon". */ + } - name = xmalloc (strlen (dir) + strlen (uiserver) + 2); + name = xmalloc (strlen (dir) + strlen (uiserver) + extra_arglen + 2); strcpy (stpcpy (stpcpy (name, dir), "\\"), uiserver); for (p = name; *p; p++) if (*p == '/') *p = '\\'; xfree (uiserver); + if (extra_arglen && access (name, F_OK)) + { + /* Kleopatra iis not nstalled: Try GPA instead but if it is + also not available still return the Kleopatra + filename. */ + const char gpaserver[] = "gpa.exe"; + char *name2; + + name2 = xmalloc (strlen (dir) + strlen (gpaserver) + extra_arglen+2); + strcpy (stpcpy (stpcpy (name2, dir), "\\"), gpaserver); + for (p = name2; *p; p++) + if (*p == '/') + *p = '\\'; + if (access (name2, F_OK )) + xfree (name2); + else + { + xfree (name); + name = name2; + } + } xfree (dir); + + /* Append the arg for Kleopatra. */ + if (name && extra_arglen) + strcat (name, " --daemon"); } return name; Modified: trunk/src/engine-gpgme.c =================================================================== --- trunk/src/engine-gpgme.c 2008-03-19 18:40:09 UTC (rev 239) +++ trunk/src/engine-gpgme.c 2008-03-26 16:14:14 UTC (rev 240) @@ -1,5 +1,5 @@ /* engine-gpgme.c - Crypto engine with GPGME - * Copyright (C) 2005, 2006, 2007 g10 Code GmbH + * Copyright (C) 2005, 2006, 2007, 2008 g10 Code GmbH * * This file is part of GpgOL. * @@ -59,10 +59,11 @@ static int basic_init_done = 0; static int init_done = 0; +static int shutdown_gpgme = 0; - static DWORD WINAPI waiter_thread (void *dummy); static CRITICAL_SECTION waiter_thread_lock; +static HANDLE waiter_thread_handle = INVALID_HANDLE_VALUE; static void update_passphrase_cache (int err, struct passphrase_cb_s *pass_cb_value); /* static void add_verify_attestation (gpgme_data_t at, */ @@ -75,7 +76,17 @@ static void cleanup (void) { - /* Fixme: We should stop the thread. */ + if (init_done && waiter_thread_handle != INVALID_HANDLE_VALUE ) + { + DWORD ec; + + EnterCriticalSection (&waiter_thread_lock); + shutdown_gpgme = 1; + LeaveCriticalSection (&waiter_thread_lock); + while ( GetExitCodeThread (waiter_thread_handle, &ec) ) + Sleep (100); + waiter_thread_handle = INVALID_HANDLE_VALUE; + } } @@ -139,12 +150,13 @@ HANDLE th; DWORD tid; + waiter_thread_handle = INVALID_HANDLE_VALUE; InitializeCriticalSection (&waiter_thread_lock); th = CreateThread (NULL, 128*1024, waiter_thread, NULL, 0, &tid); if (th == INVALID_HANDLE_VALUE) log_error ("failed to start the gpgme waiter thread\n"); else - CloseHandle (th); + waiter_thread_handle = th; } init_done = 1; @@ -163,7 +175,7 @@ (void)dummy; - for (;;) + while (!shutdown_gpgme) { /* Note: We don't use hang because this will end up in a tight loop and does not do a voluntary context switch. Thus we do @@ -189,6 +201,8 @@ else Sleep (50); } + ExitThread (0); + return 0; } From cvs at cvs.gnupg.org Wed Mar 26 17:38:10 2008 From: cvs at cvs.gnupg.org (svn author wk) Date: Wed, 26 Mar 2008 17:38:10 +0100 Subject: [svn] GnuPG - r4723 - trunk/po Message-ID: Author: wk Date: 2008-03-26 17:38:09 +0100 (Wed, 26 Mar 2008) New Revision: 4723 Modified: trunk/po/ChangeLog trunk/po/zh_TW.po Log: Update Modified: trunk/po/ChangeLog =================================================================== --- trunk/po/ChangeLog 2008-03-26 11:01:06 UTC (rev 4722) +++ trunk/po/ChangeLog 2008-03-26 16:38:09 UTC (rev 4723) @@ -1,3 +1,7 @@ +2008-03-26 Jedi Lin (wk) + + * zh_TW.po: Update. + 2008-03-26 Werner Koch * de.po: Translate two new strings. Modified: trunk/po/zh_TW.po [not shown] From cvs at cvs.gnupg.org Wed Mar 26 18:02:49 2008 From: cvs at cvs.gnupg.org (svn author marcus) Date: Wed, 26 Mar 2008 18:02:49 +0100 Subject: [svn] GpgEX - r50 - trunk/src Message-ID: Author: marcus Date: 2008-03-26 18:02:48 +0100 (Wed, 26 Mar 2008) New Revision: 50 Modified: trunk/src/ChangeLog trunk/src/client.cc Log: 2008-03-26 Marcus Brinkmann * client.cc (default_uiserver_cmdline): Fall back to GPA if Kleopatra is not installed. Modified: trunk/src/ChangeLog =================================================================== --- trunk/src/ChangeLog 2008-02-19 16:03:19 UTC (rev 49) +++ trunk/src/ChangeLog 2008-03-26 17:02:48 UTC (rev 50) @@ -1,3 +1,8 @@ +2008-03-26 Marcus Brinkmann + + * client.cc (default_uiserver_cmdline): Fall back to GPA if + Kleopatra is not installed. + 2008-02-19 Marcus Brinkmann * client.cc (default_uiserver_cmdline): Change default uiserver Modified: trunk/src/client.cc =================================================================== --- trunk/src/client.cc 2008-02-19 16:03:19 UTC (rev 49) +++ trunk/src/client.cc 2008-03-26 17:02:48 UTC (rev 50) @@ -78,16 +78,25 @@ int uiserver_malloced = 1; uiserver = read_w32_registry_string (NULL, REGKEY, "UI Server"); - if (!uiserver) + if (! uiserver) { + string fname; + + uiserver_malloced = 0; + + try { fname = ((string) dir) + "\\" + + "kleopatra.exe"; } catch (...) {} + /* The option --use-standard-socket is the default on windows, so we can omit it here. */ - uiserver = "kleopatra.exe --daemon"; - uiserver_malloced = 0; + if (! access (fname.c_str (), F_OK)) + uiserver = "kleopatra.exe --daemon"; + else + uiserver = "gpa.exe --daemon"; } try { name = ((string) dir) + "\\" + uiserver; } catch (...) {} - + if (uiserver_malloced) free (uiserver); free ((void *) dir); From cvs at cvs.gnupg.org Wed Mar 26 18:18:12 2008 From: cvs at cvs.gnupg.org (svn author marcus) Date: Wed, 26 Mar 2008 18:18:12 +0100 Subject: [svn] GpgEX - r51 - in trunk: . po Message-ID: Author: marcus Date: 2008-03-26 18:18:11 +0100 (Wed, 26 Mar 2008) New Revision: 51 Added: trunk/po/ar.po trunk/po/es.po trunk/po/ru.po Modified: trunk/AUTHORS trunk/ChangeLog trunk/NEWS trunk/README trunk/po/de.po Log: 2008-03-26 Marcus Brinkmann * po/ar.po, po/es.po, po/ru.po: New files. * po/de.po: Fix newline. Modified: trunk/ChangeLog =================================================================== --- trunk/ChangeLog 2008-03-26 17:02:48 UTC (rev 50) +++ trunk/ChangeLog 2008-03-26 17:18:11 UTC (rev 51) @@ -1,3 +1,8 @@ +2008-03-26 Marcus Brinkmann + + * po/ar.po, po/es.po, po/ru.po: New files. + * po/de.po: Fix newline. + 2007-11-26 Marcus Brinkmann * doc/gpgex-de.html, doc/gpgex-en.html: Add FIXME entries for Modified: trunk/AUTHORS =================================================================== --- trunk/AUTHORS 2008-03-26 17:02:48 UTC (rev 50) +++ trunk/AUTHORS 2008-03-26 17:18:11 UTC (rev 51) @@ -1,7 +1,17 @@ -Package: gpgex -Contact: info-gpgex at g10code.com -Bugs: bug-gpgex at g10code.com - - -g10 Code GmbH - New code and package maintainer. +Package: gpgex +Contact: info-gpgex at g10code.com +Bugs: bug-gpgex at g10code.com + + +g10 Code GmbH + New code and package maintainer. + +???? ????? + Arabic translations. + +Diego Escalante Urrelo + Spanish translations. + +Sergei Smirnov + Russian translations. + Modified: trunk/NEWS =================================================================== --- trunk/NEWS 2008-03-26 17:02:48 UTC (rev 50) +++ trunk/NEWS 2008-03-26 17:18:11 UTC (rev 51) @@ -1,4 +1,5 @@ -Noteworthy changes for version 0.0.0 -================================================== +Noteworthy changes for version 0.9.0 (2008-03-26) +------------------------------------------------ * Initial release. + Modified: trunk/README =================================================================== --- trunk/README 2008-03-26 17:02:48 UTC (rev 50) +++ trunk/README 2008-03-26 17:18:11 UTC (rev 51) @@ -1,4 +1,4 @@ -BGPG Explorer Extensions +GPG Explorer Extensions ======================= This package contains GpgEX, the GNU Privacy Guard extensions for the @@ -53,3 +53,6 @@ 1 under: HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer + +You can also terminate the explorer process and restart it from a +previously opened console window. Added: trunk/po/ar.po =================================================================== --- trunk/po/ar.po 2008-03-26 17:02:48 UTC (rev 50) +++ trunk/po/ar.po 2008-03-26 17:18:11 UTC (rev 51) @@ -0,0 +1,117 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) YEAR g10 Code GmbH +# This file is distributed under the same license as the PACKAGE package. +# Ahmad Gharbeia , 2008. +# +msgid "" +msgstr "" +"Project-Id-Version: gpgex\n" +"Report-Msgid-Bugs-To: bug-gpgex at g10code.com\n" +"POT-Creation-Date: 2008-02-05 01:00+0100\n" +"PO-Revision-Date: 2008-03-24 23:07+0200\n" +"Last-Translator: ???? ????? \n" +"Language-Team: arabeyes.org \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=utf-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=6; plural=n==0 ? 0 : n==1 ? 1 : n==2 ? 2 : n>=3 && n<=10 ? 3 : n>=11 && n<=99 ? 4 : 5;\\n\n" +"X-Poedit-Language: Arabic\n" +"X-Poedit-SourceCharset: utf-8\n" + +#: src/client.cc:346 +#, c-format +msgid "" +"Can not access Kleopatra:\r\n" +"%s" +msgstr "" +"????? ?????? ??? ?????????:\r\n" +"%s" + +#: src/gpgex.cc:58 +msgid "Help on GpgEX" +msgstr "??????? ??? ?GpgEx?" + +#: src/gpgex.cc:59 +msgid "Decrypt and verify" +msgstr "????? ? ????" + +#: src/gpgex.cc:60 +msgid "Decrypt" +msgstr "?????" + +#: src/gpgex.cc:61 +msgid "Verify" +msgstr "????" + +#: src/gpgex.cc:62 +msgid "Encrypt and sign" +msgstr "???? ? ?????" + +#: src/gpgex.cc:63 +msgid "Encrypt" +msgstr "????" + +#: src/gpgex.cc:64 +msgid "Sign" +msgstr "?????" + +#: src/gpgex.cc:65 +msgid "Import keys" +msgstr "?????? ????????" + +#: src/gpgex.cc:66 +msgid "Create checksums" +msgstr "???? ???????" + +#: src/gpgex.cc:67 +msgid "Verify checksums" +msgstr "???? ?????????" + +#: src/gpgex.cc:307 +msgid "More GpgEX options" +msgstr "????? ?? ?????? ?GpgEx?" + +#: src/gpgex.cc:403 +msgid "Invoke the GpgEX documentation." +msgstr "????? ????? ?GpgEx?" + +#: src/gpgex.cc:407 +msgid "Decrypt and verify the marked files." +msgstr "????? ? ???? ?? ??????? ?????????." + +#: src/gpgex.cc:411 +msgid "Decrypt the marked files." +msgstr "????? ??????? ?????????." + +#: src/gpgex.cc:415 +msgid "Verify the marked files." +msgstr "???? ?? ??????? ??????? ?????????." + +#: src/gpgex.cc:419 +msgid "Encrypt and sign the marked files." +msgstr "???? ? ????? ??????? ?????????." + +#: src/gpgex.cc:423 +msgid "Encrypt the marked files." +msgstr "???? ??????? ?????????." + +#: src/gpgex.cc:427 +msgid "Sign the marked files." +msgstr "????? ??????? ?????????." + +#: src/gpgex.cc:431 +msgid "Import the marked files." +msgstr "?????? ??????? ?????????." + +#: src/gpgex.cc:435 +msgid "Create checksums." +msgstr "???? ???????." + +#: src/gpgex.cc:439 +msgid "Verify checksums." +msgstr "???? ?????????." + +#: src/gpgex.cc:443 +msgid "Show more GpgEX options." +msgstr "????? ????? ?? ?????? ?GpgEx?." + Modified: trunk/po/de.po [not shown] From cvs at cvs.gnupg.org Wed Mar 26 18:26:16 2008 From: cvs at cvs.gnupg.org (svn author marcus) Date: Wed, 26 Mar 2008 18:26:16 +0100 Subject: [svn] GpgEX - r52 - trunk Message-ID: Author: marcus Date: 2008-03-26 18:26:16 +0100 (Wed, 26 Mar 2008) New Revision: 52 Modified: trunk/ChangeLog trunk/configure.ac Log: 2008-03-26 Marcus Brinkmann * configure.ac: Prepare for release of 0.9.0. Modified: trunk/ChangeLog =================================================================== --- trunk/ChangeLog 2008-03-26 17:18:11 UTC (rev 51) +++ trunk/ChangeLog 2008-03-26 17:26:16 UTC (rev 52) @@ -1,5 +1,7 @@ 2008-03-26 Marcus Brinkmann + * configure.ac: Prepare for release of 0.9.0. + * po/ar.po, po/es.po, po/ru.po: New files. * po/de.po: Fix newline. Modified: trunk/configure.ac =================================================================== --- trunk/configure.ac 2008-03-26 17:18:11 UTC (rev 51) +++ trunk/configure.ac 2008-03-26 17:26:16 UTC (rev 52) @@ -16,8 +16,8 @@ # Remember to change the version number immediately *after* a release. # Set my_issvn to "yes" for non-released code. Remember to run an # "svn up" and "autogen.sh" right before creating a distribution. -m4_define([my_version], [0.0.0]) -m4_define([my_issvn], [yes]) +m4_define([my_version], [0.9.0]) +#m4_define([my_issvn], [yes]) m4_define([svn_revision], m4_esyscmd([echo -n $( (svn info 2>/dev/null \ || echo 'Revision: 0')|sed -n '/^Revision:/ {s/[^0-9]//gp;q;}')])) From cvs at cvs.gnupg.org Wed Mar 26 18:30:39 2008 From: cvs at cvs.gnupg.org (svn author marcus) Date: Wed, 26 Mar 2008 18:30:39 +0100 Subject: [svn] GpgEX - r53 - trunk Message-ID: Author: marcus Date: 2008-03-26 18:30:38 +0100 (Wed, 26 Mar 2008) New Revision: 53 Modified: trunk/ChangeLog trunk/Makefile.am Log: 2008-03-26 Marcus Brinkmann * Makefile.am (AUTOMAKE_OPTIONS): Add no-dist-gzip. Modified: trunk/ChangeLog =================================================================== --- trunk/ChangeLog 2008-03-26 17:26:16 UTC (rev 52) +++ trunk/ChangeLog 2008-03-26 17:30:38 UTC (rev 53) @@ -1,5 +1,7 @@ 2008-03-26 Marcus Brinkmann + * Makefile.am (AUTOMAKE_OPTIONS): Add no-dist-gzip. + * configure.ac: Prepare for release of 0.9.0. * po/ar.po, po/es.po, po/ru.po: New files. Modified: trunk/Makefile.am =================================================================== --- trunk/Makefile.am 2008-03-26 17:26:16 UTC (rev 52) +++ trunk/Makefile.am 2008-03-26 17:30:38 UTC (rev 53) @@ -12,7 +12,7 @@ ## Process this file with automake to produce Makefile.in ACLOCAL_AMFLAGS = -I m4 -AUTOMAKE_OPTIONS = dist-bzip2 +AUTOMAKE_OPTIONS = no-dist-gzip dist-bzip2 # Because we can only build the w32 version e need to help automake here a bit. DISTCHECK_CONFIGURE_FLAGS = --host=i586-mingw32msvc --build=i686-pc-linux-gnu \ --with-libassuan-prefix=@prefix@ \ From cvs at cvs.gnupg.org Wed Mar 26 18:44:57 2008 From: cvs at cvs.gnupg.org (svn author wk) Date: Wed, 26 Mar 2008 18:44:57 +0100 Subject: [svn] GnuPG - r4724 - trunk/tools Message-ID: Author: wk Date: 2008-03-26 18:44:56 +0100 (Wed, 26 Mar 2008) New Revision: 4724 Modified: trunk/tools/ChangeLog trunk/tools/make-dns-cert.c Log: Allow standalone build. Modified: trunk/tools/ChangeLog =================================================================== --- trunk/tools/ChangeLog 2008-03-26 16:38:09 UTC (rev 4723) +++ trunk/tools/ChangeLog 2008-03-26 17:44:56 UTC (rev 4724) @@ -1,3 +1,9 @@ +2008-03-26 Werner Koch + + * make-dns-cert.c: Include unistd.h. Use config.h if requested. + (cert_key): Protect read against EINTR. + (main): Print SVN revision for standalone version. + 2008-03-05 Werner Koch * gpg-connect-agent.c (arithmetic_op): Add logical not, or and and. Modified: trunk/tools/make-dns-cert.c =================================================================== --- trunk/tools/make-dns-cert.c 2008-03-26 16:38:09 UTC (rev 4723) +++ trunk/tools/make-dns-cert.c 2008-03-26 17:44:56 UTC (rev 4724) @@ -1,5 +1,5 @@ /* make-dns-cert.c - An OpenPGP-to-DNS CERT conversion tool - * Copyright (C) 2006 Free Software Foundation, Inc. + * Copyright (C) 2006, 2008 Free Software Foundation, Inc. * * This file is part of GnuPG. * @@ -17,7 +17,10 @@ * along with this program; if not, see . */ -#include +#ifdef HAVE_CONFIG_H +# include +#endif + #include #ifdef HAVE_GETOPT_H #include @@ -26,6 +29,7 @@ #include #include #include +#include #include #include #include @@ -72,7 +76,9 @@ { unsigned char buffer[1024]; - err=read(fd,buffer,1024); + do + err = read (fd,buffer,1024); + while (err == -1 && errno == EINTR); if(err==-1) { fprintf(stderr,"Unable to read key file %s: %s\n", @@ -181,7 +187,11 @@ } else if(argc>1 && strcmp(argv[1],"--version")==0) { - printf("make-dns-cert (GnuPG) " VERSION "\n"); +#if defined(HAVE_CONFIG_H) && defined(VERSION) + printf ("make-dns-cert (GnuPG) " VERSION "\n"); +#else + printf ("make-dns-cert gnupg-svn%s\n", "$Revision$"); +#endif return 0; } else if(argc>1 && strcmp(argv[1],"--help")==0) Property changes on: trunk/tools/make-dns-cert.c ___________________________________________________________________ Name: svn:keywords + Revision From cvs at cvs.gnupg.org Wed Mar 26 18:48:04 2008 From: cvs at cvs.gnupg.org (svn author marcus) Date: Wed, 26 Mar 2008 18:48:04 +0100 Subject: [svn] GpgEX - r54 - in trunk: . po Message-ID: Author: marcus Date: 2008-03-26 18:48:03 +0100 (Wed, 26 Mar 2008) New Revision: 54 Modified: trunk/ChangeLog trunk/po/LINGUAS Log: 2008-03-26 Marcus Brinkmann * po/LINGUAS: Add ar, es, ru. Modified: trunk/ChangeLog =================================================================== --- trunk/ChangeLog 2008-03-26 17:30:38 UTC (rev 53) +++ trunk/ChangeLog 2008-03-26 17:48:03 UTC (rev 54) @@ -1,5 +1,7 @@ 2008-03-26 Marcus Brinkmann + * po/LINGUAS: Add ar, es, ru. + * Makefile.am (AUTOMAKE_OPTIONS): Add no-dist-gzip. * configure.ac: Prepare for release of 0.9.0. Modified: trunk/po/LINGUAS =================================================================== --- trunk/po/LINGUAS 2008-03-26 17:30:38 UTC (rev 53) +++ trunk/po/LINGUAS 2008-03-26 17:48:03 UTC (rev 54) @@ -1,2 +1,2 @@ # Set of available languages. -de +de ar es ru From cvs at cvs.gnupg.org Wed Mar 26 18:53:05 2008 From: cvs at cvs.gnupg.org (svn author wk) Date: Wed, 26 Mar 2008 18:53:05 +0100 Subject: [svn] GnuPG - r4725 - branches/STABLE-BRANCH-1-4 Message-ID: Author: wk Date: 2008-03-26 18:53:04 +0100 (Wed, 26 Mar 2008) New Revision: 4725 Modified: branches/STABLE-BRANCH-1-4/ChangeLog branches/STABLE-BRANCH-1-4/NEWS branches/STABLE-BRANCH-1-4/README branches/STABLE-BRANCH-1-4/configure.ac Log: prepare a release. Modified: branches/STABLE-BRANCH-1-4/ChangeLog =================================================================== --- branches/STABLE-BRANCH-1-4/ChangeLog 2008-03-26 17:44:56 UTC (rev 4724) +++ branches/STABLE-BRANCH-1-4/ChangeLog 2008-03-26 17:53:04 UTC (rev 4725) @@ -1,3 +1,7 @@ +2008-03-26 Werner Koch + + Release 1.4.9. + 2008-03-07 David Shaw * configure.ac: Darwin's /bin/sh has a builtin echo that doesn't Modified: branches/STABLE-BRANCH-1-4/NEWS =================================================================== --- branches/STABLE-BRANCH-1-4/NEWS 2008-03-26 17:44:56 UTC (rev 4724) +++ branches/STABLE-BRANCH-1-4/NEWS 2008-03-26 17:53:04 UTC (rev 4725) @@ -1,10 +1,11 @@ -Noteworthy changes in version 1.4.9 (unreleased) +Noteworthy changes in version 1.4.9 (2008-03-26) ------------------------------------------------ * Improved AES encryption performance by more than 20% (on ia32). Decryption is also a bit faster. - * Fixed possible memory corruption while importing OpenPGP keys. + * Fixed possible memory corruption bug in 1.4.8 while importing + OpenPGP keys. Noteworthy changes in version 1.4.8 (2007-12-20) Modified: branches/STABLE-BRANCH-1-4/README =================================================================== --- branches/STABLE-BRANCH-1-4/README 2008-03-26 17:44:56 UTC (rev 4724) +++ branches/STABLE-BRANCH-1-4/README 2008-03-26 17:53:04 UTC (rev 4725) @@ -1,10 +1,10 @@ GnuPG - The GNU Privacy Guard ------------------------------- - Version 1.4.8 + Version 1.4.9 Copyright 1998, 1999, 2000, 2001, 2002, 2003, 2004, - 2005, 2006, 2007 Free Software Foundation, Inc. + 2005, 2006, 2007, 2008 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 Modified: branches/STABLE-BRANCH-1-4/configure.ac =================================================================== --- branches/STABLE-BRANCH-1-4/configure.ac 2008-03-26 17:44:56 UTC (rev 4724) +++ branches/STABLE-BRANCH-1-4/configure.ac 2008-03-26 17:53:04 UTC (rev 4725) @@ -26,7 +26,7 @@ # Set my_issvn to "yes" for non-released code. Remember to run an # "svn up" and "autogen.sh --force" right before creating a distribution. m4_define([my_version], [1.4.9]) -m4_define([my_issvn], [yes]) +m4_define([my_issvn], [no]) m4_define([svn_revision], m4_esyscmd([echo $((svn info 2>/dev/null \ || echo 'Revision: 0')|sed -n '/^Revision:/ s/[^0-9]//gp'|head -1)| \ From cvs at cvs.gnupg.org Wed Mar 26 18:57:15 2008 From: cvs at cvs.gnupg.org (svn author marcus) Date: Wed, 26 Mar 2008 18:57:15 +0100 Subject: [svn] GpgEX - r55 - tags Message-ID: Author: marcus Date: 2008-03-26 18:57:15 +0100 (Wed, 26 Mar 2008) New Revision: 55 Added: tags/gpgex-0.9.0/ Log: Tag release 0.9.0. From cvs at cvs.gnupg.org Wed Mar 26 18:57:51 2008 From: cvs at cvs.gnupg.org (svn author marcus) Date: Wed, 26 Mar 2008 18:57:51 +0100 Subject: [svn] GpgEX - r56 - trunk Message-ID: Author: marcus Date: 2008-03-26 18:57:51 +0100 (Wed, 26 Mar 2008) New Revision: 56 Modified: trunk/ChangeLog trunk/configure.ac Log: 2008-03-26 Marcus Brinkmann Released 0.9.0. Modified: trunk/ChangeLog =================================================================== --- trunk/ChangeLog 2008-03-26 17:57:15 UTC (rev 55) +++ trunk/ChangeLog 2008-03-26 17:57:51 UTC (rev 56) @@ -1,5 +1,7 @@ 2008-03-26 Marcus Brinkmann + Released 0.9.0. + * po/LINGUAS: Add ar, es, ru. * Makefile.am (AUTOMAKE_OPTIONS): Add no-dist-gzip. Modified: trunk/configure.ac =================================================================== --- trunk/configure.ac 2008-03-26 17:57:15 UTC (rev 55) +++ trunk/configure.ac 2008-03-26 17:57:51 UTC (rev 56) @@ -16,8 +16,8 @@ # Remember to change the version number immediately *after* a release. # Set my_issvn to "yes" for non-released code. Remember to run an # "svn up" and "autogen.sh" right before creating a distribution. -m4_define([my_version], [0.9.0]) -#m4_define([my_issvn], [yes]) +m4_define([my_version], [0.9.1]) +m4_define([my_issvn], [yes]) m4_define([svn_revision], m4_esyscmd([echo -n $( (svn info 2>/dev/null \ || echo 'Revision: 0')|sed -n '/^Revision:/ {s/[^0-9]//gp;q;}')])) From cvs at cvs.gnupg.org Wed Mar 26 19:15:36 2008 From: cvs at cvs.gnupg.org (svn author wk) Date: Wed, 26 Mar 2008 19:15:36 +0100 Subject: [svn] GnuPG - r4726 - tags Message-ID: Author: wk Date: 2008-03-26 19:15:36 +0100 (Wed, 26 Mar 2008) New Revision: 4726 Added: tags/gnupg-1.4.9/ Log: Release! From cvs at cvs.gnupg.org Wed Mar 26 19:37:30 2008 From: cvs at cvs.gnupg.org (svn author wk) Date: Wed, 26 Mar 2008 19:37:30 +0100 Subject: [svn] GnuPG - r4727 - branches/STABLE-BRANCH-1-4 Message-ID: Author: wk Date: 2008-03-26 19:37:29 +0100 (Wed, 26 Mar 2008) New Revision: 4727 Modified: branches/STABLE-BRANCH-1-4/NEWS branches/STABLE-BRANCH-1-4/configure.ac Log: Post release version number bump. Modified: branches/STABLE-BRANCH-1-4/NEWS =================================================================== --- branches/STABLE-BRANCH-1-4/NEWS 2008-03-26 18:15:36 UTC (rev 4726) +++ branches/STABLE-BRANCH-1-4/NEWS 2008-03-26 18:37:29 UTC (rev 4727) @@ -1,3 +1,8 @@ +Noteworthy changes in version 1.4.10 (unreleased) +------------------------------------------------- + + + Noteworthy changes in version 1.4.9 (2008-03-26) ------------------------------------------------ Modified: branches/STABLE-BRANCH-1-4/configure.ac =================================================================== --- branches/STABLE-BRANCH-1-4/configure.ac 2008-03-26 18:15:36 UTC (rev 4726) +++ branches/STABLE-BRANCH-1-4/configure.ac 2008-03-26 18:37:29 UTC (rev 4727) @@ -25,8 +25,8 @@ # Remember to change the version number immediately *after* a release. # Set my_issvn to "yes" for non-released code. Remember to run an # "svn up" and "autogen.sh --force" right before creating a distribution. -m4_define([my_version], [1.4.9]) -m4_define([my_issvn], [no]) +m4_define([my_version], [1.4.10]) +m4_define([my_issvn], [yes]) m4_define([svn_revision], m4_esyscmd([echo $((svn info 2>/dev/null \ || echo 'Revision: 0')|sed -n '/^Revision:/ s/[^0-9]//gp'|head -1)| \ From cvs at cvs.gnupg.org Thu Mar 27 14:18:31 2008 From: cvs at cvs.gnupg.org (svn author wk) Date: Thu, 27 Mar 2008 14:18:31 +0100 Subject: [svn] GnuPG - r4728 - in trunk: . doc po tools Message-ID: Author: wk Date: 2008-03-27 14:18:19 +0100 (Thu, 27 Mar 2008) New Revision: 4728 Modified: trunk/ChangeLog trunk/Makefile.am trunk/doc/ChangeLog trunk/doc/Makefile.am trunk/po/be.po trunk/po/ca.po trunk/po/cs.po trunk/po/da.po trunk/po/de.po trunk/po/el.po trunk/po/eo.po trunk/po/es.po trunk/po/et.po trunk/po/fi.po trunk/po/fr.po trunk/po/gl.po trunk/po/hu.po trunk/po/id.po trunk/po/it.po trunk/po/ja.po trunk/po/nb.po trunk/po/pl.po trunk/po/pt.po trunk/po/pt_BR.po trunk/po/ro.po trunk/po/ru.po trunk/po/sk.po trunk/po/sv.po trunk/po/tr.po trunk/po/zh_CN.po trunk/po/zh_TW.po trunk/tools/make-dns-cert.c Log: Utilize new automake vars for proper installation into doc/. Modified: trunk/ChangeLog =================================================================== --- trunk/ChangeLog 2008-03-26 18:37:29 UTC (rev 4727) +++ trunk/ChangeLog 2008-03-27 13:18:19 UTC (rev 4728) @@ -1,3 +1,7 @@ +2008-03-27 Werner Koch + + * Makefile.am (dist_doc_DATA): New. Install README. + 2008-03-26 Werner Koch Release 2.0.9. Modified: trunk/doc/ChangeLog =================================================================== --- trunk/doc/ChangeLog 2008-03-26 18:37:29 UTC (rev 4727) +++ trunk/doc/ChangeLog 2008-03-27 13:18:19 UTC (rev 4728) @@ -1,3 +1,9 @@ +2008-03-27 Werner Koch + + * Makefile.am (nobase_dist_doc_DATA, dist_html_DATA): New. Move + relevant files to here. + (install-html-local): Remove. + 2008-02-27 Marcus Brinkmann * tools.texi (Listing options): Document new types. Modified: trunk/Makefile.am =================================================================== --- trunk/Makefile.am 2008-03-26 18:37:29 UTC (rev 4727) +++ trunk/Makefile.am 2008-03-27 13:18:19 UTC (rev 4728) @@ -74,6 +74,9 @@ SUBDIRS = m4 gl include jnlib common ${kbx} \ ${gpg} ${keyserver} ${sm} ${agent} ${scd} ${tools} po ${doc} ${tests} +dist_doc_DATA = README + + dist-hook: echo "$(VERSION)" > $(distdir)/VERSION Modified: trunk/doc/Makefile.am =================================================================== --- trunk/doc/Makefile.am 2008-03-26 18:37:29 UTC (rev 4727) +++ trunk/doc/Makefile.am 2008-03-27 13:18:19 UTC (rev 4728) @@ -28,22 +28,27 @@ help.pt_BR.txt help.ro.txt help.ru.txt help.sk.txt \ help.sv.txt help.tr.txt help.zh_CN.txt help.zh_TW.txt -EXTRA_DIST = DETAILS HACKING TRANSLATE OpenPGP KEYSERVER samplekeys.asc \ +EXTRA_DIST = samplekeys.asc \ gnupg-logo.eps gnupg-logo.pdf gnupg-logo.png \ gnupg-card-architecture.eps gnupg-card-architecture.png \ gnupg-card-architecture.pdf \ faq.raw FAQ faq.html gnupg7.texi \ opt-homedir.texi see-also-note.texi specify-user-id.texi \ - gpgv.texi texi.css $(examples) yat2m.c + gpgv.texi texi.css yat2m.c BUILT_SOURCES = gnupg-card-architecture.eps gnupg-card-architecture.png \ gnupg-card-architecture.pdf FAQ faq.html info_TEXINFOS = gnupg.texi -dist_pkgdata_DATA = qualified.txt FAQ faq.html com-certs.pem \ - $(helpfiles) +dist_pkgdata_DATA = qualified.txt com-certs.pem $(helpfiles) +nobase_dist_doc_DATA = FAQ DETAILS HACKING TRANSLATE OpenPGP KEYSERVER \ + $(examples) + +dist_html_DATA = faq.html + + gnupg_TEXINFOS = \ gpg.texi gpgsm.texi gpg-agent.texi scdaemon.texi instguide.texi \ tools.texi debugging.texi glossary.texi contrib.texi gpl.texi \ @@ -140,9 +145,6 @@ gnupg.texi : $(gnupg_TEXINFOS) touch $(srcdir)/gnupg.texi -install-html-local: - cp $(srcdir)/gnupg-logo.png gnupg.html/ - online: gnupg.html gnupg.pdf set -e; \ echo "Uploading current manuals to www.gnupg.org ..."; \ Modified: trunk/po/be.po [not shown] Modified: trunk/po/ca.po [not shown] Modified: trunk/po/cs.po [not shown] Modified: trunk/po/da.po [not shown] Modified: trunk/po/de.po [not shown] Modified: trunk/po/el.po [not shown] Modified: trunk/po/eo.po [not shown] Modified: trunk/po/es.po [not shown] Modified: trunk/po/et.po [not shown] Modified: trunk/po/fi.po [not shown] Modified: trunk/po/fr.po [not shown] Modified: trunk/po/gl.po [not shown] Modified: trunk/po/hu.po [not shown] Modified: trunk/po/id.po [not shown] Modified: trunk/po/it.po [not shown] Modified: trunk/po/ja.po [not shown] Modified: trunk/po/nb.po [not shown] Modified: trunk/po/pl.po [not shown] Modified: trunk/po/pt.po [not shown] Modified: trunk/po/pt_BR.po [not shown] Modified: trunk/po/ro.po [not shown] Modified: trunk/po/ru.po [not shown] Modified: trunk/po/sk.po [not shown] Modified: trunk/po/sv.po [not shown] Modified: trunk/po/tr.po [not shown] Modified: trunk/po/zh_CN.po [not shown] Modified: trunk/po/zh_TW.po [not shown] Modified: trunk/tools/make-dns-cert.c =================================================================== --- trunk/tools/make-dns-cert.c 2008-03-26 18:37:29 UTC (rev 4727) +++ trunk/tools/make-dns-cert.c 2008-03-27 13:18:19 UTC (rev 4728) @@ -190,7 +190,7 @@ #if defined(HAVE_CONFIG_H) && defined(VERSION) printf ("make-dns-cert (GnuPG) " VERSION "\n"); #else - printf ("make-dns-cert gnupg-svn%s\n", "$Revision$"); + printf ("make-dns-cert gnupg-svn%d\n", atoi (10+"$Revision$")); #endif return 0; } From cvs at cvs.gnupg.org Thu Mar 27 14:23:40 2008 From: cvs at cvs.gnupg.org (svn author wk) Date: Thu, 27 Mar 2008 14:23:40 +0100 Subject: [svn] GnuPG - r4729 - in branches/STABLE-BRANCH-1-4: . po Message-ID: Author: wk Date: 2008-03-27 14:23:39 +0100 (Thu, 27 Mar 2008) New Revision: 4729 Modified: branches/STABLE-BRANCH-1-4/Makefile.am branches/STABLE-BRANCH-1-4/po/ChangeLog branches/STABLE-BRANCH-1-4/po/zh_TW.po Log: add comment. Minor update of zh_TW. Modified: branches/STABLE-BRANCH-1-4/po/ChangeLog =================================================================== --- branches/STABLE-BRANCH-1-4/po/ChangeLog 2008-03-27 13:18:19 UTC (rev 4728) +++ branches/STABLE-BRANCH-1-4/po/ChangeLog 2008-03-27 13:23:39 UTC (rev 4729) @@ -1,3 +1,7 @@ +2008-03-27 Jedi (wk) + + * zh_TW.po: Minor update. + 2008-01-02 Jedi (wk) * zh_TW.po: Update. Modified: branches/STABLE-BRANCH-1-4/Makefile.am =================================================================== --- branches/STABLE-BRANCH-1-4/Makefile.am 2008-03-27 13:18:19 UTC (rev 4728) +++ branches/STABLE-BRANCH-1-4/Makefile.am 2008-03-27 13:23:39 UTC (rev 4729) @@ -31,6 +31,11 @@ EXTRA_DIST = scripts/config.rpath PROJECTS BUGS config.h.in autogen.sh DISTCLEANFILES = +# We do not install README into the doc directory because that would +# conflict with GnuPG-2. +# dist_doc_DATA = README + + # Add all the files listed in "distfiles" files to the distribution, # apply version numbers to some files and create a VERSION file which # we need for the Prereq: patch file trick. Modified: branches/STABLE-BRANCH-1-4/po/zh_TW.po [not shown] From cvs at cvs.gnupg.org Fri Mar 28 10:22:00 2008 From: cvs at cvs.gnupg.org (svn author wk) Date: Fri, 28 Mar 2008 10:22:00 +0100 Subject: [svn] GnuPG - r4730 - trunk Message-ID: Author: wk Date: 2008-03-28 10:21:59 +0100 (Fri, 28 Mar 2008) New Revision: 4730 Modified: trunk/NEWS Log: Add CVE number. Modified: trunk/NEWS =================================================================== --- trunk/NEWS 2008-03-27 13:23:39 UTC (rev 4729) +++ trunk/NEWS 2008-03-28 09:21:59 UTC (rev 4730) @@ -20,7 +20,7 @@ * Fixed a bug in the ambigious name detection. * Fixed possible memory corruption while importing OpenPGP keys (bug - introduced with 2.0.8). + introduced with 2.0.8). [CVE-2008-1530] * Minor bug fixes. From cvs at cvs.gnupg.org Mon Mar 31 12:31:21 2008 From: cvs at cvs.gnupg.org (svn author wk) Date: Mon, 31 Mar 2008 12:31:21 +0200 Subject: [svn] GnuPG - r4731 - trunk/sm Message-ID: Author: wk Date: 2008-03-31 12:31:20 +0200 (Mon, 31 Mar 2008) New Revision: 4731 Modified: trunk/sm/ChangeLog trunk/sm/call-dirmngr.c Log: Fix problem when using the fallback dirmngr. Modified: trunk/sm/ChangeLog =================================================================== --- trunk/sm/ChangeLog 2008-03-28 09:21:59 UTC (rev 4730) +++ trunk/sm/ChangeLog 2008-03-31 10:31:20 UTC (rev 4731) @@ -1,3 +1,8 @@ +2008-03-31 Werner Koch + + * call-dirmngr.c (start_dirmngr): Use log_info instead of + log_error when falling back to start dirmngr. + 2008-03-20 Werner Koch * certlist.c (gpgsm_add_to_certlist): Always save the first Modified: trunk/sm/call-dirmngr.c =================================================================== --- trunk/sm/call-dirmngr.c 2008-03-28 09:21:59 UTC (rev 4730) +++ trunk/sm/call-dirmngr.c 2008-03-31 10:31:20 UTC (rev 4731) @@ -274,7 +274,7 @@ #ifndef HAVE_W32_SYSTEM if (gpg_err_code (rc) == GPG_ERR_ASS_CONNECT_FAILED) { - log_error (_("can't connect to the dirmngr - trying fall back\n")); + log_info (_("can't connect to the dirmngr - trying fall back\n")); force_pipe_server = 1; return start_dirmngr (ctrl); } From cvs at cvs.gnupg.org Mon Mar 31 18:29:56 2008 From: cvs at cvs.gnupg.org (svn author wk) Date: Mon, 31 Mar 2008 18:29:56 +0200 Subject: [svn] GpgOL - r241 - in trunk: . po src Message-ID: Author: wk Date: 2008-03-31 18:29:54 +0200 (Mon, 31 Mar 2008) New Revision: 241 Modified: trunk/TODO trunk/po/de.po trunk/po/sv.po trunk/src/ChangeLog trunk/src/config-dialog.c trunk/src/dialogs.h trunk/src/dialogs.rc trunk/src/ext-commands.cpp trunk/src/ext-commands.h trunk/src/message.cpp trunk/src/olflange-dlgs.cpp trunk/src/olflange.cpp Log: Visual cleanups. [The diff below has been truncated] Modified: trunk/src/ChangeLog =================================================================== --- trunk/src/ChangeLog 2008-03-26 16:14:14 UTC (rev 240) +++ trunk/src/ChangeLog 2008-03-31 16:29:54 UTC (rev 241) @@ -1,3 +1,28 @@ +2008-03-31 Werner Koch + + * ext-commands.h (class GpgolExtCommands): Add m_nCmdCryptoState. + * ext-commands.cpp (InstallCommands): Add a toolbar crypto state + button. + (DoCommand): Show a message when trying to select the disabled + S/MIME protocol. + + * message.cpp (message_sign, message_verify, message_decrypt) + (sign_encrypt): Display message boxes only in debug mode. + + * olflange-dlgs.cpp: Remove G-Data 2001 copyright because all that + old code has gone. + + * dialogs.rc (IDD_EXT_OPTIONS): Remove option to select the key + manager. + (IDD_GPG_OPTIONS): Remove caching time, reorder options, add group + boxes. + * olflange-dlgs.cpp (GPGOptionsDlgProc): Clean up accordingly. + * config-dialog.c (config_dlg_proc): Ditto. + (get_open_file_name, does_file_exist, error_box): Remove. + + * ext-commands.cpp: Rename nCmdShowInfo to nCmdDebug0 and enable + it only in debug mode. + 2008-03-26 Werner Koch * engine-gpgme.c (cleanup): Implement. Modified: trunk/TODO =================================================================== --- trunk/TODO 2008-03-26 16:14:14 UTC (rev 240) +++ trunk/TODO 2008-03-31 16:29:54 UTC (rev 241) @@ -1,7 +1,3 @@ -* Show more details in case of some errors. - For example 'No Secret Key' should contain the key-ID - and if possible the primary user-ID. - * Find out why sometimes the new body cannot set to a MAPI object. In this case the body is empty but the W32 API said it was correctly set. This might be due to the length of the object. HrGetOneProp has @@ -9,11 +5,6 @@ same holds true for HrSetOneProp. We might want to use OpenProperty for longer texts. -* Hook into OnDelivery and rename attachments named like the - Attestation attachment we generate locally. We might also want to - detect whether this is an encrypted message and change the - MessageClass accordingly. - * Allow for symmetric encryption. * Please consider adding a few more options like key signing rules Modified: trunk/po/de.po [not shown] Modified: trunk/po/sv.po [not shown] Modified: trunk/src/config-dialog.c =================================================================== --- trunk/src/config-dialog.c 2008-03-26 16:14:14 UTC (rev 240) +++ trunk/src/config-dialog.c 2008-03-31 16:29:54 UTC (rev 241) @@ -1,5 +1,5 @@ /* config-dialog.c - * Copyright (C) 2005 g10 Code GmbH + * Copyright (C) 2005, 2008 g10 Code GmbH * Copyright (C) 2003 Timo Schulz * * This file is part of GpgOL. @@ -37,69 +37,8 @@ /* Registry path to store plugin settings */ #define GPGOL_REGPATH "Software\\GNU\\GpgOL" -static char* -get_open_file_name (const char *dir, const char *title) -{ - static char fname[MAX_PATH+1]; - OPENFILENAME ofn; - memset (&ofn, 0, sizeof (ofn)); - memset (fname, 0, sizeof (fname)); - ofn.hwndOwner = GetDesktopWindow (); - ofn.hInstance = glob_hinst; - ofn.Flags = OFN_FILEMUSTEXIST; - ofn.lpstrTitle = title; - ofn.lStructSize = sizeof (ofn); - ofn.lpstrInitialDir = dir; - ofn.lpstrFilter = "EXE-Files (*.EXE)\0*.EXE\0\0"; - ofn.lpstrFile = fname; - ofn.nMaxFile = sizeof (fname)-1; - if (GetOpenFileName (&ofn) == FALSE) - return NULL; - return fname; -} - - -#if 0 -static void -SHFree (void *p) -{ - IMalloc *pm; - SHGetMalloc (&pm); - if (pm) { - pm->lpVtbl->Free(pm,p); - pm->lpVtbl->Release(pm); - } -} -#endif - -#if 0 -/* Open the common dialog to select a folder. Caller has to free the string. */ static char* -get_folder (const char *title) -{ - char fname[MAX_PATH+1]; - BROWSEINFO bi; - ITEMIDLIST * il; - char *path = NULL; - - memset (&bi, 0, sizeof (bi)); - memset (fname, 0, sizeof (fname)); - bi.hwndOwner = GetDesktopWindow (); - bi.lpszTitle = title; - il = SHBrowseForFolder (&bi); - if (il != NULL) - { - SHGetPathFromIDList (il, fname); - path = xstrdup (fname); - SHFree (il); - } - return path; -} -#endif - - -static char* expand_path (const char *path) { DWORD len; @@ -188,78 +127,6 @@ } -#if 0 -static int -does_folder_exist (const char *path) -{ - int attrs = GetFileAttributes (path); - int err = 0; - - if (attrs == 0xFFFFFFFF) - err = -1; - else if (!(attrs & FILE_ATTRIBUTE_DIRECTORY)) - err = -1; - if (err != 0) { - const char *fmt = "\"%s\" either does not exist or is not a directory"; - char *p = xmalloc (strlen (fmt) + strlen (path) + 2 + 2); - sprintf (p, fmt, path); - MessageBox (NULL, p, "Config Error", MB_ICONERROR|MB_OK); - xfree (p); - } - return err; -} -#endif - -static int -does_file_exist (const char *name, int is_file) -{ - struct stat st; - const char *s; - char *p, *name2; - int err = 0; - - /* check WinPT specific flags */ - if ((p=strstr (name, "--keymanager"))) { - name2 = xcalloc (1, (p-name)+2); - strncpy (name2, name, (p-name)-1); - } - else - name2 = xstrdup (name); - - if (stat (name2, &st) == -1) { - s = "\"%s\" does not exist."; - p = xmalloc (strlen (s) + strlen (name2) + 2); - sprintf (p, s, name2); - MessageBox (NULL, p, "Config Error", MB_ICONERROR|MB_OK); - err = -1; - } - else if (is_file && !(st.st_mode & _S_IFREG)) { - s = "\"%s\" is not a regular file."; - p = xmalloc (strlen (s) + strlen (name2) + 2); - sprintf (p, s, name2); - MessageBox (NULL, p, "Config Error", MB_ICONERROR|MB_OK); - err = -1; - } - xfree (name2); - xfree (p); - return err; -} - - -static void -error_box (const char *title) -{ - TCHAR buf[256]; - DWORD last_err; - - last_err = GetLastError (); - FormatMessage (FORMAT_MESSAGE_FROM_SYSTEM, NULL, last_err, - MAKELANGID (LANG_NEUTRAL, SUBLANG_DEFAULT), - buf, sizeof (buf)-1, NULL); - MessageBox (NULL, buf, title, MB_OK); -} - - /* To avoid writing a dialog template for each language we use gettext for the labels and hope that there is enough space in the dialog to fit teh longest translation. */ @@ -267,7 +134,6 @@ config_dlg_set_labels (HWND dlg) { static struct { int itemid; const char *label; } labels[] = { - { IDC_T_OPT_KEYMAN_PATH, N_("Path to certificate manager binary")}, { IDC_T_DEBUG_LOGFILE, N_("Debug output (for analysing problems)")}, { 0, NULL} }; @@ -275,58 +141,38 @@ for (i=0; labels[i].itemid; i++) SetDlgItemText (dlg, labels[i].itemid, _(labels[i].label)); - + } static BOOL CALLBACK config_dlg_proc (HWND dlg, UINT msg, WPARAM wparam, LPARAM lparam) { - char *buf = NULL; - char name[MAX_PATH+1]; - int n; - const char *s; - - switch (msg) { + char name[MAX_PATH+1]; + int n; + const char *s; + + switch (msg) + { case WM_INITDIALOG: - center_window (dlg, 0); - if (!load_config_value (NULL, REGPATH, "keyManager", &buf)) { - SetDlgItemText (dlg, IDC_OPT_KEYMAN_PATH, buf); - xfree (buf); - buf=NULL; - } - else - SetDlgItemText (dlg, IDC_OPT_KEYMAN_PATH, ""); - s = get_log_file (); - SetDlgItemText (dlg, IDC_DEBUG_LOGFILE, s? s:""); - config_dlg_set_labels (dlg); - break; - + center_window (dlg, 0); + s = get_log_file (); + SetDlgItemText (dlg, IDC_DEBUG_LOGFILE, s? s:""); + config_dlg_set_labels (dlg); + break; + case WM_COMMAND: - switch (LOWORD (wparam)) { - case IDC_OPT_SEL_KEYMAN_PATH: - buf = get_open_file_name (NULL, _("Select Certificate Manager")); - if (buf && *buf) - SetDlgItemText (dlg, IDC_OPT_KEYMAN_PATH, buf); - break; - + switch (LOWORD (wparam)) + { case IDOK: - n = GetDlgItemText (dlg, IDC_OPT_KEYMAN_PATH, name, MAX_PATH-1); - if (n > 0) { - if (does_file_exist (name, 1)) - return FALSE; - if (store_config_value (NULL, REGPATH, "keyManager", name)) - error_box ("GPG Config"); - } - n = GetDlgItemText (dlg, IDC_DEBUG_LOGFILE, name, MAX_PATH-1); - set_log_file (n>0?name:NULL); - - EndDialog (dlg, TRUE); - break; + n = GetDlgItemText (dlg, IDC_DEBUG_LOGFILE, name, MAX_PATH-1); + set_log_file (n>0?name:NULL); + EndDialog (dlg, TRUE); + break; } - break; + break; } - - return FALSE; + + return FALSE; } Modified: trunk/src/dialogs.h =================================================================== --- trunk/src/dialogs.h 2008-03-26 16:14:14 UTC (rev 240) +++ trunk/src/dialogs.h 2008-03-31 16:29:54 UTC (rev 241) @@ -17,8 +17,9 @@ #define IDB_BANNER_HI 3007 #define IDB_SELECT_SMIME 3008 #define IDB_KEY_MANAGER_PNG 3105 +#define IDB_CRYPTO_STATE 3005 /* We use the keymanager + icon for now*/ - /* Ids used for the main config dialog. */ #define IDD_GPG_OPTIONS 4001 #define IDC_TIME_PHRASES 4010 @@ -34,17 +35,13 @@ #define IDC_ENABLE_SMIME 4020 #define IDC_PREVIEW_DECRYPT 4021 #define IDC_PREFER_HTML 4022 -#define IDC_G_OPTIONS 4023 -#define IDC_G_PASSPHRASE 4024 -#define IDC_T_PASSPHRASE_TTL 4025 -#define IDC_T_PASSPHRASE_MIN 4026 +#define IDC_G_GENERAL 4023 +#define IDC_G_SEND 4024 +#define IDC_G_RECV 4025 /* Ids for the extended options dialog. */ #define IDD_EXT_OPTIONS 4101 -#define IDC_T_OPT_KEYMAN_PATH 4110 -#define IDC_OPT_KEYMAN_PATH 4111 -#define IDC_OPT_SEL_KEYMAN_PATH 4112 #define IDC_T_DEBUG_LOGFILE 4113 #define IDC_DEBUG_LOGFILE 4114 Modified: trunk/src/dialogs.rc =================================================================== --- trunk/src/dialogs.rc 2008-03-26 16:14:14 UTC (rev 240) +++ trunk/src/dialogs.rc 2008-03-31 16:29:54 UTC (rev 241) @@ -35,98 +35,76 @@ CAPTION "GpgOL" FONT 8, "MS Sans Serif" BEGIN - /* Options box. */ - GROUPBOX "options", IDC_G_OPTIONS, - 9, 9, 242, 124 + /* General options box. */ + GROUPBOX "general-options", IDC_G_GENERAL, + 9, 9, 250, 25 - CONTROL "encrypt-by-default", IDC_ENCRYPT_DEFAULT, + CONTROL "enable-smime", IDC_ENABLE_SMIME, "Button", BS_AUTOCHECKBOX | WS_TABSTOP, 24, 19, 215, 10 + /* Send options box. */ + GROUPBOX "send-options", IDC_G_SEND, + 9, 40, 250, 58 + + CONTROL "encrypt-by-default", IDC_ENCRYPT_DEFAULT, + "Button", BS_AUTOCHECKBOX | WS_TABSTOP, + 24, 50, 215, 10 + CONTROL "sign-by-default", IDC_SIGN_DEFAULT, "Button", BS_AUTOCHECKBOX | WS_TABSTOP, - 24, 30, 215, 10 + 24, 61, 215, 10 CONTROL "openpgp-by-default", IDC_OPENPGP_DEFAULT, "Button", BS_AUTOCHECKBOX | WS_TABSTOP, - 24, 42, 215, 10 + 24, 72, 215, 10 CONTROL "smime-by-default", IDC_SMIME_DEFAULT, "Button", BS_AUTOCHECKBOX | WS_TABSTOP, - 24, 54, 215, 10 + 24, 83, 215, 10 - CONTROL "enable-smime", IDC_ENABLE_SMIME, - "Button", BS_AUTOCHECKBOX | WS_TABSTOP, - 24, 66, 215, 10 + /* Receive options box. */ + GROUPBOX "recv-options", IDC_G_RECV, + 9, 104, 250, 36 - /* Note: We epp the spae for now in case we need to add other config - options. */ -/* CONTROL "encrypt-to", IDC_ENCRYPT_WITH_STANDARD_KEY, */ -/* "Button", BS_AUTOCHECKBOX | WS_TABSTOP, */ -/* 24, 79, 215, 10 */ - -/* EDITTEXT IDC_ENCRYPT_TO, */ -/* 36, 91, 133, 12, ES_AUTOHSCROLL */ - CONTROL "preview-decrypt", IDC_PREVIEW_DECRYPT, "Button", BS_AUTOCHECKBOX | WS_TABSTOP, - 24, 107, 215, 10 + 24, 114, 215, 10 CONTROL "prefer-html", IDC_PREFER_HTML, "Button", BS_AUTOCHECKBOX | WS_TABSTOP, - 24, 119, 215, 10 + 24, 125, 215, 10 - /* Passphrase option box. */ - GROUPBOX "Passphrase", IDC_G_PASSPHRASE, - 9, 136, 242, 31 - - LTEXT "passphrase-ttl", IDC_T_PASSPHRASE_TTL, - 24, 148, 80, 8 - - EDITTEXT IDC_TIME_PHRASES, - 107, 147, 39, 14, ES_AUTOHSCROLL - - LTEXT "minutes", IDC_T_PASSPHRASE_MIN, - 151, 149, 50, 8 - /* Stuff below the group boxes. */ - PUSHBUTTON "advanced", IDC_GPG_OPTIONS, - 202, 178, 50, 14 - LTEXT "GpgOL by g10 Code GmbH", IDC_STATIC, 8, 197, 100, 8 LTEXT "Version x ", IDC_VERSION_INFO, - 150, 197, 109, 9 + 130, 197, 129, 9 CONTROL IDB_BANNER, IDC_BITMAP, "Static", SS_BITMAP | SS_REALSIZEIMAGE, 8, 212, 150, 64 + + PUSHBUTTON "advanced", IDC_GPG_OPTIONS, + 209, 240, 50, 14 + END -IDD_EXT_OPTIONS DIALOG DISCARDABLE 0, 0, 167, 119 +IDD_EXT_OPTIONS DIALOG DISCARDABLE 0, 0, 155, 70 STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION -CAPTION "GpgOL - Extended Options (debug only!)" +CAPTION "GpgOL - Debug Options" FONT 8, "MS Sans Serif" BEGIN - LTEXT "keyman", IDC_T_OPT_KEYMAN_PATH, - 2,20, 122,8 - - EDITTEXT IDC_OPT_KEYMAN_PATH, - 2, 34, 144, 12, ES_AUTOHSCROLL - - PUSHBUTTON "...", IDC_OPT_SEL_KEYMAN_PATH, - 148, 34, 11, 14 - LTEXT "debug-logfile", IDC_T_DEBUG_LOGFILE, - 2, 50, 122,8 + 8, 10, 122, 8 EDITTEXT IDC_DEBUG_LOGFILE, - 2, 60, 144, 12, ES_AUTOHSCROLL + 8, 20, 138, 12, ES_AUTOHSCROLL DEFPUSHBUTTON "&OK", IDOK, - 112, 101, 50, 14 + 90, 50, 50, 14 END Modified: trunk/src/ext-commands.cpp =================================================================== --- trunk/src/ext-commands.cpp 2008-03-26 16:14:14 UTC (rev 240) +++ trunk/src/ext-commands.cpp 2008-03-31 16:29:54 UTC (rev 241) @@ -104,9 +104,10 @@ m_nCmdEncrypt = 0; m_nCmdDecrypt = 0; m_nCmdSign = 0; - m_nCmdShowInfo = 0; m_nCmdCheckSig = 0; m_nCmdKeyManager = 0; + m_nCmdCryptoState = 0; + m_nCmdDebug0 = 0; m_nCmdDebug1 = 0; m_nCmdDebug2 = 0; m_toolbar_info = NULL; @@ -444,11 +445,23 @@ "@", NULL, need_dvm? _("&Decrypt and verify message"):"", &m_nCmdDecrypt, _("&Verify signature"), &m_nCmdCheckSig, - _("&Display crypto information"), &m_nCmdShowInfo, - "@", NULL, - opt.enable_debug? "Debug-1 (open_inspector)":"", &m_nCmdDebug1, - opt.enable_debug? "Debug-2 (change msg class)":"", &m_nCmdDebug2, + opt.enable_debug? "GpgOL Debug-0 (display crypto info)":"", + &m_nCmdDebug0, + opt.enable_debug? "GpgOL Debug-1 (open_inspector)":"", &m_nCmdDebug1, + opt.enable_debug? "GpgOL Debug-2 (change msg class)":"", &m_nCmdDebug2, NULL); + + + add_toolbar (pTBEArray, nTBECnt, + need_dvm + ? _("This is an encrypted message.\n" + "Click for more information. ") + : _("This is a signed message.\n" + "Click for more information. "), + IDB_CRYPTO_STATE, m_nCmdCryptoState, + NULL, 0, 0); + + } else if (m_lContext == EECONTEXT_SENDNOTEMESSAGE) { @@ -625,18 +638,6 @@ ul_release (message, __func__, __LINE__); ul_release (mdb, __func__, __LINE__); } - else if (nCommandID == m_nCmdShowInfo - && m_lContext == EECONTEXT_READNOTEMESSAGE) - { - log_debug ("%s:%s: command ShowInfo called\n", SRCNAME, __func__); From cvs at cvs.gnupg.org Mon Mar 31 23:17:19 2008 From: cvs at cvs.gnupg.org (svn author dshaw) Date: Mon, 31 Mar 2008 23:17:19 +0200 Subject: [svn] GnuPG - r4732 - branches/STABLE-BRANCH-1-4 Message-ID: Author: dshaw Date: 2008-03-31 23:17:18 +0200 (Mon, 31 Mar 2008) New Revision: 4732 Modified: branches/STABLE-BRANCH-1-4/ChangeLog branches/STABLE-BRANCH-1-4/configure.ac Log: * configure.ac: Require curl 7.10 (Oct 1 2002) or later as we use curl_version_info(). Modified: branches/STABLE-BRANCH-1-4/ChangeLog =================================================================== --- branches/STABLE-BRANCH-1-4/ChangeLog 2008-03-31 10:31:20 UTC (rev 4731) +++ branches/STABLE-BRANCH-1-4/ChangeLog 2008-03-31 21:17:18 UTC (rev 4732) @@ -1,3 +1,8 @@ +2008-03-31 David Shaw + + * configure.ac: Require curl 7.10 (Oct 1 2002) or later as we use + curl_version_info(). + 2008-03-26 Werner Koch Release 1.4.9. Modified: branches/STABLE-BRANCH-1-4/configure.ac =================================================================== --- branches/STABLE-BRANCH-1-4/configure.ac 2008-03-31 10:31:20 UTC (rev 4731) +++ branches/STABLE-BRANCH-1-4/configure.ac 2008-03-31 21:17:18 UTC (rev 4732) @@ -762,8 +762,9 @@ fi # Check for curl. We fake the curl API if libcurl isn't installed. +# We require 7.10 or better as we use curl_version_info(). -LIBCURL_CHECK_CONFIG([yes],,,[fake_curl=yes]) +LIBCURL_CHECK_CONFIG([yes],[7.10],,[fake_curl=yes]) AM_CONDITIONAL(FAKE_CURL,test x"$fake_curl" = xyes) # Generic, for us, means curl