From cvs at cvs.gnupg.org Fri Nov 2 12:01:16 2007 From: cvs at cvs.gnupg.org (svn author wk) Date: Fri, 02 Nov 2007 12:01:16 +0100 Subject: [svn] GpgEX - r37 - in trunk: . doc po src Message-ID: Author: wk Date: 2007-11-02 12:01:07 +0100 (Fri, 02 Nov 2007) New Revision: 37 Modified: trunk/ChangeLog trunk/autogen.sh trunk/doc/gpgex.texi trunk/po/de.po trunk/src/ChangeLog trunk/src/client.cc trunk/src/w32-gettext.c Log: Protocol update "INPUT FILE" -> "FILE" Fixed w32-gettext for modern mingw32. Add --force to autogen. Modified: trunk/ChangeLog =================================================================== --- trunk/ChangeLog 2007-10-22 22:24:59 UTC (rev 36) +++ trunk/ChangeLog 2007-11-02 11:01:07 UTC (rev 37) @@ -1,3 +1,9 @@ +2007-11-02 Werner Koch + + * autogen.sh: Add --force option. + + * doc/gpgex.texi: Protocol change s/"INPUT FILE"/"FILE"/. + 2007-10-08 Marcus Brinkmann * doc/gpgex.texi (Certificate management): New section Modified: trunk/autogen.sh =================================================================== --- trunk/autogen.sh 2007-10-22 22:24:59 UTC (rev 36) +++ trunk/autogen.sh 2007-11-02 11:01:07 UTC (rev 37) @@ -39,6 +39,11 @@ MSGMERGE=${GETTEXT_PREFIX}${MSGMERGE:-msgmerge}${GETTEXT_SUFFIX} DIE=no +FORCE= +if test x"$1" = x"--force"; then + FORCE=" --force" + shift +fi # ***** W32 build script ******* # Used to cross-compile for Windows. @@ -86,7 +91,7 @@ ./configure --enable-maintainer-mode --prefix=${w32root} \ --host=i586-mingw32msvc --build=${build} \ --with-gpg-error-prefix=${w32root} \ - --with-gpgme-prefix=${w32root} + --with-libassuan-prefix=${w32root} rc=$? exit $rc @@ -150,8 +155,8 @@ echo "Running autoheader..." $AUTOHEADER echo "Running automake --gnu ..." -$AUTOMAKE --gnu --add-missing; -echo "Running autoconf..." -$AUTOCONF +$AUTOMAKE --gnu --add-missing +echo "Running autoconf${FORCE} ..." +$AUTOCONF${FORCE} echo "You may now run \"./configure --enable-maintainer-mode && make\"." Modified: trunk/doc/gpgex.texi =================================================================== --- trunk/doc/gpgex.texi 2007-10-22 22:24:59 UTC (rev 36) +++ trunk/doc/gpgex.texi 2007-11-02 11:01:07 UTC (rev 37) @@ -135,13 +135,13 @@ All commands operate on a number of input files or directories, specified by one or more @code{INPUT} commands: - at deffn Command INPUT FILE=@var{name} [--continued] + at deffn Command FILE=@var{name} [--continued] Add the file or directory @var{name} to the list of pathnames to be processed by the server. The parameter @var{name} must be an absolute path name (including the drive letter) and is percent espaced (in particular, the characters %, = and white space characters are always escaped). The option @code{--continued} is present for all but the -last @code{INPUT} command. +last @code{FILE} command. @end deffn @@ -149,7 +149,7 @@ @section Encrypting and signing files. First, the input files need to be specified by one or more - at code{INPUT} commands. Afterwards, the actual operation is requested: + at code{FILE} commands. Afterwards, the actual operation is requested: @deffn Command ENCRYPT_FILES --nohup @deffnx Command SIGN_FILES --nohup @@ -218,11 +218,11 @@ @section Managing certificates. First, the input files need to be specified by one or more - at code{INPUT} commands. Afterwards, the actual operation is requested: + at code{FILE} commands. Afterwards, the actual operation is requested: @deffn Command IMPORT --nohup Request that the certificates contained in the files specified by - at code{INPUT} are imported into the local certificate databases. + at code{FILE} are imported into the local certificate databases. For directories, the server may offer multiple options to the user (for example ignore or process recursively). @@ -241,11 +241,11 @@ @section Create and verify checksums for files. First, the input files need to be specified by one or more - at code{INPUT} commands. Afterwards, the actual operation is requested: + at code{FILE} commands. Afterwards, the actual operation is requested: @deffn Command CHECKSUM_CREATE_FILES --nohup Request that checksums are created for the files specifed by - at code{INPUT}. The choice of checksum algorithm and the destination + at code{FILE}. The choice of checksum algorithm and the destination storage and format for the created checksums depend on the preferences of the user and the functionality provided by the UI server. For directories, the server may offer multiple options to the user (for Modified: trunk/po/de.po =================================================================== --- trunk/po/de.po 2007-10-22 22:24:59 UTC (rev 36) +++ trunk/po/de.po 2007-11-02 11:01:07 UTC (rev 37) @@ -7,7 +7,7 @@ msgstr "" "Project-Id-Version: gpgex 0.0.0-svn10\n" "Report-Msgid-Bugs-To: bug-gpgex at g10code.com\n" -"POT-Creation-Date: 2007-10-05 02:37+0200\n" +"POT-Creation-Date: 2007-11-02 11:48+0100\n" "PO-Revision-Date: 2007-10-08 18:34+0200\n" "Last-Translator: Marcus Brinkmann \n" "Language-Team: German\n" @@ -16,7 +16,7 @@ "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n" -#: src/client.cc:194 +#: src/client.cc:345 msgid "Can not access Kleopatra, see log file for details" msgstr "Kann nicht auf Kleopatra zugreifen, siehe Protokolldatei f?r Details" Modified: trunk/src/ChangeLog =================================================================== --- trunk/src/ChangeLog 2007-10-22 22:24:59 UTC (rev 36) +++ trunk/src/ChangeLog 2007-11-02 11:01:07 UTC (rev 37) @@ -1,3 +1,12 @@ +2007-11-02 Werner Koch + + * w32-gettext.c (SUBLANG_BENGALI_BANGLADESH): Fix to 2 as per MSDN. + (SUBLANG_PUNJABI_PAKISTAN): Remove as it is not in MSDN. + (SUBLANG_ROMANIAN_MOLDOVA): Remove as it is not in MSDN. + (SUBLANG_ROMANIAN_ROMANIA): Change to value 1 as per MSDN. + + * client.cc (call_assuan): Now use "FILE" instead of "INPUT FILE". + 2007-10-22 Marcus Brinkmann * exechelp.h (gpgex_spawn_detached): Change signature to just a Modified: trunk/src/client.cc =================================================================== --- trunk/src/client.cc 2007-10-22 22:24:59 UTC (rev 36) +++ trunk/src/client.cc 2007-11-02 11:01:07 UTC (rev 37) @@ -308,7 +308,7 @@ /* Set the input files. We don't specify the output files. */ for (unsigned int i = 0; i < filenames.size (); i++) { - msg = "INPUT FILE=" + escape (filenames[i]); + msg = "FILE=" + escape (filenames[i]); (void) TRACE_LOG1 ("sending cmd: %s", msg.c_str ()); Modified: trunk/src/w32-gettext.c =================================================================== --- trunk/src/w32-gettext.c 2007-10-22 22:24:59 UTC (rev 36) +++ trunk/src/w32-gettext.c 2007-11-02 11:01:07 UTC (rev 37) @@ -520,10 +520,10 @@ # define SUBLANG_AZERI_CYRILLIC 0x02 # endif # ifndef SUBLANG_BENGALI_INDIA -# define SUBLANG_BENGALI_INDIA 0x00 +# define SUBLANG_BENGALI_INDIA 0x01 # endif # ifndef SUBLANG_BENGALI_BANGLADESH -# define SUBLANG_BENGALI_BANGLADESH 0x01 +# define SUBLANG_BENGALI_BANGLADESH 0x02 # endif # ifndef SUBLANG_CHINESE_MACAU # define SUBLANG_CHINESE_MACAU 0x05 @@ -616,17 +616,11 @@ # define SUBLANG_NEPALI_INDIA 0x02 # endif # ifndef SUBLANG_PUNJABI_INDIA -# define SUBLANG_PUNJABI_INDIA 0x00 +# define SUBLANG_PUNJABI_INDIA 0x01 # endif -# ifndef SUBLANG_PUNJABI_PAKISTAN -# define SUBLANG_PUNJABI_PAKISTAN 0x01 -# endif # ifndef SUBLANG_ROMANIAN_ROMANIA -# define SUBLANG_ROMANIAN_ROMANIA 0x00 +# define SUBLANG_ROMANIAN_ROMANIA 0x01 # endif -# ifndef SUBLANG_ROMANIAN_MOLDOVA -# define SUBLANG_ROMANIAN_MOLDOVA 0x01 -# endif # ifndef SUBLANG_SERBIAN_LATIN # define SUBLANG_SERBIAN_LATIN 0x02 # endif @@ -1054,7 +1048,6 @@ switch (sub) { case SUBLANG_PUNJABI_INDIA: return "pa_IN"; /* Gurmukhi script */ - case SUBLANG_PUNJABI_PAKISTAN: return "pa_PK"; /* Arabic script */ } return "pa"; case LANG_RHAETO_ROMANCE: return "rm_CH"; @@ -1062,7 +1055,6 @@ switch (sub) { case SUBLANG_ROMANIAN_ROMANIA: return "ro_RO"; - case SUBLANG_ROMANIAN_MOLDOVA: return "ro_MD"; } return "ro"; case LANG_RUSSIAN: From cvs at cvs.gnupg.org Sat Nov 3 15:10:33 2007 From: cvs at cvs.gnupg.org (svn author mo) Date: Sat, 03 Nov 2007 15:10:33 +0100 Subject: [svn] ksba - r279 - trunk/src Message-ID: Author: mo Date: 2007-11-03 15:10:24 +0100 (Sat, 03 Nov 2007) New Revision: 279 Modified: trunk/src/ChangeLog trunk/src/ksba.h Log: 2007-11-03 Moritz Schulte * ksba.h: Include , since FILE* is used. Modified: trunk/src/ChangeLog =================================================================== --- trunk/src/ChangeLog 2007-08-08 09:10:58 UTC (rev 278) +++ trunk/src/ChangeLog 2007-11-03 14:10:24 UTC (rev 279) @@ -1,3 +1,7 @@ +2007-11-03 Moritz Schulte + + * ksba.h: Include , since FILE* is used. + 2007-07-04 Werner Koch Changed license to GPLv3. Modified: trunk/src/ksba.h =================================================================== --- trunk/src/ksba.h 2007-08-08 09:10:58 UTC (rev 278) +++ trunk/src/ksba.h 2007-11-03 14:10:24 UTC (rev 279) @@ -21,6 +21,7 @@ #define KSBA_H 1 #include +#include #ifdef __cplusplus extern "C" { From cvs at cvs.gnupg.org Wed Nov 7 12:44:46 2007 From: cvs at cvs.gnupg.org (svn author wk) Date: Wed, 07 Nov 2007 12:44:46 +0100 Subject: [svn] ksba - r280 - in trunk: . gl src tests Message-ID: Author: wk Date: 2007-11-07 12:44:36 +0100 (Wed, 07 Nov 2007) New Revision: 280 Modified: trunk/ChangeLog trunk/configure.ac trunk/gl/alloca.h trunk/src/ChangeLog trunk/src/cms.c trunk/src/crl.c trunk/src/der-encoder.c trunk/tests/ChangeLog trunk/tests/t-common.h trunk/tests/t-crl-parser.c Log: Fixed a segv when using more then one signing certificiate. Fix for CRL parsing. Typo fixes. Make test output easier readable. New option --disable-optimization for configure. Modified: trunk/ChangeLog =================================================================== --- trunk/ChangeLog 2007-11-03 14:10:24 UTC (rev 279) +++ trunk/ChangeLog 2007-11-07 11:44:36 UTC (rev 280) @@ -1,3 +1,7 @@ +2007-11-07 Werner Koch + + * configure.ac: Add option --disable-optimization. + 2007-08-08 Werner Koch * configure.ac: Use $host and not $target. Reported by Peter Modified: trunk/configure.ac =================================================================== --- trunk/configure.ac 2007-11-03 14:10:24 UTC (rev 279) +++ trunk/configure.ac 2007-11-07 11:44:36 UTC (rev 280) @@ -99,6 +99,15 @@ AC_LIBTOOL_RC AM_PROG_LIBTOOL +# This is handy for debugging so the compiler doesn't rearrange +# things and eliminate variables. +AC_ARG_ENABLE(optimization, + AC_HELP_STRING([--disable-optimization], + [disable compiler optimization]), + [if test $enableval = no ; then + CFLAGS=`echo $CFLAGS | sed 's/-O[[0-9]]//'` + fi]) + if test "$GCC" = yes; then CFLAGS="$CFLAGS -Wall -Wcast-align -Wshadow -Wstrict-prototypes" Modified: trunk/gl/alloca.h =================================================================== --- trunk/gl/alloca.h 2007-11-03 14:10:24 UTC (rev 279) +++ trunk/gl/alloca.h 2007-11-07 11:44:36 UTC (rev 280) @@ -5,7 +5,7 @@ This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published - by the Free Software Foundation; either version 2, or (at your option) + by the Free Software Foundation; either version 3, or (at your option) any later version. This program is distributed in the hope that it will be useful, @@ -14,9 +14,8 @@ General Public License for more details. You should have received a copy of the GNU General Public - License along with this program; if not, write to the Free Software - Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, - USA. */ + License along with this program; if not, see . + */ /* Avoid using the symbol _ALLOCA_H here, as Bison assumes _ALLOCA_H means there is a real alloca function. */ Modified: trunk/src/ChangeLog =================================================================== --- trunk/src/ChangeLog 2007-11-03 14:10:24 UTC (rev 279) +++ trunk/src/ChangeLog 2007-11-07 11:44:36 UTC (rev 280) @@ -1,3 +1,8 @@ +2007-11-07 Werner Koch + + * cms.c (build_signed_data_attribute): Reset ATTRIDX for new + signers. Use xfree and not free. + 2007-11-03 Moritz Schulte * ksba.h: Include , since FILE* is used. @@ -2,2 +7,6 @@ +2007-08-08 Werner Koch + + * crl.c (ksba_crl_get_update_times): Require only THIS_UPDATE. + 2007-07-04 Werner Koch Modified: trunk/src/cms.c =================================================================== --- trunk/src/cms.c 2007-11-03 14:10:24 UTC (rev 279) +++ trunk/src/cms.c 2007-11-07 11:44:36 UTC (rev 280) @@ -2398,6 +2398,14 @@ unsigned char *image; size_t imagelen; + for (i = 0; i < attridx; i++) + { + _ksba_asn_release_nodes (attrarray[i].root); + xfree (attrarray[i].image); + } + attridx = 0; + memset (attrarray, 0, sizeof (attrarray)); + if (!digestlist) { err = gpg_error (GPG_ERR_MISSING_VALUE); /* oops */ @@ -2580,6 +2588,7 @@ goto leave; } + assert (attridx <= DIM (attrarray)); for (i=0; i < attridx; i++) { if (i) @@ -2620,7 +2629,7 @@ for (i = 0; i < attridx; i++) { _ksba_asn_release_nodes (attrarray[i].root); - free (attrarray[i].image); + xfree (attrarray[i].image); } return err; Modified: trunk/src/crl.c =================================================================== --- trunk/src/crl.c 2007-11-03 14:10:24 UTC (rev 279) +++ trunk/src/crl.c 2007-11-07 11:44:36 UTC (rev 280) @@ -36,6 +36,8 @@ static const char oidstr_crlNumber[] = "2.5.29.20"; static const char oidstr_crlReason[] = "2.5.29.21"; +static const char oidstr_issuingDistributionPoint[] = "2.5.29.28"; +static const char oidstr_certificateIssuer[] = "2.5.29.29"; static const char oidstr_authorityKeyIdentifier[] = "2.5.29.35"; /* We better buffer the hashing. */ @@ -560,7 +562,7 @@ *next = 0; if (!crl) return gpg_error (GPG_ERR_INV_VALUE); - if (!*crl->this_update || !*crl->next_update) + if (!*crl->this_update) return gpg_error (GPG_ERR_INV_TIME); if (this) _ksba_copy_time (this, crl->this_update); @@ -1130,6 +1132,10 @@ default: crl->item.reason |= KSBA_CRLREASON_OTHER; break; } } + if (!strcmp (oid, oidstr_certificateIssuer)) + { + /* FIXME: We need to implement this. */ + } else if (critical) err = gpg_error (GPG_ERR_UNKNOWN_CRIT_EXTN); Modified: trunk/src/der-encoder.c =================================================================== --- trunk/src/der-encoder.c 2007-11-03 14:10:24 UTC (rev 279) +++ trunk/src/der-encoder.c 2007-11-07 11:44:36 UTC (rev 280) @@ -523,10 +523,10 @@ } /* Create a DER encoding from the value tree ROOT and return an - allocated image of appropriate length in r_imae and r_imagelen. + allocated image of appropriate length in r_image and r_imagelen. The value tree is modified so that it can be used the same way as a parsed one, i.e the elements off, and len are set to point into - image. */ + image. */ gpg_error_t _ksba_der_encode_tree (AsnNode root, unsigned char **r_image, size_t *r_imagelen) Modified: trunk/tests/ChangeLog =================================================================== --- trunk/tests/ChangeLog 2007-11-03 14:10:24 UTC (rev 279) +++ trunk/tests/ChangeLog 2007-11-07 11:44:36 UTC (rev 280) @@ -1,3 +1,7 @@ +2007-08-08 Werner Koch + + * t-common.h (print_sexp_hex): New. + 2007-07-04 Werner Koch Changed license to GPLv3. Modified: trunk/tests/t-common.h =================================================================== --- trunk/tests/t-common.h 2007-11-03 14:10:24 UTC (rev 279) +++ trunk/tests/t-common.h 2007-11-07 11:44:36 UTC (rev 280) @@ -155,7 +155,58 @@ } } +/* Variant of print_sexp which force printing the values in hex. */ +void +print_sexp_hex (ksba_const_sexp_t p) +{ + int level = 0; + if (!p) + fputs ("[none]", stdout); + else + { + for (;;) + { + if (*p == '(') + { + putchar (*p); + p++; + level++; + } + else if (*p == ')') + { + putchar (*p); + if (--level <= 0 ) + return; + } + else if (!digitp (p)) + { + fputs ("[invalid s-exp]", stdout); + return; + } + else + { + char *endp; + unsigned long len, n; + + len = strtoul (p, &endp, 10); + p = endp; + if (*p != ':') + { + fputs ("[invalid s-exp]", stdout); + return; + } + p++; + putchar('#'); + for (n=0; n < len; n++, p++) + printf ("%02X", *p); + putchar('#'); + } + } + } +} + + void print_dn (char *p) { Modified: trunk/tests/t-crl-parser.c =================================================================== --- trunk/tests/t-crl-parser.c 2007-11-03 14:10:24 UTC (rev 279) +++ trunk/tests/t-crl-parser.c 2007-11-07 11:44:36 UTC (rev 280) @@ -179,7 +179,7 @@ err = ksba_crl_get_item (crl, &serial, rdate, &reason); fail_if_err2 (fname, err); printf ("CRL entry %d: s=", ++count); - print_sexp (serial); + print_sexp_hex (serial); printf (", t="); print_time (rdate); printf (", r=%x\n", reason); @@ -221,7 +221,7 @@ print_names (24, name1); ksba_name_release (name1); fputs (" serial: ", stdout); - print_sexp (serial); + print_sexp_hex (serial); ksba_free (serial); } putchar ('\n'); From cvs at cvs.gnupg.org Thu Nov 8 09:14:08 2007 From: cvs at cvs.gnupg.org (svn author wk) Date: Thu, 08 Nov 2007 09:14:08 +0100 Subject: [svn] GpgOL - r196 - trunk/src Message-ID: Author: wk Date: 2007-11-08 09:13:59 +0100 (Thu, 08 Nov 2007) New Revision: 196 Modified: trunk/src/ChangeLog trunk/src/ext-commands.cpp trunk/src/item-events.cpp trunk/src/message-events.cpp trunk/src/message.cpp trunk/src/mimemaker.c trunk/src/rfc822parse.c Log: Make decryption through the menu item work again. Due to ongoing changes (ECF file) other ways of decryption are currently not possible. Modified: trunk/src/ChangeLog =================================================================== --- trunk/src/ChangeLog 2007-10-22 15:40:00 UTC (rev 195) +++ trunk/src/ChangeLog 2007-11-08 08:13:59 UTC (rev 196) @@ -1,3 +1,15 @@ +2007-10-29 Werner Koch + + * mimemaker.c (create_top_signing_header): Add arg FIRST. + (mime_sign): Factor allmost all code out to .. + (do_mime_sign): .. new function. + (create_mapi_attachment): Add arg TEMPSIGN. + (delete_all_attachments): Adjust for that. + (mime_encrypt): Factor some code out to .. + (create_top_encryption_header): .. new. + (write_tempsign_attachment): New. + (mime_sign_encrypt): Implement. + 2007-10-22 Werner Koch * engine-assuan.c (connect_uiserver): Try to start the server. Modified: trunk/src/ext-commands.cpp =================================================================== --- trunk/src/ext-commands.cpp 2007-10-22 15:40:00 UTC (rev 195) +++ trunk/src/ext-commands.cpp 2007-11-08 08:13:59 UTC (rev 196) @@ -455,21 +455,19 @@ /* Called by Exchange when a user selects a command. Return value: S_OK if command is handled, otherwise S_FALSE. */ STDMETHODIMP -GpgolExtCommands::DoCommand ( - LPEXCHEXTCALLBACK pEECB, // The Exchange Callback Interface. - UINT nCommandID) // The command id. +GpgolExtCommands::DoCommand (LPEXCHEXTCALLBACK eecb, UINT nCommandID) { HRESULT hr; - HWND hWnd = NULL; + HWND hwnd = NULL; LPMESSAGE message = NULL; LPMDB mdb = NULL; - if (FAILED (pEECB->GetWindow (&hWnd))) - hWnd = NULL; + 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); + ext_context_name (m_lContext), hwnd); if (nCommandID == SC_CLOSE && m_lContext == EECONTEXT_READNOTEMESSAGE) { @@ -482,7 +480,7 @@ DISPPARAMS dispparams; VARIANT aVariant; - pDisp = find_outlook_property (pEECB, "Close", &dispid); + pDisp = find_outlook_property (eecb, "Close", &dispid); if (pDisp) { /* Note that there is a report on the Net from 2005 by Amit @@ -532,10 +530,11 @@ else if (nCommandID == m_nCmdDecrypt && m_lContext == EECONTEXT_READNOTEMESSAGE) { - hr = pEECB->GetObject (&mdb, (LPMAPIPROP *)&message); + hr = eecb->GetObject (&mdb, (LPMAPIPROP *)&message); if (SUCCEEDED (hr)) { - message_decrypt (message, m_pExchExt->getMsgtype (pEECB), 1); + message_decrypt (message, m_pExchExt->getMsgtype (eecb), 1); + message_display_handler (eecb, hwnd); } ul_release (message); ul_release (mdb); @@ -543,10 +542,10 @@ else if (nCommandID == m_nCmdCheckSig && m_lContext == EECONTEXT_READNOTEMESSAGE) { - hr = pEECB->GetObject (&mdb, (LPMAPIPROP *)&message); + hr = eecb->GetObject (&mdb, (LPMAPIPROP *)&message); if (SUCCEEDED (hr)) { - message_verify (message, m_pExchExt->getMsgtype (pEECB), 1); + message_verify (message, m_pExchExt->getMsgtype (eecb), 1); } else log_debug_w32 (hr, "%s:%s: CmdCheckSig failed", SRCNAME, __func__); @@ -556,10 +555,10 @@ else if (nCommandID == m_nCmdShowInfo && m_lContext == EECONTEXT_READNOTEMESSAGE) { - hr = pEECB->GetObject (&mdb, (LPMAPIPROP *)&message); + hr = eecb->GetObject (&mdb, (LPMAPIPROP *)&message); if (SUCCEEDED (hr)) { - message_show_info (message, hWnd); + message_show_info (message, hwnd); } ul_release (message); ul_release (mdb); @@ -574,13 +573,13 @@ && m_lContext == EECONTEXT_SENDNOTEMESSAGE) { m_pExchExt->m_gpgEncrypt = !m_pExchExt->m_gpgEncrypt; - check_menu (pEECB, m_nCmdEncrypt, m_pExchExt->m_gpgEncrypt); + check_menu (eecb, m_nCmdEncrypt, m_pExchExt->m_gpgEncrypt); } else if (nCommandID == m_nCmdSign && m_lContext == EECONTEXT_SENDNOTEMESSAGE) { m_pExchExt->m_gpgSign = !m_pExchExt->m_gpgSign; - check_menu (pEECB, m_nCmdSign, m_pExchExt->m_gpgSign); + check_menu (eecb, m_nCmdSign, m_pExchExt->m_gpgSign); } else if (nCommandID == m_nCmdKeyManager && m_lContext == EECONTEXT_VIEWER) @@ -593,10 +592,10 @@ else if (nCommandID == m_nCmdDebug1 && m_lContext == EECONTEXT_READNOTEMESSAGE) { - hr = pEECB->GetObject (&mdb, (LPMAPIPROP *)&message); + hr = eecb->GetObject (&mdb, (LPMAPIPROP *)&message); if (SUCCEEDED (hr)) { - open_inspector (pEECB, message); + open_inspector (eecb, message); } ul_release (message); ul_release (mdb); @@ -628,11 +627,11 @@ /* Called by Exchange when the user requests help for a menu item. - PEECP is the pointer to Exchange Callback Interface. NCOMMANDID is + EECB is the pointer to Exchange Callback Interface. NCOMMANDID is the command id. Return value: S_OK when it is a menu item of this plugin and the help was shown; otherwise S_FALSE. */ STDMETHODIMP -GpgolExtCommands::Help (LPEXCHEXTCALLBACK pEECB, UINT nCommandID) +GpgolExtCommands::Help (LPEXCHEXTCALLBACK eecb, UINT nCommandID) { if (nCommandID == m_nCmdDecrypt && m_lContext == EECONTEXT_READNOTEMESSAGE) Modified: trunk/src/item-events.cpp =================================================================== --- trunk/src/item-events.cpp 2007-10-22 15:40:00 UTC (rev 195) +++ trunk/src/item-events.cpp 2007-11-08 08:13:59 UTC (rev 196) @@ -132,7 +132,7 @@ { log_debug ("%s:%s: received, flags=%#lx", SRCNAME, __func__, flags); - /* If the message has been processed by is (i.e. in OnOpen), we now + /* If the message has been processed by us (i.e. in OnOpen), we now use our own display code. */ if (!flags && m_processed) { Modified: trunk/src/message-events.cpp =================================================================== --- trunk/src/message-events.cpp 2007-10-22 15:40:00 UTC (rev 195) +++ trunk/src/message-events.cpp 2007-11-08 08:13:59 UTC (rev 196) @@ -128,7 +128,8 @@ STDMETHODIMP GpgolMessageEvents::OnReadComplete (LPEXCHEXTCALLBACK eecb, ULONG flags) { - log_debug ("%s:%s: received\n", SRCNAME, __func__); + log_debug ("%s:%s: received; flags=%#lx m_processed=%d\n", + SRCNAME, __func__, flags, m_processed); /* If the message has been processed by is (i.e. in OnRead), we now use our own display code. */ Modified: trunk/src/message.cpp =================================================================== --- trunk/src/message.cpp 2007-10-22 15:40:00 UTC (rev 195) +++ trunk/src/message.cpp 2007-11-08 08:13:59 UTC (rev 196) @@ -105,7 +105,7 @@ } -/* Common Code ise by OnReadComplete and OnOpenComplete to display a +/* Common Code used by OnReadComplete and OnOpenComplete to display a modified message. Returns true if the message was encrypted. */ bool message_display_handler (LPEXCHEXTCALLBACK eecb, HWND hwnd) Modified: trunk/src/mimemaker.c =================================================================== --- trunk/src/mimemaker.c 2007-10-22 15:40:00 UTC (rev 195) +++ trunk/src/mimemaker.c 2007-11-08 08:13:59 UTC (rev 196) @@ -44,6 +44,12 @@ SRCNAME, __func__, __LINE__); \ } while (0) +/* The filename of the attachment we create as the result of sign or + encrypt operation. */ +#define MIMEATTACHFILENAME "gpgolXXX.dat" +/* The filename of another temporary attachment. */ +#define TMPMIMEATTACHFILENAME "gpgolXX0.dat" + static const char oid_mimetag[] = {0x2A, 0x86, 0x48, 0x86, 0xf7, 0x14, 0x03, 0x0a, 0x04}; @@ -136,9 +142,11 @@ prepare the MIME message. On sucess the stream to write the data to is stored at STREAM and the attachment object itself is the returned. The caller needs to call SaveChanges. Returns NULL on - failure in which case STREAM will be set to NULL. */ + failure in which case STREAM will be set to NULL. If TEMPSIGN is + set the attchment is used only as a temporary buffer and will later + be part of an encrypted mIME body. */ static LPATTACH -create_mapi_attachment (LPMESSAGE message, sink_t sink) +create_mapi_attachment (LPMESSAGE message, sink_t sink, int tempsign) { HRESULT hr; ULONG pos; @@ -181,7 +189,7 @@ /* We better insert a short filename. */ prop.ulPropTag = PR_ATTACH_FILENAME_A; - prop.Value.lpszA = "gpgolXXX.dat"; + prop.Value.lpszA = tempsign? TMPMIMEATTACHFILENAME : MIMEATTACHFILENAME; hr = HrSetOneProp ((LPMAPIPROP)att, &prop); if (hr) { @@ -917,6 +925,38 @@ } +/* Write the tempsign attachment. */ +static int +write_tempsign_attachment (sink_t sink, + LPMESSAGE message, mapi_attach_item_t *table) +{ + int idx, rc; + char *buffer; + size_t buflen; + + for (idx=0; table && !table[idx].end_of_table; idx++) + { + if (table[idx].attach_type == ATTACHTYPE_MOSSTEMPL + && table[idx].filename + && !strcmp (table[idx].filename, TMPMIMEATTACHFILENAME)) + { + buffer = mapi_get_attach (message, table+idx, &buflen); + if (!buffer) + { + log_debug ("Tempsign attachment at index %d not found\n", idx); + return -1; + } + /* Write the attachment out as is. */ + rc = write_buffer (sink, buffer, buflen); + xfree (buffer); + return rc; + } + } + log_error ("Tempsign attachment not found\n"); + return -1; /* Ooops. */ +} + + /* Delete all attachments from TABLE except for the one we just created */ static int delete_all_attachments (LPMESSAGE message, mapi_attach_item_t *table) @@ -927,7 +967,9 @@ if (table) for (idx=0; !table[idx].end_of_table; idx++) { - if (table[idx].attach_type == ATTACHTYPE_MOSSTEMPL) + if (table[idx].attach_type == ATTACHTYPE_MOSSTEMPL + && table[idx].filename + && !strcmp (table[idx].filename, MIMEATTACHFILENAME)); continue; hr = IMessage_DeleteAttach (message, table[idx].mapipos, 0, NULL, 0); if (hr) @@ -1103,30 +1145,32 @@ /* Helper to create the signing header. This includes enough space - for later fixup of the micalg parameter. */ - static void + for later fixup of the micalg parameter. The MIME version is only + written if FIRST is set. */ +static void create_top_signing_header (char *buffer, size_t buflen, protocol_t protocol, - const char *boundary, const char *micalg) + int first, const char *boundary, const char *micalg) { snprintf (buffer, buflen, - "MIME-Version: 1.0\r\n" + "%s" "Content-Type: multipart/signed;\r\n" "\tprotocol=\"application/%s\";\r\n" "\tmicalg=%-15.15s;\r\n" "\tboundary=\"%s\"\r\n" "\r\n", + first? "MIME-Version: 1.0\r\n":"", (protocol==PROTOCOL_OPENPGP? "pgp-signature":"pkcs7-signature"), micalg, boundary); } -/* Sign the MESSAGE using PROTOCOL. If PROTOCOL is PROTOCOL_UNKNOWN - the engine decides what protocol to use. On return MESSAGE is - modified so that sending it will result in a properly MOSS (that is - PGP or S/MIME) signed message. On failure the function tries to - keep the original message intact but there is no 100% guarantee for - it. */ -int -mime_sign (LPMESSAGE message, protocol_t protocol) + +/* Main body of mime_sign without the the code to delete the original + attachments. On success the function returns the current + attachment table at R_ATT_TABLE or sets this to NULL on error. If + TEMPSIGN is set the result will later be encrypted. */ +static int +do_mime_sign (LPMESSAGE message, protocol_t protocol, + mapi_attach_item_t **r_att_table, int tempsign) { int result = -1; int rc; @@ -1144,6 +1188,8 @@ engine_filter_t filter; struct databuf_s sigbuffer; + *r_att_table = NULL; + memset (sink, 0, sizeof *sink); memset (hashsink, 0, sizeof *hashsink); memset (&sigbuffer, 0, sizeof sigbuffer); @@ -1152,7 +1198,7 @@ if (protocol == PROTOCOL_UNKNOWN) return -1; - attach = create_mapi_attachment (message, sink); + attach = create_mapi_attachment (message, sink, tempsign); if (!attach) return -1; @@ -1180,7 +1226,7 @@ /* Write the top header. */ generate_boundary (boundary); create_top_signing_header (top_header, sizeof top_header, - protocol, boundary, "xxx"); + protocol, 1, boundary, "xxx"); if ((rc = write_string (sink, top_header))) goto failure; @@ -1287,7 +1333,7 @@ } create_top_signing_header (top_header, sizeof top_header, - protocol, boundary, "pgp-sha1"); + protocol, 1, boundary, "pgp-sha1"); hr = IStream_Write (stream, top_header, strlen (top_header), NULL); if (hr) @@ -1312,24 +1358,44 @@ if (close_mapi_attachment (&attach, sink)) goto failure; - if (finalize_message (message, att_table)) - goto failure; - - mapi_to_mime (message, "c:\\tmp\\x.msg"); - result = 0; /* Everything is fine, fall through the cleanup now. */ failure: engine_cancel (filter); cancel_mapi_attachment (&attach, sink); xfree (body); - mapi_release_attach_table (att_table); + if (result) + mapi_release_attach_table (att_table); + else + *r_att_table = att_table; xfree (sigbuffer.buf); return result; } +/* Sign the MESSAGE using PROTOCOL. If PROTOCOL is PROTOCOL_UNKNOWN + the engine decides what protocol to use. On return MESSAGE is + modified so that sending it will result in a properly MOSS (that is + PGP or S/MIME) signed message. On failure the function tries to + keep the original message intact but there is no 100% guarantee for + it. */ +int +mime_sign (LPMESSAGE message, protocol_t protocol) +{ + int result = -1; + mapi_attach_item_t *att_table; + if (!do_mime_sign (message, protocol, &att_table, 0)) + { + if (!finalize_message (message, att_table)) + result = 0; + } + + mapi_release_attach_table (att_table); + return result; +} + + /* Sink write method used by mime_encrypt. */ static int @@ -1443,6 +1509,61 @@ #endif /*Not used.*/ +/* Helper from mime_encrypt. BOUNDARY is a buffer of at least + BOUNDARYSIZE+1 bytes which will be set on return from that + function. */ +static int +create_top_encryption_header (sink_t sink, protocol_t protocol, char *boundary) +{ + int rc; + + if (protocol == PROTOCOL_SMIME) + { + *boundary = 0; + rc = write_multistring (sink, + "MIME-Version: 1.0\r\n" + "Content-Type: application/pkcs7-mime;\r\n" + "\tsmime-type=enveloped-data;\r\n" + "\tname=\"smime.p7m\"\r\n" + "Content-Transfer-Encoding: base64\r\n", + NULL); + } + else + { + generate_boundary (boundary); + rc = write_multistring (sink, + "MIME-Version: 1.0\r\n" + "Content-Type: multipart/encrypted;\r\n" + "\tprotocol=\"application/pgp-encrypted\";\r\n", + "\tboundary=\"", boundary, "\"\r\n", + NULL); + if (rc) + return rc; + + /* Write the PGP/MIME encrypted part. */ + rc = write_boundary (sink, boundary, 0); + if (rc) + return rc; + rc = write_multistring (sink, + "Content-Type: application/pgp-encrypted\r\n" + "\r\n" + "Version: 1\r\n", NULL); + if (rc) + return rc; + + /* And start the second part. */ + rc = write_boundary (sink, boundary, 0); + if (rc) + return rc; + rc = write_multistring (sink, + "Content-Type: application/octet-stream\r\n" + "\r\n", NULL); + } + + return rc; +} + + /* Encrypt the MESSAGE. */ int mime_encrypt (LPMESSAGE message, protocol_t protocol, char **recipients) @@ -1464,7 +1585,7 @@ memset (sink, 0, sizeof *sink); memset (encsink, 0, sizeof *encsink); - attach = create_mapi_attachment (message, sink); + attach = create_mapi_attachment (message, sink, 0); if (!attach) return -1; @@ -1496,51 +1617,10 @@ } /* Write the top header. */ - if (protocol == PROTOCOL_SMIME) - { - *boundary = 0; - rc = write_multistring (sink, - "MIME-Version: 1.0\r\n" - "Content-Type: application/pkcs7-mime;\r\n" - "\tsmime-type=enveloped-data;\r\n" - "\tname=\"smime.p7m\"\r\n" - "Content-Transfer-Encoding: base64\r\n", - NULL); - } - else - { - generate_boundary (boundary); - rc = write_multistring (sink, - "MIME-Version: 1.0\r\n" - "Content-Type: multipart/encrypted;\r\n" - "\tprotocol=\"application/pgp-encrypted\";\r\n", - "\tboundary=\"", boundary, "\"\r\n", - NULL); - } + rc = create_top_encryption_header (sink, protocol, boundary); if (rc) goto failure; - if (protocol == PROTOCOL_OPENPGP) - { - /* Write the PGP/MIME encrypted part. */ - if ((rc = write_boundary (sink, boundary, 0))) - goto failure; - if ((rc=write_multistring (sink, - "Content-Type: application/pgp-encrypted\r\n" - "\r\n" - "Version: 1\r\n", - NULL))) - goto failure; - - /* And start the second part. */ - if ((rc = write_boundary (sink, boundary, 0))) - goto failure; - if ((rc=write_multistring (sink, - "Content-Type: application/octet-stream\r\n" - "\r\n", NULL))) - goto failure; - } - /* Create a new sink for encrypting the following stuff. */ encsink->cb_data = filter; encsink->writefnc = sink_encryption_write; @@ -1604,8 +1684,104 @@ } + + +/* Sign and Encrypt the MESSAGE. */ int mime_sign_encrypt (LPMESSAGE message, protocol_t protocol, char **recipients) { - return -1; + int result = -1; + int rc = 0; + LPATTACH attach; + struct sink_s sinkmem; + sink_t sink = &sinkmem; + struct sink_s encsinkmem; + sink_t encsink = &encsinkmem; + char boundary[BOUNDARYSIZE+1]; + mapi_attach_item_t *att_table = NULL; + engine_filter_t filter; + + memset (sink, 0, sizeof *sink); + memset (encsink, 0, sizeof *encsink); + + attach = create_mapi_attachment (message, sink, 0); + if (!attach) + return -1; + + /* 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. */ + TRACEPOINT (); + if (engine_create_filter (&filter, write_buffer_for_cb, sink)) + goto failure; + TRACEPOINT (); + if ((rc=engine_encrypt_start (filter, protocol, recipients, &protocol))) + goto failure; + + TRACEPOINT (); + protocol = check_protocol (protocol); + if (protocol == PROTOCOL_UNKNOWN) + goto failure; + TRACEPOINT (); + + /* Now sign the message. This creates another attchment with the + 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. */ + if (!do_mime_sign (message, protocol, &att_table, 1)) + goto failure; + + TRACEPOINT (); + /* Write the top header. */ + rc = create_top_encryption_header (sink, protocol, boundary); + if (rc) + goto failure; + + TRACEPOINT (); + /* Create a new sink for encrypting the temporary attachment with + the signed message. */ + encsink->cb_data = filter; + encsink->writefnc = sink_encryption_write; + + rc = write_tempsign_attachment (encsink, message, att_table); + if (rc) + goto failure; + + TRACEPOINT (); + /* Flush the encryption sink and wait for the encryption to get + ready. */ + if ((rc = write_buffer (encsink, NULL, 0))) + goto failure; + TRACEPOINT (); + if ((rc = engine_wait (filter))) + goto failure; + TRACEPOINT (); + filter = NULL; /* Not valid anymore. */ + encsink->cb_data = NULL; /* Not needed anymore. */ + + /* Write the final boundary (for OpenPGP) and finish the attachment. */ + if (*boundary && (rc = write_boundary (sink, boundary, 1))) + goto failure; + + TRACEPOINT (); + if (close_mapi_attachment (&attach, sink)) + goto failure; + + TRACEPOINT (); + if (finalize_message (message, att_table)) + goto failure; + + TRACEPOINT (); + result = 0; /* Everything is fine, fall through the cleanup now. */ + + failure: + TRACEPOINT (); + if (result) + log_debug ("%s:%s: failed rc=%d (%s) <%s>", SRCNAME, __func__, rc, + gpg_strerror (rc), gpg_strsource (rc)); + engine_cancel (filter); + cancel_mapi_attachment (&attach, sink); + mapi_release_attach_table (att_table); + return result; } Modified: trunk/src/rfc822parse.c =================================================================== --- trunk/src/rfc822parse.c 2007-10-22 15:40:00 UTC (rev 195) +++ trunk/src/rfc822parse.c 2007-11-08 08:13:59 UTC (rev 196) @@ -153,6 +153,8 @@ *name = *name - 'A' + 'a'; } + +#ifndef HAVE_STPCPY static char * stpcpy (char *a,const char *b) { @@ -162,6 +164,7 @@ return (char*)a; } +#endif /* If a callback has been registerd, call it for the event of type EVENT. */ From cvs at cvs.gnupg.org Thu Nov 8 17:43:34 2007 From: cvs at cvs.gnupg.org (svn author marcus) Date: Thu, 08 Nov 2007 17:43:34 +0100 Subject: [svn] GpgEX - r38 - trunk/src Message-ID: Author: marcus Date: 2007-11-08 17:43:26 +0100 (Thu, 08 Nov 2007) New Revision: 38 Modified: trunk/src/ChangeLog trunk/src/client.cc Log: 2007-11-08 Marcus Brinkmann * client.cc (client_t::call_assuan): Fix FILE command and rename all commands to the protocol version. (client_t::call_assuan): Report the actual error and remove log file reference. Modified: trunk/src/ChangeLog =================================================================== --- trunk/src/ChangeLog 2007-11-02 11:01:07 UTC (rev 37) +++ trunk/src/ChangeLog 2007-11-08 16:43:26 UTC (rev 38) @@ -1,3 +1,10 @@ +2007-11-08 Marcus Brinkmann + + * client.cc (client_t::call_assuan): Fix FILE command and rename + all commands to the protocol version. + (client_t::call_assuan): Report the actual error and remove log + file reference. + 2007-11-02 Werner Koch * w32-gettext.c (SUBLANG_BENGALI_BANGLADESH): Fix to 2 as per MSDN. Modified: trunk/src/client.cc =================================================================== --- trunk/src/client.cc 2007-11-02 11:01:07 UTC (rev 37) +++ trunk/src/client.cc 2007-11-08 16:43:26 UTC (rev 38) @@ -308,7 +308,7 @@ /* Set the input files. We don't specify the output files. */ for (unsigned int i = 0; i < filenames.size (); i++) { - msg = "FILE=" + escape (filenames[i]); + msg = "FILE " + escape (filenames[i]); (void) TRACE_LOG1 ("sending cmd: %s", msg.c_str ()); @@ -341,9 +341,10 @@ assuan_disconnect (ctx); if (rc) { - MessageBox (this->window, - _("Can not access Kleopatra, see log file for details"), - "GpgEX", MB_ICONINFORMATION); + char buf[256]; + snprintf (buf, sizeof (buf), _("Can not access Kleopatra:\r\n%s"), + gpg_strerror (buf)); + MessageBox (this->window, buf, "GpgEX", MB_ICONINFORMATION); } return rc ? false : true; @@ -353,61 +354,61 @@ void client_t::decrypt_verify (vector &filenames) { - this->call_assuan ("DECRYPT_VERIFY", filenames); + this->call_assuan ("DECRYPT_VERIFY_FILES", filenames); } void client_t::verify (vector &filenames) { - this->call_assuan ("VERIFY", filenames); + this->call_assuan ("VERIFY_FILES", filenames); } void client_t::decrypt (vector &filenames) { - this->call_assuan ("DECRYPT", filenames); + this->call_assuan ("DECRYPT_FILES", filenames); } void client_t::encrypt_sign (vector &filenames) { - this->call_assuan ("ENCRYPT_SIGN", filenames); + this->call_assuan ("ENCRYPT_SIGN_FILES", filenames); } void client_t::encrypt (vector &filenames) { - this->call_assuan ("ENCRYPT", filenames); + this->call_assuan ("ENCRYPT_FILES", filenames); } void client_t::sign (vector &filenames) { - this->call_assuan ("SIGN", filenames); + this->call_assuan ("SIGN_FILES", filenames); } void client_t::import (vector &filenames) { - this->call_assuan ("IMPORT", filenames); + this->call_assuan ("IMPORT_FILES", filenames); } void client_t::create_checksums (vector &filenames) { - this->call_assuan ("CREATE_CHECKSUMS", filenames); + this->call_assuan ("CHECKSUM_CREATE_FILES", filenames); } void client_t::verify_checksums (vector &filenames) { - this->call_assuan ("VERIFY_CHECKSUMS", filenames); + this->call_assuan ("CHECKSUM_VERIFY_FILES", filenames); } From cvs at cvs.gnupg.org Thu Nov 8 19:18:52 2007 From: cvs at cvs.gnupg.org (svn author marcus) Date: Thu, 08 Nov 2007 19:18:52 +0100 Subject: [svn] GpgEX - r39 - in trunk: . doc po src Message-ID: Author: marcus Date: 2007-11-08 19:18:43 +0100 (Thu, 08 Nov 2007) New Revision: 39 Added: trunk/doc/gpgex-de.html trunk/doc/gpgex-en.html Modified: trunk/ChangeLog trunk/doc/Makefile.am trunk/doc/gpgex.texi trunk/po/de.po trunk/src/ChangeLog trunk/src/client.cc trunk/src/gpgex.cc Log: 2007-11-08 Marcus Brinkmann * po/de.po: Update. * doc/gpgex-de.html, doc/gpgex-en.html: New files. * doc/Makefile.am (dist_doc_DATA): New variable. * doc/gpgex.texi: Complete protocol change from INPUT FILE to FILE. Also from IMPORT to IMPORT_FILES. src/ 2007-11-08 Marcus Brinkmann * gpgex.cc: Include registry.h. (start_help): Launch gpgex help from install directory. * client.cc (client_t::call_assuan): Fix bug in last change. Modified: trunk/ChangeLog =================================================================== --- trunk/ChangeLog 2007-11-08 16:43:26 UTC (rev 38) +++ trunk/ChangeLog 2007-11-08 18:18:43 UTC (rev 39) @@ -1,3 +1,13 @@ +2007-11-08 Marcus Brinkmann + + * po/de.po: Update. + + * doc/gpgex-de.html, doc/gpgex-en.html: New files. + * doc/Makefile.am (dist_doc_DATA): New variable. + + * doc/gpgex.texi: Complete protocol change from INPUT FILE to + FILE. Also from IMPORT to IMPORT_FILES. + 2007-11-02 Werner Koch * autogen.sh: Add --force option. Modified: trunk/doc/Makefile.am =================================================================== --- trunk/doc/Makefile.am 2007-11-08 16:43:26 UTC (rev 38) +++ trunk/doc/Makefile.am 2007-11-08 18:18:43 UTC (rev 39) @@ -16,4 +16,4 @@ info_TEXINFOS = gpgex.texi gpgex_TEXINFOS = gpl.texi - +dist_doc_DATA = gpgex-en.html gpgex-de.html Added: trunk/doc/gpgex-de.html =================================================================== --- trunk/doc/gpgex-de.html 2007-11-08 16:43:26 UTC (rev 38) +++ trunk/doc/gpgex-de.html 2007-11-08 18:18:43 UTC (rev 39) @@ -0,0 +1,60 @@ + + + + + Hilfe f?r die GnuPG Shell Extension (GpgEX) + + +

GnuPG Shell Extension

+

+ (Verf?gbare Sprachen: English, Deutsch) +

+

+ Die GNU Privacy Guard Erweiterungen f?r die Windows Explorer + Umgebung erlaubt es ihnen, kryptographische Funktionen in + Kleopatra ?ber die Kontext-Men?s von Dateien aufzurufen. +

+

Befehle

+

Entschl?sseln und verifizieren, Entschl?sseln, Verifizieren

+

+ Entschl?sselt und/oder verifiziert die ausgew?hlten Dateien. +

+

Verschl?sseln und signieren, Verschl?sseln, Signieren

+

+ Verschl?sselt und/oder signiert die ausgew?hlten Dateien. +

+

Zertifikate importieren

+

+ Import die Zertifikate in den ausgew?hlten Dateien. +

+

Pr?fsummen erstellen

+

+ Erstellt Pr?fsummen f?r die ausgew?hlten Dateien. +

+

Pr?fsummen verifizieren

+

+ Verifiziert die Pr?fsummen f?r die ausgew?hlten Dateien. +

+

Hilfe zu GpgEX

+

+ Stellt diese Hilfe dar. +

+

Debugging

+

+ Falls nicht auf Kleopatra zugegriffen werden kann, wird ein + Nachrichtenfenster mit einer Fehlermeldung angezeigt. Um mehr + Informationen zu erhalten, kann der Fehlerbericht von Kleopatra + eingesehen werden, oder es kann eine Debug Datei im Registry Eintrag + GpgEX Debug File zum Schl?ssel + HKLM\Software\GNU\GnuPG angegeben werden. + Informationen zum Protokoll werden dann ggf. nach einem Neustart + an diese Datei angehangen. +

+

Verweise

+

+ Mehr Informationen und aktuelle Versionen sind auf der + Gpg4win Webpr?senz + verf?gbar. +

+ + Added: trunk/doc/gpgex-en.html =================================================================== --- trunk/doc/gpgex-en.html 2007-11-08 16:43:26 UTC (rev 38) +++ trunk/doc/gpgex-en.html 2007-11-08 18:18:43 UTC (rev 39) @@ -0,0 +1,57 @@ + + + + + Help for GnuPG Shell Extension (GpgEX) + + +

GnuPG Shell Extension

+

+ (Available languages: English, Deutsch) +

+

+ The GNU Privacy Guard extensions for the Windows Explorer shell + allow you to access cryptographic functions in Kleopatra using + the context menu to files. +

+

Commands

+

Decrypt and verify, Decrypt, Verify

+

+ Decrypt and/or verify the selected files. +

+

Encrypt and sign, Encrypt, Sign

+

+ Encrypt and/or sign the selected files. +

+

Import keys

+

+ Import certificates in the selected files. +

+

Create checksums

+

+ Create checksums for the selected files. +

+

Verify checksums

+

+ Verify the checksums for the selected files. +

+

Help on GpgEX

+

+ Display this help. +

+

Debugging

+

+ If Kleopatra can not be accessed, a message box with an error + message will be displayed. To get more information, you can + either check the error log of Kleopatra, or specify a debug file + with the registry value GpgEX Debug File in the key + HKLM\Software\GNU\GnuPG. To this file logging + information is appended, after a restart if necessary. +

+

References

+

+ Please find more information and new versions at + the Gpg4win web-site. +

+ + Modified: trunk/doc/gpgex.texi =================================================================== --- trunk/doc/gpgex.texi 2007-11-08 16:43:26 UTC (rev 38) +++ trunk/doc/gpgex.texi 2007-11-08 18:18:43 UTC (rev 39) @@ -133,9 +133,9 @@ @section Specifying the input files to operate on. All commands operate on a number of input files or directories, -specified by one or more @code{INPUT} commands: +specified by one or more @code{FILE} commands: - at deffn Command FILE=@var{name} [--continued] + at deffn Command FILE @var{name} [--continued] Add the file or directory @var{name} to the list of pathnames to be processed by the server. The parameter @var{name} must be an absolute path name (including the drive letter) and is percent espaced (in @@ -154,7 +154,7 @@ @deffn Command ENCRYPT_FILES --nohup @deffnx Command SIGN_FILES --nohup @deffnx Command ENCRYPT_SIGN_FILES --nohup -Request that the files specified by @code{INPUT} are encrypted and/or +Request that the files specified by @code{FILE} are encrypted and/or signed. The command selects the default action. The UI server may allow the user to change this default afterwards interactively, and even abort the operation or complete it only on some of the selected @@ -184,12 +184,12 @@ @section Decrypting and verifying files. First, the input files need to be specified by one or more - at code{INPUT} commands. Afterwards, the actual operation is requested: + at code{FILE} commands. Afterwards, the actual operation is requested: @deffn Command DECRYPT_FILES --nohup @deffnx Command VERIFY_FILES --nohup @deffnx Command DECRYPT_VERIFY_FILES --nohup -Request that the files specified by @code{INPUT} are decrypted and/or +Request that the files specified by @code{FILE} are decrypted and/or verified. The command selects the default action. The UI server may allow the user to change this default afterwards interactively, and even abort the operation or complete it only on some of the selected @@ -220,7 +220,7 @@ First, the input files need to be specified by one or more @code{FILE} commands. Afterwards, the actual operation is requested: - at deffn Command IMPORT --nohup + at deffn Command IMPORT_FILES --nohup Request that the certificates contained in the files specified by @code{FILE} are imported into the local certificate databases. @@ -260,7 +260,7 @@ @deffn Command CHECKSUM_VERIFY_FILES --nohup Request that checksums are created for the files specifed by - at code{INPUT} and verified against previously created and stored + at code{FILE} and verified against previously created and stored checksums. The choice of checksum algorithm and the source storage and format for previously created checksums depend on the preferences of the user and the functionality provided by the UI server. For @@ -269,9 +269,9 @@ If the source storage of previously created checksums is available to the user through the Windows shell, this command may also accept such -checksum files as INPUT arguments. In this case, the UI server should -instead verify the checksum of the referenced files as if they were -given as INPUT files. +checksum files as @code{FILE} arguments. In this case, the UI server +should instead verify the checksum of the referenced files as if they +were given as INPUT files. The option @code{--nohup} is mandatory. It is currently unspecified what should happen if @code{--nohup} is not present. Because Modified: trunk/po/de.po =================================================================== --- trunk/po/de.po 2007-11-08 16:43:26 UTC (rev 38) +++ trunk/po/de.po 2007-11-08 18:18:43 UTC (rev 39) @@ -7,8 +7,8 @@ msgstr "" "Project-Id-Version: gpgex 0.0.0-svn10\n" "Report-Msgid-Bugs-To: bug-gpgex at g10code.com\n" -"POT-Creation-Date: 2007-11-02 11:48+0100\n" -"PO-Revision-Date: 2007-10-08 18:34+0200\n" +"POT-Creation-Date: 2007-11-08 18:55+0100\n" +"PO-Revision-Date: 2007-11-08 18:57+0100\n" "Last-Translator: Marcus Brinkmann \n" "Language-Team: German\n" "MIME-Version: 1.0\n" @@ -17,96 +17,96 @@ "Plural-Forms: nplurals=2; plural=(n != 1);\n" #: src/client.cc:345 -msgid "Can not access Kleopatra, see log file for details" -msgstr "Kann nicht auf Kleopatra zugreifen, siehe Protokolldatei f?r Details" +#, c-format +msgid "" +"Can not access Kleopatra:\r\n" +"%s" +msgstr "Kann nicht auf Kleopatra zugreifen:\\r\\n%s" -#: src/gpgex.cc:57 +#: src/gpgex.cc:58 msgid "Help on GpgEX" msgstr "Hilfe zu GpgEX" -#: src/gpgex.cc:58 +#: src/gpgex.cc:59 msgid "Decrypt and verify" msgstr "Entschl?sseln und verifizieren" -#: src/gpgex.cc:59 +#: src/gpgex.cc:60 msgid "Decrypt" msgstr "Entschl?sseln" -#: src/gpgex.cc:60 +#: src/gpgex.cc:61 msgid "Verify" msgstr "Verifizieren" -#: src/gpgex.cc:61 +#: src/gpgex.cc:62 msgid "Encrypt and sign" msgstr "Verschl?sseln und signieren" -#: src/gpgex.cc:62 +#: src/gpgex.cc:63 msgid "Encrypt" msgstr "Verschl?sseln" -#: src/gpgex.cc:63 +#: src/gpgex.cc:64 msgid "Sign" msgstr "Signieren" -#: src/gpgex.cc:64 +#: src/gpgex.cc:65 msgid "Import keys" msgstr "Zertifikate importieren" -#: src/gpgex.cc:65 +#: src/gpgex.cc:66 msgid "Create checksums" msgstr "Pr?fsummen erstellen" -#: src/gpgex.cc:66 +#: src/gpgex.cc:67 msgid "Verify checksums" msgstr "Pr?fsummen verifizieren" -#: src/gpgex.cc:306 +#: src/gpgex.cc:307 msgid "More GpgEX options" msgstr "Mehr GpgEX Optionen" -#: src/gpgex.cc:402 +#: src/gpgex.cc:403 msgid "Invoke the GpgEX documentation." msgstr "?ffne die Dokumentation zu GpgEX" -#: src/gpgex.cc:406 -#, fuzzy +#: src/gpgex.cc:407 msgid "Decrypt and verify the marked files." msgstr "Die markierten Dateien entschl?sseln und verifizieren." -#: src/gpgex.cc:410 +#: src/gpgex.cc:411 msgid "Decrypt the marked files." msgstr "Die markierten Dateien entschl?sseln." -#: src/gpgex.cc:414 +#: src/gpgex.cc:415 msgid "Verify the marked files." msgstr "Die markierten Dateien verifizieren." -#: src/gpgex.cc:418 -#, fuzzy +#: src/gpgex.cc:419 msgid "Encrypt and sign the marked files." -msgstr "Die markierten Dateien verschl?sseln und verifizieren." +msgstr "Die markierten Dateien verschl?sseln und signieren." -#: src/gpgex.cc:422 +#: src/gpgex.cc:423 msgid "Encrypt the marked files." msgstr "Die markierten Dateien verschl?sseln." -#: src/gpgex.cc:426 +#: src/gpgex.cc:427 msgid "Sign the marked files." msgstr "Die markierten Dateien signieren." -#: src/gpgex.cc:430 +#: src/gpgex.cc:431 msgid "Import the marked files." msgstr "Die markierten Dateien importieren." -#: src/gpgex.cc:434 +#: src/gpgex.cc:435 msgid "Create checksums." msgstr "F?r die markierten Dateien Pr?fsummen erstellen." -#: src/gpgex.cc:438 +#: src/gpgex.cc:439 msgid "Verify checksums." msgstr "Die Pr?fsummen der markierten Dateien verifizieren." -#: src/gpgex.cc:442 -#, fuzzy +#: src/gpgex.cc:443 msgid "Show more GpgEX options." -msgstr "Mehr GpgEX Optionen" +msgstr "Mehr GpgEX Optionen." Modified: trunk/src/ChangeLog =================================================================== --- trunk/src/ChangeLog 2007-11-08 16:43:26 UTC (rev 38) +++ trunk/src/ChangeLog 2007-11-08 18:18:43 UTC (rev 39) @@ -1,5 +1,9 @@ 2007-11-08 Marcus Brinkmann + * gpgex.cc: Include registry.h. + (start_help): Launch gpgex help from install directory. + * client.cc (client_t::call_assuan): Fix bug in last change. + * client.cc (client_t::call_assuan): Fix FILE command and rename all commands to the protocol version. (client_t::call_assuan): Report the actual error and remove log Modified: trunk/src/client.cc =================================================================== --- trunk/src/client.cc 2007-11-08 16:43:26 UTC (rev 38) +++ trunk/src/client.cc 2007-11-08 18:18:43 UTC (rev 39) @@ -343,7 +343,7 @@ { char buf[256]; snprintf (buf, sizeof (buf), _("Can not access Kleopatra:\r\n%s"), - gpg_strerror (buf)); + gpg_strerror (rc)); MessageBox (this->window, buf, "GpgEX", MB_ICONINFORMATION); } Modified: trunk/src/gpgex.cc =================================================================== --- trunk/src/gpgex.cc 2007-11-08 16:43:26 UTC (rev 38) +++ trunk/src/gpgex.cc 2007-11-08 18:18:43 UTC (rev 39) @@ -36,6 +36,7 @@ #include "main.h" #include "client.h" +#include "registry.h" #include "gpgex.h" @@ -490,12 +491,28 @@ // width, height web->put_Visible (VARIANT_TRUE); - /* FIXME: Replace by real URL. */ - BSTR url = SysAllocString ((const OLECHAR *) L"http://www.gpg4win.org/"); +#define URLSIZE 512 + wchar_t url[URLSIZE]; + { + char *dir = NULL; + + dir = read_w32_registry_string ("HKEY_LOCAL_MACHINE", REGKEY, + "Install Directory"); + if (!dir) + _snwprintf (url, URLSIZE, L"%S", "http://www.gpg4win.org/"); + else + /* FIXME: Select on language. */ + _snwprintf (url, + URLSIZE, L"file:///%S\\share\\doc\\gpgex\\gpgex-en.html", + dir); + url[URLSIZE - 1] = '\0'; + } + + BSTR burl = SysAllocString ((const OLECHAR *) url); VARIANT vars[4]; memset (vars, 0, sizeof (vars)); - res = web->Navigate (url, vars, vars + 1, vars + 2, vars + 3); - SysFreeString (url); + res = web->Navigate (burl, vars, vars + 1, vars + 2, vars + 3); + SysFreeString (burl); if (!SUCCEEDED (res)) { web->Release (); From cvs at cvs.gnupg.org Mon Nov 12 12:34:22 2007 From: cvs at cvs.gnupg.org (svn author marcus) Date: Mon, 12 Nov 2007 12:34:22 +0100 Subject: [svn] gpgme - r1276 - trunk/gpgme Message-ID: Author: marcus Date: 2007-11-12 12:34:13 +0100 (Mon, 12 Nov 2007) New Revision: 1276 Modified: trunk/gpgme/ChangeLog trunk/gpgme/kdpipeiodevice.cpp Log: 2007-11-12 Marcus Brinkmann * kdpipeiodevice.cpp: New version from Frank Osterfeld. Modified: trunk/gpgme/ChangeLog =================================================================== --- trunk/gpgme/ChangeLog 2007-10-11 13:03:59 UTC (rev 1275) +++ trunk/gpgme/ChangeLog 2007-11-12 11:34:13 UTC (rev 1276) @@ -1,3 +1,7 @@ +2007-11-12 Marcus Brinkmann + + * kdpipeiodevice.cpp: New version from Frank Osterfeld. + 2007-10-11 Marcus Brinkmann * kdpipeiodevice.cpp: New version from Frank Osterfeld. Modified: trunk/gpgme/kdpipeiodevice.cpp =================================================================== --- trunk/gpgme/kdpipeiodevice.cpp 2007-10-11 13:03:59 UTC (rev 1275) +++ trunk/gpgme/kdpipeiodevice.cpp 2007-11-12 11:34:13 UTC (rev 1276) @@ -276,7 +276,7 @@ bool KDPipeIODevice::open( Qt::HANDLE h, OpenMode mode ) { KDAB_CHECK_THIS; #ifdef Q_OS_WIN32 - return d->doOpen( 0, h, mode ); + return d->doOpen( -1, h, mode ); #else Q_UNUSED( h ); Q_UNUSED( mode ); @@ -341,12 +341,15 @@ bool KDPipeIODevice::Private::doOpen( int fd_, Qt::HANDLE handle_, OpenMode mode_ ) { - if ( q->isOpen() || fd_ < 0 ) + if ( q->isOpen() ) return false; #ifdef Q_OS_WIN32 if ( !handle_ ) return false; +#else + if ( fd_ < 0 ) + return false; #endif if ( !(mode_ & ReadWrite) ) @@ -662,8 +665,10 @@ waitAndDelete( d->reader ); #undef waitAndDelete #ifdef Q_OS_WIN32 - qDebug( "Closing handle" ); - CloseHandle( d->handle ); + if ( d->fd != -1 ) + _close( d->fd ); + else + CloseHandle( d->handle ); #else ::close( d->fd ); #endif From cvs at cvs.gnupg.org Mon Nov 12 13:20:43 2007 From: cvs at cvs.gnupg.org (svn author marcus) Date: Mon, 12 Nov 2007 13:20:43 +0100 Subject: [svn] GpgEX - r40 - trunk Message-ID: Author: marcus Date: 2007-11-12 13:20:35 +0100 (Mon, 12 Nov 2007) New Revision: 40 Modified: trunk/README Log: Replace link by specific information. Modified: trunk/README =================================================================== --- trunk/README 2007-11-08 18:18:43 UTC (rev 39) +++ trunk/README 2007-11-12 12:20:35 UTC (rev 40) @@ -1,4 +1,4 @@ -GPG Explorer Extensions +BGPG Explorer Extensions ======================= This package contains GpgEX, the GNU Privacy Guard extensions for the @@ -41,6 +41,15 @@ A debug file path can be specified with the registry value "GpgEX Debug File" in the HKLM\Software\GNU\GnuPG key. To this file logging -information is appended. Also see: +information is appended. -http://msdn2.microsoft.com/en-us/library/aa969286.aspx +To increase the frequency at which extensions are unloaded, create the +following registry key with default value "1". + +HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Explorer\AlwaysUnloadDLL + +On NT, you can run the taskbar, the Desktop and each explorer window +in a separate process by creating a DWORD "DesktopProcess" with value +1 under: + +HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer From cvs at cvs.gnupg.org Mon Nov 12 14:04:01 2007 From: cvs at cvs.gnupg.org (svn author marcus) Date: Mon, 12 Nov 2007 14:04:01 +0100 Subject: [svn] GpgEX - r41 - trunk/src Message-ID: Author: marcus Date: 2007-11-12 14:03:52 +0100 (Mon, 12 Nov 2007) New Revision: 41 Modified: trunk/src/ChangeLog trunk/src/gpgex.cc Log: 2007-11-12 Marcus Brinkmann * gpgex.cc (get_lang_name): Get preferred language. (start_help): Invoke language specific help. Modified: trunk/src/ChangeLog =================================================================== --- trunk/src/ChangeLog 2007-11-12 12:20:35 UTC (rev 40) +++ trunk/src/ChangeLog 2007-11-12 13:03:52 UTC (rev 41) @@ -1,3 +1,8 @@ +2007-11-12 Marcus Brinkmann + + * gpgex.cc (get_lang_name): Get preferred language. + (start_help): Invoke language specific help. + 2007-11-08 Marcus Brinkmann * gpgex.cc: Include registry.h. Modified: trunk/src/gpgex.cc =================================================================== --- trunk/src/gpgex.cc 2007-11-12 12:20:35 UTC (rev 40) +++ trunk/src/gpgex.cc 2007-11-12 13:03:52 UTC (rev 41) @@ -460,6 +460,23 @@ } +static char * +get_lang_name (void) +{ + LANGID lang; + + lang = GetUserDefaultUILanguage (void); + switch (PRIMARYLANGID (lang)) + { + case LANG_GERMAN: + return "de"; + + case LANG_ENGLISH: + default: + return "en"; + } +} + /* FIXME: Might be exported in a helper utility. Also, it might be that we use KDE's help browser? */ static void @@ -501,10 +518,9 @@ if (!dir) _snwprintf (url, URLSIZE, L"%S", "http://www.gpg4win.org/"); else - /* FIXME: Select on language. */ _snwprintf (url, - URLSIZE, L"file:///%S\\share\\doc\\gpgex\\gpgex-en.html", - dir); + URLSIZE, L"file:///%S\\share\\doc\\gpgex\\gpgex-%S.html", + dir, get_lang_name ()); url[URLSIZE - 1] = '\0'; } From cvs at cvs.gnupg.org Mon Nov 12 14:22:07 2007 From: cvs at cvs.gnupg.org (svn author marcus) Date: Mon, 12 Nov 2007 14:22:07 +0100 Subject: [svn] GpgEX - r42 - in trunk: . src Message-ID: Author: marcus Date: 2007-11-12 14:21:58 +0100 (Mon, 12 Nov 2007) New Revision: 42 Modified: trunk/ChangeLog trunk/configure.ac trunk/src/ChangeLog trunk/src/gpgex.cc Log: 2007-11-12 Marcus Brinkmann * configure.ac (WINVER): New symbol. src/ 2007-11-12 Marcus Brinkmann * gpgex.cc (get_lang_name): Fix last change. Modified: trunk/ChangeLog =================================================================== --- trunk/ChangeLog 2007-11-12 13:03:52 UTC (rev 41) +++ trunk/ChangeLog 2007-11-12 13:21:58 UTC (rev 42) @@ -1,3 +1,7 @@ +2007-11-12 Marcus Brinkmann + + * configure.ac (WINVER): New symbol. + 2007-11-08 Marcus Brinkmann * po/de.po: Update. Modified: trunk/configure.ac =================================================================== --- trunk/configure.ac 2007-11-12 13:03:52 UTC (rev 41) +++ trunk/configure.ac 2007-11-12 13:21:58 UTC (rev 42) @@ -186,6 +186,9 @@ AC_DEFINE(GPG_ERR_SOURCE_DEFAULT, GPG_ERR_SOURCE_USER_1, [The default error source for GpgEX.]) +# We need the declaration for the function GetUserDefaultUILanguage. +AC_DEFINE(WINVER, 0x500, [Version of Windows API]) + # # libassuan is used for IPC # Modified: trunk/src/ChangeLog =================================================================== --- trunk/src/ChangeLog 2007-11-12 13:03:52 UTC (rev 41) +++ trunk/src/ChangeLog 2007-11-12 13:21:58 UTC (rev 42) @@ -1,5 +1,7 @@ 2007-11-12 Marcus Brinkmann + * gpgex.cc (get_lang_name): Fix last change. + * gpgex.cc (get_lang_name): Get preferred language. (start_help): Invoke language specific help. Modified: trunk/src/gpgex.cc =================================================================== --- trunk/src/gpgex.cc 2007-11-12 13:03:52 UTC (rev 41) +++ trunk/src/gpgex.cc 2007-11-12 13:21:58 UTC (rev 42) @@ -465,7 +465,7 @@ { LANGID lang; - lang = GetUserDefaultUILanguage (void); + lang = GetUserDefaultUILanguage (); switch (PRIMARYLANGID (lang)) { case LANG_GERMAN: From cvs at cvs.gnupg.org Mon Nov 12 15:19:11 2007 From: cvs at cvs.gnupg.org (svn author wk) Date: Mon, 12 Nov 2007 15:19:11 +0100 Subject: [svn] GpgOL - r197 - in trunk: . doc src Message-ID: Author: wk Date: 2007-11-12 15:19:00 +0100 (Mon, 12 Nov 2007) New Revision: 197 Modified: trunk/AUTHORS trunk/ChangeLog trunk/NEWS trunk/TODO trunk/configure.ac trunk/doc/gpgol.texi trunk/src/ChangeLog trunk/src/Makefile.am trunk/src/common.h trunk/src/dialogs.h trunk/src/dialogs.rc trunk/src/ext-commands.cpp trunk/src/ext-commands.h trunk/src/item-events.cpp trunk/src/main.c trunk/src/mapihelp.cpp trunk/src/mapihelp.h trunk/src/message-events.cpp trunk/src/message.cpp trunk/src/message.h trunk/src/mimeparser.c trunk/src/olflange-dlgs.cpp trunk/src/olflange.cpp trunk/src/olflange.h trunk/src/util.h Log: Fixes. Modified: trunk/AUTHORS =================================================================== --- trunk/AUTHORS 2007-11-08 08:13:59 UTC (rev 196) +++ trunk/AUTHORS 2007-11-12 14:19:00 UTC (rev 197) @@ -1,6 +1,7 @@ Package: gpgol Contact: info-gpgol at g10code.com Bugs: bug-gpgol at g10code.com +License: LGPLv2.1+ g10 Code GmbH Modified: trunk/ChangeLog =================================================================== --- trunk/ChangeLog 2007-11-08 08:13:59 UTC (rev 196) +++ trunk/ChangeLog 2007-11-12 14:19:00 UTC (rev 197) @@ -1,3 +1,7 @@ +2007-10-22 Werner Koch + + Released 0.10.1 development version. + 2007-10-12 Werner Koch * po/POTFILES.in: Add more files. Modified: trunk/NEWS =================================================================== --- trunk/NEWS 2007-11-08 08:13:59 UTC (rev 196) +++ trunk/NEWS 2007-11-12 14:19:00 UTC (rev 197) @@ -1,11 +1,16 @@ -Noteworthy changes for version 0.10.1 (2007-10-22) +Noteworthy changes for version 0.10.2 ================================================== UNDER HEAVY DEVELOPMENT - DO NOT USE FOR PRODUCTION! - - Signed and encrypt has not yet been implemented - Under OL2007 some menu entries are missing. + * New menu items to select the default protocol. + + +Noteworthy changes for version 0.10.1 (2007-10-22) +================================================== + * Auto start the server. * Code cleanups. Modified: trunk/TODO =================================================================== --- trunk/TODO 2007-11-08 08:13:59 UTC (rev 196) +++ trunk/TODO 2007-11-12 14:19:00 UTC (rev 197) @@ -1,6 +1,3 @@ -* inline PGG versenden wir als UTF-8. Andere aber wohl als Latin-1. - Heuristic implementieren. - * 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. @@ -19,11 +16,11 @@ * Allow for symmetric encryption. -* Please consider adding a few more options like key singing rules +* Please consider adding a few more options like key signing rules like Enigmail has. -* We should not rite a decrupted file without user content. A - possible solution in attach-file-events.c is to keep tarck of - prensented file names and decrypt them only on OpenSzFile. Need to +* We should not write a decrypted file without user consent. A + possible solution in attach-file-events.c is to keep track of + presented file names and decrypt them only on OpenSzFile. Need to get some documentaion first. Modified: trunk/configure.ac =================================================================== --- trunk/configure.ac 2007-11-08 08:13:59 UTC (rev 196) +++ trunk/configure.ac 2007-11-12 14:19:00 UTC (rev 197) @@ -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.1]) -m4_define([my_issvn], [no]) +m4_define([my_version], [0.10.2]) +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/doc/gpgol.texi =================================================================== --- trunk/doc/gpgol.texi 2007-11-08 08:13:59 UTC (rev 196) +++ trunk/doc/gpgol.texi 2007-11-12 14:19:00 UTC (rev 197) @@ -113,9 +113,13 @@ @c @node Introduction @chapter Introduction -Bla bla +To debug GpgOL you should set the Registry entry + at code{HKCU\Software\Gnu\GnuPG:enableDebug} to the string value @code{1}. +This allows easy setting of a debug file by using the extended options +menu and enables a few extra menu items. + @c @c P R O T O C O L D E S C R I P T I O N @c @@ -585,6 +589,12 @@ re-encrypted attachment. The existence of this property indicates that the attachment has been encrypted under the non-permanent session key. + at item GpgOL Last Decrypted +This binary property is used on the message to save a session marker to +tell GpgOL whether the message as already been decrypted. If this +property does not exists or the session marker does not macth the one of +the current session, GpgOL needs to decrypt it again. + @item GpgOL MIME Info This property is of type STRING8 and used to store the MIME structure of the orginal message. The content are lines of colon delimited fields. @@ -626,7 +636,31 @@ actual program name contains spaces the program name nees to be enclosed in quotes. + at item HKCU\Software\Gnu\GnuPG:enableDebug +Setting this key to the string @code{1} enables a few extra features in +the UI, useful only for debugging. + at itemx HKCU\Software\Gnu\GnuPG:logFile +If the value is not empty, GpgOL takes this as a log file and appends +debug information to this file. The file may get very large. + + at itemx HKCU\Software\Gnu\GnuPG:compatFlags +This is a string consisting of @code{0} and @code{1} to enable certain +compatibility flags. Not generally useful; use the source for a +description. + + at item HKCU\Software\Gnu\GnuPG:enableSmime + at itemx HKCU\Software\Gnu\GnuPG:defaultProtocol + at itemx HKCU\Software\Gnu\GnuPG:encryptDefault + at itemx HKCU\Software\Gnu\GnuPG:signDefault + at itemx HKCU\Software\Gnu\GnuPG:previewDecrypt + at itemx HKCU\Software\Gnu\GnuPG:storePasswdTime + at itemx HKCU\Software\Gnu\GnuPG:encodingFormat + at itemx HKCU\Software\Gnu\GnuPG:defaultKey + at itemx HKCU\Software\Gnu\GnuPG:enableDefaultKey + at itemx HKCU\Software\Gnu\GnuPG:preferHtml +These registry keys store the values from the configuration dialog. + @end table Modified: trunk/src/ChangeLog =================================================================== --- trunk/src/ChangeLog 2007-11-08 08:13:59 UTC (rev 196) +++ trunk/src/ChangeLog 2007-11-12 14:19:00 UTC (rev 197) @@ -1,3 +1,37 @@ +2007-11-12 Werner Koch + + * olflange.h (class GpgolExt): Rename m_gpgSelectSmime to + m_protoSelection. + * message-events.cpp (OnWriteComplete): Use it accordingly. + * main.c (write_options, read_options): Load and save it. + * dialogs.rc: Add new check box for OpenPGP default protocol. + * olflange-dlgs.cpp (GPGOptionsDlgProc): Adjust for above chnages. + +2007-11-09 Werner Koch + + * main.c (read_options): New option ENABLE_DEBUG to be enabled + only using the Registry. + (read_options): Show warning for certain option combinations. + * olflange-dlgs.cpp (GPGOptionsDlgProc): Hide the Advanced options + button unless in debug mode. + + * mapihelp.cpp (get_gpgollastdecrypted_tag): New. + (mapi_test_last_decrypted): New. + (mapi_has_last_decrypted): new. + * mimeparser.c (finish_message): Update the Last Decrypted property. + * message.cpp (message_decrypt): Use it here. + (message_wipe_body_cruft): New. + + * main.c (do_log_window_hierarchy): Factor some code out to .. + (do_log_window_info): .. this. + (log_window_hierarchy): Log parent window info. + (get_64bit_session_marker): New. + (initialize_session_key): Init session marker. + + * Makefile.am (gpgol_SOURCES): Remove item-events.cpp + * olflange.cpp (GpgolExt): Disable the GpgOLItemEvents as they can + only be used with the undocumented ECF file. + 2007-10-29 Werner Koch * mimemaker.c (create_top_signing_header): Add arg FIRST. Modified: trunk/src/Makefile.am =================================================================== --- trunk/src/Makefile.am 2007-11-08 08:13:59 UTC (rev 196) +++ trunk/src/Makefile.am 2007-11-12 14:19:00 UTC (rev 197) @@ -11,8 +11,10 @@ ## Process this file with automake to produce Makefile.in +unused_sources = item-events.cpp + bin_PROGRAMS = gpgol -EXTRA_DIST = versioninfo.rc.in mapi32.def \ +EXTRA_DIST = versioninfo.rc.in mapi32.def $(unused_sources) \ logo.bmp decrypt.bmp encrypt.bmp sign.bmp key_mana.bmp EXEEXT = .dll @@ -55,7 +57,7 @@ message-events.cpp message-events.h \ attached-file-events.cpp attached-file-events.h \ property-sheets.cpp property-sheets.h \ - item-events.cpp item-events.h \ + item-events.h \ ol-ext-callback.cpp ol-ext-callback.h \ w32-gettext.c w32-gettext.h Modified: trunk/src/common.h =================================================================== --- trunk/src/common.h 2007-11-08 08:13:59 UTC (rev 196) +++ trunk/src/common.h 2007-11-12 14:19:00 UTC (rev 197) @@ -105,11 +105,12 @@ #endif struct { + int enable_debug; /* Enable extra debug options. */ + int enable_smime; /* Enable S/MIME support. */ int passwd_ttl; /* Time in seconds the passphrase is stored. */ - int smime_default; /* Use S/MIME by default. */ + protocol_t default_protocol;/* The default protocol. */ int encrypt_default; /* Encrypt by default. */ int sign_default; /* Sign by default. */ - int enable_smime; /* Enable S/MIME support. */ int enc_format; /* Encryption format for attachments. */ char *default_key; /* The key we want to always encrypt to. */ int enable_default_key; /* Enable the use of DEFAULT_KEY. */ Modified: trunk/src/dialogs.h =================================================================== --- trunk/src/dialogs.h 2007-11-08 08:13:59 UTC (rev 196) +++ trunk/src/dialogs.h 2007-11-12 14:19:00 UTC (rev 197) @@ -25,18 +25,19 @@ #define IDC_ENCRYPT_DEFAULT 4011 #define IDC_SIGN_DEFAULT 4012 #define IDC_ENCRYPT_WITH_STANDARD_KEY 4013 -#define IDC_SMIME_DEFAULT 4014 -#define IDC_GPG_OPTIONS 4015 -#define IDC_BITMAP 4016 -#define IDC_VERSION_INFO 4017 -#define IDC_ENCRYPT_TO 4018 -#define IDC_ENABLE_SMIME 4019 -#define IDC_PREVIEW_DECRYPT 4020 -#define IDC_PREFER_HTML 4021 -#define IDC_G_OPTIONS 4022 -#define IDC_G_PASSPHRASE 4023 -#define IDC_T_PASSPHRASE_TTL 4024 -#define IDC_T_PASSPHRASE_MIN 4025 +#define IDC_OPENPGP_DEFAULT 4014 +#define IDC_SMIME_DEFAULT 4015 +#define IDC_GPG_OPTIONS 4016 +#define IDC_BITMAP 4017 +#define IDC_VERSION_INFO 4018 +#define IDC_ENCRYPT_TO 4019 +#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 /* Ids for the extended options dialog. */ Modified: trunk/src/dialogs.rc =================================================================== --- trunk/src/dialogs.rc 2007-11-08 08:13:59 UTC (rev 196) +++ trunk/src/dialogs.rc 2007-11-12 14:19:00 UTC (rev 197) @@ -37,7 +37,7 @@ BEGIN /* Options box. */ GROUPBOX "options", IDC_G_OPTIONS, - 9, 9, 242, 112 + 9, 9, 242, 124 CONTROL "encrypt-by-default", IDC_ENCRYPT_DEFAULT, "Button", BS_AUTOCHECKBOX | WS_TABSTOP, @@ -47,61 +47,65 @@ "Button", BS_AUTOCHECKBOX | WS_TABSTOP, 24, 30, 215, 10 - CONTROL "smime-by-default", IDC_SMIME_DEFAULT, + CONTROL "openpgp-by-default", IDC_OPENPGP_DEFAULT, "Button", BS_AUTOCHECKBOX | WS_TABSTOP, 24, 42, 215, 10 - CONTROL "enable-smime", IDC_ENABLE_SMIME, + CONTROL "smime-by-default", IDC_SMIME_DEFAULT, "Button", BS_AUTOCHECKBOX | WS_TABSTOP, 24, 54, 215, 10 + CONTROL "enable-smime", IDC_ENABLE_SMIME, + "Button", BS_AUTOCHECKBOX | WS_TABSTOP, + 24, 66, 215, 10 + CONTROL "encrypt-to", IDC_ENCRYPT_WITH_STANDARD_KEY, "Button", BS_AUTOCHECKBOX | WS_TABSTOP, - 24, 67, 215, 10 + 24, 79, 215, 10 EDITTEXT IDC_ENCRYPT_TO, - 36, 79, 133, 12, ES_AUTOHSCROLL + 36, 91, 133, 12, ES_AUTOHSCROLL CONTROL "preview-decrypt", IDC_PREVIEW_DECRYPT, "Button", BS_AUTOCHECKBOX | WS_TABSTOP, - 24, 95, 215, 10 + 24, 107, 215, 10 CONTROL "prefer-html", IDC_PREFER_HTML, "Button", BS_AUTOCHECKBOX | WS_TABSTOP, - 24, 107, 215, 10 + 24, 119, 215, 10 /* Passphrase option box. */ GROUPBOX "Passphrase", IDC_G_PASSPHRASE, - 9, 124, 242, 31 + 9, 136, 242, 31 LTEXT "passphrase-ttl", IDC_T_PASSPHRASE_TTL, - 24, 136, 80, 8 + 24, 148, 80, 8 EDITTEXT IDC_TIME_PHRASES, - 107, 135, 39, 14, ES_AUTOHSCROLL + 107, 147, 39, 14, ES_AUTOHSCROLL LTEXT "minutes", IDC_T_PASSPHRASE_MIN, - 151, 137, 50, 8 + 151, 149, 50, 8 /* Stuff below the group boxes. */ PUSHBUTTON "advanced", IDC_GPG_OPTIONS, - 202, 166, 50, 14 + 202, 178, 50, 14 LTEXT "GpgOL by g10 Code GmbH", IDC_STATIC, - 8, 185, 100, 8 + 8, 197, 100, 8 LTEXT "Version x ", IDC_VERSION_INFO, - 150, 185, 109, 9 + 150, 197, 109, 9 CONTROL IDB_BANNER, IDC_BITMAP, "Static", SS_BITMAP | SS_REALSIZEIMAGE, - 8, 200, 150, 64 + 8, 212, 150, 64 END IDD_EXT_OPTIONS DIALOG DISCARDABLE 0, 0, 167, 119 STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION -CAPTION "GpgOL - Extended Options" +CAPTION "GpgOL - Extended Options (debug only!)" FONT 8, "MS Sans Serif" BEGIN LTEXT "keyman", IDC_T_OPT_KEYMAN_PATH, Modified: trunk/src/ext-commands.cpp =================================================================== --- trunk/src/ext-commands.cpp 2007-11-08 08:13:59 UTC (rev 196) +++ trunk/src/ext-commands.cpp 2007-11-12 14:19:00 UTC (rev 197) @@ -64,7 +64,7 @@ -static void add_menu (LPEXCHEXTCALLBACK pEECB, +static void add_menu (LPEXCHEXTCALLBACK eecb, UINT FAR *pnCommandIDBase, ...) #if __GNUC__ >= 4 __attribute__ ((sentinel)) @@ -97,7 +97,9 @@ m_pExchExt = pParentInterface; m_lRef = 0; m_lContext = 0; - m_nCmdSelectSmime = 0; + m_nCmdProtoAuto = 0; + m_nCmdProtoPgpmime = 0; + m_nCmdProtoSmime = 0; m_nCmdEncrypt = 0; m_nCmdDecrypt = 0; m_nCmdSign = 0; @@ -144,20 +146,23 @@ /* Add a new menu. The variable entries are made up of pairs of - strings and UINT *. A NULL is used to terminate this list. An empty - string is translated to a separator menu item. */ + strings and UINT *. A NULL is used to terminate this list. An + empty string is translated to a separator menu item. One level of + submenus are supported. */ static void -add_menu (LPEXCHEXTCALLBACK pEECB, UINT FAR *pnCommandIDBase, ...) +add_menu (LPEXCHEXTCALLBACK eecb, UINT FAR *pnCommandIDBase, ...) { va_list arg_ptr; - HMENU menu; + HMENU mainmenu, submenu, menu; const char *string; UINT *cmdptr; va_start (arg_ptr, pnCommandIDBase); /* We put all new entries into the tools menu. To make this work we need to pass the id of an existing item from that menu. */ - pEECB->GetMenuPos (EECMDID_ToolsCustomizeToolbar, &menu, NULL, NULL, 0); + eecb->GetMenuPos (EECMDID_ToolsCustomizeToolbar, &mainmenu, NULL, NULL, 0); + menu = mainmenu; + submenu = NULL; while ( (string = va_arg (arg_ptr, const char *)) ) { cmdptr = va_arg (arg_ptr, UINT*); @@ -166,11 +171,23 @@ ; /* Ignore this entry. */ else if (*string == '@' && !string[1]) AppendMenu (menu, MF_SEPARATOR, 0, NULL); + else if (*string == '>') + { + submenu = CreatePopupMenu (); + AppendMenu (menu, MF_STRING|MF_POPUP, (UINT_PTR)submenu, string+1); + menu = submenu; + } + else if (*string == '<') + { + menu = mainmenu; + submenu = NULL; + } else { AppendMenu (menu, MF_STRING, *pnCommandIDBase, string); -// SetMenuItemBitmaps (menu, *pnCommandIDBase, MF_BYCOMMAND, -// my_uncheck_bitmap, my_check_bitmap); + if (menu == submenu) + SetMenuItemBitmaps (menu, *pnCommandIDBase, MF_BYCOMMAND, + my_uncheck_bitmap, my_check_bitmap); if (cmdptr) *cmdptr = *pnCommandIDBase; (*pnCommandIDBase)++; @@ -181,11 +198,13 @@ static void -check_menu (LPEXCHEXTCALLBACK pEECB, UINT menu_id, int checked) +check_menu (LPEXCHEXTCALLBACK eecb, UINT menu_id, int checked) { HMENU menu; - - pEECB->GetMenuPos (EECMDID_ToolsCustomizeToolbar, &menu, NULL, NULL, 0); + + 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); CheckMenuItem (menu, menu_id, MF_BYCOMMAND | (checked?MF_CHECKED:MF_UNCHECKED)); } @@ -255,7 +274,7 @@ S_FALSE to signal Exchange to continue calling extensions. */ STDMETHODIMP GpgolExtCommands::InstallCommands ( - LPEXCHEXTCALLBACK pEECB, // The Exchange Callback Interface. + LPEXCHEXTCALLBACK eecb, // The Exchange Callback Interface. HWND hWnd, // The window handle to the main window // of context. HMENU hMenu, // The menu handle to main menu of context. @@ -304,7 +323,7 @@ /* Note that for read and send the object returned by the outlook extension callback is of class 43 (MailItem) so we only need to ask for Body then. */ - hr = pEECB->GetObject (&mdb, (LPMAPIPROP *)&message); + hr = eecb->GetObject (&mdb, (LPMAPIPROP *)&message); if (FAILED(hr)) log_debug ("%s:%s: getObject failed: hr=%#lx\n", SRCNAME,__func__,hr); else if (!opt.compat.no_msgcache) @@ -314,7 +333,7 @@ size_t keylen = 0; void *refhandle = NULL; - pDisp = find_outlook_property (pEECB, "ConversationIndex", &dispid); + pDisp = find_outlook_property (eecb, "ConversationIndex", &dispid); if (pDisp) { DISPPARAMS dispparamsNoArgs = {NULL, NULL, 0, 0}; @@ -349,7 +368,7 @@ if (key && keylen && (body = msgcache_get (key, keylen, &refhandle)) - && (pDisp = find_outlook_property (pEECB, "Body", &dispid))) + && (pDisp = find_outlook_property (eecb, "Body", &dispid))) { #if 1 dispparams.cNamedArgs = 1; @@ -390,7 +409,7 @@ { int need_dvm = 0; - switch (m_pExchExt->getMsgtype (pEECB)) + switch (m_pExchExt->getMsgtype (eecb)) { case MSGTYPE_GPGOL_MULTIPART_ENCRYPTED: case MSGTYPE_GPGOL_OPAQUE_ENCRYPTED: @@ -403,15 +422,15 @@ /* We always enable the verify button as it might be useful on an already decrypted message. */ - add_menu (pEECB, pnCommandIDBase, + add_menu (eecb, pnCommandIDBase, "@", NULL, need_dvm? _("&Decrypt and verify message"):"", &m_nCmdDecrypt, _("&Verify signature"), &m_nCmdCheckSig, _("&Display crypto information"), &m_nCmdShowInfo, - "@", NULL, - "Debug-1 (open_inspector)", &m_nCmdDebug1, - "Debug-2 (n/a)", &m_nCmdDebug2, - NULL); + "@", NULL, + opt.enable_debug? "Debug-1 (open_inspector)":"", &m_nCmdDebug1, + opt.enable_debug? "Debug-2 (n/a)":"", &m_nCmdDebug2, + NULL); add_toolbar (pTBEArray, nTBECnt, _("Decrypt message and verify signature"), IDB_DECRYPT, m_nCmdDecrypt, @@ -419,9 +438,13 @@ } else if (m_lContext == EECONTEXT_SENDNOTEMESSAGE) { - add_menu (pEECB, pnCommandIDBase, + add_menu (eecb, pnCommandIDBase, "@", NULL, - opt.enable_smime? _("use S/MIME protocol"):"", &m_nCmdSelectSmime, + _(">GnuPG protocol"), NULL, + _("auto"), &m_nCmdProtoAuto, + _("OpenPGP"),&m_nCmdProtoPgpmime, + _("S/MIME"), &m_nCmdProtoSmime, + "<", NULL, _("&encrypt message with GnuPG"), &m_nCmdEncrypt, _("&sign message with GnuPG"), &m_nCmdSign, NULL ); @@ -431,15 +454,37 @@ _("Sign message with GnuPG"), IDB_SIGN, m_nCmdSign, NULL, 0, 0); - m_pExchExt->m_gpgSelectSmime = opt.enable_smime && opt.smime_default; + m_pExchExt->m_protoSelection = opt.default_protocol; + switch (opt.default_protocol) + { + case PROTOCOL_OPENPGP: + check_menu (eecb, m_nCmdProtoAuto, FALSE); + check_menu (eecb, m_nCmdProtoPgpmime, TRUE); + check_menu (eecb, m_nCmdProtoSmime, FALSE); + break; + case PROTOCOL_SMIME: + check_menu (eecb, m_nCmdProtoAuto, FALSE); + check_menu (eecb, m_nCmdProtoPgpmime, FALSE); + check_menu (eecb, m_nCmdProtoSmime, TRUE); + break; + default: + check_menu (eecb, m_nCmdProtoAuto, TRUE); + check_menu (eecb, m_nCmdProtoPgpmime, FALSE); + check_menu (eecb, m_nCmdProtoSmime, FALSE); + break; + } + m_pExchExt->m_gpgEncrypt = opt.encrypt_default; + m_pExchExt->m_gpgSign = opt.sign_default; if (force_encrypt) m_pExchExt->m_gpgEncrypt = true; + check_menu (eecb, m_nCmdEncrypt, m_pExchExt->m_gpgEncrypt); + check_menu (eecb, m_nCmdSign, m_pExchExt->m_gpgSign); } else if (m_lContext == EECONTEXT_VIEWER) { - add_menu (pEECB, pnCommandIDBase, + add_menu (eecb, pnCommandIDBase, "@", NULL, _("GnuPG Certificate &Manager"), &m_nCmdKeyManager, NULL); @@ -499,6 +544,7 @@ if (hr == S_OK) { log_debug ("%s:%s: invoking Close succeeded", SRCNAME,__func__); + message_wipe_body_cruft (eecb); return S_OK; /* We handled the close command. */ } @@ -506,6 +552,8 @@ SRCNAME, __func__, hr); } + message_wipe_body_cruft (eecb); + /* Closing on our own failed - pass it on. */ return S_FALSE; } @@ -563,11 +611,32 @@ ul_release (message); ul_release (mdb); } - else if (nCommandID == m_nCmdSelectSmime + else if (nCommandID == m_nCmdProtoAuto && m_lContext == EECONTEXT_SENDNOTEMESSAGE) { + check_menu (eecb, m_nCmdProtoAuto, TRUE); + check_menu (eecb, m_nCmdProtoPgpmime, FALSE); + check_menu (eecb, m_nCmdProtoSmime, FALSE); + m_pExchExt->m_protoSelection = PROTOCOL_UNKNOWN; + } + else if (nCommandID == m_nCmdProtoPgpmime + && m_lContext == EECONTEXT_SENDNOTEMESSAGE) + { + check_menu (eecb, m_nCmdProtoAuto, FALSE); + check_menu (eecb, m_nCmdProtoPgpmime, TRUE); + check_menu (eecb, m_nCmdProtoSmime, FALSE); + m_pExchExt->m_protoSelection = PROTOCOL_OPENPGP; + } + else if (nCommandID == m_nCmdProtoSmime + && m_lContext == EECONTEXT_SENDNOTEMESSAGE) + { if (opt.enable_smime) - m_pExchExt->m_gpgSelectSmime = !m_pExchExt->m_gpgSelectSmime; + { + check_menu (eecb, m_nCmdProtoAuto, FALSE); + check_menu (eecb, m_nCmdProtoPgpmime, FALSE); + check_menu (eecb, m_nCmdProtoSmime, TRUE); + m_pExchExt->m_protoSelection = PROTOCOL_SMIME; + } } else if (nCommandID == m_nCmdEncrypt && m_lContext == EECONTEXT_SENDNOTEMESSAGE) @@ -587,9 +656,9 @@ if (engine_start_keymanager ()) if (start_key_manager ()) MessageBox (NULL, _("Could not start certificate manager"), - "GpgOL", MB_ICONERROR|MB_OK); + _("GpgOL"), MB_ICONERROR|MB_OK); } - else if (nCommandID == m_nCmdDebug1 + else if (opt.enable_debug && nCommandID == m_nCmdDebug1 && m_lContext == EECONTEXT_READNOTEMESSAGE) { hr = eecb->GetObject (&mdb, (LPMAPIPROP *)&message); @@ -615,14 +684,6 @@ STDMETHODIMP_(VOID) GpgolExtCommands::InitMenu(LPEXCHEXTCALLBACK eecb) { - HRESULT hr; - HMENU menu; - - hr = eecb->GetMenu (&menu); - if (FAILED(hr)) - return; /* Ooops. */ - CheckMenuItem (menu, m_nCmdEncrypt, MF_BYCOMMAND - | (m_pExchExt->m_gpgSign?MF_CHECKED:MF_UNCHECKED)); } @@ -655,10 +716,24 @@ _("Check the signature now and display the result"), "GpgOL", MB_OK); } - else if (nCommandID == m_nCmdSelectSmime + else if (nCommandID == m_nCmdProtoAuto && m_lContext == EECONTEXT_SENDNOTEMESSAGE) { MessageBox (m_hWnd, + _("Select this option to automatically select the protocol."), + "GpgOL", MB_OK); + } + else if (nCommandID == m_nCmdProtoPgpmime + && m_lContext == EECONTEXT_SENDNOTEMESSAGE) + { + MessageBox (m_hWnd, + _("Select this option to select the OpenPGP protocol."), + "GpgOL", MB_OK); + } + else if (nCommandID == m_nCmdProtoSmime + && m_lContext == EECONTEXT_SENDNOTEMESSAGE) + { + MessageBox (m_hWnd, _("Select this option to select the S/MIME protocol."), "GpgOL", MB_OK); } @@ -731,7 +806,7 @@ _("Check the signature now and display the result"), nCharCnt); } - else if (nCommandID == m_nCmdSelectSmime + else if (nCommandID == m_nCmdProtoSmime && m_lContext == EECONTEXT_SENDNOTEMESSAGE) { if (lFlags == EECQHT_STATUS) @@ -822,12 +897,24 @@ if (m_pExchExt->m_gpgSign) pTBB->fsState |= TBSTATE_CHECKED; } - else if (tb_info->cmd_id == m_nCmdSelectSmime) + else if (tb_info->cmd_id == m_nCmdProtoAuto) { pTBB->fsStyle |= TBSTYLE_CHECK; - if (m_pExchExt->m_gpgSelectSmime) + if (m_pExchExt->m_protoSelection == PROTOCOL_UNKNOWN) pTBB->fsState |= TBSTATE_CHECKED; } + else if (tb_info->cmd_id == m_nCmdProtoPgpmime) + { + pTBB->fsStyle |= TBSTYLE_CHECK; + if (m_pExchExt->m_protoSelection == PROTOCOL_OPENPGP) + pTBB->fsState |= TBSTATE_CHECKED; + } + else if (tb_info->cmd_id == m_nCmdProtoSmime) + { + pTBB->fsStyle |= TBSTYLE_CHECK; + if (m_pExchExt->m_protoSelection == PROTOCOL_SMIME) + pTBB->fsState |= TBSTATE_CHECKED; + } return S_OK; } Modified: trunk/src/ext-commands.h =================================================================== --- trunk/src/ext-commands.h 2007-11-08 08:13:59 UTC (rev 196) +++ trunk/src/ext-commands.h 2007-11-12 14:19:00 UTC (rev 197) @@ -40,7 +40,9 @@ ULONG m_lRef; ULONG m_lContext; - UINT m_nCmdSelectSmime; + UINT m_nCmdProtoAuto; + UINT m_nCmdProtoPgpmime; + UINT m_nCmdProtoSmime; UINT m_nCmdEncrypt; UINT m_nCmdDecrypt; UINT m_nCmdSign; Modified: trunk/src/item-events.cpp =================================================================== --- trunk/src/item-events.cpp 2007-11-08 08:13:59 UTC (rev 196) +++ trunk/src/item-events.cpp 2007-11-12 14:19:00 UTC (rev 197) @@ -17,6 +17,8 @@ * along with this program; if not, see . */ +#error not used becuase it requires an ECF + #ifdef HAVE_CONFIG_H #include #endif Modified: trunk/src/main.c =================================================================== --- trunk/src/main.c 2007-11-08 08:13:59 UTC (rev 196) +++ trunk/src/main.c 2007-11-12 14:19:00 UTC (rev 197) @@ -44,6 +44,10 @@ initialized at startup. */ static char *the_session_key; +/* The session marker to identify this session. Its value is not + confidential. It is initialized at startup. */ +static char *the_session_marker; + /* Local function prototypes. */ static char *get_locale_dir (void); static void drop_locale_dir (char *locale_dir); @@ -102,10 +106,11 @@ } +/* Initialize the session key and the session marker. */ static int initialize_session_key (void) { - the_session_key = get_crypt_random (16+sizeof (unsigned int)); + the_session_key = get_crypt_random (16+sizeof (unsigned int)+8); if (the_session_key) { /* We use rand() in generate_boundary so we need to seed it. */ @@ -113,6 +118,9 @@ memcpy (&tmp, the_session_key+16, sizeof (unsigned int)); srand (tmp); + + /* And save the session marker. */ + the_session_marker = the_session_key + 16 + sizeof (unsigned int); } return !the_session_key; } @@ -185,6 +193,13 @@ } +const void * +get_64bit_session_marker (void) +{ + return the_session_marker; +} + + /* Return a new allocated IV of size NBYTES. Caller must free it. On error NULL is returned. */ void * @@ -330,6 +345,32 @@ } +static void +do_log_window_info (HWND window, int level) +{ + char buf[1024+1]; + char name[200]; + int nname; + char *pname; + + if (!window) + return; + + memset (buf, 0, sizeof (buf)); + GetWindowText (window, buf, sizeof (buf)-1); + nname = GetClassName (window, name, sizeof (name)-1); + if (nname) + pname = name; + else + pname = NULL; + if (level == -1) + log_debug (" parent=%p (%s) `%s'", window, pname? pname:"", buf); + else + log_debug (" %*shwnd=%p (%s) `%s'", level*2, "", window, + pname? pname:"", buf); +} + + /* Helper to log_window_hierarchy. */ static HWND do_log_window_hierarchy (HWND parent, int level) @@ -339,20 +380,7 @@ child = GetWindow (parent, GW_CHILD); while (child) { - char buf[1024+1]; - char name[200]; - int nname; - char *pname; - - memset (buf, 0, sizeof (buf)); - GetWindowText (child, buf, sizeof (buf)-1); - nname = GetClassName (child, name, sizeof (name)-1); - if (nname) - pname = name; - else - pname = NULL; - log_debug (" %*shwnd=%p (%s) `%s'", level*2, "", child, - pname? pname:"", buf); + do_log_window_info (child, level); do_log_window_hierarchy (child, level+1); child = GetNextWindow (child, GW_HWNDNEXT); } @@ -371,7 +399,11 @@ va_start (a, fmt); do_log (fmt, a, 0, 0, NULL, 0); va_end (a); - do_log_window_hierarchy (window, 0); + if (window) + { + do_log_window_info (window, -1); + do_log_window_hierarchy (window, 0); + } } @@ -473,14 +505,25 @@ void read_options (void) { + static int warnings_shown; char *val = NULL; + load_extension_value ("enableDebug", &val); + opt.enable_debug = val == NULL || *val != '1' ? 0 : 1; + xfree (val); val = NULL; + load_extension_value ("enableSmime", &val); opt.enable_smime = val == NULL || *val != '1' ? 0 : 1; xfree (val); val = NULL; - load_extension_value ("smimeDefault", &val); - opt.smime_default = val == NULL || *val != '1'? 0 : 1; + load_extension_value ("defaultProtocol", &val); + switch ((!val || *val == '0')? 0 : atol (val)) + { + case 1: opt.default_protocol = PROTOCOL_OPENPGP; break; + case 2: opt.default_protocol = PROTOCOL_SMIME; break; + case 0: + default: opt.default_protocol = PROTOCOL_UNKNOWN /*(auto*)*/; break; + } xfree (val); val = NULL; load_extension_value ("encryptDefault", &val); @@ -547,7 +590,27 @@ } log_debug ("Note: using compatibility flags: %s", val); } + + if (!warnings_shown) + { + char tmpbuf[512]; + + warnings_shown = 1; + if (val && *val) + { + snprintf (tmpbuf, sizeof tmpbuf, + _("Note: Using compatibility flags: %s"), val); + MessageBox (NULL, tmpbuf, _("GpgOL"), MB_ICONWARNING|MB_OK); + } + if (logfile && !opt.enable_debug) + { + snprintf (tmpbuf, sizeof tmpbuf, + _("Note: Writing debug logs to\n\n\"%s\""), logfile); + MessageBox (NULL, tmpbuf, _("GpgOL"), MB_ICONWARNING|MB_OK); + } + } xfree (val); val = NULL; + } @@ -562,10 +625,10 @@ int value; char *s_val; } table[] = { - {"smimeDefault", 0, opt.smime_default}, + {"enableSmime", 0, opt.enable_smime}, + {"defaultProtocol", 3, opt.default_protocol}, {"encryptDefault", 0, opt.encrypt_default}, {"signDefault", 0, opt.sign_default}, - {"enableSmime", 0, opt.enable_smime}, {"previewDecrypt", 0, opt.preview_decrypt}, {"storePasswdTime", 1, opt.passwd_ttl}, {"encodingFormat", 1, opt.enc_format}, @@ -594,6 +657,18 @@ rc = store_extension_value (table[i].name, table[i].s_val? table[i].s_val : ""); break; + case 3: + buf[0] = '0'; + buf[1] = 0; + switch (opt.default_protocol) + { + case PROTOCOL_UNKNOWN: buf[0] = '0'; /* auto */ break; + case PROTOCOL_OPENPGP: buf[0] = '1'; break; + case PROTOCOL_SMIME: buf[0] = '2'; break; + } + rc = store_extension_value (table[i].name, buf); + break; + default: rc = -1; break; Modified: trunk/src/mapihelp.cpp =================================================================== --- trunk/src/mapihelp.cpp 2007-11-08 08:13:59 UTC (rev 196) +++ trunk/src/mapihelp.cpp 2007-11-12 14:19:00 UTC (rev 197) @@ -153,7 +153,17 @@ return 0; } +/* Return the property tag for GpgOL Last Decrypted. */ +int +get_gpgollastdecrypted_tag (LPMESSAGE message, ULONG *r_tag) +{ + if (!(*r_tag = create_gpgol_tag (message, L"GpgOL Last Decrypted",__func__))) + return -1; + *r_tag |= PT_BINARY; + return 0; +} + /* Return the property tag for GpgOL MIME structure. */ int get_gpgolmimeinfo_tag (LPMESSAGE message, ULONG *r_tag) @@ -1547,6 +1557,57 @@ } +/* Returns True if MESSAGE has a GpgOL Last Decrypted property with any value. + This indicates that there sghould be no PR_BODY tag. */ +int +mapi_has_last_decrypted (LPMESSAGE message) +{ + HRESULT hr; + LPSPropValue propval = NULL; + ULONG tag; + int yes = 0; + + if (get_gpgollastdecrypted_tag (message, &tag) ) + return 0; /* No. */ + hr = HrGetOneProp ((LPMAPIPROP)message, tag, &propval); + if (FAILED (hr)) + return 0; /* No. */ + + if (PROP_TYPE (propval->ulPropTag) == PT_BINARY) + yes = 1; + + MAPIFreeBuffer (propval); + return yes; +} + + +/* Returns True if MESSAGE has a GpgOL Last Decrypted property and + that matches the curren sessiobn. */ +int +mapi_test_last_decrypted (LPMESSAGE message) +{ + HRESULT hr; + LPSPropValue propval = NULL; + ULONG tag; + int yes = 0; + + if (get_gpgollastdecrypted_tag (message, &tag) ) + return 0; /* No. */ + hr = HrGetOneProp ((LPMAPIPROP)message, tag, &propval); + if (FAILED (hr)) + return 0; /* No. */ + + if (PROP_TYPE (propval->ulPropTag) == PT_BINARY + && propval->Value.bin.cb == 8 + && !memcmp (propval->Value.bin.lpb, get_64bit_session_marker (), 8) ) + yes = 1; + + MAPIFreeBuffer (propval); + return yes; +} + + + /* Helper for mapi_get_gpgol_body_attachment. */ static int has_gpgol_body_name (LPATTACH obj) @@ -1682,4 +1743,3 @@ return body; } - Modified: trunk/src/mapihelp.h =================================================================== --- trunk/src/mapihelp.h 2007-11-08 08:13:59 UTC (rev 196) +++ trunk/src/mapihelp.h 2007-11-12 14:19:00 UTC (rev 197) @@ -85,7 +85,8 @@ int get_gpgolattachtype_tag (LPMESSAGE message, ULONG *r_tag); int get_gpgolsigstatus_tag (LPMESSAGE message, ULONG *r_tag); int get_gpgolprotectiv_tag (LPMESSAGE message, ULONG *r_tag); -int get_gpgolmimeinfo_tag (LPMESSAGE message, ULONG *r_tag); +int get_gpgollastdecrypted_tag (LPMESSAGE message, ULONG *r_tag); +int get_gpgolmimeinfo_tag (LPMESSAGE message, ULONG *r_tag); int mapi_set_header (LPMESSAGE msg, const char *name, const char *val); @@ -117,6 +118,8 @@ char *mapi_get_message_content_type (LPMESSAGE message, char **r_protocol, char **r_smtype); +int mapi_has_last_decrypted (LPMESSAGE message); +int mapi_test_last_decrypted (LPMESSAGE message); char *mapi_get_gpgol_body_attachment (LPMESSAGE message, size_t *r_nbytes, int *r_ishtml, int *r_protected); Modified: trunk/src/message-events.cpp =================================================================== --- trunk/src/message-events.cpp 2007-11-08 08:13:59 UTC (rev 196) +++ trunk/src/message-events.cpp 2007-11-12 14:19:00 UTC (rev 197) @@ -109,7 +109,7 @@ log_debug ("%s:%s: received\n", SRCNAME, __func__); m_wasencrypted = false; - if (opt.preview_decrypt) + if (1 /*opt.preview_decrypt*/) { eecb->GetObject (&mdb, (LPMAPIPROP *)&message); if (message_incoming_handler (message, m_pExchExt->getMsgtype (eecb))) @@ -270,9 +270,7 @@ HRESULT hr = eecb->GetObject (&pMDB, (LPMAPIPROP *)&msg); if (SUCCEEDED (hr)) { - protocol_t proto = (m_pExchExt->m_gpgSelectSmime - ? PROTOCOL_SMIME - : PROTOCOL_OPENPGP); + protocol_t proto = m_pExchExt->m_protoSelection; if (m_pExchExt->m_gpgEncrypt && m_pExchExt->m_gpgSign) rc = message_sign_encrypt (msg, proto, hWnd); Modified: trunk/src/message.cpp =================================================================== --- trunk/src/message.cpp 2007-11-08 08:13:59 UTC (rev 196) +++ trunk/src/message.cpp 2007-11-12 14:19:00 UTC (rev 197) @@ -119,12 +119,13 @@ hr = eecb->GetObject (&mdb, (LPMAPIPROP *)&message); if (SUCCEEDED (hr)) { - /* If the message was protected we don't allow a fallback to the - OOM display methods. */ + /* (old: If the message was protected we don't allow a fallback to the + OOM display methods.) Now: As it is difficult to find the + actual winodw we now use the OOM display always. */ body = mapi_get_gpgol_body_attachment (message, NULL, &ishtml, &wasprotected); if (body) - update_display (hwnd, wasprotected? NULL: eecb, ishtml, body); + update_display (hwnd, /*wasprotected? NULL:*/ eecb, ishtml, body); else update_display (hwnd, NULL, 0, _("[Crypto operation failed - " @@ -143,6 +144,66 @@ } +/* If the current message is an encrypted one remove the body + properties which might have come up due to OL internal + syncronization and a failing olDiscard feature. */ +void +message_wipe_body_cruft (LPEXCHEXTCALLBACK eecb) +{ + + HRESULT hr; + LPMESSAGE message = NULL; + LPMDB mdb = NULL; + + log_debug ("%s:%s: enter", SRCNAME, __func__); + hr = eecb->GetObject (&mdb, (LPMAPIPROP *)&message); + if (SUCCEEDED (hr)) + { + if (mapi_has_last_decrypted (message)) + { + SPropTagArray proparray; + int anyokay = 0; + + proparray.cValues = 1; + proparray.aulPropTag[0] = PR_BODY; + hr = message->DeleteProps (&proparray, NULL); + if (hr) + log_debug_w32 (hr, "%s:%s: deleting PR_BODY failed", + SRCNAME, __func__); + else + anyokay++; + + proparray.cValues = 1; + proparray.aulPropTag[0] = PR_BODY_HTML; + message->DeleteProps (&proparray, NULL); + if (hr) + log_debug_w32 (hr, "%s:%s: deleting PR_BODY_HTML failed", + SRCNAME, __func__); + else + anyokay++; + + if (anyokay) + { + hr = message->SaveChanges (KEEP_OPEN_READWRITE); + if (hr) + log_error_w32 (hr, "%s:%s: SaveChanges failed", + SRCNAME, __func__); + else + log_debug ("%s:%s: SaveChanges succeded; body cruft removed", + SRCNAME, __func__); + } + } + else + log_debug_w32 (hr, "%s:%s: error getting message", + SRCNAME, __func__); + + ul_release (message); + ul_release (mdb); + } +} + + + /* Display some information about MESSAGE. */ void message_show_info (LPMESSAGE message, HWND hwnd) @@ -476,9 +537,8 @@ /* Decrypt MESSAGE, check signature and update the attachments as required. MSGTYPE should be the type of the message so that the - function can decide what to do. With FORCE set the verification is - done regardlessless of a cached signature result - hmmm, should we - such a thing for an encrypted message? */ + function can decide what to do. With FORCE set the decryption is + done regardless whether it has already been done. */ int message_decrypt (LPMESSAGE message, msgtype_t msgtype, int force) { @@ -508,6 +568,10 @@ break; } + if (!force && mapi_test_last_decrypted (message)) + return 0; /* Already decrypted this message once during this + session. No need to do it again. */ + if (msgtype == MSGTYPE_GPGOL_PGP_MESSAGE) { /* PGP messages are special: All is contained in the body and thus Modified: trunk/src/message.h =================================================================== --- trunk/src/message.h 2007-11-08 08:13:59 UTC (rev 196) +++ trunk/src/message.h 2007-11-12 14:19:00 UTC (rev 197) @@ -23,6 +23,7 @@ bool message_incoming_handler (LPMESSAGE message, msgtype_t msgtype); bool message_display_handler (LPEXCHEXTCALLBACK eecb, HWND hwnd); +void message_wipe_body_cruft (LPEXCHEXTCALLBACK eecb); void message_show_info (LPMESSAGE message, HWND hwnd); Modified: trunk/src/mimeparser.c =================================================================== --- trunk/src/mimeparser.c 2007-11-08 08:13:59 UTC (rev 196) +++ trunk/src/mimeparser.c 2007-11-12 14:19:00 UTC (rev 197) @@ -559,12 +559,39 @@ static int -finish_message (LPMESSAGE message, gpg_error_t err, +finish_message (LPMESSAGE message, gpg_error_t err, int protect_mode, mimestruct_item_t mimestruct) { HRESULT hr; SPropValue prop; + /* If this was an encrypted message we save the session marker in a + specila property so that we now that we already decrypted that + message within this session. This is pretty useful when + scrolling through messages and preview decryption has been + enabled. */ + if (protect_mode) + { + char sesmrk[8]; + + if (get_gpgollastdecrypted_tag (message, &prop.ulPropTag) ) + return -1; + if (err) + memset (sesmrk, 0, 8); + else + memcpy (sesmrk, get_64bit_session_marker (), 8); + prop.Value.bin.cb = 8; + prop.Value.bin.lpb = sesmrk; + hr = IMessage_SetProps (message, 1, &prop, NULL); + if (hr) + { + log_error ("%s:%s: can't set %s property: hr=%#lx\n", + SRCNAME, __func__, "GpgOL Last Decrypted", hr); + return -1; + } + } + + /* Store the MIME structure away. */ if (get_gpgolmimeinfo_tag (message, &prop.ulPropTag) ) return -1; prop.Value.lpszA = build_mimeinfo (mimestruct); @@ -1077,7 +1104,7 @@ rfc822parse_close (ctx->msg); gpgme_data_release (ctx->signed_data); gpgme_data_release (ctx->sig_data); - finish_message (mapi_message, err, ctx->mimestruct); + finish_message (mapi_message, err, ctx->protect_mode, ctx->mimestruct); while (ctx->mimestruct) { mimestruct_item_t tmp = ctx->mimestruct->next; @@ -1193,7 +1220,7 @@ gpgme_data_release (ctx->signed_data); if (ctx->sig_data) gpgme_data_release (ctx->sig_data); - finish_message (mapi_message, err, ctx->mimestruct); + finish_message (mapi_message, err, ctx->protect_mode, ctx->mimestruct); while (ctx->mimestruct) { mimestruct_item_t tmp = ctx->mimestruct->next; Modified: trunk/src/olflange-dlgs.cpp =================================================================== --- trunk/src/olflange-dlgs.cpp 2007-11-08 08:13:59 UTC (rev 196) +++ trunk/src/olflange-dlgs.cpp 2007-11-12 14:19:00 UTC (rev 197) @@ -44,6 +44,7 @@ static struct { int itemid; const char *label; } labels[] = { { IDC_ENCRYPT_DEFAULT, N_("&Encrypt new messages by default")}, { IDC_SIGN_DEFAULT, N_("&Sign new messages by default")}, + { IDC_OPENPGP_DEFAULT, N_("Use OPENPGP by default")}, { IDC_SMIME_DEFAULT, N_("Use S/MIME by default")}, { IDC_ENABLE_SMIME, N_("Enable the S/MIME support")}, { IDC_ENCRYPT_WITH_STANDARD_KEY, @@ -75,6 +76,8 @@ BOOL bMsgResult = FALSE; static LPNMHDR pnmhdr; static HWND hWndPage; + static BOOL openpgp_state = FALSE; + static BOOL smime_state = FALSE; switch (uMsg) { @@ -106,6 +109,9 @@ /* ReleaseDC (hDlg, hdc); */ /* } */ + openpgp_state = opt.default_protocol = PROTOCOL_OPENPGP; + smime_state = opt.default_protocol = PROTOCOL_SMIME; + EnableWindow (GetDlgItem (hDlg, IDC_ENCRYPT_TO), !!opt.enable_default_key); EnableWindow (GetDlgItem (hDlg, IDC_SMIME_DEFAULT), @@ -113,6 +119,8 @@ if (opt.enable_default_key) CheckDlgButton (hDlg, IDC_ENCRYPT_WITH_STANDARD_KEY, BST_CHECKED); set_labels (hDlg); + ShowWindow (GetDlgItem (hDlg, IDC_GPG_OPTIONS), + opt.enable_debug? SW_SHOW : SW_HIDE); } return TRUE; @@ -153,6 +161,7 @@ case IDC_ENCRYPT_WITH_STANDARD_KEY: case IDC_PREFER_HTML: case IDC_SIGN_DEFAULT: + case IDC_OPENPGP_DEFAULT: case IDC_SMIME_DEFAULT: case IDC_PREVIEW_DECRYPT: case IDC_ENABLE_SMIME: @@ -174,7 +183,27 @@ EnableWindow (GetDlgItem (hDlg, IDC_SMIME_DEFAULT), opt.enable_smime); } - if (LOWORD (wParam) == IDC_GPG_OPTIONS) + if (HIWORD (wParam) == BN_CLICKED && + LOWORD (wParam) == IDC_OPENPGP_DEFAULT) + { + openpgp_state = !openpgp_state; + if (openpgp_state) + { + smime_state = 0; + SendDlgItemMessage (hDlg, IDC_SMIME_DEFAULT, BM_SETCHECK,0,0L); + } + } + if (HIWORD (wParam) == BN_CLICKED && + LOWORD (wParam) == IDC_SMIME_DEFAULT) + { + smime_state = !smime_state; + if (smime_state) + { + openpgp_state = 0; + SendDlgItemMessage (hDlg, IDC_OPENPGP_DEFAULT, BM_SETCHECK,0,0L); + } + } + if (opt.enable_debug && LOWORD (wParam) == IDC_GPG_OPTIONS) config_dialog_box (hDlg); break; @@ -189,7 +218,7 @@ TCHAR s[30]; if (opt.default_key && *opt.default_key) - SetDlgItemText (hDlg, IDC_ENCRYPT_TO, opt.default_key); + SetDlgItemText (hDlg, IDC_ENCRYPT_TO, opt.default_key); else SetDlgItemText (hDlg, IDC_ENCRYPT_TO, ""); wsprintf (s, "%d", opt.passwd_ttl/60); @@ -202,8 +231,10 @@ !!opt.sign_default, 0L); SendDlgItemMessage (hDlg, IDC_ENCRYPT_WITH_STANDARD_KEY, BM_SETCHECK, opt.enable_default_key, 0L); - SendDlgItemMessage (hDlg, IDC_SMIME_DEFAULT, BM_SETCHECK, - !!opt.smime_default, 0L); + SendDlgItemMessage (hDlg, IDC_OPENPGP_DEFAULT, BM_SETCHECK, + openpgp_state, 0L); + SendDlgItemMessage (hDlg, IDC_SMIME_DEFAULT, BM_SETCHECK, + smime_state, 0L); SendDlgItemMessage (hDlg, IDC_ENABLE_SMIME, BM_SETCHECK, !!opt.enable_smime, 0L); SendDlgItemMessage (hDlg, IDC_PREVIEW_DECRYPT, BM_SETCHECK, @@ -254,8 +285,14 @@ "provided when GpgOL arrives at production quality status."), "GpgOL", MB_ICONWARNING|MB_OK); } - opt.smime_default = !!SendDlgItemMessage - (hDlg, IDC_SMIME_DEFAULT, BM_GETCHECK, 0, 0L); + + if (openpgp_state) + opt.default_protocol = PROTOCOL_OPENPGP; + else if (smime_state && opt.enable_smime) + opt.default_protocol = PROTOCOL_SMIME; + else + opt.default_protocol = PROTOCOL_UNKNOWN; + opt.preview_decrypt = !!SendDlgItemMessage (hDlg, IDC_PREVIEW_DECRYPT, BM_GETCHECK, 0, 0L); opt.prefer_html = !!SendDlgItemMessage Modified: trunk/src/olflange.cpp =================================================================== --- trunk/src/olflange.cpp 2007-11-08 08:13:59 UTC (rev 196) +++ trunk/src/olflange.cpp 2007-11-12 14:19:00 UTC (rev 197) @@ -287,7 +287,7 @@ m_lRef = 1; m_lContext = 0; m_hWndExchange = 0; - m_gpgSelectSmime = FALSE; + m_protoSelection = PROTOCOL_UNKNOWN; m_gpgEncrypt = FALSE; m_gpgSign = FALSE; msgtype = MSGTYPE_UNKNOWN; @@ -299,19 +299,19 @@ m_pExchExtMessageEvents = new GpgolMessageEvents (this); m_pExchExtAttachedFileEvents = new GpgolAttachedFileEvents (this); m_pExchExtPropertySheets = new GpgolPropertySheets (this); - m_pOutlookExtItemEvents = new GpgolItemEvents (this); +// m_pOutlookExtItemEvents = new GpgolItemEvents (this); if (!m_pExchExtCommands || !m_pExchExtUserEvents || !m_pExchExtSessionEvents || !m_pExchExtMessageEvents || !m_pExchExtAttachedFileEvents || !m_pExchExtPropertySheets - || !m_pOutlookExtItemEvents) + /*|| !m_pOutlookExtItemEvents*/) out_of_core (); /* For this class we need to bump the reference counter intially. The question is why it works at all with the other stuff. */ - m_pOutlookExtItemEvents->AddRef (); +// m_pOutlookExtItemEvents->AddRef (); if (!g_initdll) { @@ -330,8 +330,8 @@ log_debug ("%s:%s: cleaning up GpgolExt object; context=%s\n", SRCNAME, __func__, ext_context_name (m_lContext)); - if (m_pOutlookExtItemEvents) - m_pOutlookExtItemEvents->Release (); +// if (m_pOutlookExtItemEvents) +// m_pOutlookExtItemEvents->Release (); if (m_lContext == EECONTEXT_SESSION) { @@ -394,10 +394,10 @@ return E_NOINTERFACE; *ppvObj = (LPUNKNOWN) m_pExchExtPropertySheets; } - else if (riid == IID_IOutlookExtItemEvents) - { - *ppvObj = (LPUNKNOWN)m_pOutlookExtItemEvents; - } +// else if (riid == IID_IOutlookExtItemEvents) +// { +// *ppvObj = (LPUNKNOWN)m_pOutlookExtItemEvents; +// } else hr = E_NOINTERFACE; Modified: trunk/src/olflange.h =================================================================== --- trunk/src/olflange.h 2007-11-08 08:13:59 UTC (rev 196) +++ trunk/src/olflange.h 2007-11-12 14:19:00 UTC (rev 197) @@ -39,7 +39,7 @@ HWND m_hWndExchange; /* Handle of the exchange window. */ /* Parameters for sending mails. */ - BOOL m_gpgSelectSmime; + protocol_t m_protoSelection; BOOL m_gpgEncrypt; BOOL m_gpgSign; Modified: trunk/src/util.h =================================================================== --- trunk/src/util.h 2007-11-08 08:13:59 UTC (rev 196) +++ trunk/src/util.h 2007-11-12 14:19:00 UTC (rev 197) @@ -69,6 +69,7 @@ /*-- main.c --*/ const void *get_128bit_session_key (void); +const void *get_64bit_session_marker (void); void *create_initialization_vector (size_t nbytes); void log_debug (const char *fmt, ...) __attribute__ ((format (printf,1,2))); From cvs at cvs.gnupg.org Mon Nov 12 15:29:43 2007 From: cvs at cvs.gnupg.org (svn author wk) Date: Mon, 12 Nov 2007 15:29:43 +0100 Subject: [svn] GpgOL - r198 - in trunk: . po src Message-ID: Author: wk Date: 2007-11-12 15:29:34 +0100 (Mon, 12 Nov 2007) New Revision: 198 Modified: trunk/ChangeLog trunk/NEWS trunk/configure.ac trunk/po/de.po trunk/po/sv.po trunk/src/engine.c trunk/src/ext-commands.cpp trunk/src/olflange-dlgs.cpp trunk/src/verify-dialog.c Log: s,OpenPGP,PGP/MIME,g Modified: trunk/ChangeLog =================================================================== --- trunk/ChangeLog 2007-11-12 14:19:00 UTC (rev 197) +++ trunk/ChangeLog 2007-11-12 14:29:34 UTC (rev 198) @@ -1,3 +1,7 @@ +2007-11-12 Werner Koch + + Released 0.10.2 development version. + 2007-10-22 Werner Koch Released 0.10.1 development version. Modified: trunk/NEWS =================================================================== --- trunk/NEWS 2007-11-12 14:19:00 UTC (rev 197) +++ trunk/NEWS 2007-11-12 14:29:34 UTC (rev 198) @@ -1,4 +1,4 @@ -Noteworthy changes for version 0.10.2 +Noteworthy changes for version 0.10.2 (2007-11-12) ================================================== UNDER HEAVY DEVELOPMENT - DO NOT USE FOR PRODUCTION! @@ -7,6 +7,7 @@ * New menu items to select the default protocol. + * Code cleanups. Noteworthy changes for version 0.10.1 (2007-10-22) ================================================== Modified: trunk/configure.ac =================================================================== --- trunk/configure.ac 2007-11-12 14:19:00 UTC (rev 197) +++ trunk/configure.ac 2007-11-12 14:29:34 UTC (rev 198) @@ -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.2]) -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/po/de.po =================================================================== --- trunk/po/de.po 2007-11-12 14:19:00 UTC (rev 197) +++ trunk/po/de.po 2007-11-12 14:29:34 UTC (rev 198) @@ -7,8 +7,8 @@ msgstr "" "Project-Id-Version: GpgOL 0.10.0\n" "Report-Msgid-Bugs-To: bug-gpgol at g10code.com\n" -"POT-Creation-Date: 2007-10-22 17:20+0200\n" -"PO-Revision-Date: 2007-10-22 17:21+0200\n" +"POT-Creation-Date: 2007-11-12 15:15+0100\n" +"PO-Revision-Date: 2007-11-12 15:14+0100\n" "Last-Translator: Werner Koch \n" "Language-Team: de\n" "MIME-Version: 1.0\n" @@ -61,7 +61,7 @@ "The user interface server is not available or does not work. Using an " "internal user interface.\n" "\n" -"This is limited to the OpenPGP protocol and thus S/MIME protected message " +"This is limited to the PGP/MIME protocol and thus S/MIME protected message " "are not readable." msgstr "" "Der Dienst f?r GpgOLs Benutzerschnittstelle ist nicht verf?gbar oder " @@ -70,7 +70,7 @@ "Diese ist allerdings sehr vereinfacht und kann z.B. keine S/MIME " "verschl?sselten Nachrichten entschl?sseln." -#: src/engine.c:367 +#: src/engine.c:367 src/ext-commands.cpp:659 src/main.c:603 src/main.c:609 msgid "GpgOL" msgstr "GpgOL" @@ -208,108 +208,146 @@ msgid "*** End Notation ***\n" msgstr "*** Ende Notation ***\n" -#: src/ext-commands.cpp:408 +#: src/ext-commands.cpp:427 msgid "&Decrypt and verify message" msgstr "Entschl?sseln/Pr?fen der Nachricht" -#: src/ext-commands.cpp:409 +#: src/ext-commands.cpp:428 msgid "&Verify signature" msgstr "&Unterschrift pr?fen" -#: src/ext-commands.cpp:410 +#: src/ext-commands.cpp:429 msgid "&Display crypto information" msgstr "~Krypto Informationen anzeigen" -#: src/ext-commands.cpp:417 src/ext-commands.cpp:713 +#: src/ext-commands.cpp:436 src/ext-commands.cpp:787 msgid "Decrypt message and verify signature" msgstr "Nachricht entschl?sseln und Unterschrift pr?fen" -#: src/ext-commands.cpp:424 -msgid "use S/MIME protocol" -msgstr "S/MIME verwenden" +#: src/ext-commands.cpp:443 +msgid ">GnuPG protocol" +msgstr ">GnuPG Protokoll" -#: src/ext-commands.cpp:425 +#: src/ext-commands.cpp:444 +msgid "auto" +msgstr "automatisch" + +#: src/ext-commands.cpp:445 +msgid "PGP/MIME" +msgstr "PGP/MIME" + +#: src/ext-commands.cpp:446 +msgid "S/MIME" +msgstr "S/MIME" + +#: src/ext-commands.cpp:448 msgid "&encrypt message with GnuPG" msgstr "Nachricht mit GnuPG verschl?sseln" -#: src/ext-commands.cpp:426 +#: src/ext-commands.cpp:449 msgid "&sign message with GnuPG" msgstr "Nachricht mit GnuPG unterschreiben" -#: src/ext-commands.cpp:430 +#: src/ext-commands.cpp:453 msgid "Encrypt message with GnuPG" msgstr "Nachricht mit GnuPG verschl?sseln" -#: src/ext-commands.cpp:431 +#: src/ext-commands.cpp:454 msgid "Sign message with GnuPG" msgstr "Nachricht mit GnuPG unterschreiben" -#: src/ext-commands.cpp:444 +#: src/ext-commands.cpp:489 msgid "GnuPG Certificate &Manager" msgstr "GnuPG Zertifikats&verwaltung" -#: src/ext-commands.cpp:448 +#: src/ext-commands.cpp:493 msgid "Open the certificate manager" msgstr "Die Zertifikatsverwaltung ?ffnen" -#: src/ext-commands.cpp:590 +#: src/ext-commands.cpp:658 msgid "Could not start certificate manager" msgstr "Die Zertifikatsverwaltung konnte nicht aufgerufen werden" -#: src/ext-commands.cpp:641 +#: src/ext-commands.cpp:701 msgid "Select this option to decrypt and verify the message." msgstr "" "W?hlen Sie diese Option um die Nachricht zu entschl?sseln bzw. zu " "verifizieren." -#: src/ext-commands.cpp:648 +#: src/ext-commands.cpp:708 msgid "Select this option to show information on the crypto status" msgstr "" "W?hlen Sie diese Option um Informationen ?ber den Krypto-Status der " "Nachricht anzuzeigen." -#: src/ext-commands.cpp:656 src/ext-commands.cpp:732 +#: src/ext-commands.cpp:716 src/ext-commands.cpp:806 msgid "Check the signature now and display the result" msgstr "Die digitale Unterschrift jetzt pr?fen und das Resultat anzeigen" -#: src/ext-commands.cpp:663 +#: src/ext-commands.cpp:723 +msgid "Select this option to automatically select the protocol." +msgstr "W?hlen Sie diese Option zum das Protokoll automatisch auszuw?hlen." + +#: src/ext-commands.cpp:730 +msgid "Select this option to select the PGP/MIME protocol." +msgstr "W?hlen Sie diese Option zum das PGP/MIME Protokoll auszuw?hlen." + +#: src/ext-commands.cpp:737 msgid "Select this option to select the S/MIME protocol." msgstr "W?hlen Sie diese Option zum das S/MIME Protokoll auszuw?hlen." -#: src/ext-commands.cpp:670 +#: src/ext-commands.cpp:744 msgid "Select this option to encrypt the message." msgstr "W?hlen Sie diese Option zum Verschl?sseln der Nachricht." -#: src/ext-commands.cpp:677 +#: src/ext-commands.cpp:751 msgid "Select this option to sign the message." msgstr "W?hlen Sie diese Option zum Unterschreiben der Nachricht." -#: src/ext-commands.cpp:684 +#: src/ext-commands.cpp:758 msgid "Select this option to open the certificate manager" msgstr "W?hlen Sie diese Option zum die Zertifikatsverwaltung zu ?ffenen." -#: src/ext-commands.cpp:722 +#: src/ext-commands.cpp:796 msgid "Show S/MIME status info" msgstr "S/MIME Status Informationen anzeigen" -#: src/ext-commands.cpp:742 +#: src/ext-commands.cpp:816 msgid "Use S/MIME for sign/encrypt" msgstr "S/MIME zum signieren/verschl?sseln verwenden" -#: src/ext-commands.cpp:752 +#: src/ext-commands.cpp:826 msgid "Encrypt message with GPG" msgstr "Nachricht mit GnuPG unterschreiben" -#: src/ext-commands.cpp:762 +#: src/ext-commands.cpp:836 msgid "Sign message with GPG" msgstr "Nachricht mit GnuPG unterschreiben" -#: src/ext-commands.cpp:772 +#: src/ext-commands.cpp:846 msgid "Open the GpgOL certificate manager" msgstr "Zertifikatsverwaltung von GpgOL ?ffnen" -#: src/mapihelp.cpp:1183 +#: src/main.c:602 +#, c-format +msgid "Note: Using compatibility flags: %s" +msgstr "Notiz: Diese Kompatibilit?tsflags werden verwendet: %s" + +#: src/main.c:608 +#, c-format msgid "" +"Note: Writing debug logs to\n" +"\n" +"\"%s\"" +msgstr "" +"Notiz: Debug-Logausgaben werden nach\n" +"\n" +"\"%s\"\n" +"\n" +"geschrieben." + +#: src/mapihelp.cpp:1193 +msgid "" "[The content of this message is not visible because it has been decrypted by " "another Outlook session. Use the \"decrypt/verify\" command to make it " "visible]" @@ -318,7 +356,7 @@ "Outlook Sitzung entschl?sselt wurde. Verwenden Sie den Men?punkt " "\"entschl?sseln/verifizieren\" um den Inhalt wieder sichtbar zu machen.]" -#: src/mapihelp.cpp:1678 +#: src/mapihelp.cpp:1739 msgid "" "[The content of this message is not visible due to an processing error in " "GpgOL.]" @@ -326,7 +364,7 @@ "[Aufgrund eines Verarbeitungsfehlers in GpgOL ist der Inhalt dieser " "Nachricht nicht sichtbar.]" -#: src/message-events.cpp:214 +#: src/message-events.cpp:215 msgid "" "Sorry, we can only encrypt plain text messages and\n" "no RTF messages. Please make sure that only the text\n" @@ -337,13 +375,13 @@ "Sie sicher, da? lediglich das Text Format ausgew?hlt wurde.\n" "(In der Men?leiste: \"Format\" => \"Nur Text\")" -#: src/message.cpp:130 +#: src/message.cpp:131 msgid "[Crypto operation failed - can't show the body of the message]" msgstr "" "[Krypto-Operation ist fehlgeschlagen - Der Text der Nachricht kann nicht " "angezeigt werden.]" -#: src/message.cpp:159 +#: src/message.cpp:220 #, c-format msgid "" "Message class: %s\n" @@ -356,29 +394,29 @@ "Struktur der Nachricht:\n" "%s" -#: src/message.cpp:167 +#: src/message.cpp:228 msgid "GpgOL - Message Information" msgstr "GpgOL - Informationen zu der Nachricht" -#: src/message.cpp:750 +#: src/message.cpp:814 msgid "No recipients to encrypt to are given" msgstr "Empf?nger zum Verschl?sseln wurde nicht angegeben" -#: src/message.cpp:766 +#: src/message.cpp:830 #, c-format msgid "Encryption failed (%s)" msgstr "Verschl?sselungsfehler (%s)" -#: src/message.cpp:787 +#: src/message.cpp:851 #, c-format msgid "Signing failed (%s)" msgstr "Unterschrifterstellungsfehler (%s)" -#: src/mimeparser.c:929 +#: src/mimeparser.c:956 msgid "Error writing to stream" msgstr "Dateischreibfehler" -#: src/mimeparser.c:930 +#: src/mimeparser.c:957 msgid "I/O-Error" msgstr "Ein-/Ausgabefehler" @@ -391,47 +429,51 @@ msgstr "Neue Nachrichten per Voreinstellung signieren" #: src/olflange-dlgs.cpp:47 +msgid "Use PGP/MIME by default" +msgstr "PGP/MIME per Voreinstellung verwenden" + +#: src/olflange-dlgs.cpp:48 msgid "Use S/MIME by default" msgstr "S/MIME per Voreinstellung verwenden" -#: src/olflange-dlgs.cpp:48 +#: src/olflange-dlgs.cpp:49 msgid "Enable the S/MIME support" msgstr "S/MIME Unterst?tzung einschalten" -#: src/olflange-dlgs.cpp:50 +#: src/olflange-dlgs.cpp:51 msgid "Also encrypt message with the default certificate" msgstr "Nachricht ebenfalls an das voreingestellte Zertifikat verschl?sseln" -#: src/olflange-dlgs.cpp:51 +#: src/olflange-dlgs.cpp:52 msgid "Also decrypt in preview window" msgstr "Auch im Vorschaufenster entschl?sseln" -#: src/olflange-dlgs.cpp:52 +#: src/olflange-dlgs.cpp:53 msgid "Show HTML view if possible" msgstr "HTML Darstellung anzeigen wenn m?glich" -#: src/olflange-dlgs.cpp:54 +#: src/olflange-dlgs.cpp:55 msgid "Passphrase" msgstr "Passphrase" -#: src/olflange-dlgs.cpp:55 +#: src/olflange-dlgs.cpp:56 msgid "Cache &passphrase for" msgstr "Passphrase speichern f?r" -#: src/olflange-dlgs.cpp:56 +#: src/olflange-dlgs.cpp:57 msgid "minutes" msgstr "Minuten" -#: src/olflange-dlgs.cpp:58 +#: src/olflange-dlgs.cpp:59 msgid "Ad&vanced.." msgstr "&Erweitert..." -#: src/olflange-dlgs.cpp:227 +#: src/olflange-dlgs.cpp:258 msgid "The default certificate may not contain any spaces." msgstr "" "Der Bezeichner f?r das Standardzertifikat darf keine Leerzeichen enthalten." -#: src/olflange-dlgs.cpp:249 +#: src/olflange-dlgs.cpp:280 msgid "" "You have enabled GpgOL's support for the S/MIME protocol.\n" "\n" @@ -450,11 +492,11 @@ "kann." #. TRANSLATORS: See the source for the full english text. -#: src/olflange-dlgs.cpp:292 +#: src/olflange-dlgs.cpp:329 msgid "-#GpgOLFullHelpText#-" msgstr "" "GpgOL ist ein Plugin f?r Microsoft Outlook, welches es erm?glicht\n" -"Nachrichten mittels der Internet-Standards OpenPGP oder S/MIME\n" +"Nachrichten mittels der Internet-Standards PGP/MIME oder S/MIME\n" "zu verschl?sseln und digital zu signieren. Im Hintergrund wird\n" "dazu die GnuPG Software () benutzt.\n" "Aktuelle Informationen zu GpgOL erhalten Sie durch eine Mausklick\n" @@ -475,7 +517,7 @@ "Public License erhalten haben. Falls nicht, finden Sie diese\n" "unter der Webadresse ." -#: src/olflange-dlgs.cpp:298 +#: src/olflange-dlgs.cpp:335 #, c-format msgid "This is GpgOL version %s" msgstr "Dies ist GpgOL Version %s" @@ -632,13 +674,16 @@ msgstr "auch bekannt als" #: src/verify-dialog.c:244 -msgid "OpenPGP Verification Result" -msgstr "OpenPGP Pr?fungsresultat" +msgid "PGP/MIME Verification Result" +msgstr "PGP/MIME Pr?fungsresultat" #: src/verify-dialog.c:247 msgid "S/MIME Verification Result" msgstr "S/MIME Pr?fungsresultat" +#~ msgid "use S/MIME protocol" +#~ msgstr "S/MIME verwenden" + #~ msgid "Use the S/MIME protocol" #~ msgstr "S/MIME Unterst?tzung einschalten" Modified: trunk/po/sv.po =================================================================== --- trunk/po/sv.po 2007-11-12 14:19:00 UTC (rev 197) +++ trunk/po/sv.po 2007-11-12 14:29:34 UTC (rev 198) @@ -7,7 +7,7 @@ msgstr "" "Project-Id-Version: GPGol\n" "Report-Msgid-Bugs-To: bug-gpgol at g10code.com\n" -"POT-Creation-Date: 2007-10-22 17:20+0200\n" +"POT-Creation-Date: 2007-11-12 15:15+0100\n" "PO-Revision-Date: 2006-12-12 23:52+0100\n" "Last-Translator: Daniel Nylander \n" "Language-Team: Swedish \n" @@ -61,11 +61,11 @@ "The user interface server is not available or does not work. Using an " "internal user interface.\n" "\n" -"This is limited to the OpenPGP protocol and thus S/MIME protected message " +"This is limited to the PGP/MIME protocol and thus S/MIME protected message " "are not readable." msgstr "" -#: src/engine.c:367 +#: src/engine.c:367 src/ext-commands.cpp:659 src/main.c:603 src/main.c:609 msgid "GpgOL" msgstr "" @@ -206,129 +206,165 @@ msgid "*** End Notation ***\n" msgstr "*** Notation slut ***\n" -#: src/ext-commands.cpp:408 +#: src/ext-commands.cpp:427 msgid "&Decrypt and verify message" msgstr "&Dekryptera och validera meddelandet" -#: src/ext-commands.cpp:409 +#: src/ext-commands.cpp:428 #, fuzzy msgid "&Verify signature" msgstr "FELAKTIG signatur!" -#: src/ext-commands.cpp:410 +#: src/ext-commands.cpp:429 msgid "&Display crypto information" msgstr "" -#: src/ext-commands.cpp:417 src/ext-commands.cpp:713 +#: src/ext-commands.cpp:436 src/ext-commands.cpp:787 msgid "Decrypt message and verify signature" msgstr "Dekryptera meddelandet och validera signaturen" -#: src/ext-commands.cpp:424 -msgid "use S/MIME protocol" +#: src/ext-commands.cpp:443 +msgid ">GnuPG protocol" msgstr "" -#: src/ext-commands.cpp:425 +#: src/ext-commands.cpp:444 +msgid "auto" +msgstr "" + +#: src/ext-commands.cpp:445 #, fuzzy +msgid "PGP/MIME" +msgstr "[PGP/MIME-meddelande]" + +#: src/ext-commands.cpp:446 +msgid "S/MIME" +msgstr "" + +#: src/ext-commands.cpp:448 +#, fuzzy msgid "&encrypt message with GnuPG" msgstr "Signera meddelandet med GPG" -#: src/ext-commands.cpp:426 +#: src/ext-commands.cpp:449 #, fuzzy msgid "&sign message with GnuPG" msgstr "Signera meddelandet med GPG" -#: src/ext-commands.cpp:430 +#: src/ext-commands.cpp:453 #, fuzzy msgid "Encrypt message with GnuPG" msgstr "Signera meddelandet med GPG" -#: src/ext-commands.cpp:431 +#: src/ext-commands.cpp:454 #, fuzzy msgid "Sign message with GnuPG" msgstr "Signera meddelandet med GPG" -#: src/ext-commands.cpp:444 +#: src/ext-commands.cpp:489 #, fuzzy msgid "GnuPG Certificate &Manager" msgstr "GPG-nyckel&hanterare" -#: src/ext-commands.cpp:448 +#: src/ext-commands.cpp:493 msgid "Open the certificate manager" msgstr "" -#: src/ext-commands.cpp:590 +#: src/ext-commands.cpp:658 #, fuzzy msgid "Could not start certificate manager" msgstr "Kunde inte starta nyckelhanteraren" -#: src/ext-commands.cpp:641 +#: src/ext-commands.cpp:701 #, fuzzy msgid "Select this option to decrypt and verify the message." msgstr "V?lj det h?r alternativet f?r att kryptera meddelandet." -#: src/ext-commands.cpp:648 +#: src/ext-commands.cpp:708 #, fuzzy msgid "Select this option to show information on the crypto status" msgstr "V?lj det h?r alternativet f?r att signera meddelandet." -#: src/ext-commands.cpp:656 src/ext-commands.cpp:732 +#: src/ext-commands.cpp:716 src/ext-commands.cpp:806 msgid "Check the signature now and display the result" msgstr "" -#: src/ext-commands.cpp:663 +#: src/ext-commands.cpp:723 #, fuzzy +msgid "Select this option to automatically select the protocol." +msgstr "V?lj det h?r alternativet f?r att kryptera meddelandet." + +#: src/ext-commands.cpp:730 +#, fuzzy +msgid "Select this option to select the PGP/MIME protocol." +msgstr "V?lj det h?r alternativet f?r att kryptera meddelandet." + +#: src/ext-commands.cpp:737 +#, fuzzy msgid "Select this option to select the S/MIME protocol." msgstr "V?lj det h?r alternativet f?r att kryptera meddelandet." -#: src/ext-commands.cpp:670 +#: src/ext-commands.cpp:744 msgid "Select this option to encrypt the message." msgstr "V?lj det h?r alternativet f?r att kryptera meddelandet." -#: src/ext-commands.cpp:677 +#: src/ext-commands.cpp:751 msgid "Select this option to sign the message." msgstr "V?lj det h?r alternativet f?r att signera meddelandet." -#: src/ext-commands.cpp:684 +#: src/ext-commands.cpp:758 #, fuzzy msgid "Select this option to open the certificate manager" msgstr "V?lj det h?r alternativet f?r att kryptera meddelandet." -#: src/ext-commands.cpp:722 +#: src/ext-commands.cpp:796 msgid "Show S/MIME status info" msgstr "" -#: src/ext-commands.cpp:742 +#: src/ext-commands.cpp:816 msgid "Use S/MIME for sign/encrypt" msgstr "" -#: src/ext-commands.cpp:752 +#: src/ext-commands.cpp:826 #, fuzzy msgid "Encrypt message with GPG" msgstr "Signera meddelandet med GPG" -#: src/ext-commands.cpp:762 +#: src/ext-commands.cpp:836 msgid "Sign message with GPG" msgstr "Signera meddelandet med GPG" -#: src/ext-commands.cpp:772 +#: src/ext-commands.cpp:846 msgid "Open the GpgOL certificate manager" msgstr "" -#: src/mapihelp.cpp:1183 +#: src/main.c:602 +#, c-format +msgid "Note: Using compatibility flags: %s" +msgstr "" + +#: src/main.c:608 +#, c-format msgid "" +"Note: Writing debug logs to\n" +"\n" +"\"%s\"" +msgstr "" + +#: src/mapihelp.cpp:1193 +msgid "" "[The content of this message is not visible because it has been decrypted by " "another Outlook session. Use the \"decrypt/verify\" command to make it " "visible]" msgstr "" -#: src/mapihelp.cpp:1678 +#: src/mapihelp.cpp:1739 msgid "" "[The content of this message is not visible due to an processing error in " "GpgOL.]" msgstr "" # A bit unclear in the original text -#: src/message-events.cpp:214 +#: src/message-events.cpp:215 msgid "" "Sorry, we can only encrypt plain text messages and\n" "no RTF messages. Please make sure that only the text\n" @@ -338,11 +374,11 @@ "och inte RTF-meddelanden. Se till att endast textformatet\n" "har valts i inst?llningarna." -#: src/message.cpp:130 +#: src/message.cpp:131 msgid "[Crypto operation failed - can't show the body of the message]" msgstr "" -#: src/message.cpp:159 +#: src/message.cpp:220 #, c-format msgid "" "Message class: %s\n" @@ -351,30 +387,30 @@ "%s" msgstr "" -#: src/message.cpp:167 +#: src/message.cpp:228 msgid "GpgOL - Message Information" msgstr "" -#: src/message.cpp:750 +#: src/message.cpp:814 msgid "No recipients to encrypt to are given" msgstr "" -#: src/message.cpp:766 +#: src/message.cpp:830 #, fuzzy, c-format msgid "Encryption failed (%s)" msgstr "Kryptering misslyckades" -#: src/message.cpp:787 +#: src/message.cpp:851 #, fuzzy, c-format msgid "Signing failed (%s)" msgstr "Signering misslyckades" -#: src/mimeparser.c:929 +#: src/mimeparser.c:956 #, fuzzy msgid "Error writing to stream" msgstr "Fel vid skrivning av fil" -#: src/mimeparser.c:930 +#: src/mimeparser.c:957 msgid "I/O-Error" msgstr "In-/Ut-fel" @@ -388,48 +424,52 @@ msgstr "" #: src/olflange-dlgs.cpp:47 +msgid "Use PGP/MIME by default" +msgstr "" + +#: src/olflange-dlgs.cpp:48 msgid "Use S/MIME by default" msgstr "" -#: src/olflange-dlgs.cpp:48 +#: src/olflange-dlgs.cpp:49 msgid "Enable the S/MIME support" msgstr "" -#: src/olflange-dlgs.cpp:50 +#: src/olflange-dlgs.cpp:51 #, fuzzy msgid "Also encrypt message with the default certificate" msgstr "Kryptera meddelandet med GPG" -#: src/olflange-dlgs.cpp:51 +#: src/olflange-dlgs.cpp:52 msgid "Also decrypt in preview window" msgstr "" -#: src/olflange-dlgs.cpp:52 +#: src/olflange-dlgs.cpp:53 msgid "Show HTML view if possible" msgstr "" -#: src/olflange-dlgs.cpp:54 +#: src/olflange-dlgs.cpp:55 msgid "Passphrase" msgstr "" -#: src/olflange-dlgs.cpp:55 +#: src/olflange-dlgs.cpp:56 msgid "Cache &passphrase for" msgstr "" -#: src/olflange-dlgs.cpp:56 +#: src/olflange-dlgs.cpp:57 msgid "minutes" msgstr "" -#: src/olflange-dlgs.cpp:58 +#: src/olflange-dlgs.cpp:59 msgid "Ad&vanced.." msgstr "" -#: src/olflange-dlgs.cpp:227 +#: src/olflange-dlgs.cpp:258 #, fuzzy msgid "The default certificate may not contain any spaces." msgstr "Standardnyckeln f?r inte inneh?lla n?gra blanksteg." -#: src/olflange-dlgs.cpp:249 +#: src/olflange-dlgs.cpp:280 msgid "" "You have enabled GpgOL's support for the S/MIME protocol.\n" "\n" @@ -440,11 +480,11 @@ msgstr "" #. TRANSLATORS: See the source for the full english text. -#: src/olflange-dlgs.cpp:292 +#: src/olflange-dlgs.cpp:329 msgid "-#GpgOLFullHelpText#-" msgstr "" -#: src/olflange-dlgs.cpp:298 +#: src/olflange-dlgs.cpp:335 #, c-format msgid "This is GpgOL version %s" msgstr "" @@ -608,7 +648,7 @@ #: src/verify-dialog.c:244 #, fuzzy -msgid "OpenPGP Verification Result" +msgid "PGP/MIME Verification Result" msgstr "Resultat fr?n validering" #: src/verify-dialog.c:247 @@ -616,6 +656,14 @@ msgid "S/MIME Verification Result" msgstr "Resultat fr?n validering" +#, fuzzy +#~ msgid "Select this option to select the OpenPGP protocol." +#~ msgstr "V?lj det h?r alternativet f?r att kryptera meddelandet." + +#, fuzzy +#~ msgid "OpenPGP Verification Result" +#~ msgstr "Resultat fr?n validering" + #~ msgid "No valid OpenPGP data found." #~ msgstr "Inget giltigt OpenPGP-data hittades." @@ -713,9 +761,6 @@ #~ msgid "Attachment Signing Failure" #~ msgstr "Signering av bilaga misslyckades" -#~ msgid "[PGP/MIME message]" -#~ msgstr "[PGP/MIME-meddelande]" - #~ msgid "[PGP/MIME message without plain text body]" #~ msgstr "[PGP/MIME-meddelande utan vanlig meddelandetext]" Modified: trunk/src/engine.c =================================================================== --- trunk/src/engine.c 2007-11-12 14:19:00 UTC (rev 197) +++ trunk/src/engine.c 2007-11-12 14:29:34 UTC (rev 198) @@ -362,7 +362,7 @@ MessageBox (NULL, _("The user interface server is not available or does " "not work. Using an internal user interface.\n\n" - "This is limited to the OpenPGP protocol and " + "This is limited to the PGP/MIME protocol and " "thus S/MIME protected message are not readable."), _("GpgOL"), MB_ICONWARNING|MB_OK); err = op_gpgme_init (); Modified: trunk/src/ext-commands.cpp =================================================================== --- trunk/src/ext-commands.cpp 2007-11-12 14:19:00 UTC (rev 197) +++ trunk/src/ext-commands.cpp 2007-11-12 14:29:34 UTC (rev 198) @@ -442,7 +442,7 @@ "@", NULL, _(">GnuPG protocol"), NULL, _("auto"), &m_nCmdProtoAuto, - _("OpenPGP"),&m_nCmdProtoPgpmime, + _("PGP/MIME"),&m_nCmdProtoPgpmime, _("S/MIME"), &m_nCmdProtoSmime, "<", NULL, _("&encrypt message with GnuPG"), &m_nCmdEncrypt, @@ -727,7 +727,7 @@ && m_lContext == EECONTEXT_SENDNOTEMESSAGE) { MessageBox (m_hWnd, - _("Select this option to select the OpenPGP protocol."), + _("Select this option to select the PGP/MIME protocol."), "GpgOL", MB_OK); } else if (nCommandID == m_nCmdProtoSmime Modified: trunk/src/olflange-dlgs.cpp =================================================================== --- trunk/src/olflange-dlgs.cpp 2007-11-12 14:19:00 UTC (rev 197) +++ trunk/src/olflange-dlgs.cpp 2007-11-12 14:29:34 UTC (rev 198) @@ -44,7 +44,7 @@ static struct { int itemid; const char *label; } labels[] = { { IDC_ENCRYPT_DEFAULT, N_("&Encrypt new messages by default")}, { IDC_SIGN_DEFAULT, N_("&Sign new messages by default")}, - { IDC_OPENPGP_DEFAULT, N_("Use OPENPGP by default")}, + { IDC_OPENPGP_DEFAULT, N_("Use PGP/MIME by default")}, { IDC_SMIME_DEFAULT, N_("Use S/MIME by default")}, { IDC_ENABLE_SMIME, N_("Enable the S/MIME support")}, { IDC_ENCRYPT_WITH_STANDARD_KEY, Modified: trunk/src/verify-dialog.c =================================================================== --- trunk/src/verify-dialog.c 2007-11-12 14:19:00 UTC (rev 197) +++ trunk/src/verify-dialog.c 2007-11-12 14:29:34 UTC (rev 198) @@ -241,7 +241,7 @@ switch (ctx->protocol) { case GPGME_PROTOCOL_OpenPGP: - s = _("OpenPGP Verification Result"); + s = _("PGP/MIME Verification Result"); break; case GPGME_PROTOCOL_CMS: s = _("S/MIME Verification Result"); From cvs at cvs.gnupg.org Mon Nov 12 15:32:53 2007 From: cvs at cvs.gnupg.org (svn author wk) Date: Mon, 12 Nov 2007 15:32:53 +0100 Subject: [svn] GpgOL - r199 - tags Message-ID: Author: wk Date: 2007-11-12 15:32:45 +0100 (Mon, 12 Nov 2007) New Revision: 199 Added: tags/gpgol-0.10.2/ Log: Devel release Copied: tags/gpgol-0.10.2 (from rev 198, trunk) From cvs at cvs.gnupg.org Mon Nov 12 15:36:54 2007 From: cvs at cvs.gnupg.org (svn author marcus) Date: Mon, 12 Nov 2007 15:36:54 +0100 Subject: [svn] assuan - r277 - trunk/src Message-ID: Author: marcus Date: 2007-11-12 15:36:45 +0100 (Mon, 12 Nov 2007) New Revision: 277 Modified: trunk/src/ChangeLog trunk/src/assuan-inquire.c Log: 2007-11-12 Marcus Brinkmann * assuan-inquire.c (_assuan_inquire_ext_cb): Clear CTX->inquire_membuf after deallocating it. Modified: trunk/src/ChangeLog =================================================================== --- trunk/src/ChangeLog 2007-10-18 14:41:51 UTC (rev 276) +++ trunk/src/ChangeLog 2007-11-12 14:36:45 UTC (rev 277) @@ -1,3 +1,8 @@ +2007-11-12 Marcus Brinkmann + + * assuan-inquire.c (_assuan_inquire_ext_cb): Clear + CTX->inquire_membuf after deallocating it. + 2007-10-18 Marcus Brinkmann * assuan-handler.c (std_handler_help): New function. Modified: trunk/src/assuan-inquire.c =================================================================== --- trunk/src/assuan-inquire.c 2007-10-18 14:41:51 UTC (rev 276) +++ trunk/src/assuan-inquire.c 2007-11-12 14:36:45 UTC (rev 277) @@ -321,6 +321,7 @@ rc = _assuan_error (ASSUAN_Out_Of_Core); free_membuf (mb); free (mb); + ctx->inquire_membuf = NULL; } ctx->in_inquire = 0; (ctx->inquire_cb) (ctx->inquire_cb_data, rc, buf, buf_len); From cvs at cvs.gnupg.org Mon Nov 12 16:52:11 2007 From: cvs at cvs.gnupg.org (svn author wk) Date: Mon, 12 Nov 2007 16:52:11 +0100 Subject: [svn] GnuPG - r4616 - in branches/STABLE-BRANCH-1-4: . doc g10 Message-ID: Author: wk Date: 2007-11-12 16:52:01 +0100 (Mon, 12 Nov 2007) New Revision: 4616 Modified: branches/STABLE-BRANCH-1-4/AUTHORS branches/STABLE-BRANCH-1-4/doc/faq.raw branches/STABLE-BRANCH-1-4/g10/ChangeLog branches/STABLE-BRANCH-1-4/g10/status.c Log: * status.c (do_get_from_fd, do_shm_get): s/bool/getbool/ to overcome problems with Mac OS 10.5 which seems to include stdbool.h silently. Modified: branches/STABLE-BRANCH-1-4/AUTHORS =================================================================== --- branches/STABLE-BRANCH-1-4/AUTHORS 2007-10-31 13:09:16 UTC (rev 4615) +++ branches/STABLE-BRANCH-1-4/AUTHORS 2007-11-12 15:52:01 UTC (rev 4616) @@ -2,6 +2,7 @@ Maintainer: Werner Koch Bug reports: Security related bug reports: +License: GPLv3+ Authors Modified: branches/STABLE-BRANCH-1-4/doc/faq.raw =================================================================== --- branches/STABLE-BRANCH-1-4/doc/faq.raw 2007-10-31 13:09:16 UTC (rev 4615) +++ branches/STABLE-BRANCH-1-4/doc/faq.raw 2007-11-12 15:52:01 UTC (rev 4616) @@ -1338,5 +1338,6 @@ [H hr] Copyright (C) 2000, 2001, 2002, 2003 Free Software Foundation, Inc., + Verbatim copying and distribution of this entire article is permitted in any medium, provided this notice is preserved. Modified: branches/STABLE-BRANCH-1-4/g10/ChangeLog =================================================================== --- branches/STABLE-BRANCH-1-4/g10/ChangeLog 2007-10-31 13:09:16 UTC (rev 4615) +++ branches/STABLE-BRANCH-1-4/g10/ChangeLog 2007-11-12 15:52:01 UTC (rev 4616) @@ -1,3 +1,9 @@ +2007-11-12 Werner Koch + + * status.c (do_get_from_fd, do_shm_get): s/bool/getbool/ to + overcome problems with Mac OS 10.5 which seems to include + stdbool.h silently. + 2007-10-27 David Shaw * parse-packet.c (parse_onepass_sig): Sigclass is hex, so include Modified: branches/STABLE-BRANCH-1-4/g10/status.c =================================================================== --- branches/STABLE-BRANCH-1-4/g10/status.c 2007-10-31 13:09:16 UTC (rev 4615) +++ branches/STABLE-BRANCH-1-4/g10/status.c 2007-11-12 15:52:01 UTC (rev 4616) @@ -468,10 +468,10 @@ /**************** * Request a string from client - * If bool, returns static string on true (do not free) or NULL for false + * If GETBOOL, returns static string on true (do not free) or NULL for false */ static char * -do_shm_get( const char *keyword, int hidden, int bool ) +do_shm_get( const char *keyword, int hidden, int getbool ) { size_t n; byte *p; @@ -485,7 +485,7 @@ shm_area[2] = 1; /* indicate that we are waiting on a reply */ shm_area[3] = 0; /* clear data available flag */ - write_status_text( bool? STATUS_SHM_GET_BOOL : + write_status_text( getbool? STATUS_SHM_GET_BOOL : hidden? STATUS_SHM_GET_HIDDEN : STATUS_SHM_GET, keyword ); do { @@ -500,7 +500,7 @@ if( n+32+2+1 > 4095 ) log_fatal("client returns too large data (%u bytes)\n", (unsigned)n ); - if( bool ) + if( getbool ) return p[0]? "" : NULL; string = hidden? xmalloc_secure( n+1 ) : xmalloc( n+1 ); @@ -543,10 +543,10 @@ /**************** * Request a string from the client over the command-fd - * If bool, returns static string on true (do not free) or NULL for false + * If getbool, returns static string on true (do not free) or NULL for false */ static char * -do_get_from_fd( const char *keyword, int hidden, int bool ) +do_get_from_fd( const char *keyword, int hidden, int getbool ) { int i, len; char *string; @@ -554,7 +554,7 @@ if(statusfp!=stdout) fflush(stdout); - write_status_text( bool? STATUS_GET_BOOL : + write_status_text( getbool? STATUS_GET_BOOL : hidden? STATUS_GET_HIDDEN : STATUS_GET_LINE, keyword ); for( string = NULL, i = len = 200; ; i++ ) { @@ -581,7 +581,7 @@ write_status( STATUS_GOT_IT ); - if( bool ) /* Fixme: is this correct??? */ + if( getbool ) /* Fixme: is this correct??? */ return (string[0] == 'Y' || string[0] == 'y') ? "" : NULL; return string; From cvs at cvs.gnupg.org Tue Nov 13 09:51:33 2007 From: cvs at cvs.gnupg.org (svn author wk) Date: Tue, 13 Nov 2007 09:51:33 +0100 Subject: [svn] gcry - r1269 - in trunk: . src Message-ID: Author: wk Date: 2007-11-13 09:51:23 +0100 (Tue, 13 Nov 2007) New Revision: 1269 Modified: trunk/THANKS trunk/src/ChangeLog trunk/src/gcrypt.h.in Log: Fixed malloc attribute detetection. Modified: trunk/THANKS =================================================================== --- trunk/THANKS 2007-10-31 10:48:01 UTC (rev 1268) +++ trunk/THANKS 2007-11-13 08:51:23 UTC (rev 1269) @@ -33,6 +33,7 @@ Felix von Leitner leitner at amdiv.de Frank Heckenbach heckenb at mi.uni-erlangen.de Frank Stajano frank.stajano at cl.cam.ac.uk +Gabriele Monti psicus78 gmail com Ga?l Qu?ri gqueri at mail.dotcom.fr Gregor Riepl seto-kun at freesurf.ch Gerlinde Klaes gk at u64.de Modified: trunk/src/ChangeLog =================================================================== --- trunk/src/ChangeLog 2007-10-31 10:48:01 UTC (rev 1268) +++ trunk/src/ChangeLog 2007-11-13 08:51:23 UTC (rev 1269) @@ -1,3 +1,8 @@ +2007-11-13 Werner Koch + + * gcrypt.h.in (_GCRY_GCC_ATTR_MALLOC): Fixed gcc version check. + Reported by Gabriele Monti. + 2007-10-31 Werner Koch * global.c (gcry_control): Factor most code out to .. Modified: trunk/src/gcrypt.h.in =================================================================== --- trunk/src/gcrypt.h.in 2007-10-31 10:48:01 UTC (rev 1268) +++ trunk/src/gcrypt.h.in 2007-11-13 08:51:23 UTC (rev 1269) @@ -83,7 +83,7 @@ #define _GCRY_GCC_ATTR_PURE __attribute__ ((__pure__)) #endif -#if _GCRY_GCC_VERSION >= 300200 +#if _GCRY_GCC_VERSION >= 30200 #define _GCRY_GCC_ATTR_MALLOC __attribute__ ((__malloc__)) #endif From cvs at cvs.gnupg.org Tue Nov 13 09:53:32 2007 From: cvs at cvs.gnupg.org (svn author wk) Date: Tue, 13 Nov 2007 09:53:32 +0100 Subject: [svn] gcry - r1270 - in branches/LIBGCRYPT-1-2-BRANCH: . cipher doc m4 mpi src Message-ID: Author: wk Date: 2007-11-13 09:53:21 +0100 (Tue, 13 Nov 2007) New Revision: 1270 Modified: branches/LIBGCRYPT-1-2-BRANCH/ChangeLog branches/LIBGCRYPT-1-2-BRANCH/cipher/ChangeLog branches/LIBGCRYPT-1-2-BRANCH/cipher/ac.c branches/LIBGCRYPT-1-2-BRANCH/cipher/md.c branches/LIBGCRYPT-1-2-BRANCH/configure.ac branches/LIBGCRYPT-1-2-BRANCH/doc/ChangeLog branches/LIBGCRYPT-1-2-BRANCH/doc/Makefile.am branches/LIBGCRYPT-1-2-BRANCH/doc/gcrypt.texi branches/LIBGCRYPT-1-2-BRANCH/m4/socklen.m4 branches/LIBGCRYPT-1-2-BRANCH/mpi/ChangeLog branches/LIBGCRYPT-1-2-BRANCH/mpi/mpi-bit.c branches/LIBGCRYPT-1-2-BRANCH/src/ChangeLog Log: Collected fixes. Modified: branches/LIBGCRYPT-1-2-BRANCH/ChangeLog =================================================================== --- branches/LIBGCRYPT-1-2-BRANCH/ChangeLog 2007-11-13 08:51:23 UTC (rev 1269) +++ branches/LIBGCRYPT-1-2-BRANCH/ChangeLog 2007-11-13 08:53:21 UTC (rev 1270) @@ -1,3 +1,7 @@ +2007-02-02 Werner Koch + + * configure.ac (FALLBACK_SOCKLEN_T): Special case for mingw32. + 2007-02-01 Werner Koch Released 1.2.4. Modified: branches/LIBGCRYPT-1-2-BRANCH/cipher/ChangeLog =================================================================== --- branches/LIBGCRYPT-1-2-BRANCH/cipher/ChangeLog 2007-11-13 08:51:23 UTC (rev 1269) +++ branches/LIBGCRYPT-1-2-BRANCH/cipher/ChangeLog 2007-11-13 08:53:21 UTC (rev 1270) @@ -1,3 +1,10 @@ +2007-02-04 Werner Koch + + * md.c (md_copy): Use cast for the string in md_start_debug. + + * ac.c (gcry_ac_data_copy_internal): Take care of strict aliasing + when calling _gcry_malloc. + 2007-02-01 Werner Koch * serpent.c: Add some missing struct element inits. Also for all Modified: branches/LIBGCRYPT-1-2-BRANCH/cipher/ac.c =================================================================== --- branches/LIBGCRYPT-1-2-BRANCH/cipher/ac.c 2007-11-13 08:51:23 UTC (rev 1269) +++ branches/LIBGCRYPT-1-2-BRANCH/cipher/ac.c 2007-11-13 08:53:21 UTC (rev 1270) @@ -137,9 +137,12 @@ data_new->data_n = data->data_n; if (! err) - /* Allocate space for named MPIs. */ - err = _gcry_malloc (sizeof (gcry_ac_mpi_t) * data->data_n, 0, - (void **) &data_new->data); + { + /* Allocate space for named MPIs. */ + err = _gcry_malloc (sizeof (gcry_ac_mpi_t) * data->data_n, 0, &p); + if (!err) + data_new->data = p; + } if (! err) { Modified: branches/LIBGCRYPT-1-2-BRANCH/cipher/md.c =================================================================== --- branches/LIBGCRYPT-1-2-BRANCH/cipher/md.c 2007-11-13 08:51:23 UTC (rev 1269) +++ branches/LIBGCRYPT-1-2-BRANCH/cipher/md.c 2007-11-13 08:53:21 UTC (rev 1270) @@ -131,7 +131,7 @@ static int md_get_algo( gcry_md_hd_t a ); static int md_digest_length( int algo ); static const byte *md_asn_oid( int algo, size_t *asnlen, size_t *mdlen ); -static void md_start_debug( gcry_md_hd_t a, char *suffix ); +static void md_start_debug ( gcry_md_hd_t a, char *suffix ); static void md_stop_debug( gcry_md_hd_t a ); @@ -623,8 +623,11 @@ ath_mutex_unlock (&digests_registered_lock); } + /* (The cast is required to silent the gcc warning. md_start-debug + should actually take a const string but that may conflict wity + gcry_md_ctl.) */ if (a->debug) - md_start_debug (bhd, "unknown"); + md_start_debug (bhd, (char*)"unknown"); if (! err) *b_hd = bhd; @@ -1113,7 +1116,7 @@ static void -md_start_debug( gcry_md_hd_t md, char *suffix ) +md_start_debug ( gcry_md_hd_t md, char *suffix ) { static int idx=0; char buf[50]; Modified: branches/LIBGCRYPT-1-2-BRANCH/configure.ac =================================================================== --- branches/LIBGCRYPT-1-2-BRANCH/configure.ac 2007-11-13 08:51:23 UTC (rev 1269) +++ branches/LIBGCRYPT-1-2-BRANCH/configure.ac 2007-11-13 08:53:21 UTC (rev 1270) @@ -39,6 +39,8 @@ # (Interfaces removed: CURRENT++, AGE=0, REVISION=0) # (Interfaces added: CURRENT++, AGE++, REVISION=0) # (No interfaces changed: REVISION++) +# WARNING: This is the stable branch: Never change any interface; thus +# only bump up revision. LIBGCRYPT_LT_CURRENT=13 LIBGCRYPT_LT_AGE=2 LIBGCRYPT_LT_REVISION=3 @@ -479,12 +481,21 @@ GNUPG_CHECK_TYPEDEF(u16, HAVE_U16_TYPEDEF) GNUPG_CHECK_TYPEDEF(u32, HAVE_U32_TYPEDEF) + gl_TYPE_SOCKLEN_T -if test ".$gl_cv_socklen_t_equiv" = "."; then - FALLBACK_SOCKLEN_T="typedef socklen_t gcry_socklen_t;" -else - FALLBACK_SOCKLEN_T="typedef ${gl_cv_socklen_t_equiv} gcry_socklen_t;" -fi +case "${host}" in + *-*-mingw32*) + # socklen_t may or may not be defined depending on what headers + # are included. To be safe we use int as this is the actual type. + FALLBACK_SOCKLEN_T="typedef int gcry_socklen_t;" + ;; + *) + if test ".$gl_cv_socklen_t_equiv" = "."; then + FALLBACK_SOCKLEN_T="typedef socklen_t gcry_socklen_t;" + else + FALLBACK_SOCKLEN_T="typedef ${gl_cv_socklen_t_equiv} gcry_socklen_t;" + fi +esac AC_SUBST(FALLBACK_SOCKLEN_T) @@ -635,8 +646,8 @@ test "$more_gcc_warnings" = "yes"; then CFLAGS="$CFLAGS -Wall -Wcast-align -Wshadow -Wstrict-prototypes" if test "$more_gcc_warnings" = "yes"; then - CFLAGS="$CFLAGS -W -Wpointer-arith -Wbad-function-cast" - CFLAGS="$CFLAGS -Wwrite-strings -Wunreachable-code" + CFLAGS="$CFLAGS -Wpointer-arith -Wbad-function-cast" + CFLAGS="$CFLAGS -Wwrite-strings" CFLAGS="$CFLAGS -Wno-sign-compare" fi else Modified: branches/LIBGCRYPT-1-2-BRANCH/doc/ChangeLog =================================================================== --- branches/LIBGCRYPT-1-2-BRANCH/doc/ChangeLog 2007-11-13 08:51:23 UTC (rev 1269) +++ branches/LIBGCRYPT-1-2-BRANCH/doc/ChangeLog 2007-11-13 08:53:21 UTC (rev 1270) @@ -1,3 +1,9 @@ +2007-02-22 Werner Koch + + * gcrypt.texi: For HTML move the content section behind tghe menu. + + * Makefile.am (online): New target. + 2006-11-03 Werner Koch * gcrypt.texi (Available ciphers): Fixed typo. Modified: branches/LIBGCRYPT-1-2-BRANCH/doc/Makefile.am =================================================================== --- branches/LIBGCRYPT-1-2-BRANCH/doc/Makefile.am 2007-11-13 08:51:23 UTC (rev 1269) +++ branches/LIBGCRYPT-1-2-BRANCH/doc/Makefile.am 2007-11-13 08:53:21 UTC (rev 1270) @@ -22,3 +22,13 @@ info_TEXINFOS = gcrypt.texi gcrypt_TEXINFOS = lgpl.texi gpl.texi + +online: gcrypt.html gcrypt.pdf gcrypt.info + set -e; \ + echo "Uploading current manuals to www.gnupg.org ..."; \ + user=werner ; dir="webspace/manuals/gcrypt/" ; \ + (cd gcrypt.html && rsync -vr --exclude='.svn' . \ + $${user}@cvs.gnupg.org:$${dir} ); \ + rsync -v gcrypt.pdf gcrypt.info $${user}@cvs.gnupg.org:$${dir} + + Modified: branches/LIBGCRYPT-1-2-BRANCH/doc/gcrypt.texi =================================================================== --- branches/LIBGCRYPT-1-2-BRANCH/doc/gcrypt.texi 2007-11-13 08:51:23 UTC (rev 1269) +++ branches/LIBGCRYPT-1-2-BRANCH/doc/gcrypt.texi 2007-11-13 08:53:21 UTC (rev 1270) @@ -46,10 +46,11 @@ @insertcopying @end titlepage - + at ifnothtml @summarycontents @contents @page + at end ifnothtml @ifnottex @@ -162,6 +163,11 @@ @end menu + at ifhtml + at page + at summarycontents + at contents + at end ifhtml @c ********************************************************** Modified: branches/LIBGCRYPT-1-2-BRANCH/m4/socklen.m4 =================================================================== --- branches/LIBGCRYPT-1-2-BRANCH/m4/socklen.m4 2007-11-13 08:51:23 UTC (rev 1269) +++ branches/LIBGCRYPT-1-2-BRANCH/m4/socklen.m4 2007-11-13 08:53:21 UTC (rev 1270) @@ -19,7 +19,7 @@ [AC_REQUIRE([gl_HEADER_SYS_SOCKET])dnl AC_CHECK_TYPE([socklen_t], , [AC_MSG_CHECKING([for socklen_t equivalent]) - AC_CACHE_VAL([gl_cv_gl_cv_socklen_t_equiv], + AC_CACHE_VAL([gl_cv_socklen_t_equiv], [# Systems have either "struct sockaddr *" or # "void *" as the second argument to getpeername gl_cv_socklen_t_equiv= Modified: branches/LIBGCRYPT-1-2-BRANCH/mpi/ChangeLog =================================================================== --- branches/LIBGCRYPT-1-2-BRANCH/mpi/ChangeLog 2007-11-13 08:51:23 UTC (rev 1269) +++ branches/LIBGCRYPT-1-2-BRANCH/mpi/ChangeLog 2007-11-13 08:53:21 UTC (rev 1270) @@ -1,3 +1,7 @@ +2007-03-23 Werner Koch + + * mpi-bit.c (_gcry_mpi_lshift_limbs): Assign AP after the resize. + 2007-02-02 Werner Koch * config.links (mpi_optional_modules): Make sure that powerpc64 is Modified: branches/LIBGCRYPT-1-2-BRANCH/mpi/mpi-bit.c =================================================================== --- branches/LIBGCRYPT-1-2-BRANCH/mpi/mpi-bit.c 2007-11-13 08:51:23 UTC (rev 1269) +++ branches/LIBGCRYPT-1-2-BRANCH/mpi/mpi-bit.c 2007-11-13 08:53:21 UTC (rev 1270) @@ -276,7 +276,7 @@ void _gcry_mpi_lshift_limbs( gcry_mpi_t a, unsigned int count ) { - mpi_ptr_t ap = a->d; + mpi_ptr_t ap; int n = a->nlimbs; int i; @@ -285,6 +285,7 @@ RESIZE_IF_NEEDED( a, n+count ); + ap = a->d; for( i = n-1; i >= 0; i-- ) ap[i+count] = ap[i]; for(i=0; i < count; i++ ) Modified: branches/LIBGCRYPT-1-2-BRANCH/src/ChangeLog =================================================================== --- branches/LIBGCRYPT-1-2-BRANCH/src/ChangeLog 2007-11-13 08:51:23 UTC (rev 1269) +++ branches/LIBGCRYPT-1-2-BRANCH/src/ChangeLog 2007-11-13 08:53:21 UTC (rev 1270) @@ -1,3 +1,8 @@ +2007-11-13 Werner Koch + + * gcrypt.h (_GCRY_GCC_ATTR_MALLOC): Fixed gcc version check. + Reported by Gabriele Monti. + 2007-02-12 Werner Koch * gcrypt.h.in: Include stdlib.h for the sake fo the trheading From cvs at cvs.gnupg.org Tue Nov 13 10:09:26 2007 From: cvs at cvs.gnupg.org (svn author wk) Date: Tue, 13 Nov 2007 10:09:26 +0100 Subject: [svn] GpgOL - r200 - trunk/src Message-ID: Author: wk Date: 2007-11-13 10:09:17 +0100 (Tue, 13 Nov 2007) New Revision: 200 Modified: trunk/src/engine-assuan.c Log: Fixed prep_encrypt Modified: trunk/src/engine-assuan.c =================================================================== --- trunk/src/engine-assuan.c 2007-11-12 14:32:45 UTC (rev 199) +++ trunk/src/engine-assuan.c 2007-11-13 09:09:17 UTC (rev 200) @@ -1291,9 +1291,9 @@ { for (line += 8; *line == ' '; line++) ; - if (strncmp (line, "OpenPGP", 7) && (line[7]==' '||!line[7])) + if (!strncmp (line, "OpenPGP", 7) && (line[7]==' '||!line[7])) *protocol = PROTOCOL_OPENPGP; - else if (strncmp (line, "CMS", 3) && (line[3]==' '||!line[3])) + else if (!strncmp (line, "CMS", 3) && (line[3]==' '||!line[3])) *protocol = PROTOCOL_SMIME; } return 0; From cvs at cvs.gnupg.org Wed Nov 14 20:07:53 2007 From: cvs at cvs.gnupg.org (svn author wk) Date: Wed, 14 Nov 2007 20:07:53 +0100 Subject: [svn] dirmngr - r274 - in trunk: . doc src Message-ID: Author: wk Date: 2007-11-14 20:07:43 +0100 (Wed, 14 Nov 2007) New Revision: 274 Modified: trunk/NEWS trunk/TODO trunk/doc/dirmngr.texi trunk/src/ChangeLog trunk/src/crlcache.c trunk/src/crlfetch.c trunk/src/crlfetch.h trunk/src/dirmngr-client.c trunk/src/server.c Log: Add --url option Modified: trunk/NEWS =================================================================== --- trunk/NEWS 2007-10-24 21:01:17 UTC (rev 273) +++ trunk/NEWS 2007-11-14 19:07:43 UTC (rev 274) @@ -1,7 +1,9 @@ Noteworthy changes in version 1.0.2 ------------------------------------------------ + * New option --url for the LOOKUP command and dirmngr-client. + Noteworthy changes in version 1.0.1 (2007-08-16) ------------------------------------------------ Modified: trunk/TODO =================================================================== --- trunk/TODO 2007-10-24 21:01:17 UTC (rev 273) +++ trunk/TODO 2007-11-14 19:07:43 UTC (rev 274) @@ -25,3 +25,7 @@ * Test OCSP responder redirection. We need to figure out an OCSP responder actually using redirection. +* Restrict validtroot certificates + For some purposes (e.g. Poldi) it might make sense to allow the + caller to restrict what root certificates are to be used for the + chain validation. Modified: trunk/doc/dirmngr.texi =================================================================== --- trunk/doc/dirmngr.texi 2007-10-24 21:01:17 UTC (rev 273) +++ trunk/doc/dirmngr.texi 2007-11-14 19:07:43 UTC (rev 274) @@ -679,7 +679,16 @@ To indicate that the output was truncated to N items due to a limitation of the server or by an arbitrary set limit. +The option @option{--url} may be used if instaead of a search pattern a +completeURL to the certificate is known: + at example + C: LOOKUP --url CN%3DWerner%20Koch,o%3DIntevation%20GmbH,c%3DDE?userCertificate + at end example + + + + @node Dirmngr ISVALID @section Validate a certificate using a CRL or OCSP @@ -979,6 +988,10 @@ may be used to retrieve certificates from a server. However the output format is not very well suited if more than one certificate is returned. + at item --url + at opindex url +Modify the @command{lookup} command to take an URL and not a pattern. + @item --squid-mode @opindex squid-mode Run @sc{dirmngr-client} in a mode suitable as a helper program for Modified: trunk/src/ChangeLog =================================================================== --- trunk/src/ChangeLog 2007-10-24 21:01:17 UTC (rev 273) +++ trunk/src/ChangeLog 2007-11-14 19:07:43 UTC (rev 274) @@ -1,3 +1,39 @@ +2007-11-14 Werner Koch + + * dirmngr-client.c: Replace --lookup-url by --url. + (main): Remove extra code for --lookup-url. + (do_lookup): Remove LOOKUP_URL arg and use the + global option OPT.URL. + + * server.c (has_leading_option): New. + (cmd_lookup): Use it. + + * crlfetch.c (fetch_cert_by_url): Use GPG_ERR_INV_CERT_OBJ. + (fetch_cert_by_url): Use gpg_error_from_syserror. + +2007-11-14 Moritz (wk) + + * dirmngr-client.c: New command: --lookup-url . + (do_lookup): New parameter: lookup_url. If TRUE, include "--url" + switch in LOOKUP transaction. + (enum): New entry: oLookupUrl. + (opts): Likewise. + (main): Handle oLookupUrl. New variable: cmd_lookup_url, set + during option parsing, pass to do_lookup() and substitute some + occurences of "cmd_lookup" with "cmd_lookup OR cmd_lookup_url". + * crlfetch.c (fetch_cert_by_url): New function, uses + url_fetch_ldap() to create a reader object and libksba functions + to read a single cert from that reader. + * server.c (lookup_cert_by_url, lookup_cert_by_pattern): New + functions. + (cmd_lookup): Moved almost complete code ... + (lookup_cert_by_pattern): ... here. + (cmd_lookup): Support new optional argument: --url. Depending on + the presence of that switch, call lookup_cert_by_url() or + lookup_cert_by_pattern(). + (lookup_cert_by_url): Heavily stripped down version of + lookup_cert_by_pattern(), using fetch_cert_by_url. + 2007-10-24 Marcus Brinkmann * exechelp.c (dirmngr_spawn_process): Fix child handles. Modified: trunk/src/crlcache.c =================================================================== --- trunk/src/crlcache.c 2007-10-24 21:01:17 UTC (rev 273) +++ trunk/src/crlcache.c 2007-11-14 19:07:43 UTC (rev 274) @@ -123,6 +123,7 @@ static const char oidstr_crlNumber[] = "2.5.29.20"; +static const char oidstr_issuingDistributionPoint[] = "2.5.29.28"; static const char oidstr_authorityKeyIdentifier[] = "2.5.29.35"; Modified: trunk/src/crlfetch.c =================================================================== --- trunk/src/crlfetch.c 2007-10-24 21:01:17 UTC (rev 273) +++ trunk/src/crlfetch.c 2007-11-14 19:07:43 UTC (rev 274) @@ -1,6 +1,6 @@ /* crlfetch.c - LDAP access * Copyright (C) 2002 Klar?lvdalens Datakonsult AB - * Copyright (C) 2003, 2004, 2005, 2006 g10 Code GmbH + * Copyright (C) 2003, 2004, 2005, 2006, 2007 g10 Code GmbH * * This file is part of DirMngr. * @@ -13,11 +13,9 @@ * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - * + * * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA - * 02110-1301, USA. + * along with this program; if not, see . */ #include @@ -273,6 +271,7 @@ return start_cert_fetch_ldap (ctrl, context, patterns, server); } + gpg_error_t fetch_next_cert (cert_fetch_context_t context, unsigned char **value, size_t * valuelen) @@ -325,6 +324,60 @@ } +/* Lookup a cert by it's URL. */ +gpg_error_t +fetch_cert_by_url (ctrl_t ctrl, const char *url, + unsigned char **value, size_t *valuelen) +{ + const unsigned char *cert_image; + size_t cert_image_n; + ksba_reader_t reader; + ksba_cert_t cert; + gpg_error_t err; + + *value = NULL; + *valuelen = 0; + cert_image = NULL; + reader = NULL; + cert = NULL; + + err = url_fetch_ldap (ctrl, url, NULL, 0, &reader); + if (err) + goto leave; + + err = ksba_cert_new (&cert); + if (err) + goto leave; + + err = ksba_cert_read_der (cert, reader); + if (err) + goto leave; + + cert_image = ksba_cert_get_image (cert, &cert_image_n); + if (!cert_image || !cert_image_n) + { + err = gpg_error (GPG_ERR_INV_CERT_OBJ); + goto leave; + } + + *value = xtrymalloc (cert_image_n); + if (!*value) + { + err = gpg_error_from_syserror (); + goto leave; + } + + memcpy (*value, cert_image, cert_image_n); + *valuelen = cert_image_n; + + leave: + + ksba_cert_release (cert); + ldap_wrapper_release_context (reader); + + return err; +} + /* This function is to be used to close the reader object. In addition to running ksba_reader_release it also releases the LDAP or HTTP contexts associated with that reader. */ Modified: trunk/src/crlfetch.h =================================================================== --- trunk/src/crlfetch.h 2007-10-24 21:01:17 UTC (rev 273) +++ trunk/src/crlfetch.h 2007-11-14 19:07:43 UTC (rev 274) @@ -14,8 +14,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA + * along with this program; if not, see . */ #ifndef CRLFETCH_H @@ -54,6 +53,10 @@ ksba_cert_t *r_cert); void end_cert_fetch (cert_fetch_context_t context); +/* Lookup a cert by it's URL. */ +gpg_error_t fetch_cert_by_url (ctrl_t ctrl, const char *url, + unsigned char **value, size_t *valuelen); + /* Close a reader object. */ void crl_close_reader (ksba_reader_t reader); Modified: trunk/src/dirmngr-client.c =================================================================== --- trunk/src/dirmngr-client.c 2007-10-24 21:01:17 UTC (rev 273) +++ trunk/src/dirmngr-client.c 2007-11-14 19:07:43 UTC (rev 274) @@ -15,9 +15,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, - * USA. + * along with this program; if not, see . */ #include @@ -56,6 +54,7 @@ oCacheCert, oValidate, oLookup, + oUrl, oLoadCRL, oSquidMode, oPEM, @@ -73,6 +72,7 @@ { oCacheCert,"cache-cert",0, N_("add a certificate to the cache")}, { oValidate, "validate", 0, N_("validate a certificate")}, { oLookup, "lookup", 0, N_("lookup a certificate")}, + { oUrl, "url", 0, N_("expect an URL for --lookup")}, { oLoadCRL, "load-crl", 0, N_("load a CRL into the dirmngr")}, { oSquidMode,"squid-mode",0, N_("special mode for use by Squid")}, { oPEM, "pem", 0, N_("certificates are expected in PEM format")}, @@ -92,9 +92,9 @@ int force_default_responder; int pem; int escaped_pem; /* PEM is additional percent encoded. */ - + int url; /* Expect an URL. */ + int use_ocsp; - } opt; @@ -231,6 +231,7 @@ case oCacheCert: cmd_cache_cert = 1; break; case oValidate: cmd_validate = 1; break; case oLookup: cmd_lookup = 1; break; + case oUrl: opt.url = 1; break; case oLoadCRL: cmd_loadcrl = 1; break; case oPEM: opt.pem = 1; break; case oSquidMode: @@ -370,7 +371,7 @@ log_info (_("a dirmngr daemon is up and running\n")); return 0; } - else if (cmd_lookup||cmd_loadcrl||cmd_squid_mode) + else if (cmd_lookup|| cmd_loadcrl || cmd_squid_mode) return err? 1:0; else if (cmd_cache_cert) { @@ -939,9 +940,11 @@ if (err) return err; - line = xmalloc (10 + strlen (pattern)*3 + 1); + line = xmalloc (10 + 6 + strlen (pattern)*3 + 1); p = stpcpy (line, "LOOKUP "); + if (opt.url) + p = stpcpy (p, "--url "); for (s=pattern; *s; s++) { if (*s < ' ' || *s == '+') Modified: trunk/src/server.c =================================================================== --- trunk/src/server.c 2007-10-24 21:01:17 UTC (rev 273) +++ trunk/src/server.c 2007-11-14 19:07:43 UTC (rev 274) @@ -1,6 +1,6 @@ /* dirmngr.c - LDAP access * Copyright (C) 2002 Klar?lvdalens Datakonsult AB - * Copyright (C) 2003, 2004, 2005 g10 Code GmbH + * Copyright (C) 2003, 2004, 2005, 2007 g10 Code GmbH * * This file is part of DirMngr. * @@ -15,8 +15,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA + * along with this program; if not, see . */ #include @@ -96,7 +95,32 @@ return (s && (s == line || spacep (s-1)) && (!s[n] || spacep (s+n))); } +/* Same as has_option but only considers options at the begin of the + line. This is useful for commands which allow arbitrary strings on + the line. */ +static int +has_leading_option (const char *line, const char *name) +{ + const char *s; + int n; + if (name[0] != '-' || name[1] != '-' || !name[2] || spacep (name+2)) + return 0; + n = strlen (name); + while ( *line == '-' && line[1] == '-' ) + { + s = line; + while (*line && !spacep (line)) + line++; + if (n == (line - s) && !strncmp (s, name, n)) + return 1; + while (spacep (line)) + line++; + } + return 0; +} + + /* Same as has_option but does only test for the name of the option and ignores an argument, i.e. with NAME being "--hash" it would return a pointer for "--hash" as well as for "--hash=foo". If @@ -670,18 +694,41 @@ return err; } +static int +lookup_cert_by_url (assuan_context_t ctx, const char *url) +{ + ctrl_t ctrl = assuan_get_pointer (ctx); + gpg_error_t err = 0; + unsigned char *value = NULL; + size_t valuelen; + /* Fetch single certificate given it's URL. */ + err = fetch_cert_by_url (ctrl, url, &value, &valuelen); + if (err) + { + log_error (_("fetch_cert_by_url failed: %s\n"), gpg_strerror (err)); + goto leave; + } -/* LOOKUP + /* Send the data, flush the buffer and then send an END. */ + err = assuan_send_data (ctx, value, valuelen); + if (!err) + err = assuan_send_data (ctx, NULL, 0); + if (!err) + err = assuan_write_line (ctx, "END"); + if (err) + { + log_error (_("error sending data: %s\n"), gpg_strerror (err)); + goto leave; + } - Lookup certificates matching PATTERN. To allow for multiple - patterns (which are ORed) quoting is required: Spaces are to be - translated into "+" or into "%20"; obviously this requires that the - usual escape quoting rules are applied. -*/ + leave: + return err; +} + static int -cmd_lookup (assuan_context_t ctx, char *line) +lookup_cert_by_pattern (assuan_context_t ctx, char *line) { ctrl_t ctrl = assuan_get_pointer (ctx); gpg_error_t err = 0; @@ -820,9 +867,41 @@ err = gpg_error (GPG_ERR_NO_DATA); leave: + free_strlist (list); + return err; +} + + +/* LOOKUP [--url] + + Lookup certificates matching PATTERN. + + If --url is not given: To allow for multiple + patterns (which are ORed) quoting is required: Spaces are to be + translated into "+" or into "%20"; obviously this requires that the + usual escape quoting rules are applied. + + If --url is given no special escaping is required because URLs are + already escaped this way. +*/ + +static int +cmd_lookup (assuan_context_t ctx, char *line) +{ + gpg_error_t err; + int lookup_url; + + lookup_url = has_leading_option (line, "--url"); + line = skip_options (line); + + if (lookup_url) + err = lookup_cert_by_url (ctx, line); + else + err = lookup_cert_by_pattern (ctx, line); + if (err) log_error (_("command %s failed: %s\n"), "LOOKUP", gpg_strerror (err)); - free_strlist (list); + return err; } From cvs at cvs.gnupg.org Fri Nov 16 14:25:10 2007 From: cvs at cvs.gnupg.org (svn author wk) Date: Fri, 16 Nov 2007 14:25:10 +0100 Subject: [svn] GnuPG - r4618 - in branches/STABLE-BRANCH-1-4: . scripts Message-ID: Author: wk Date: 2007-11-16 14:25:01 +0100 (Fri, 16 Nov 2007) New Revision: 4618 Modified: branches/STABLE-BRANCH-1-4/ChangeLog branches/STABLE-BRANCH-1-4/NEWS branches/STABLE-BRANCH-1-4/configure.ac branches/STABLE-BRANCH-1-4/scripts/ChangeLog branches/STABLE-BRANCH-1-4/scripts/gnupg.spec.in Log: Preparing a release candidate Modified: branches/STABLE-BRANCH-1-4/ChangeLog =================================================================== --- branches/STABLE-BRANCH-1-4/ChangeLog 2007-11-12 19:13:47 UTC (rev 4617) +++ branches/STABLE-BRANCH-1-4/ChangeLog 2007-11-16 13:25:01 UTC (rev 4618) @@ -1,3 +1,7 @@ +2007-11-16 Werner Koch + + Released 1.4.8rc1. + 2007-10-27 David Shaw * README: Update notes about OSX Leopard. Modified: branches/STABLE-BRANCH-1-4/NEWS =================================================================== --- branches/STABLE-BRANCH-1-4/NEWS 2007-11-12 19:13:47 UTC (rev 4617) +++ branches/STABLE-BRANCH-1-4/NEWS 2007-11-16 13:25:01 UTC (rev 4618) @@ -5,9 +5,13 @@ * Improved detection of keyrings specified multiple times. + * Changes to better cope with broken keyservers. + * Minor bug fixes. + * New option --rfc4880 which is currently identical to --openpgp. + Noteworthy changes in version 1.4.7 (2007-03-05) ------------------------------------------------ Modified: branches/STABLE-BRANCH-1-4/configure.ac =================================================================== --- branches/STABLE-BRANCH-1-4/configure.ac 2007-11-12 19:13:47 UTC (rev 4617) +++ branches/STABLE-BRANCH-1-4/configure.ac 2007-11-16 13:25:01 UTC (rev 4618) @@ -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" right before creating a distribution. -m4_define([my_version], [1.4.8]) -m4_define([my_issvn], [yes]) +m4_define([my_version], [1.4.8rc1]) +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'|head -1)])) Modified: branches/STABLE-BRANCH-1-4/scripts/ChangeLog =================================================================== --- branches/STABLE-BRANCH-1-4/scripts/ChangeLog 2007-11-12 19:13:47 UTC (rev 4617) +++ branches/STABLE-BRANCH-1-4/scripts/ChangeLog 2007-11-16 13:25:01 UTC (rev 4618) @@ -1,3 +1,8 @@ +2007-11-15 Werner Koch + + * gnupg.spec.in: Converted to utf-8. Changed polish description. + This is bug#676. + 2007-06-22 Werner Koch * mk-w32-dist: Remove underline markup from man pages. Reported Modified: branches/STABLE-BRANCH-1-4/scripts/gnupg.spec.in =================================================================== --- branches/STABLE-BRANCH-1-4/scripts/gnupg.spec.in 2007-11-12 19:13:47 UTC (rev 4617) +++ branches/STABLE-BRANCH-1-4/scripts/gnupg.spec.in 2007-11-16 13:25:01 UTC (rev 4618) @@ -1,4 +1,4 @@ -# +# -*- coding: utf-8 -*- # gnupg -- gnu privacy guard # This is a template. The dist target uses it to create the real file. # @@ -6,16 +6,16 @@ %define name gnupg Summary: GNU Utility for data encryption and digital signatures Summary(it): Utility GNU per la sicurezza nelle comunicazioni e nell'archiviazione dei dati. -Summary(cs): GNU n?stroj pro ?ifrovanou komunikaci a bezpe?n? ukl?d?n? dat -Summary(fr): Utilitaire GNU de chiffrement et d'authentification des communications et des donn?es -Summary(pl): Narzedzie GNU do szyfrowania i podpisywania danych +Summary(cs): GNU n??stroj pro ??ifrovanou komunikaci a bezpe??n?? ukl??d??n?? dat +Summary(fr): Utilitaire GNU de chiffrement et d'authentification des communications et des donn??es +Summary(pl): Narz??dzie GNU do szyfrowania i podpisywania danych Vendor: GNU Privacy Guard Project Name: %{name} Version: %{version} Release: 1 Copyright: GPL Group: Applications/Cryptography -Group(cs): Aplikace/?ifrov?n? +Group(cs): Aplikace/??ifrov??n?? Group(fr): Applications/Cryptographie Group(it): Applicazioni/Crittografia Source: ftp://ftp.gnupg.org/gcrypt/gnupg/%{name}-%{version}.tar.gz @@ -69,13 +69,13 @@ - Added a * to catch all formats for man pages (plain, gz, bz2...) * Mon May 01 2000 Fabio Coatti -- Some corrections in French description, thanks to Ga?l Qu?ri +- Some corrections in French description, thanks to Ga??l Qu??ri ; Some corrections to Italian descriptions. * Tue Apr 25 2000 Fabio Coatti - Removed the no longer needed patch for man page by Keith Owens -* Wed Mar 1 2000 Petr Kri?tof +* Wed Mar 1 2000 Petr Kri??tof - Czech descriptions added; some fixes and updates. * Sat Jan 15 2000 Keith Owens @@ -85,7 +85,7 @@ - Upgraded for 1.0.1 (added missing gpg.1 man page) * Sat May 29 1999 Fabio Coatti -- Some corrections in French description, thanks to Ga?l Qu?ri +- Some corrections in French description, thanks to Ga??l Qu??ri * Mon May 17 1999 Fabio Coatti - Added French description, provided by @@ -121,43 +121,43 @@ these versions of PGP 2. %description -l it -GnuPG (GNU Privacy Guard) ? una utility GNU per la cifratura di dati e +GnuPG (GNU Privacy Guard) ?? una utility GNU per la cifratura di dati e la creazione di firme digitali. Possiede una gestione avanzata delle -chiavi ed ? conforme allo standard Internet OpenPGP, descritto nella -RFC 2440. Non utilizzando algoritmi brevettati, non ? compatibile con +chiavi ed ?? conforme allo standard Internet OpenPGP, descritto nella +RFC 2440. Non utilizzando algoritmi brevettati, non ?? compatibile con PGP2 (PGP2.x usa solo IDEA, coperto da brevetto mondiale, ed RSA, brevettato negli USA con scadenza 20/09/2000). Questi algoritmi sono utilizzabili da GnuPG tramite moduli esterni. %description -l fr -GnuPG est un utilitaire GNU destin? ? chiffrer des donn?es et ? cr?er -des signatures ?lectroniques. Il a des capacit?s avanc?es de gestion de -cl?s et il est conforme ? la norme propos?e OpenPGP d?crite dans la -RFC2440. Comme GnuPG n'utilise pas d'algorithme brevet?, il n'est +GnuPG est un utilitaire GNU destin?? ?? chiffrer des donn??es et ?? cr??er +des signatures ??lectroniques. Il a des capacit??s avanc??es de gestion de +cl??s et il est conforme ?? la norme propos??e OpenPGP d??crite dans la +RFC2440. Comme GnuPG n'utilise pas d'algorithme brevet??, il n'est compatible avec aucune version de PGP2 (PGP2.x ne sait utiliser que -l'IDEA brevet? dans le monde entier et RSA, brevet? aux ?tats-Unis +l'IDEA brevet?? dans le monde entier et RSA, brevet?? aux ??tats-Unis jusqu'au 20 septembre 2000). %description -l cs -GnuPG je GNU n?stroj pro bezpe?nou komunikaci a ukl?d?n? dat. M??e b?t -pou?it na ?ifrov?n? dat a vytv??en? digit?ln?ch podpis?. Obsahuje -funkce pro pokro?ilou spr?vu kl??? a vyhovuje navrhovan?mu OpenPGP -Internet standardu podle RFC2440. Byl vytvo?en jako kompletn? -n?hrada za PGP. Proto?e neobsahuje ?ifrovac? algoritmy IDEA nebo RSA, -m??e b?t pou??v?n bez omezen?. -Proto?e GnuPG nepou??v? ??dn? patentovan? algoritmus, nem??e b?t ?pln? -kompatibiln? s PGP verze 2. PGP 2.x pou??v? algoritmy IDEA (patentov?no -celosv?tov?) a RSA (patentov?no ve Spojen?ch st?tech do 20. z??? -2000). Tyto algoritmy lze zav?st do GnuPG pomoc? extern?ch modul?. +GnuPG je GNU n??stroj pro bezpe??nou komunikaci a ukl??d??n?? dat. M????e b??t +pou??it na ??ifrov??n?? dat a vytv????en?? digit??ln??ch podpis??. Obsahuje +funkce pro pokro??ilou spr??vu kl?????? a vyhovuje navrhovan??mu OpenPGP +Internet standardu podle RFC2440. Byl vytvo??en jako kompletn?? +n??hrada za PGP. Proto??e neobsahuje ??ifrovac?? algoritmy IDEA nebo RSA, +m????e b??t pou????v??n bez omezen??. +Proto??e GnuPG nepou????v?? ????dn?? patentovan?? algoritmus, nem????e b??t ??pln?? +kompatibiln?? s PGP verze 2. PGP 2.x pou????v?? algoritmy IDEA (patentov??no +celosv??tov??) a RSA (patentov??no ve Spojen??ch st??tech do 20. z?????? +2000). Tyto algoritmy lze zav??st do GnuPG pomoc?? extern??ch modul??. %description -l pl -GnuPG (GNU Privacy Guard) jest nazedziem do szfrowania danych i tworzenia -cyfrowych podpis?w. GnuPG posiada zaawansowane mozliwosci obslugi kluczy -i jest zgodne z OpenPGP, proponowanym standardem internetowym opisanym -w RFC2440. Poniewaz GnuPG nie uzywa zadnych opatentowanych algorytm?w -nie jest wiec zgodne z jaka kolwiek wersja PGP2 (PGP2.x kozysta jedynie -z algorytm?w: IDEA, opatentowanego na calym swiecie, oraz RSA, kt?rego -patent na terenie Stan?w Zjednoczonych wygasa 20 wrzesnia 2000). +GnuPG (GNU Privacy Guard) jest narz??dziem do szyfrowania danych i tworzenia +cyfrowych podpis??w. GnuPG posiada zaawansowane mo??liwo??ci obs??ugi kluczy +i jest zgodne z proponowanym standardem internetowym OpenPGP, opisanym +w RFC2440. Poniewa?? GnuPG nie u??ywa ??adnych opatentowanych algorytm??w, +nie jest zgodne z jak??kolwiek wersj?? PGP2 (PGP2.x korzysta jedynie +z algorytm??w: IDEA, opatentowanego na calym ??wiecie oraz RSA, kt??rego +patent na terenie Stan??w Zjednoczonych wygasa 20. wrze??nia 2000). %prep rm -rf $RPM_BUILD_ROOT From cvs at cvs.gnupg.org Fri Nov 16 14:56:57 2007 From: cvs at cvs.gnupg.org (svn author wk) Date: Fri, 16 Nov 2007 14:56:57 +0100 Subject: [svn] GnuPG - r4619 - tags Message-ID: Author: wk Date: 2007-11-16 14:56:48 +0100 (Fri, 16 Nov 2007) New Revision: 4619 Added: tags/gnupg-1.4.8rc1/ Log: Release candidate! Copied: tags/gnupg-1.4.8rc1 (from rev 4618, branches/STABLE-BRANCH-1-4) From cvs at cvs.gnupg.org Fri Nov 16 15:00:27 2007 From: cvs at cvs.gnupg.org (svn author wk) Date: Fri, 16 Nov 2007 15:00:27 +0100 Subject: [svn] GnuPG - r4620 - branches/STABLE-BRANCH-1-4 Message-ID: Author: wk Date: 2007-11-16 15:00:19 +0100 (Fri, 16 Nov 2007) New Revision: 4620 Modified: branches/STABLE-BRANCH-1-4/configure.ac Log: Post release update Modified: branches/STABLE-BRANCH-1-4/configure.ac =================================================================== --- branches/STABLE-BRANCH-1-4/configure.ac 2007-11-16 13:56:48 UTC (rev 4619) +++ branches/STABLE-BRANCH-1-4/configure.ac 2007-11-16 14:00:19 UTC (rev 4620) @@ -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" right before creating a distribution. -m4_define([my_version], [1.4.8rc1]) -m4_define([my_issvn], [no]) +m4_define([my_version], [1.4.8]) +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 Fri Nov 16 16:19:53 2007 From: cvs at cvs.gnupg.org (svn author marcus) Date: Fri, 16 Nov 2007 16:19:53 +0100 Subject: [svn] GpgEX - r43 - trunk/src Message-ID: Author: marcus Date: 2007-11-16 16:19:43 +0100 (Fri, 16 Nov 2007) New Revision: 43 Modified: trunk/src/ChangeLog trunk/src/gpgex.cc Log: 2007-11-16 Marcus Brinkmann * gpgex.cc (start_help): Fix URL for Windows Exploder. Modified: trunk/src/ChangeLog =================================================================== --- trunk/src/ChangeLog 2007-11-12 13:21:58 UTC (rev 42) +++ trunk/src/ChangeLog 2007-11-16 15:19:43 UTC (rev 43) @@ -1,3 +1,7 @@ +2007-11-16 Marcus Brinkmann + + * gpgex.cc (start_help): Fix URL for Windows Exploder. + 2007-11-12 Marcus Brinkmann * gpgex.cc (get_lang_name): Fix last change. Modified: trunk/src/gpgex.cc =================================================================== --- trunk/src/gpgex.cc 2007-11-12 13:21:58 UTC (rev 42) +++ trunk/src/gpgex.cc 2007-11-16 15:19:43 UTC (rev 43) @@ -518,9 +518,15 @@ if (!dir) _snwprintf (url, URLSIZE, L"%S", "http://www.gpg4win.org/"); else - _snwprintf (url, - URLSIZE, L"file:///%S\\share\\doc\\gpgex\\gpgex-%S.html", - dir, get_lang_name ()); + { + int sep = 0; + int len = strlen (dir) - 1; + if (len >= 0 && (dir[len] == '\\' || dir[len] == '/')) + sep = 1; + _snwprintf (url, + URLSIZE, L"file:///%S%Sshare\\doc\\gpgex\\gpgex-%S.html", + dir, get_lang_name (), sep ? "" : "\\"); + } url[URLSIZE - 1] = '\0'; } From cvs at cvs.gnupg.org Sun Nov 18 04:59:30 2007 From: cvs at cvs.gnupg.org (svn author dshaw) Date: Sun, 18 Nov 2007 04:59:30 +0100 Subject: [svn] GnuPG - r4621 - branches/STABLE-BRANCH-1-4 Message-ID: Author: dshaw Date: 2007-11-18 04:59:21 +0100 (Sun, 18 Nov 2007) New Revision: 4621 Modified: branches/STABLE-BRANCH-1-4/ChangeLog branches/STABLE-BRANCH-1-4/NEWS Log: * NEWS: Say a bit more about RFC-4880. Note some defaults changing. Modified: branches/STABLE-BRANCH-1-4/ChangeLog =================================================================== --- branches/STABLE-BRANCH-1-4/ChangeLog 2007-11-16 14:00:19 UTC (rev 4620) +++ branches/STABLE-BRANCH-1-4/ChangeLog 2007-11-18 03:59:21 UTC (rev 4621) @@ -1,3 +1,8 @@ +2007-11-17 David Shaw + + * NEWS: Say a bit more about RFC-4880. Note some defaults + changing. + 2007-11-16 Werner Koch Released 1.4.8rc1. Modified: branches/STABLE-BRANCH-1-4/NEWS =================================================================== --- branches/STABLE-BRANCH-1-4/NEWS 2007-11-16 14:00:19 UTC (rev 4620) +++ branches/STABLE-BRANCH-1-4/NEWS 2007-11-18 03:59:21 UTC (rev 4621) @@ -1,6 +1,6 @@ Noteworthy changes in version 1.4.8 (unreleased) ------------------------------------------------ - + * Changed the license to GPLv3. * Improved detection of keyrings specified multiple times. @@ -9,8 +9,17 @@ * Minor bug fixes. - * New option --rfc4880 which is currently identical to --openpgp. + * The new OpenPGP standard is now complete, and has been published + as RFC-4880. The GnuPG --openpgp mode (note this is not the + default) has been updated to match the new standard. The + --rfc2440 option can be used to return to the older RFC-2440 + behavior. The main differences between the two are + "--enable-dsa2 --no-rfc2440-text --escape-from-lines + --require-cross-certification". + * By default (i.e. --gnupg mode), --require-cross-certification is + now on. --rfc2440-text and --force-v3-sigs are now off. + Noteworthy changes in version 1.4.7 (2007-03-05) ------------------------------------------------ From cvs at cvs.gnupg.org Mon Nov 19 11:10:25 2007 From: cvs at cvs.gnupg.org (svn author wk) Date: Mon, 19 Nov 2007 11:10:25 +0100 Subject: [svn] GnuPG - r4622 - in branches/STABLE-BRANCH-1-4: g10 po Message-ID: Author: wk Date: 2007-11-19 11:10:02 +0100 (Mon, 19 Nov 2007) New Revision: 4622 Modified: branches/STABLE-BRANCH-1-4/g10/ChangeLog branches/STABLE-BRANCH-1-4/g10/keyedit.c branches/STABLE-BRANCH-1-4/po/be.po branches/STABLE-BRANCH-1-4/po/ca.po branches/STABLE-BRANCH-1-4/po/cs.po branches/STABLE-BRANCH-1-4/po/da.po branches/STABLE-BRANCH-1-4/po/de.po branches/STABLE-BRANCH-1-4/po/el.po branches/STABLE-BRANCH-1-4/po/eo.po branches/STABLE-BRANCH-1-4/po/es.po branches/STABLE-BRANCH-1-4/po/et.po branches/STABLE-BRANCH-1-4/po/fi.po branches/STABLE-BRANCH-1-4/po/fr.po branches/STABLE-BRANCH-1-4/po/gl.po branches/STABLE-BRANCH-1-4/po/hu.po branches/STABLE-BRANCH-1-4/po/id.po branches/STABLE-BRANCH-1-4/po/it.po branches/STABLE-BRANCH-1-4/po/ja.po branches/STABLE-BRANCH-1-4/po/nb.po branches/STABLE-BRANCH-1-4/po/nl.po branches/STABLE-BRANCH-1-4/po/pl.po branches/STABLE-BRANCH-1-4/po/pt.po branches/STABLE-BRANCH-1-4/po/pt_BR.po branches/STABLE-BRANCH-1-4/po/ro.po branches/STABLE-BRANCH-1-4/po/ru.po branches/STABLE-BRANCH-1-4/po/sk.po branches/STABLE-BRANCH-1-4/po/sv.po branches/STABLE-BRANCH-1-4/po/tr.po branches/STABLE-BRANCH-1-4/po/zh_CN.po branches/STABLE-BRANCH-1-4/po/zh_TW.po Log: Grammar fix Modified: branches/STABLE-BRANCH-1-4/g10/ChangeLog =================================================================== --- branches/STABLE-BRANCH-1-4/g10/ChangeLog 2007-11-18 03:59:21 UTC (rev 4621) +++ branches/STABLE-BRANCH-1-4/g10/ChangeLog 2007-11-19 10:10:02 UTC (rev 4622) @@ -1,3 +1,7 @@ +2007-11-19 Werner Koch + + * keyedit.c (keyedit_menu): String grammar fix. + 2007-11-12 Werner Koch * status.c (do_get_from_fd, do_shm_get): s/bool/getbool/ to Modified: branches/STABLE-BRANCH-1-4/g10/keyedit.c =================================================================== --- branches/STABLE-BRANCH-1-4/g10/keyedit.c 2007-11-18 03:59:21 UTC (rev 4621) +++ branches/STABLE-BRANCH-1-4/g10/keyedit.c 2007-11-19 10:10:02 UTC (rev 4622) @@ -2081,7 +2081,7 @@ if(opt.trust_model==TM_EXTERNAL) { tty_printf(_("Owner trust may not be set while " - "using an user provided trust database\n")); + "using a user provided trust database\n")); break; } Modified: branches/STABLE-BRANCH-1-4/po/be.po =================================================================== --- branches/STABLE-BRANCH-1-4/po/be.po 2007-11-18 03:59:21 UTC (rev 4621) +++ branches/STABLE-BRANCH-1-4/po/be.po 2007-11-19 10:10:02 UTC (rev 4622) @@ -6,7 +6,7 @@ msgstr "" "Project-Id-Version: gnupg 1.2.2\n" "Report-Msgid-Bugs-To: gnupg-i18n at gnupg.org\n" -"POT-Creation-Date: 2007-10-23 12:03+0200\n" +"POT-Creation-Date: 2007-11-19 10:56+0100\n" "PO-Revision-Date: 2003-10-30 16:35+0200\n" "Last-Translator: Ales Nyakhaychyk \n" "Language-Team: Belarusian \n" @@ -3150,8 +3150,7 @@ msgstr "???????????????? ?????????? ???????????? ?? ID ????????????????????????????" #: g10/keyedit.c:2083 -msgid "" -"Owner trust may not be set while using an user provided trust database\n" +msgid "Owner trust may not be set while using a user provided trust database\n" msgstr "" #: g10/keyedit.c:2125 Modified: branches/STABLE-BRANCH-1-4/po/ca.po =================================================================== --- branches/STABLE-BRANCH-1-4/po/ca.po 2007-11-18 03:59:21 UTC (rev 4621) +++ branches/STABLE-BRANCH-1-4/po/ca.po 2007-11-19 10:10:02 UTC (rev 4622) @@ -27,7 +27,7 @@ msgstr "" "Project-Id-Version: gnupg 1.4.0\n" "Report-Msgid-Bugs-To: gnupg-i18n at gnupg.org\n" -"POT-Creation-Date: 2007-10-23 12:03+0200\n" +"POT-Creation-Date: 2007-11-19 10:56+0100\n" "PO-Revision-Date: 2005-02-04 02:04+0100\n" "Last-Translator: Jordi Mallach \n" "Language-Team: Catalan \n" @@ -3472,8 +3472,7 @@ msgstr "Realment voleu revocar aquesta clau? " #: g10/keyedit.c:2083 -msgid "" -"Owner trust may not be set while using an user provided trust database\n" +msgid "Owner trust may not be set while using a user provided trust database\n" msgstr "" #: g10/keyedit.c:2125 Modified: branches/STABLE-BRANCH-1-4/po/cs.po =================================================================== --- branches/STABLE-BRANCH-1-4/po/cs.po 2007-11-18 03:59:21 UTC (rev 4621) +++ branches/STABLE-BRANCH-1-4/po/cs.po 2007-11-19 10:10:02 UTC (rev 4622) @@ -7,7 +7,7 @@ msgstr "" "Project-Id-Version: gnupg-1.3.92\n" "Report-Msgid-Bugs-To: gnupg-i18n at gnupg.org\n" -"POT-Creation-Date: 2007-10-23 12:03+0200\n" +"POT-Creation-Date: 2007-11-19 10:56+0100\n" "PO-Revision-Date: 2004-11-26 09:12+0200\n" "Last-Translator: Roman Pavlik \n" "Language-Team: Czech \n" @@ -3315,8 +3315,7 @@ msgstr "Opravdu chcete revokovat tento podkl??? (a/N) " #: g10/keyedit.c:2083 -msgid "" -"Owner trust may not be set while using an user provided trust database\n" +msgid "Owner trust may not be set while using a user provided trust database\n" msgstr "" "D?v?ryhodnost vlastn?ka nelze m?nit je-li pou??v?na datab?ze d?v?ry " "poskytnut? u?ivatelem\n" Modified: branches/STABLE-BRANCH-1-4/po/da.po =================================================================== --- branches/STABLE-BRANCH-1-4/po/da.po 2007-11-18 03:59:21 UTC (rev 4621) +++ branches/STABLE-BRANCH-1-4/po/da.po 2007-11-19 10:10:02 UTC (rev 4622) @@ -8,7 +8,7 @@ msgstr "" "Project-Id-Version: gnupg 1.0.0h\n" "Report-Msgid-Bugs-To: gnupg-i18n at gnupg.org\n" -"POT-Creation-Date: 2007-10-23 12:03+0200\n" +"POT-Creation-Date: 2007-11-19 10:56+0100\n" "PO-Revision-Date: 2003-12-03 16:11+0100\n" "Last-Translator: Birger Langkjer \n" "Language-Team: Danish \n" @@ -3235,8 +3235,7 @@ msgstr "Vil du virkelig gerne g?re dette?" #: g10/keyedit.c:2083 -msgid "" -"Owner trust may not be set while using an user provided trust database\n" +msgid "Owner trust may not be set while using a user provided trust database\n" msgstr "" #: g10/keyedit.c:2125 Modified: branches/STABLE-BRANCH-1-4/po/de.po =================================================================== --- branches/STABLE-BRANCH-1-4/po/de.po 2007-11-18 03:59:21 UTC (rev 4621) +++ branches/STABLE-BRANCH-1-4/po/de.po 2007-11-19 10:10:02 UTC (rev 4622) @@ -7,7 +7,7 @@ msgstr "" "Project-Id-Version: gnupg-1.4.1\n" "Report-Msgid-Bugs-To: gnupg-i18n at gnupg.org\n" -"POT-Creation-Date: 2007-10-23 12:03+0200\n" +"POT-Creation-Date: 2007-11-19 10:56+0100\n" "PO-Revision-Date: 2006-06-28 20:54+0200\n" "Last-Translator: Walter Koch \n" "Language-Team: German \n" @@ -3405,8 +3405,7 @@ msgstr "M??chten Sie diesen Schl??ssel wirklich widerrufen? " #: g10/keyedit.c:2083 -msgid "" -"Owner trust may not be set while using an user provided trust database\n" +msgid "Owner trust may not be set while using a user provided trust database\n" msgstr "" #: g10/keyedit.c:2125 Modified: branches/STABLE-BRANCH-1-4/po/el.po =================================================================== --- branches/STABLE-BRANCH-1-4/po/el.po 2007-11-18 03:59:21 UTC (rev 4621) +++ branches/STABLE-BRANCH-1-4/po/el.po 2007-11-19 10:10:02 UTC (rev 4622) @@ -6,7 +6,7 @@ msgstr "" "Project-Id-Version: gnupg-1.1.92\n" "Report-Msgid-Bugs-To: gnupg-i18n at gnupg.org\n" -"POT-Creation-Date: 2007-10-23 12:03+0200\n" +"POT-Creation-Date: 2007-11-19 10:56+0100\n" "PO-Revision-Date: 2003-06-27 12:00+0200\n" "Last-Translator: Dokianakis Theofanis \n" "Language-Team: Greek \n" @@ -3410,8 +3410,7 @@ msgstr "??????? ?????? ?? ????????? ???? ?? ??????; " #: g10/keyedit.c:2083 -msgid "" -"Owner trust may not be set while using an user provided trust database\n" +msgid "Owner trust may not be set while using a user provided trust database\n" msgstr "" #: g10/keyedit.c:2125 Modified: branches/STABLE-BRANCH-1-4/po/eo.po =================================================================== --- branches/STABLE-BRANCH-1-4/po/eo.po 2007-11-18 03:59:21 UTC (rev 4621) +++ branches/STABLE-BRANCH-1-4/po/eo.po 2007-11-19 10:10:02 UTC (rev 4622) @@ -6,7 +6,7 @@ msgstr "" "Project-Id-Version: gnupg 1.0.6d\n" "Report-Msgid-Bugs-To: gnupg-i18n at gnupg.org\n" -"POT-Creation-Date: 2007-10-23 12:03+0200\n" +"POT-Creation-Date: 2007-11-19 10:56+0100\n" "PO-Revision-Date: 2002-04-14 14:33+0100\n" "Last-Translator: Edmund GRIMLEY EVANS \n" "Language-Team: Esperanto \n" @@ -3379,8 +3379,7 @@ msgstr "?u vi vere volas revoki ?i tiun ?losilon? " #: g10/keyedit.c:2083 -msgid "" -"Owner trust may not be set while using an user provided trust database\n" +msgid "Owner trust may not be set while using a user provided trust database\n" msgstr "" #: g10/keyedit.c:2125 Modified: branches/STABLE-BRANCH-1-4/po/es.po =================================================================== --- branches/STABLE-BRANCH-1-4/po/es.po 2007-11-18 03:59:21 UTC (rev 4621) +++ branches/STABLE-BRANCH-1-4/po/es.po 2007-11-19 10:10:02 UTC (rev 4622) @@ -10,7 +10,7 @@ msgstr "" "Project-Id-Version: GnuPG 1.4.1\n" "Report-Msgid-Bugs-To: gnupg-i18n at gnupg.org\n" -"POT-Creation-Date: 2007-10-23 12:03+0200\n" +"POT-Creation-Date: 2007-11-19 10:56+0100\n" "PO-Revision-Date: 2007-10-23 11:32+0200\n" "Last-Translator: Jaime Su?rez \n" "Language-Team: Spanish \n" @@ -3314,8 +3314,7 @@ msgstr "?De verdad quiere revocar esta subclave? (s/N) " #: g10/keyedit.c:2083 -msgid "" -"Owner trust may not be set while using an user provided trust database\n" +msgid "Owner trust may not be set while using a user provided trust database\n" msgstr "" "La confianza del propietario no puede establecerse si se est? usando\n" "una base de datos de confianza propocionada por el usuario\n" Modified: branches/STABLE-BRANCH-1-4/po/et.po =================================================================== --- branches/STABLE-BRANCH-1-4/po/et.po 2007-11-18 03:59:21 UTC (rev 4621) +++ branches/STABLE-BRANCH-1-4/po/et.po 2007-11-19 10:10:02 UTC (rev 4622) @@ -6,7 +6,7 @@ msgstr "" "Project-Id-Version: gnupg 1.2.2\n" "Report-Msgid-Bugs-To: gnupg-i18n at gnupg.org\n" -"POT-Creation-Date: 2007-10-23 12:03+0200\n" +"POT-Creation-Date: 2007-11-19 10:56+0100\n" "PO-Revision-Date: 2004-06-17 11:04+0300\n" "Last-Translator: Toomas Soome \n" "Language-Team: Estonian \n" @@ -3364,8 +3364,7 @@ msgstr "Kas te t?esti soovite seda v?tit t?histada? " #: g10/keyedit.c:2083 -msgid "" -"Owner trust may not be set while using an user provided trust database\n" +msgid "Owner trust may not be set while using a user provided trust database\n" msgstr "" #: g10/keyedit.c:2125 Modified: branches/STABLE-BRANCH-1-4/po/fi.po =================================================================== --- branches/STABLE-BRANCH-1-4/po/fi.po 2007-11-18 03:59:21 UTC (rev 4621) +++ branches/STABLE-BRANCH-1-4/po/fi.po 2007-11-19 10:10:02 UTC (rev 4622) @@ -22,7 +22,7 @@ msgstr "" "Project-Id-Version: gnupg 1.2.2\n" "Report-Msgid-Bugs-To: gnupg-i18n at gnupg.org\n" -"POT-Creation-Date: 2007-10-23 12:03+0200\n" +"POT-Creation-Date: 2007-11-19 10:56+0100\n" "PO-Revision-Date: 2004-06-16 22:40+0300\n" "Last-Translator: Tommi Vainikainen \n" "Language-Team: Finnish \n" @@ -3401,8 +3401,7 @@ msgstr "Haluatko varmasti mit??t??id?? t??m??n avaimen? " #: g10/keyedit.c:2083 -msgid "" -"Owner trust may not be set while using an user provided trust database\n" +msgid "Owner trust may not be set while using a user provided trust database\n" msgstr "" #: g10/keyedit.c:2125 Modified: branches/STABLE-BRANCH-1-4/po/fr.po =================================================================== --- branches/STABLE-BRANCH-1-4/po/fr.po 2007-11-18 03:59:21 UTC (rev 4621) +++ branches/STABLE-BRANCH-1-4/po/fr.po 2007-11-19 10:10:02 UTC (rev 4622) @@ -11,7 +11,7 @@ msgstr "" "Project-Id-Version: gnupg 1.4.2rc2\n" "Report-Msgid-Bugs-To: gnupg-i18n at gnupg.org\n" -"POT-Creation-Date: 2007-10-23 12:03+0200\n" +"POT-Creation-Date: 2007-11-19 10:56+0100\n" "PO-Revision-Date: 2005-06-28 00:24+0200\n" "Last-Translator: Ga?l Qu?ri \n" "Language-Team: French \n" @@ -3391,8 +3391,7 @@ msgstr "Voulez-vous vraiment r?voquer cette sous-cl? ? (o/N) " #: g10/keyedit.c:2083 -msgid "" -"Owner trust may not be set while using an user provided trust database\n" +msgid "Owner trust may not be set while using a user provided trust database\n" msgstr "" "La confiance du propri?taire peut ne pas ?tre positionn?e en utilisant\n" "la base de confiance d'un tiers\n" Modified: branches/STABLE-BRANCH-1-4/po/gl.po =================================================================== --- branches/STABLE-BRANCH-1-4/po/gl.po 2007-11-18 03:59:21 UTC (rev 4621) +++ branches/STABLE-BRANCH-1-4/po/gl.po 2007-11-19 10:10:02 UTC (rev 4622) @@ -6,7 +6,7 @@ msgstr "" "Project-Id-Version: gnupg 1.2.4\n" "Report-Msgid-Bugs-To: gnupg-i18n at gnupg.org\n" -"POT-Creation-Date: 2007-10-23 12:03+0200\n" +"POT-Creation-Date: 2007-11-19 10:56+0100\n" "PO-Revision-Date: 2003-12-04 11:39+0100\n" "Last-Translator: Jacobo Tarrio \n" "Language-Team: Galician \n" @@ -3395,8 +3395,7 @@ msgstr "?Realmente quere revocar esta chave? " #: g10/keyedit.c:2083 -msgid "" -"Owner trust may not be set while using an user provided trust database\n" +msgid "Owner trust may not be set while using a user provided trust database\n" msgstr "" #: g10/keyedit.c:2125 Modified: branches/STABLE-BRANCH-1-4/po/hu.po =================================================================== --- branches/STABLE-BRANCH-1-4/po/hu.po 2007-11-18 03:59:21 UTC (rev 4621) +++ branches/STABLE-BRANCH-1-4/po/hu.po 2007-11-19 10:10:02 UTC (rev 4622) @@ -6,7 +6,7 @@ msgstr "" "Project-Id-Version: gnupg 1.2.5\n" "Report-Msgid-Bugs-To: gnupg-i18n at gnupg.org\n" -"POT-Creation-Date: 2007-10-23 12:03+0200\n" +"POT-Creation-Date: 2007-11-19 10:56+0100\n" "PO-Revision-Date: 2004-06-19 21:53+0200\n" "Last-Translator: Nagy Ferenc L?szl? \n" "Language-Team: Hungarian \n" @@ -3374,8 +3374,7 @@ msgstr "Val?ban visszavonja ezt a kulcsot? " #: g10/keyedit.c:2083 -msgid "" -"Owner trust may not be set while using an user provided trust database\n" +msgid "Owner trust may not be set while using a user provided trust database\n" msgstr "" #: g10/keyedit.c:2125 Modified: branches/STABLE-BRANCH-1-4/po/id.po =================================================================== --- branches/STABLE-BRANCH-1-4/po/id.po 2007-11-18 03:59:21 UTC (rev 4621) +++ branches/STABLE-BRANCH-1-4/po/id.po 2007-11-19 10:10:02 UTC (rev 4622) @@ -7,7 +7,7 @@ msgstr "" "Project-Id-Version: gnupg-id\n" "Report-Msgid-Bugs-To: gnupg-i18n at gnupg.org\n" -"POT-Creation-Date: 2007-10-23 12:03+0200\n" +"POT-Creation-Date: 2007-11-19 10:56+0100\n" "PO-Revision-Date: 2004-06-17 16:32+0700\n" "Last-Translator: Tedi Heriyanto \n" "Language-Team: Indonesian \n" @@ -3390,8 +3390,7 @@ msgstr "Anda ingin membatalkan kunci ini? " #: g10/keyedit.c:2083 -msgid "" -"Owner trust may not be set while using an user provided trust database\n" +msgid "Owner trust may not be set while using a user provided trust database\n" msgstr "" #: g10/keyedit.c:2125 Modified: branches/STABLE-BRANCH-1-4/po/it.po =================================================================== --- branches/STABLE-BRANCH-1-4/po/it.po 2007-11-18 03:59:21 UTC (rev 4621) +++ branches/STABLE-BRANCH-1-4/po/it.po 2007-11-19 10:10:02 UTC (rev 4622) @@ -6,7 +6,7 @@ msgstr "" "Project-Id-Version: gnupg 1.1.92\n" "Report-Msgid-Bugs-To: gnupg-i18n at gnupg.org\n" -"POT-Creation-Date: 2007-10-23 12:03+0200\n" +"POT-Creation-Date: 2007-11-19 10:56+0100\n" "PO-Revision-Date: 2004-06-16 17:01+0200\n" "Last-Translator: Marco d'Itri \n" "Language-Team: Italian \n" @@ -3401,8 +3401,7 @@ msgstr "Vuoi davvero revocare questa chiave? " #: g10/keyedit.c:2083 -msgid "" -"Owner trust may not be set while using an user provided trust database\n" +msgid "Owner trust may not be set while using a user provided trust database\n" msgstr "" #: g10/keyedit.c:2125 Modified: branches/STABLE-BRANCH-1-4/po/ja.po =================================================================== --- branches/STABLE-BRANCH-1-4/po/ja.po 2007-11-18 03:59:21 UTC (rev 4621) +++ branches/STABLE-BRANCH-1-4/po/ja.po 2007-11-19 10:10:02 UTC (rev 4622) @@ -9,7 +9,7 @@ msgstr "" "Project-Id-Version: gnupg 1.3.92\n" "Report-Msgid-Bugs-To: gnupg-i18n at gnupg.org\n" -"POT-Creation-Date: 2007-10-23 12:03+0200\n" +"POT-Creation-Date: 2007-11-19 10:56+0100\n" "PO-Revision-Date: 2004-11-23 11:14+0900\n" "Last-Translator: IIDA Yosiaki \n" "Language-Team: Japanese \n" @@ -3284,8 +3284,7 @@ msgstr "??????????????????????????? (y/N) " #: g10/keyedit.c:2083 -msgid "" -"Owner trust may not be set while using an user provided trust database\n" +msgid "Owner trust may not be set while using a user provided trust database\n" msgstr "" "????????????????????????????????????????????????????????????????????????" "????\n" Modified: branches/STABLE-BRANCH-1-4/po/nb.po =================================================================== --- branches/STABLE-BRANCH-1-4/po/nb.po 2007-11-18 03:59:21 UTC (rev 4621) +++ branches/STABLE-BRANCH-1-4/po/nb.po 2007-11-19 10:10:02 UTC (rev 4622) @@ -10,7 +10,7 @@ msgstr "" "Project-Id-Version: gnupg 1.4.3\n" "Report-Msgid-Bugs-To: gnupg-i18n at gnupg.org\n" -"POT-Creation-Date: 2007-10-23 12:03+0200\n" +"POT-Creation-Date: 2007-11-19 10:56+0100\n" "PO-Revision-Date: 2006-06-13 20:31+0200\n" "Last-Translator: Trond Endrest?l \n" "Language-Team: Norwegian Bokm?l \n" @@ -3184,8 +3184,7 @@ msgstr "Vil du virkelig oppheve denne undern?kkelen? (j/N) " #: g10/keyedit.c:2083 -msgid "" -"Owner trust may not be set while using an user provided trust database\n" +msgid "Owner trust may not be set while using a user provided trust database\n" msgstr "" #: g10/keyedit.c:2125 Modified: branches/STABLE-BRANCH-1-4/po/nl.po =================================================================== --- branches/STABLE-BRANCH-1-4/po/nl.po 2007-11-18 03:59:21 UTC (rev 4621) +++ branches/STABLE-BRANCH-1-4/po/nl.po 2007-11-19 10:10:02 UTC (rev 4622) @@ -29,7 +29,7 @@ msgstr "" "Project-Id-Version: gnupg 1.4.6\n" "Report-Msgid-Bugs-To: gnupg-i18n at gnupg.org\n" -"POT-Creation-Date: 2007-10-23 12:03+0200\n" +"POT-Creation-Date: 2007-11-19 10:56+0100\n" "PO-Revision-Date: 2007-03-05 10:27+0100\n" "Last-Translator: Ivar Snaaijer\n" "Language-Team: none\n" @@ -3388,8 +3388,7 @@ msgstr "Wilt U deze sub-sleutel intrekken? (j/N) " #: g10/keyedit.c:2083 -msgid "" -"Owner trust may not be set while using an user provided trust database\n" +msgid "Owner trust may not be set while using a user provided trust database\n" msgstr "" "Eigenaarsvertrouwen kan niet ingesteld worden in een door een gebruiker\n" "aangeboden vertrouwenslijst\n" Modified: branches/STABLE-BRANCH-1-4/po/pl.po =================================================================== --- branches/STABLE-BRANCH-1-4/po/pl.po 2007-11-18 03:59:21 UTC (rev 4621) +++ branches/STABLE-BRANCH-1-4/po/pl.po 2007-11-19 10:10:02 UTC (rev 4622) @@ -8,7 +8,7 @@ msgstr "" "Project-Id-Version: gnupg-1.2.2\n" "Report-Msgid-Bugs-To: gnupg-i18n at gnupg.org\n" -"POT-Creation-Date: 2007-10-23 12:03+0200\n" +"POT-Creation-Date: 2007-11-19 10:56+0100\n" "PO-Revision-Date: 2004-06-23 15:54+0200\n" "Last-Translator: Janusz A. Urbanowicz \n" "Language-Team: Polish \n" @@ -3412,8 +3412,7 @@ msgstr "Czy na pewno chcesz uniewa?ni? ten klucz? " #: g10/keyedit.c:2083 -msgid "" -"Owner trust may not be set while using an user provided trust database\n" +msgid "Owner trust may not be set while using a user provided trust database\n" msgstr "" #: g10/keyedit.c:2125 Modified: branches/STABLE-BRANCH-1-4/po/pt.po =================================================================== --- branches/STABLE-BRANCH-1-4/po/pt.po 2007-11-18 03:59:21 UTC (rev 4621) +++ branches/STABLE-BRANCH-1-4/po/pt.po 2007-11-19 10:10:02 UTC (rev 4622) @@ -9,7 +9,7 @@ msgstr "" "Project-Id-Version: gnupg\n" "Report-Msgid-Bugs-To: gnupg-i18n at gnupg.org\n" -"POT-Creation-Date: 2007-10-23 12:03+0200\n" +"POT-Creation-Date: 2007-11-19 10:56+0100\n" "PO-Revision-Date: 2002-09-13 18:26+0100\n" "Last-Translator: Pedro Morais \n" "Language-Team: pt \n" @@ -3385,8 +3385,7 @@ msgstr "Voc? quer realmente revogar esta chave? " #: g10/keyedit.c:2083 -msgid "" -"Owner trust may not be set while using an user provided trust database\n" +msgid "Owner trust may not be set while using a user provided trust database\n" msgstr "" #: g10/keyedit.c:2125 Modified: branches/STABLE-BRANCH-1-4/po/pt_BR.po =================================================================== --- branches/STABLE-BRANCH-1-4/po/pt_BR.po 2007-11-18 03:59:21 UTC (rev 4621) +++ branches/STABLE-BRANCH-1-4/po/pt_BR.po 2007-11-19 10:10:02 UTC (rev 4622) @@ -13,7 +13,7 @@ msgstr "" "Project-Id-Version: GnuPG 1.0\n" "Report-Msgid-Bugs-To: gnupg-i18n at gnupg.org\n" -"POT-Creation-Date: 2007-10-23 12:03+0200\n" +"POT-Creation-Date: 2007-11-19 10:56+0100\n" "PO-Revision-Date: 2007-10-23 11:33+0200\n" "Last-Translator:\n" "Language-Team: ?\n" @@ -3333,8 +3333,7 @@ msgstr "Voc? realmente quer revogar esta chave? " #: g10/keyedit.c:2083 -msgid "" -"Owner trust may not be set while using an user provided trust database\n" +msgid "Owner trust may not be set while using a user provided trust database\n" msgstr "" #: g10/keyedit.c:2125 Modified: branches/STABLE-BRANCH-1-4/po/ro.po =================================================================== --- branches/STABLE-BRANCH-1-4/po/ro.po 2007-11-18 03:59:21 UTC (rev 4621) +++ branches/STABLE-BRANCH-1-4/po/ro.po 2007-11-19 10:10:02 UTC (rev 4622) @@ -9,7 +9,7 @@ msgstr "" "Project-Id-Version: gnupg 1.4.2rc1\n" "Report-Msgid-Bugs-To: gnupg-i18n at gnupg.org\n" -"POT-Creation-Date: 2007-10-23 12:03+0200\n" +"POT-Creation-Date: 2007-11-19 10:56+0100\n" "PO-Revision-Date: 2005-05-31 22:00-0500\n" "Last-Translator: Laurentiu Buzdugan \n" "Language-Team: Romanian \n" @@ -3330,8 +3330,7 @@ msgstr "Dori?i ?ntr-adev?r s? revoca?i aceast? subcheie? (d/N) " #: g10/keyedit.c:2083 -msgid "" -"Owner trust may not be set while using an user provided trust database\n" +msgid "Owner trust may not be set while using a user provided trust database\n" msgstr "" "?ncrederea proprietar nu poate fi setat? c?nd este folosit? o baz? de date " "de ?ncredere furnizat? de utilizator\n" Modified: branches/STABLE-BRANCH-1-4/po/ru.po =================================================================== --- branches/STABLE-BRANCH-1-4/po/ru.po 2007-11-18 03:59:21 UTC (rev 4621) +++ branches/STABLE-BRANCH-1-4/po/ru.po 2007-11-19 10:10:02 UTC (rev 4622) @@ -8,7 +8,7 @@ msgstr "" "Project-Id-Version: GnuPG 1.4.2\n" "Report-Msgid-Bugs-To: gnupg-i18n at gnupg.org\n" -"POT-Creation-Date: 2007-10-23 12:03+0200\n" +"POT-Creation-Date: 2007-11-19 10:56+0100\n" "PO-Revision-Date: 2005-06-22 02:53+0200\n" "Last-Translator: Maxim Britov \n" "Language-Team: Russian \n" @@ -3294,8 +3294,7 @@ msgstr "???? ?????????????????????????? ???????????? ???????????????? ???????????? ??????????????? (y/N)" #: g10/keyedit.c:2083 -msgid "" -"Owner trust may not be set while using an user provided trust database\n" +msgid "Owner trust may not be set while using a user provided trust database\n" msgstr "" "???????????????????? ?????????????????? ?????????????? ?????????????? ???????? ???????????????????????? ?????????????????? " "?????????????????????????? ?????????????? ??????????????\n" Modified: branches/STABLE-BRANCH-1-4/po/sk.po =================================================================== --- branches/STABLE-BRANCH-1-4/po/sk.po 2007-11-18 03:59:21 UTC (rev 4621) +++ branches/STABLE-BRANCH-1-4/po/sk.po 2007-11-19 10:10:02 UTC (rev 4622) @@ -5,7 +5,7 @@ msgstr "" "Project-Id-Version: gnupg 1.2.5\n" "Report-Msgid-Bugs-To: gnupg-i18n at gnupg.org\n" -"POT-Creation-Date: 2007-10-23 12:03+0200\n" +"POT-Creation-Date: 2007-11-19 10:56+0100\n" "PO-Revision-Date: 2004-07-20 15:52+0200\n" "Last-Translator: Michal Majer \n" "Language-Team: Slovak \n" @@ -3395,8 +3395,7 @@ msgstr "Skuto?ne chcete revokova? tento k???? " #: g10/keyedit.c:2083 -msgid "" -"Owner trust may not be set while using an user provided trust database\n" +msgid "Owner trust may not be set while using a user provided trust database\n" msgstr "" #: g10/keyedit.c:2125 Modified: branches/STABLE-BRANCH-1-4/po/sv.po =================================================================== --- branches/STABLE-BRANCH-1-4/po/sv.po 2007-11-18 03:59:21 UTC (rev 4621) +++ branches/STABLE-BRANCH-1-4/po/sv.po 2007-11-19 10:10:02 UTC (rev 4622) @@ -24,7 +24,7 @@ msgstr "" "Project-Id-Version: gnupg 2.0\n" "Report-Msgid-Bugs-To: gnupg-i18n at gnupg.org\n" -"POT-Creation-Date: 2007-10-23 12:03+0200\n" +"POT-Creation-Date: 2007-11-19 10:56+0100\n" "PO-Revision-Date: 2007-02-22 00:33+0100\n" "Last-Translator: Daniel Nylander \n" "Language-Team: Swedish \n" @@ -3362,8 +3362,7 @@ msgstr "Vill du verkligen sp??rra denna undernyckel? (j/N) " #: g10/keyedit.c:2083 -msgid "" -"Owner trust may not be set while using an user provided trust database\n" +msgid "Owner trust may not be set while using a user provided trust database\n" msgstr "" "??gartillit f??r inte st??llas in n??r en tillitsdatabas anv??nds som anv??ndaren " "tillhandah??ller\n" Modified: branches/STABLE-BRANCH-1-4/po/tr.po =================================================================== --- branches/STABLE-BRANCH-1-4/po/tr.po 2007-11-18 03:59:21 UTC (rev 4621) +++ branches/STABLE-BRANCH-1-4/po/tr.po 2007-11-19 10:10:02 UTC (rev 4622) @@ -6,7 +6,7 @@ msgstr "" "Project-Id-Version: gnupg 1.4.1\n" "Report-Msgid-Bugs-To: gnupg-i18n at gnupg.org\n" -"POT-Creation-Date: 2007-10-23 12:03+0200\n" +"POT-Creation-Date: 2007-11-19 10:56+0100\n" "PO-Revision-Date: 2005-03-16 07:30+0300\n" "Last-Translator: Nilg??n Belma Bug??ner \n" "Language-Team: Turkish \n" @@ -3300,8 +3300,7 @@ "ya da y/N) " #: g10/keyedit.c:2083 -msgid "" -"Owner trust may not be set while using an user provided trust database\n" +msgid "Owner trust may not be set while using a user provided trust database\n" msgstr "" "Kullan??c?? tara??ndan sa??lanm???? bir g??vence veritaban?? kullan??larak " "sahibining??vencesi belirlenemez\n" Modified: branches/STABLE-BRANCH-1-4/po/zh_CN.po =================================================================== --- branches/STABLE-BRANCH-1-4/po/zh_CN.po 2007-11-18 03:59:21 UTC (rev 4621) +++ branches/STABLE-BRANCH-1-4/po/zh_CN.po 2007-11-19 10:10:02 UTC (rev 4622) @@ -7,7 +7,7 @@ msgstr "" "Project-Id-Version: gnupg 1.4.4\n" "Report-Msgid-Bugs-To: gnupg-i18n at gnupg.org\n" -"POT-Creation-Date: 2007-10-23 12:03+0200\n" +"POT-Creation-Date: 2007-11-19 10:56+0100\n" "PO-Revision-Date: 2006-07-02 10:58+0800\n" "Last-Translator: Meng Jie \n" "Language-Team: Chinese (simplified) \n" @@ -3212,8 +3212,7 @@ msgstr "????????????????????????????????????(y/N)" #: g10/keyedit.c:2083 -msgid "" -"Owner trust may not be set while using an user provided trust database\n" +msgid "Owner trust may not be set while using a user provided trust database\n" msgstr "????????????????????????????????????????????????????????????????????????\n" #: g10/keyedit.c:2125 Modified: branches/STABLE-BRANCH-1-4/po/zh_TW.po =================================================================== --- branches/STABLE-BRANCH-1-4/po/zh_TW.po 2007-11-18 03:59:21 UTC (rev 4621) +++ branches/STABLE-BRANCH-1-4/po/zh_TW.po 2007-11-19 10:10:02 UTC (rev 4622) @@ -9,7 +9,7 @@ msgstr "" "Project-Id-Version: gnupg 1.4.2\n" "Report-Msgid-Bugs-To: gnupg-i18n at gnupg.org\n" -"POT-Creation-Date: 2007-10-23 12:03+0200\n" +"POT-Creation-Date: 2007-11-19 10:56+0100\n" "PO-Revision-Date: 2005-07-29 09:49+0800\n" "Last-Translator: Jedi \n" "Language-Team: Chinese (traditional) \n" @@ -3240,8 +3240,7 @@ msgstr "????????????????????????????????????? (y/N) " #: g10/keyedit.c:2083 -msgid "" -"Owner trust may not be set while using an user provided trust database\n" +msgid "Owner trust may not be set while using a user provided trust database\n" msgstr "???????????????????????????????????????????????????????????????????????????\n" #: g10/keyedit.c:2125 From cvs at cvs.gnupg.org Mon Nov 19 13:37:03 2007 From: cvs at cvs.gnupg.org (svn author wk) Date: Mon, 19 Nov 2007 13:37:03 +0100 Subject: [svn] pinentry - r171 - in trunk: . assuan doc gtk+-2 pinentry qt Message-ID: Author: wk Date: 2007-11-19 13:36:53 +0100 (Mon, 19 Nov 2007) New Revision: 171 Modified: trunk/ChangeLog trunk/assuan/assuan-util.c trunk/doc/pinentry.texi trunk/gtk+-2/gtksecentry.c trunk/gtk+-2/pinentry-gtk-2.c trunk/pinentry/pinentry.c trunk/pinentry/pinentry.h trunk/qt/main.cpp trunk/qt/pinentrydialog.cpp trunk/qt/pinentrydialog.h Log: Applied batch from Bernhard Herzog. Allow caller to set the toolip. The QT versions still crashes - someone else might want to look into it. TIA. Modified: trunk/ChangeLog =================================================================== --- trunk/ChangeLog 2007-09-18 17:52:39 UTC (rev 170) +++ trunk/ChangeLog 2007-11-19 12:36:53 UTC (rev 171) @@ -1,3 +1,33 @@ +2007-11-19 Werner Koch + + * gtk+-2/pinentry-gtk-2.c (create_window): Use again map-event and + unmap-event as this works on my setup far more reliable than + expose-event/no-expose-event. + + * gtk+-2/gtksecentry.c (get_cursor_time): s/time/blinktime/ t + avoid shadowing warning. + + * pinentry/pinentry.h (struct pinentry): Change QUALITY_BAR to a + char ptr. + (struct pinentry): Add QUALITY_BAR_TT. + * pinentry/pinentry.c (cmd_setqualitybar): Allow to set a label text. + (cmd_setqualitybar_tt): New. + * gtk+-2/pinentry-gtk-2.c (create_window): Take label and tooltip + from global. + * qt/pinentrydialog.h (setQualityBar, setQualityBarTT) + (_quality_bar_label): New. + * qt/pinentrydialog.cpp (setQualityBar, setQualityBarTT): New. + (PinEntryDialog): Remove setting of tooltip. + * qt/main.cpp (qt_cmd_handler): Propagate quality bar label and tootip. + +2007-11-19 Bernhard Herzog (wk) + + * qt/pinentrydialog.cpp (PinEntryDialog): Move the quality bar + below the text entry and align them properly. Show a tooltip. + * gtk+-2/pinentry-gtk-2.c (create_window): Ditto. Don't let it + change its height. + (QUALITYBAR_EMPTY_TEXT): New. + 2007-09-18 Werner Koch * qt/secqlineedit.h (SecQLineEdit): New signal textModified. Modified: trunk/assuan/assuan-util.c =================================================================== --- trunk/assuan/assuan-util.c 2007-09-18 17:52:39 UTC (rev 170) +++ trunk/assuan/assuan-util.c 2007-11-19 12:36:53 UTC (rev 171) @@ -161,7 +161,7 @@ void _assuan_log_sanitized_string (const char *string) { - const unsigned char *s = string; + const unsigned char *s = (const unsigned char*)string; #ifdef HAVE_JNLIB_LOGGING FILE *fp = log_get_stream (); #else Modified: trunk/doc/pinentry.texi =================================================================== --- trunk/doc/pinentry.texi 2007-09-18 17:52:39 UTC (rev 170) +++ trunk/doc/pinentry.texi 2007-11-19 12:36:53 UTC (rev 171) @@ -288,6 +288,11 @@ S: OK @end example +If a custom laber for the auality bar is required, just add that label +as an argument as precent escaped string. You will need this feature to +translate the label because pinentry has no internal gettext except for +stock strings from the toolkit library. + @item Ask for a PIN The meat of this tool is to ask for a passphrase of PIN, it is done with this command: Modified: trunk/gtk+-2/gtksecentry.c =================================================================== --- trunk/gtk+-2/gtksecentry.c 2007-09-18 17:52:39 UTC (rev 170) +++ trunk/gtk+-2/gtksecentry.c 2007-11-19 12:36:53 UTC (rev 171) @@ -3210,11 +3210,11 @@ get_cursor_time(GtkSecureEntry * entry) { GtkSettings *settings = gtk_widget_get_settings(GTK_WIDGET(entry)); - gint time; + gint blinktime; - g_object_get(settings, "gtk-cursor-blink-time", &time, NULL); + g_object_get(settings, "gtk-cursor-blink-time", &blinktime, NULL); - return time; + return blinktime; } static void Modified: trunk/gtk+-2/pinentry-gtk-2.c =================================================================== --- trunk/gtk+-2/pinentry-gtk-2.c 2007-09-18 17:52:39 UTC (rev 170) +++ trunk/gtk+-2/pinentry-gtk-2.c 2007-11-19 12:36:53 UTC (rev 171) @@ -59,11 +59,19 @@ static GtkWidget *qualitybar; static GtkWidget *insure; static GtkWidget *time_out; +static GtkTooltips *tooltips; /* Gnome hig small and large space in pixels. */ #define HIG_SMALL 6 #define HIG_LARGE 12 +/* The text shown in the quality bar when no text is shown. This is not + * the empty string, becase because with an empty string the height of + * the quality bar is less than with a non-empty string. This results + * in ugly layout changes when the text changes from non-empty to empty + * and vice versa */ +#define QUALITYBAR_EMPTY_TEXT " " + /* Constrain size of the window the window should not shrink beyond the requisition, and should not grow vertically. */ @@ -203,7 +211,7 @@ percent = length? pinentry_inq_quality (pinentry, s, length) : 0; if (!length) { - *textbuf = 0; + strcpy(textbuf, QUALITYBAR_EMPTY_TEXT); color.red = 0xffff; } else if (percent < 0) @@ -229,11 +237,13 @@ create_window (int confirm_mode) { GtkWidget *w; - GtkWidget *win, *box, *ebox; + GtkWidget *win, *box; GtkWidget *wvbox, *chbox, *bbox; GtkAccelGroup *acc; gchar *msg; + tooltips = gtk_tooltips_new (); + /* FIXME: check the grabbing code against the one we used with the old gpg-agent */ win = gtk_window_new (GTK_WINDOW_TOPLEVEL); @@ -251,10 +261,10 @@ if (!confirm_mode) { g_signal_connect (G_OBJECT (win), - pinentry->grab ? "expose-event" : "focus-in-event", + pinentry->grab ? "map-event" : "focus-in-event", G_CALLBACK (grab_keyboard), NULL); g_signal_connect (G_OBJECT (win), - pinentry->grab ? "no-expose-event" : "focus-out-event", + pinentry->grab ? "unmap-event" : "focus-out-event", G_CALLBACK (ungrab_keyboard), NULL); } gtk_window_add_accel_group (GTK_WINDOW (win), acc); @@ -295,28 +305,23 @@ gtk_box_pack_start (GTK_BOX (box), w, TRUE, FALSE, 0); gtk_widget_modify_fg (w, GTK_STATE_NORMAL, &color); } - - if (pinentry->quality_bar) - { - qualitybar = gtk_progress_bar_new(); - gtk_progress_bar_set_text (GTK_PROGRESS_BAR (qualitybar), ""); - gtk_progress_bar_set_fraction (GTK_PROGRESS_BAR (qualitybar), 0.0); - gtk_box_pack_start (GTK_BOX (box), qualitybar, TRUE, FALSE, 0); - } - else - qualitybar = NULL; - - ebox = gtk_hbox_new (FALSE, HIG_SMALL); - gtk_box_pack_start (GTK_BOX(box), ebox, FALSE, FALSE, 0); + qualitybar = NULL; + if (!confirm_mode) { + GtkWidget* table = gtk_table_new (pinentry->quality_bar ? 2 : 1, 2, + FALSE); + gtk_box_pack_start (GTK_BOX (box), table, FALSE, FALSE, 0); + if (pinentry->prompt) { msg = pinentry_utf8_validate (pinentry->prompt); w = gtk_label_new (msg); g_free (msg); - gtk_box_pack_start (GTK_BOX (ebox), w, FALSE, FALSE, 0); + gtk_misc_set_alignment (GTK_MISC (w), 1.0, 0.5); + gtk_table_attach (GTK_TABLE (table), w, 0, 1, 0, 1, + GTK_FILL, GTK_FILL, 4, 0); } entry = gtk_secure_entry_new (); @@ -325,10 +330,32 @@ G_CALLBACK (enter_callback), entry); g_signal_connect (G_OBJECT (entry), "changed", G_CALLBACK (changed_text_handler), entry); - gtk_box_pack_start (GTK_BOX (ebox), entry, TRUE, TRUE, 0); + gtk_table_attach (GTK_TABLE (table), entry, 1, 2, 0, 1, + GTK_EXPAND|GTK_FILL, GTK_EXPAND|GTK_FILL, 0, 0); gtk_widget_grab_focus (entry); gtk_widget_show (entry); + if (pinentry->quality_bar) + { + msg = pinentry_utf8_validate (pinentry->quality_bar); + w = gtk_label_new (msg); + g_free (msg); + gtk_misc_set_alignment (GTK_MISC (w), 1.0, 0.5); + gtk_table_attach (GTK_TABLE (table), w, 0, 1, 1, 2, + GTK_FILL, GTK_FILL, 4, 0); + qualitybar = gtk_progress_bar_new(); + gtk_widget_add_events (qualitybar, + GDK_ENTER_NOTIFY_MASK | GDK_LEAVE_NOTIFY_MASK); + gtk_progress_bar_set_text (GTK_PROGRESS_BAR (qualitybar), + QUALITYBAR_EMPTY_TEXT); + gtk_progress_bar_set_fraction (GTK_PROGRESS_BAR (qualitybar), 0.0); + if (pinentry->quality_bar_tt) + gtk_tooltips_set_tip (GTK_TOOLTIPS (tooltips), qualitybar, + pinentry->quality_bar_tt, ""); + gtk_table_attach (GTK_TABLE (table), qualitybar, 1, 2, 1, 2, + GTK_EXPAND|GTK_FILL, GTK_EXPAND|GTK_FILL, 0, 0); + } + if (pinentry->enhanced) { GtkWidget *sbox = gtk_hbox_new (FALSE, HIG_SMALL); Modified: trunk/pinentry/pinentry.c =================================================================== --- trunk/pinentry/pinentry.c 2007-09-18 17:52:39 UTC (rev 170) +++ trunk/pinentry/pinentry.c 2007-11-19 12:36:53 UTC (rev 171) @@ -69,7 +69,8 @@ 0, /* Result. */ 0, /* Locale error flag. */ 0, /* One-button flag. */ - 0, /* Quality-Bar flag. */ + NULL, /* Quality-Bar flag and description. */ + NULL, /* Quality-Bar tooltip. */ PINENTRY_COLOR_DEFAULT, 0, PINENTRY_COLOR_DEFAULT, @@ -640,7 +641,7 @@ } -/* note, that it is sufficient to allocate the target string D as +/* Note, that it is sufficient to allocate the target string D as long as the source string S, i.e.: strlen(s)+1; */ static void strcpy_escaped (char *d, const unsigned char *s) @@ -749,11 +750,45 @@ static int cmd_setqualitybar (ASSUAN_CONTEXT ctx, char *line) { - pinentry.quality_bar = 1; + char *newval; + + if (!*line) + line = "Quality:"; + + newval = malloc (strlen (line) + 1); + if (!newval) + return ASSUAN_Out_Of_Core; + + strcpy_escaped (newval, line); + if (pinentry.quality_bar) + free (pinentry.quality_bar); + pinentry.quality_bar = newval; return 0; } +/* Set the tooltip to be used for a quality bar. */ +static int +cmd_setqualitybar_tt (ASSUAN_CONTEXT ctx, char *line) +{ + char *newval; + if (*line) + { + newval = malloc (strlen (line) + 1); + if (!newval) + return ASSUAN_Out_Of_Core; + + strcpy_escaped (newval, line); + } + else + newval = NULL; + if (pinentry.quality_bar_tt) + free (pinentry.quality_bar_tt); + pinentry.quality_bar_tt = newval; + return 0; +} + + static int cmd_getpin (ASSUAN_CONTEXT ctx, char *line) { @@ -881,6 +916,7 @@ { "CONFIRM", 0, cmd_confirm }, { "MESSAGE", 0, cmd_message }, { "SETQUALITYBAR", 0, cmd_setqualitybar }, + { "SETQUALITYBAR_TT", 0, cmd_setqualitybar_tt }, { NULL } }; int i, j, rc; Modified: trunk/pinentry/pinentry.h =================================================================== --- trunk/pinentry/pinentry.h 2007-09-18 17:52:39 UTC (rev 170) +++ trunk/pinentry/pinentry.h 2007-11-19 12:36:53 UTC (rev 171) @@ -91,11 +91,15 @@ dismiss button is required. */ int one_button; - /* If this is set, a passphrase quality indicator is shown. There - will also be an inquiry back to the caller to get an indication - of the quality for the passphrase entered so far. */ - int quality_bar; + /* If this is not NULL, a passphrase quality indicator is shown. + There will also be an inquiry back to the caller to get an + indication of the quality for the passphrase entered so far. The + string is used as a labe for the auality bar. */ + char *quality_bar; + /* The tooltip to be show for the qualitybar. Malloced or NULL. */ + char *quality_bar_tt; + /* For the curses pinentry, the color of error messages. */ pinentry_color_t color_fg; int color_fg_bright; Modified: trunk/qt/main.cpp =================================================================== --- trunk/qt/main.cpp 2007-09-18 17:52:39 UTC (rev 170) +++ trunk/qt/main.cpp 2007-11-19 12:36:53 UTC (rev 171) @@ -84,6 +84,10 @@ pinentry.setCancelText (QString::fromUtf8 (pe->cancel)); if (pe->error) pinentry.setError (QString::fromUtf8 (pe->error)); + if (pe->quality_bar) + pinentry.setQualityBar (QString::fromUtf8 (pe->quality_bar)); + if (pe->quality_bar_tt) + pinentry.setQualityBarTT (QString::fromUtf8 (pe->quality_bar_tt)); bool ret = pinentry.exec (); if (!ret) Modified: trunk/qt/pinentrydialog.cpp =================================================================== --- trunk/qt/pinentrydialog.cpp 2007-09-18 17:52:39 UTC (rev 170) +++ trunk/qt/pinentrydialog.cpp 2007-11-19 12:36:53 UTC (rev 171) @@ -24,6 +24,7 @@ #include #include #include +#include #include "secqlineedit.h" @@ -46,29 +47,34 @@ _error = new QLabel( this ); labelLayout->addWidget( _error ); + _desc = new QLabel( this ); + labelLayout->addWidget( _desc ); + + QGridLayout* grid = new QGridLayout( labelLayout ); + + _prompt = new QLabel( this ); + _prompt->setAlignment( Qt::AlignRight | Qt::AlignVCenter ); + grid->addWidget( _prompt, 0, 0 ); + _edit = new SecQLineEdit( this ); + _edit->setMaxLength( 256 ); + _edit->setEchoMode( SecQLineEdit::Password ); + grid->addWidget( _edit, 0, 1 ); + if (enable_quality_bar) { - _quality_bar = new QProgressBar (this); - _quality_bar->setCenterIndicator (true); - labelLayout->addWidget ( _quality_bar ); + QLabel* _quality_bar_label = new QLabel( this ); + _quality_bar_label->setAlignment( Qt::AlignRight | Qt::AlignVCenter ); + grid->addWidget ( _quality_bar_label, 1, 0 ); + _quality_bar = new QProgressBar( this ); + _quality_bar->setCenterIndicator( true ); + grid->addWidget( _quality_bar, 1, 1 ); _have_quality_bar = true; } else _have_quality_bar = false; - - _desc = new QLabel( this ); - labelLayout->addWidget( _desc ); QBoxLayout* l = new QHBoxLayout( top ); - _prompt = new QLabel( this ); - l->addWidget( _prompt ); - _edit = new SecQLineEdit( this ); - _edit->setMaxLength( 256 ); - _edit->setEchoMode( SecQLineEdit::Password ); - l->addWidget( _edit ); - l = new QHBoxLayout( top ); - _ok = new QPushButton( tr("OK"), this ); _cancel = new QPushButton( tr("Cancel"), this ); @@ -208,7 +214,18 @@ _cancel->setText( txt ); } +void PinEntryDialog::setQualityBar( const QString& txt ) +{ + if (_have_quality_bar) + _quality_bar_label->setText( txt ); +} +void PinEntryDialog::setQualityBarTT( const QString& txt ) +{ + if (_have_quality_bar) + QToolTip::add ( _quality_bar, txt ); +} + void PinEntryDialog::setPinentryInfo (pinentry_t peinfo ) { _pinentry_info = peinfo; Modified: trunk/qt/pinentrydialog.h =================================================================== --- trunk/qt/pinentrydialog.h 2007-09-18 17:52:39 UTC (rev 170) +++ trunk/qt/pinentrydialog.h 2007-11-19 12:36:53 UTC (rev 171) @@ -56,6 +56,9 @@ void setOkText( const QString& ); void setCancelText( const QString& ); + void setQualityBar( const QString& ); + void setQualityBarTT( const QString& ); + void setPinentryInfo (pinentry_t); public slots: @@ -75,6 +78,7 @@ QLabel* _desc; QLabel* _error; QLabel* _prompt; + QLabel* _quality_bar_label; QProgressBar* _quality_bar; SecQLineEdit* _edit; QPushButton* _ok; From cvs at cvs.gnupg.org Mon Nov 19 17:32:15 2007 From: cvs at cvs.gnupg.org (svn author wk) Date: Mon, 19 Nov 2007 17:32:15 +0100 Subject: [svn] GnuPG - r4624 - in trunk: . doc sm Message-ID: Author: wk Date: 2007-11-19 17:32:05 +0100 (Mon, 19 Nov 2007) New Revision: 4624 Modified: trunk/TODO trunk/doc/ChangeLog trunk/doc/DETAILS trunk/doc/gpgsm.texi trunk/sm/ChangeLog trunk/sm/certlist.c trunk/sm/server.c Log: Document --auto-issuer-key-retrieve. Modified: trunk/TODO =================================================================== --- trunk/TODO 2007-11-19 16:03:50 UTC (rev 4623) +++ trunk/TODO 2007-11-19 16:32:05 UTC (rev 4624) @@ -129,3 +129,12 @@ This may happen and lead to an Ambiguous Name error. Solution is to check the certs for identity before throwing this error. +* Gpg-Agent Locale + Although we pass LC_MESSAGE from gpgsm et al. to Pinentry, this has + only an effect on the stock GTK strings (e.g. "OK") and not on any + strings gpg-agent generates and passes to Pinentry. This defeats + our design goal to allow changing the locale without changing + gpg-agent's default locale (e.g. by the command updatestartuptty). + + + Modified: trunk/doc/ChangeLog =================================================================== --- trunk/doc/ChangeLog 2007-11-19 16:03:50 UTC (rev 4623) +++ trunk/doc/ChangeLog 2007-11-19 16:32:05 UTC (rev 4624) @@ -1,3 +1,8 @@ +2007-11-19 Werner Koch + + * gpgsm.texi (Certificate Options): Document + --auto-issuer-key-retrieve. + 2007-11-15 Werner Koch * gpg.texi (GPG Configuration): Add PINENTRY_USER_DATA. Modified: trunk/doc/DETAILS =================================================================== --- trunk/doc/DETAILS 2007-11-19 16:03:50 UTC (rev 4623) +++ trunk/doc/DETAILS 2007-11-19 16:32:05 UTC (rev 4624) @@ -554,6 +554,7 @@ 8 := "Policy mismatch" 9 := "Not a secret key" 10 := "Key not trusted" + 11 := "Missing certifciate" (e.g. intermediate or root cert.) Note that this status is also used for gpgsm's SIGNER command where it relates to signer's of course. Modified: trunk/doc/gpgsm.texi =================================================================== --- trunk/doc/gpgsm.texi 2007-11-19 16:03:50 UTC (rev 4623) +++ trunk/doc/gpgsm.texi 2007-11-19 16:32:05 UTC (rev 4624) @@ -405,7 +405,7 @@ @itemx --disable-ocsp @opindex enable-ocsp @opindex disable-ocsp -Be default @acronym{OCSP} checks are disabled. The enable opton may +Be default @acronym{OCSP} checks are disabled. The enable option may be used to enable OCSP checks via Dirmngr. If @acronym{CRL} checks are also enabled, CRLs will be used as a fallback if for some reason an OCSP request won't succeed. Note, that you have to allow OCSP @@ -413,7 +413,18 @@ @option{--allow-ocsp} and configure dirmngr properly. If you don't do so you will get the error code @samp{Not supported}. + at item --auto-issuer-key-retrieve + at opindex auto-issuer-key-retrieve +If a required certificate is missing while validating the chain of +certificates, try to load that certificate from an external location. +This usually means that Dirmngr is employed t search for the +certificate. Note that this option makes a "web bug" like behavior +possible. LDAP server operators can see which keys you request, so by +sending you a message signed by a brand new key (which you naturally +will not have on your local keybox), the operator can tell both your IP +address and the time when you verified the signature. + @item --validation-model @var{name} @opindex validation-model This option changes the default validation model. The only possible Modified: trunk/sm/ChangeLog =================================================================== --- trunk/sm/ChangeLog 2007-11-19 16:03:50 UTC (rev 4623) +++ trunk/sm/ChangeLog 2007-11-19 16:32:05 UTC (rev 4624) @@ -1,5 +1,7 @@ 2007-11-19 Werner Koch + * server.c (cmd_recipient, cmd_signer): Add error reason 11. + * gpgsm.c (main): Print a warning if --audit-log is used. 2007-11-15 Werner Koch Modified: trunk/sm/certlist.c =================================================================== --- trunk/sm/certlist.c 2007-11-19 16:03:50 UTC (rev 4623) +++ trunk/sm/certlist.c 2007-11-19 16:32:05 UTC (rev 4624) @@ -359,7 +359,7 @@ { ksba_cert_t cert2 = NULL; - /* If this is the first possible duplicate, add thye orginal + /* If this is the first possible duplicate, add the original certificate to our list of duplicates. */ if (!dup_certs) gpgsm_add_cert_to_certlist (ctrl, cert, &dup_certs, 0); Modified: trunk/sm/server.c =================================================================== --- trunk/sm/server.c 2007-11-19 16:03:50 UTC (rev 4623) +++ trunk/sm/server.c 2007-11-19 16:32:05 UTC (rev 4624) @@ -380,6 +380,7 @@ r == GPG_ERR_NO_CRL_KNOWN? "6": r == GPG_ERR_CRL_TOO_OLD? "7": r == GPG_ERR_NO_POLICY_MATCH? "8": + r == GPG_ERR_MISSING_CERT? "11": "0", line, NULL); } @@ -425,6 +426,7 @@ r == GPG_ERR_CRL_TOO_OLD? "7": r == GPG_ERR_NO_POLICY_MATCH? "8": r == GPG_ERR_NO_SECKEY? "9": + r == GPG_ERR_MISSING_CERT? "11": "0", line, NULL); } From cvs at cvs.gnupg.org Mon Nov 19 20:30:03 2007 From: cvs at cvs.gnupg.org (svn author wk) Date: Mon, 19 Nov 2007 20:30:03 +0100 Subject: [svn] pinentry - r172 - in trunk: . doc Message-ID: Author: wk Date: 2007-11-19 20:29:54 +0100 (Mon, 19 Nov 2007) New Revision: 172 Modified: trunk/ChangeLog trunk/TODO trunk/doc/pinentry.texi Log: Applied patch from Bernhard Herzog to fix the Crash in Qt. (really stupid error by me). Typo fixes. Modified: trunk/ChangeLog =================================================================== --- trunk/ChangeLog 2007-11-19 12:36:53 UTC (rev 171) +++ trunk/ChangeLog 2007-11-19 19:29:54 UTC (rev 172) @@ -1,5 +1,14 @@ 2007-11-19 Werner Koch + * doc/pinentry.texi (Protocol): Typo fixes by Bernhard Herzog. + Describe SETQUALITYBAR_TT. + +2007-11-19 Bernhard Herzog (wk) + + * qt/pinentrydialog.cpp (PinEntryDialog): Fixed crash + +2007-11-19 Werner Koch + * gtk+-2/pinentry-gtk-2.c (create_window): Use again map-event and unmap-event as this works on my setup far more reliable than expose-event/no-expose-event. @@ -18,6 +27,7 @@ (_quality_bar_label): New. * qt/pinentrydialog.cpp (setQualityBar, setQualityBarTT): New. (PinEntryDialog): Remove setting of tooltip. + * qt/main.cpp (qt_cmd_handler): Propagate quality bar label and tootip. 2007-11-19 Bernhard Herzog (wk) Modified: trunk/TODO =================================================================== --- trunk/TODO 2007-11-19 12:36:53 UTC (rev 171) +++ trunk/TODO 2007-11-19 19:29:54 UTC (rev 172) @@ -17,3 +17,7 @@ * The gtk+-2 pinentry needs auditing. * Implement the one_button feature in Qt. + +* The format of the Assuan protocol description should be changed to + the one used by GnuPG. + Modified: trunk/doc/pinentry.texi =================================================================== --- trunk/doc/pinentry.texi 2007-11-19 12:36:53 UTC (rev 171) +++ trunk/doc/pinentry.texi 2007-11-19 19:29:54 UTC (rev 172) @@ -288,11 +288,21 @@ S: OK @end example -If a custom laber for the auality bar is required, just add that label -as an argument as precent escaped string. You will need this feature to +If a custom label for the quality bar is required, just add that label +as an argument as percent escaped string. You will need this feature to translate the label because pinentry has no internal gettext except for stock strings from the toolkit library. +If you want to show a tooltip for the quality bar, you may use + at example + C: SETQUALITYBAR_TT string + S: OK + at end example + + at noindent +With STRING being a percent escaped string shown as the tooltip. + + @item Ask for a PIN The meat of this tool is to ask for a passphrase of PIN, it is done with this command: From cvs at cvs.gnupg.org Tue Nov 20 11:40:50 2007 From: cvs at cvs.gnupg.org (svn author wk) Date: Tue, 20 Nov 2007 11:40:50 +0100 Subject: [svn] gpgme - r1277 - trunk/gpgme Message-ID: Author: wk Date: 2007-11-20 11:40:41 +0100 (Tue, 20 Nov 2007) New Revision: 1277 Modified: trunk/gpgme/ChangeLog trunk/gpgme/gpgme.h trunk/gpgme/op-support.c Log: Suuport INV_RECP reason code 11. Changed address paragraph in top comment. Modified: trunk/gpgme/ChangeLog =================================================================== --- trunk/gpgme/ChangeLog 2007-11-12 11:34:13 UTC (rev 1276) +++ trunk/gpgme/ChangeLog 2007-11-20 10:40:41 UTC (rev 1277) @@ -1,3 +1,7 @@ +2007-11-20 Werner Koch + + * op-support.c (_gpgme_parse_inv_recp): Add new reason code 11. + 2007-11-12 Marcus Brinkmann * kdpipeiodevice.cpp: New version from Frank Osterfeld. Modified: trunk/gpgme/gpgme.h =================================================================== --- trunk/gpgme/gpgme.h 2007-11-12 11:34:13 UTC (rev 1276) +++ trunk/gpgme/gpgme.h 2007-11-20 10:40:41 UTC (rev 1277) @@ -15,9 +15,8 @@ Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public - License along with this program; if not, write to the Free Software - Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, - MA 02110-1301, USA. */ + License along with this program; if not, see . + */ #ifndef GPGME_H #define GPGME_H Modified: trunk/gpgme/op-support.c =================================================================== --- trunk/gpgme/op-support.c 2007-11-12 11:34:13 UTC (rev 1276) +++ trunk/gpgme/op-support.c 2007-11-20 10:40:41 UTC (rev 1277) @@ -1,5 +1,5 @@ -/* op-support.c - Copyright (C) 2002, 2003, 2004 g10 Code GmbH +/* op-support.c - Supporting functions. + Copyright (C) 2002, 2003, 2004, 2007 g10 Code GmbH This file is part of GPGME. @@ -14,9 +14,8 @@ Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public - License along with this program; if not, write to the Free Software - Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA - 02111-1307, USA. */ + License along with this program; if not, see . + */ #if HAVE_CONFIG_H #include @@ -214,6 +213,10 @@ case 10: inv_key->reason = gpg_error (GPG_ERR_PUBKEY_NOT_TRUSTED); break; + + case 11: + inv_key->reason = gpg_error (GPG_ERR_MISSING_CERT); + break; } while (*tail == ' ') From cvs at cvs.gnupg.org Thu Nov 22 17:24:30 2007 From: cvs at cvs.gnupg.org (svn author wk) Date: Thu, 22 Nov 2007 17:24:30 +0100 Subject: [svn] GnuPG - r4625 - trunk/sm Message-ID: Author: wk Date: 2007-11-22 17:24:21 +0100 (Thu, 22 Nov 2007) New Revision: 4625 Modified: trunk/sm/ChangeLog trunk/sm/server.c Log: New command GETAUDITLOG Modified: trunk/sm/ChangeLog =================================================================== --- trunk/sm/ChangeLog 2007-11-19 16:32:05 UTC (rev 4624) +++ trunk/sm/ChangeLog 2007-11-22 16:24:21 UTC (rev 4625) @@ -1,3 +1,8 @@ +2007-11-22 Werner Koch + + * server.c (cmd_getauditlog): New. + (register_commands): Register GETAUDITLOG + 2007-11-19 Werner Koch * server.c (cmd_recipient, cmd_signer): Add error reason 11. Modified: trunk/sm/server.c =================================================================== --- trunk/sm/server.c 2007-11-19 16:32:05 UTC (rev 4624) +++ trunk/sm/server.c 2007-11-22 16:24:21 UTC (rev 4625) @@ -933,8 +933,43 @@ } + +/* GETAUDITLOG + !!!WORK in PROGRESS!!! + */ +static int +cmd_getauditlog (assuan_context_t ctx, char *line) +{ + ctrl_t ctrl = assuan_get_pointer (ctx); + int out_fd; + FILE *out_fp; + int rc; + if (!ctrl->audit) + return gpg_error (GPG_ERR_NO_DATA); + + out_fd = translate_sys2libc_fd (assuan_get_output_fd (ctx), 1); + if (out_fd == -1) + return set_error (GPG_ERR_ASS_NO_OUTPUT, NULL); + + out_fp = fdopen ( dup(out_fd), "w"); + if (!out_fp) + { + return set_error (GPG_ERR_ASS_GENERAL, "fdopen() failed"); + } + audit_print_result (ctrl->audit, out_fp); + rc = 0; + fclose (out_fp); + + /* Close and reset the fd. */ + assuan_close_output_fd (ctx); + return rc; +} + + + + /* Tell the assuan library about our commands */ static int @@ -961,6 +996,7 @@ { "DUMPSECRETKEYS",cmd_dumpsecretkeys }, { "GENKEY", cmd_genkey }, { "DELKEYS", cmd_delkeys }, + { "GETAUDITLOG", cmd_getauditlog }, { NULL } }; int i, rc; From cvs at cvs.gnupg.org Thu Nov 22 17:44:52 2007 From: cvs at cvs.gnupg.org (svn author wk) Date: Thu, 22 Nov 2007 17:44:52 +0100 Subject: [svn] gpgme - r1278 - in trunk: . assuan gpgme tests/gpgsm Message-ID: Author: wk Date: 2007-11-22 17:44:37 +0100 (Thu, 22 Nov 2007) New Revision: 1278 Added: trunk/gpgme/getauditlog.c Modified: trunk/AUTHORS trunk/NEWS trunk/assuan/assuan-buffer.c trunk/assuan/mkerrors trunk/gpgme/ChangeLog trunk/gpgme/Makefile.am trunk/gpgme/engine-backend.h trunk/gpgme/engine-gpgsm.c trunk/gpgme/engine.c trunk/gpgme/engine.h trunk/gpgme/gpgme.def trunk/gpgme/gpgme.h trunk/gpgme/libgpgme.vers trunk/gpgme/rungpg.c trunk/tests/gpgsm/t-verify.c Log: New API gpgme_op_getauditlog. Modified: trunk/AUTHORS =================================================================== --- trunk/AUTHORS 2007-11-20 10:40:41 UTC (rev 1277) +++ trunk/AUTHORS 2007-11-22 16:44:37 UTC (rev 1278) @@ -2,6 +2,7 @@ Maintainer: Marcus Brinkmann Bug reports: bug-gpgme at gnupg.org Security related bug reports: security at gnupg.org +License: LGPLv2.1+ FSF Modified: trunk/NEWS =================================================================== --- trunk/NEWS 2007-11-20 10:40:41 UTC (rev 1277) +++ trunk/NEWS 2007-11-22 16:44:37 UTC (rev 1278) @@ -6,6 +6,10 @@ * Interface changes relative to the 1.1.1 release: ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ gpgme_signature_t EXTENDED: New field chain_model. + gpgme_op_getauditlog_start NEW. + gpgme_op_getauditlog NEW. + GPGME_AUDITLOG_HTML NEW. + GPGME_AUDITLOG_WITH_HELP NEW. Noteworthy changes in version 1.1.5 (2007-07-09) @@ -1192,7 +1196,7 @@ * Made the W32 support more robust. - Copyright 2001, 2002, 2003, 2004, 2005 g10 Code GmbH + Copyright 2001, 2002, 2003, 2004, 2005, 2007 g10 Code GmbH This file is free software; as a special exception the author gives unlimited permission to copy and/or distribute it, with or without Modified: trunk/assuan/assuan-buffer.c =================================================================== --- trunk/assuan/assuan-buffer.c 2007-11-20 10:40:41 UTC (rev 1277) +++ trunk/assuan/assuan-buffer.c 2007-11-22 16:44:37 UTC (rev 1278) @@ -135,10 +135,10 @@ if (rc) { if (ctx->log_fp) - fprintf (ctx->log_fp, "%s[%u.%d] DBG: <- [Error: %s]\n", + fprintf (ctx->log_fp, "%s[%u.%d] DBG: <- [Error: %s (%d)]\n", assuan_get_assuan_log_prefix (), (unsigned int)getpid (), ctx->inbound.fd, - strerror (errno)); + strerror (errno), errno); return _assuan_error (ASSUAN_Read_Error); } if (!nread) Modified: trunk/assuan/mkerrors =================================================================== --- trunk/assuan/mkerrors 2007-11-20 10:40:41 UTC (rev 1277) +++ trunk/assuan/mkerrors 2007-11-22 16:44:37 UTC (rev 1278) @@ -16,9 +16,7 @@ # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public -# License along with this program; if not, write to the Free Software -# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA - +# License along with this program; if not, see . cat < 0 && errno < 4096) + { + n = (EAGAIN | (1 << 15)); + break; + } default: n = 270; /*GPG_ERR_ASS_READ_ERROR*/ break; } break; @@ -98,6 +107,12 @@ switch (errno) { case 0: n = 16381; /*GPG_ERR_MISSING_ERRNO*/ break; + case EAGAIN: + if (errno > 0 && errno < 4096) + { + n = (EAGAIN | (1 << 15)); + break; + } default: n = 271; /*GPG_ERR_ASS_WRITE_ERROR*/ break; } break; @@ -111,7 +126,12 @@ an error is indeed returned. */ n = 16381; /*GPG_ERR_MISSING_ERRNO*/ break; - case ENOMEM: n = (1 << 15) | 86; break; + case ENOMEM: + if (errno > 0 && errno < 4096) + { + n = (ENOMEM | (1 << 15)); + break; + } default: n = 16382; /*GPG_ERR_UNKNOWN_ERRNO*/ break; Modified: trunk/gpgme/ChangeLog =================================================================== --- trunk/gpgme/ChangeLog 2007-11-20 10:40:41 UTC (rev 1277) +++ trunk/gpgme/ChangeLog 2007-11-22 16:44:37 UTC (rev 1278) @@ -1,3 +1,15 @@ +2007-11-22 Werner Koch + + * gpgme.h (gpgme_op_getauditlog_start, gpgme_op_getauditlog): New. + * libgpgme.vers: Ditto. + * gpgme.def: Ditto. + * getauditlog.c: New. + * engine-backend.h (struct engine_ops): Add member GETAUDITLOG. + * engine-gpgsm.c (gpgsm_getauditlog): New. + (_gpgme_engine_ops_gpgsm): Insert new function. + (gpgsm_new): Try to enable audit log support. + * rungpg.c (_gpgme_engine_ops_gpg): Insert dummy entry. + 2007-11-20 Werner Koch * op-support.c (_gpgme_parse_inv_recp): Add new reason code 11. Modified: trunk/gpgme/Makefile.am =================================================================== --- trunk/gpgme/Makefile.am 2007-11-20 10:40:41 UTC (rev 1277) +++ trunk/gpgme/Makefile.am 2007-11-22 16:44:37 UTC (rev 1278) @@ -98,7 +98,7 @@ encrypt.c encrypt-sign.c decrypt.c decrypt-verify.c verify.c \ sign.c passphrase.c progress.c \ key.c keylist.c trust-item.c trustlist.c \ - import.c export.c genkey.c delete.c edit.c \ + import.c export.c genkey.c delete.c edit.c getauditlog.c \ engine.h engine-backend.h engine.c rungpg.c status-table.h \ $(gpgsm_components) sema.h priv-io.h $(system_components) \ debug.c debug.h gpgme.c version.c error.c Modified: trunk/gpgme/engine-backend.h =================================================================== --- trunk/gpgme/engine-backend.h 2007-11-20 10:40:41 UTC (rev 1277) +++ trunk/gpgme/engine-backend.h 2007-11-22 16:44:37 UTC (rev 1278) @@ -94,7 +94,9 @@ gpgme_error_t (*verify) (void *engine, gpgme_data_t sig, gpgme_data_t signed_text, gpgme_data_t plaintext); - + gpgme_error_t (*getauditlog) (void *engine, gpgme_data_t output, + unsigned int flags); + void (*set_io_cbs) (void *engine, gpgme_io_cbs_t io_cbs); void (*io_event) (void *engine, gpgme_event_io_t type, void *type_data); Modified: trunk/gpgme/engine-gpgsm.c =================================================================== --- trunk/gpgme/engine-gpgsm.c 2007-11-20 10:40:41 UTC (rev 1277) +++ trunk/gpgme/engine-gpgsm.c 2007-11-22 16:44:37 UTC (rev 1278) @@ -515,6 +515,15 @@ } } + /* Ask gpgsm to enable the audit log support. */ + if (!err) + { + err = assuan_transact (gpgsm->assuan_ctx, "OPTION enable-audit-log=1", + NULL, NULL, NULL, NULL, NULL, NULL); + if (gpg_err_code (err) == GPG_ERR_UNKNOWN_OPTION) + err = 0; /* This is an optional feature of gpgsm. */ + } + #if !USE_DESCRIPTOR_PASSING if (!err && (_gpgme_io_set_close_notify (gpgsm->input_cb.fd, @@ -1704,6 +1713,32 @@ } +/* Send the GETAUDITLOG command. The result is saved to a gpgme data + object. */ +static gpgme_error_t +gpgsm_getauditlog (void *engine, gpgme_data_t output, unsigned int flags) +{ + engine_gpgsm_t gpgsm = engine; + gpgme_error_t err = 0; + + if (!gpgsm || !output) + return gpg_error (GPG_ERR_INV_VALUE); + + gpgsm->output_cb.data = output; + err = gpgsm_set_fd (gpgsm, OUTPUT_FD, 0); + if (err) + return err; + + gpgsm_clear_fd (gpgsm, INPUT_FD); + gpgsm_clear_fd (gpgsm, MESSAGE_FD); + + err = start (gpgsm, "GETAUDITLOG"); + + return err; +} + + + static void gpgsm_set_status_handler (void *engine, engine_status_handler_t fnc, void *fnc_value) @@ -1782,6 +1817,7 @@ gpgsm_sign, NULL, /* trustlist */ gpgsm_verify, + gpgsm_getauditlog, gpgsm_set_io_cbs, gpgsm_io_event, gpgsm_cancel Modified: trunk/gpgme/engine.c =================================================================== --- trunk/gpgme/engine.c 2007-11-20 10:40:41 UTC (rev 1277) +++ trunk/gpgme/engine.c 2007-11-22 16:44:37 UTC (rev 1278) @@ -710,6 +710,20 @@ } +gpgme_error_t +_gpgme_engine_op_getauditlog (engine_t engine, gpgme_data_t output, + unsigned int flags) +{ + if (!engine) + return gpg_error (GPG_ERR_INV_VALUE); + + if (!engine->ops->getauditlog) + return gpg_error (GPG_ERR_NOT_IMPLEMENTED); + + return (*engine->ops->getauditlog) (engine->engine, output, flags); +} + + void _gpgme_engine_set_io_cbs (engine_t engine, gpgme_io_cbs_t io_cbs) { Modified: trunk/gpgme/engine.h =================================================================== --- trunk/gpgme/engine.h 2007-11-20 10:40:41 UTC (rev 1277) +++ trunk/gpgme/engine.h 2007-11-22 16:44:37 UTC (rev 1278) @@ -123,6 +123,10 @@ gpgme_data_t signed_text, gpgme_data_t plaintext); +gpgme_error_t _gpgme_engine_op_getauditlog (engine_t engine, + gpgme_data_t output, + unsigned int flags); + void _gpgme_engine_set_io_cbs (engine_t engine, gpgme_io_cbs_t io_cbs); void _gpgme_engine_io_event (engine_t engine, Added: trunk/gpgme/getauditlog.c =================================================================== --- trunk/gpgme/getauditlog.c 2007-11-20 10:40:41 UTC (rev 1277) +++ trunk/gpgme/getauditlog.c 2007-11-22 16:44:37 UTC (rev 1278) @@ -0,0 +1,81 @@ +/* getauditlog.c - Retrieve the audit log. + Copyright (C) 2007 g10 Code GmbH + + This file is part of GPGME. + + GPGME is free software; you can redistribute it and/or modify it + under the terms of the GNU Lesser General Public License as + published by the Free Software Foundation; either version 2.1 of + the License, or (at your option) any later version. + + GPGME is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this program; if not, see . + */ + +#if HAVE_CONFIG_H +#include +#endif + +#include "gpgme.h" +#include "context.h" +#include "ops.h" + + +static gpgme_error_t +getauditlog_status_handler (void *priv, gpgme_status_code_t code, char *args) +{ + return 0; +} + + +static gpgme_error_t +getauditlog_start (gpgme_ctx_t ctx, int synchronous, + gpgme_data_t output, unsigned int flags) +{ + gpgme_error_t err; + + if (!output) + return gpg_error (GPG_ERR_INV_VALUE); + + err = _gpgme_op_reset (ctx, synchronous); + if (err) + return err; + + _gpgme_engine_set_status_handler (ctx->engine, + getauditlog_status_handler, ctx); + + return _gpgme_engine_op_getauditlog (ctx->engine, output, flags); +} + + + +/* Return the auditlog for the current session. This may be called + after a successful or failed operation. If no audit log is + available GPG_ERR_NO_DATA is returned. This is the asynchronous + variant. */ +gpgme_error_t +gpgme_op_getauditlog_start (gpgme_ctx_t ctx, + gpgme_data_t output, unsigned int flags) +{ + return getauditlog_start (ctx, 0, output, flags); +} + + +/* Return the auditlog for the current session. This may be called + after a successful or failed operation. If no audit log is + available GPG_ERR_NO_DATA is returned. This is the synchronous + variant. */ +gpgme_error_t +gpgme_op_getauditlog (gpgme_ctx_t ctx, gpgme_data_t output, unsigned int flags) +{ + gpgme_error_t err = getauditlog_start (ctx, 1, output, flags); + if (!err) + err = _gpgme_wait_one (ctx); + return err; +} + Modified: trunk/gpgme/gpgme.def =================================================================== --- trunk/gpgme/gpgme.def 2007-11-20 10:40:41 UTC (rev 1277) +++ trunk/gpgme/gpgme.def 2007-11-22 16:44:37 UTC (rev 1278) @@ -156,5 +156,8 @@ gpgme_get_giochannel @121 gpgme_get_fdptr @122 + gpgme_op_getauditlog_start @123 + gpgme_op_getauditlog @124 + ; END Modified: trunk/gpgme/gpgme.h =================================================================== --- trunk/gpgme/gpgme.h 2007-11-20 10:40:41 UTC (rev 1277) +++ trunk/gpgme/gpgme.h 2007-11-22 16:44:37 UTC (rev 1278) @@ -315,6 +315,11 @@ typedef unsigned int gpgme_keylist_mode_t; +/* Flags for the audit log functions. */ +#define GPGME_AUDITLOG_HTML 1 +#define GPGME_AUDITLOG_WITH_HELP 128 + + /* Signature notations. */ /* The available signature notation flags. */ @@ -1639,6 +1644,16 @@ _GPGME_DEPRECATED; +/* Return the auditlog for the current session. This may be called + after a successful or failed operation. If no audit log is + available GPG_ERR_NO_DATA is returned. */ +gpgme_error_t gpgme_op_getauditlog_start (gpgme_ctx_t ctx, gpgme_data_t output, + unsigned int flags); +gpgme_error_t gpgme_op_getauditlog (gpgme_ctx_t ctx, gpgme_data_t output, + unsigned int flags); + + + /* Various functions. */ /* Check that the library fulfills the version requirement. */ Modified: trunk/gpgme/libgpgme.vers =================================================================== --- trunk/gpgme/libgpgme.vers 2007-11-20 10:40:41 UTC (rev 1277) +++ trunk/gpgme/libgpgme.vers 2007-11-22 16:44:37 UTC (rev 1278) @@ -36,6 +36,9 @@ gpgme_sig_notation_get; gpgme_free; + + gpgme_op_getauditlog_start; + gpgme_op_getauditlog; }; Modified: trunk/gpgme/rungpg.c =================================================================== --- trunk/gpgme/rungpg.c 2007-11-20 10:40:41 UTC (rev 1277) +++ trunk/gpgme/rungpg.c 2007-11-22 16:44:37 UTC (rev 1278) @@ -2120,6 +2120,7 @@ gpg_sign, gpg_trustlist, gpg_verify, + NULL, gpg_set_io_cbs, gpg_io_event, gpg_cancel Modified: trunk/tests/gpgsm/t-verify.c =================================================================== --- trunk/tests/gpgsm/t-verify.c 2007-11-20 10:40:41 UTC (rev 1277) +++ trunk/tests/gpgsm/t-verify.c 2007-11-22 16:44:37 UTC (rev 1278) @@ -108,6 +108,21 @@ } +static void +show_auditlog (gpgme_ctx_t ctx) +{ + gpgme_error_t err; + gpgme_data_t data; + + err = gpgme_data_new (&data); + fail_if_err (err); + err = gpgme_op_getauditlog (ctx, data, 0); + fail_if_err (err); + gpgme_data_release (data); +} + + + int main (int argc, char **argv) { @@ -135,6 +150,8 @@ "3CF405464F66ED4A7DF45BBDD1E4282E33BDB76E", GPG_ERR_NO_ERROR, GPGME_VALIDITY_FULL); + show_auditlog (ctx); + /* Checking a manipulated message. */ gpgme_data_release (text); err = gpgme_data_new_from_mem (&text, test_text1f, strlen (test_text1f), 0); From cvs at cvs.gnupg.org Fri Nov 23 14:07:14 2007 From: cvs at cvs.gnupg.org (svn author wk) Date: Fri, 23 Nov 2007 14:07:14 +0100 Subject: [svn] gpgme - r1279 - in trunk: gpgme tests tests/gpgsm Message-ID: Author: wk Date: 2007-11-23 14:07:04 +0100 (Fri, 23 Nov 2007) New Revision: 1279 Modified: trunk/gpgme/ChangeLog trunk/gpgme/getauditlog.c trunk/gpgme/op-support.c trunk/tests/ChangeLog trunk/tests/gpgsm/t-verify.c Log: Make getauditlog work. For now only when configured with --enable-fd-passing. Modified: trunk/gpgme/ChangeLog =================================================================== --- trunk/gpgme/ChangeLog 2007-11-22 16:44:37 UTC (rev 1278) +++ trunk/gpgme/ChangeLog 2007-11-23 13:07:04 UTC (rev 1279) @@ -1,3 +1,8 @@ +2007-11-23 Werner Koch + + * op-support.c (_gpgme_op_reset): Implement a no-reset flag. + * getauditlog.c (getauditlog_start): Use that flag. + 2007-11-22 Werner Koch * gpgme.h (gpgme_op_getauditlog_start, gpgme_op_getauditlog): New. Modified: trunk/gpgme/getauditlog.c =================================================================== --- trunk/gpgme/getauditlog.c 2007-11-22 16:44:37 UTC (rev 1278) +++ trunk/gpgme/getauditlog.c 2007-11-23 13:07:04 UTC (rev 1279) @@ -42,7 +42,7 @@ if (!output) return gpg_error (GPG_ERR_INV_VALUE); - err = _gpgme_op_reset (ctx, synchronous); + err = _gpgme_op_reset (ctx, ((synchronous&255) | 256) ); if (err) return err; Modified: trunk/gpgme/op-support.c =================================================================== --- trunk/gpgme/op-support.c 2007-11-22 16:44:37 UTC (rev 1278) +++ trunk/gpgme/op-support.c 2007-11-23 13:07:04 UTC (rev 1279) @@ -62,16 +62,24 @@ /* type is: 0: asynchronous operation (use global or user event loop). 1: synchronous operation (always use private event loop). 2: asynchronous private operation (use private or user - event loop). */ + event loop). + 256: Modification flag to suppress the engine reset. +*/ gpgme_error_t _gpgme_op_reset (gpgme_ctx_t ctx, int type) { gpgme_error_t err = 0; struct gpgme_io_cbs io_cbs; + int no_reset = (type & 256); + int reuse_engine = 0; + type &= 255; + _gpgme_release_result (ctx); - if (ctx->engine) + if (ctx->engine && no_reset) + reuse_engine = 1; + else if (ctx->engine) { /* Attempt to reset an existing engine. */ @@ -99,18 +107,20 @@ return err; } - err = _gpgme_engine_set_locale (ctx->engine, LC_CTYPE, ctx->lc_ctype); + if (!reuse_engine) + { + err = _gpgme_engine_set_locale (ctx->engine, LC_CTYPE, ctx->lc_ctype); #ifdef LC_MESSAGES - if (!err) - err = _gpgme_engine_set_locale (ctx->engine, - LC_MESSAGES, ctx->lc_messages); + if (!err) + err = _gpgme_engine_set_locale (ctx->engine, + LC_MESSAGES, ctx->lc_messages); #endif - - if (err) - { - _gpgme_engine_release (ctx->engine); - ctx->engine = NULL; - return err; + if (err) + { + _gpgme_engine_release (ctx->engine); + ctx->engine = NULL; + return err; + } } if (type == 1 || (type == 2 && !ctx->io_cbs.add)) Modified: trunk/tests/ChangeLog =================================================================== --- trunk/tests/ChangeLog 2007-11-22 16:44:37 UTC (rev 1278) +++ trunk/tests/ChangeLog 2007-11-23 13:07:04 UTC (rev 1279) @@ -1,3 +1,10 @@ +2007-11-23 Werner Koch + + * gpgsm/t-verify.c (check_result): Don't exit on error but set a flag. + (main): Cosnult flag for return value. + (show_auditlog): New. + (main): Use it. + 2007-09-27 Marcus Brinkmann * t-engine-info.c (check_engine_info): Fix debug output. Modified: trunk/tests/gpgsm/t-verify.c =================================================================== --- trunk/tests/gpgsm/t-verify.c 2007-11-22 16:44:37 UTC (rev 1278) +++ trunk/tests/gpgsm/t-verify.c 2007-11-23 13:07:04 UTC (rev 1279) @@ -34,6 +34,8 @@ #include "t-support.h" +static int got_errors; + static const char test_text1[] = "Hallo Leute!\n"; static const char test_text1f[]= "Hallo Leute?\n"; static const char test_sig1[] = @@ -60,50 +62,50 @@ { fprintf (stderr, "%s:%i: Unexpected number of signatures\n", __FILE__, __LINE__); - exit (1); + got_errors = 1; } if (sig->summary != summary) { fprintf (stderr, "%s:%i: Unexpected signature summary: " "want=0x%x have=0x%x\n", __FILE__, __LINE__, summary, sig->summary); - exit (1); + got_errors = 1; } if (strcmp (sig->fpr, fpr)) { fprintf (stderr, "%s:%i: Unexpected fingerprint: %s\n", __FILE__, __LINE__, sig->fpr); - exit (1); + got_errors = 1; } if (gpg_err_code (sig->status) != status) { fprintf (stderr, "%s:%i: Unexpected signature status: %s\n", __FILE__, __LINE__, gpgme_strerror (sig->status)); - exit (1); + got_errors = 1; } if (sig->notations) { fprintf (stderr, "%s:%i: Unexpected notation data\n", __FILE__, __LINE__); - exit (1); + got_errors = 1; } if (sig->wrong_key_usage) { fprintf (stderr, "%s:%i: Unexpectedly wrong key usage\n", __FILE__, __LINE__); - exit (1); + got_errors = 1; } if (sig->validity != validity) { fprintf (stderr, "%s:%i: Unexpected validity: %i\n", __FILE__, __LINE__, sig->validity); - exit (1); + got_errors = 1; } if (gpg_err_code (sig->validity_reason) != GPG_ERR_NO_ERROR) { fprintf (stderr, "%s:%i: Unexpected validity reason: %s\n", __FILE__, __LINE__, gpgme_strerror (sig->validity_reason)); - exit (1); + got_errors = 1; } } @@ -117,7 +119,13 @@ err = gpgme_data_new (&data); fail_if_err (err); err = gpgme_op_getauditlog (ctx, data, 0); - fail_if_err (err); + if (err) + { + fprintf (stderr, "%s:%i: Can't get audit log: %s\n", + __FILE__, __LINE__, gpgme_strerror (err)); + got_errors = 1; + } + print_data (data); gpgme_data_release (data); } @@ -164,8 +172,10 @@ "3CF405464F66ED4A7DF45BBDD1E4282E33BDB76E", GPG_ERR_BAD_SIGNATURE, GPGME_VALIDITY_UNKNOWN); + show_auditlog (ctx); + gpgme_data_release (text); gpgme_data_release (sig); gpgme_release (ctx); - return 0; + return got_errors? 1 : 0; } From cvs at cvs.gnupg.org Fri Nov 23 18:25:20 2007 From: cvs at cvs.gnupg.org (svn author marcus) Date: Fri, 23 Nov 2007 18:25:20 +0100 Subject: [svn] gpgme - r1280 - in trunk/tests: . gpgsm Message-ID: Author: marcus Date: 2007-11-23 18:25:11 +0100 (Fri, 23 Nov 2007) New Revision: 1280 Modified: trunk/tests/ChangeLog trunk/tests/gpgsm/t-verify.c Log: 2007-11-23 Marcus Brinkmann * gpgsm/t-verify.c (show_auditlog): Check for GPG_ERR_ASS_UNKNOWN_CMD. Modified: trunk/tests/ChangeLog =================================================================== --- trunk/tests/ChangeLog 2007-11-23 13:07:04 UTC (rev 1279) +++ trunk/tests/ChangeLog 2007-11-23 17:25:11 UTC (rev 1280) @@ -1,3 +1,7 @@ +2007-11-23 Marcus Brinkmann + + * gpgsm/t-verify.c (show_auditlog): Check for GPG_ERR_ASS_UNKNOWN_CMD. + 2007-11-23 Werner Koch * gpgsm/t-verify.c (check_result): Don't exit on error but set a flag. Modified: trunk/tests/gpgsm/t-verify.c =================================================================== --- trunk/tests/gpgsm/t-verify.c 2007-11-23 13:07:04 UTC (rev 1279) +++ trunk/tests/gpgsm/t-verify.c 2007-11-23 17:25:11 UTC (rev 1280) @@ -123,7 +123,8 @@ { fprintf (stderr, "%s:%i: Can't get audit log: %s\n", __FILE__, __LINE__, gpgme_strerror (err)); - got_errors = 1; + if (gpg_err_code (err) != GPG_ERR_ASS_UNKNOWN_CMD) + got_errors = 1; } print_data (data); gpgme_data_release (data); From cvs at cvs.gnupg.org Fri Nov 23 19:00:05 2007 From: cvs at cvs.gnupg.org (svn author marcus) Date: Fri, 23 Nov 2007 19:00:05 +0100 Subject: [svn] assuan - r278 - trunk/src Message-ID: Author: marcus Date: 2007-11-23 18:59:56 +0100 (Fri, 23 Nov 2007) New Revision: 278 Modified: trunk/src/ChangeLog trunk/src/assuan-inquire.c Log: 2007-11-23 Marcus Brinkmann * assuan-inquire.c (_assuan_inquire_ext_cb): Pass through return value from callback function. Suggested by Ben Kibbey . Modified: trunk/src/ChangeLog =================================================================== --- trunk/src/ChangeLog 2007-11-12 14:36:45 UTC (rev 277) +++ trunk/src/ChangeLog 2007-11-23 17:59:56 UTC (rev 278) @@ -1,3 +1,9 @@ +2007-11-23 Marcus Brinkmann + + * assuan-inquire.c (_assuan_inquire_ext_cb): Pass through return + value from callback function. + Suggested by Ben Kibbey . + 2007-11-12 Marcus Brinkmann * assuan-inquire.c (_assuan_inquire_ext_cb): Clear Modified: trunk/src/assuan-inquire.c =================================================================== --- trunk/src/assuan-inquire.c 2007-11-12 14:36:45 UTC (rev 277) +++ trunk/src/assuan-inquire.c 2007-11-23 17:59:56 UTC (rev 278) @@ -324,7 +324,7 @@ ctx->inquire_membuf = NULL; } ctx->in_inquire = 0; - (ctx->inquire_cb) (ctx->inquire_cb_data, rc, buf, buf_len); + rc = (ctx->inquire_cb) (ctx->inquire_cb_data, rc, buf, buf_len); } return rc; } From cvs at cvs.gnupg.org Mon Nov 26 12:00:40 2007 From: cvs at cvs.gnupg.org (svn author wk) Date: Mon, 26 Nov 2007 12:00:40 +0100 Subject: [svn] GnuPG - r4626 - in trunk: common sm Message-ID: Author: wk Date: 2007-11-26 12:00:39 +0100 (Mon, 26 Nov 2007) New Revision: 4626 Modified: trunk/common/audit.c trunk/common/audit.h trunk/sm/ChangeLog trunk/sm/gpgsm.c trunk/sm/server.c Log: Add option --data to GETAUDITLOG command. Return HTML formatted dummy output. Modified: trunk/common/audit.c =================================================================== --- trunk/common/audit.c 2007-11-22 16:24:21 UTC (rev 4625) +++ trunk/common/audit.c 2007-11-26 11:00:39 UTC (rev 4626) @@ -297,18 +297,20 @@ /* Print the formatted audit result. THIS IS WORK IN PROGRESS. */ void -audit_print_result (audit_ctx_t ctx, FILE *fp) +audit_print_result (audit_ctx_t ctx, estream_t out) { int idx; int maxlen; size_t n; + es_fputs ("
\n", out); + if (!ctx) - return; + goto leave; if (!ctx->log || !ctx->logused) { - fprintf (fp, "AUDIT-LOG: No entries\n"); - return; + es_fprintf (out, "

AUDIT-LOG: No entries

\n"); + goto leave; } for (idx=0,maxlen=0; idx < DIM (eventstr_msgidx); idx++) @@ -318,19 +320,24 @@ maxlen = n; } + es_fputs ("
    \n", out); for (idx=0; idx < ctx->logused; idx++) { - fprintf (fp, "AUDIT-LOG[%d]: %-*s", - idx, maxlen, event2str (ctx->log[idx].event)); + es_fprintf (out, "
  • %-*s", + maxlen, event2str (ctx->log[idx].event)); if (ctx->log[idx].have_intvalue) - fprintf (fp, " i=%d", ctx->log[idx].intvalue); + es_fprintf (out, " i=%d", ctx->log[idx].intvalue); if (ctx->log[idx].string) - fprintf (fp, " s=`%s'", ctx->log[idx].string); + es_fprintf (out, " s=`%s'", ctx->log[idx].string); if (ctx->log[idx].cert) - fprintf (fp, " has_cert"); + es_fprintf (out, " has_cert"); if (ctx->log[idx].have_err) - fprintf (fp, " err=\"%s\"", gpg_strerror (ctx->log[idx].err)); - putc ('\n', fp); + es_fprintf (out, " err=\"%s\"", gpg_strerror (ctx->log[idx].err)); + es_fputs ("
  • \n", out); } + es_fputs ("
\n", out); + + leave: + es_fputs ("
\n", out); } Modified: trunk/common/audit.h =================================================================== --- trunk/common/audit.h 2007-11-22 16:24:21 UTC (rev 4625) +++ trunk/common/audit.h 2007-11-26 11:00:39 UTC (rev 4626) @@ -22,6 +22,7 @@ #include +#include "estream.h" struct audit_ctx_s; typedef struct audit_ctx_s *audit_ctx_t; @@ -132,7 +133,7 @@ void audit_log_cert (audit_ctx_t ctx, audit_event_t event, ksba_cert_t cert, gpg_error_t err); -void audit_print_result (audit_ctx_t ctx, FILE *fp); +void audit_print_result (audit_ctx_t ctx, estream_t stream); Modified: trunk/sm/ChangeLog =================================================================== --- trunk/sm/ChangeLog 2007-11-22 16:24:21 UTC (rev 4625) +++ trunk/sm/ChangeLog 2007-11-26 11:00:39 UTC (rev 4626) @@ -1,7 +1,7 @@ -2007-11-22 Werner Koch +h2007-11-22 Werner Koch * server.c (cmd_getauditlog): New. - (register_commands): Register GETAUDITLOG + (register_commands): Register GETAUDITLOG. 2007-11-19 Werner Koch Modified: trunk/sm/gpgsm.c =================================================================== --- trunk/sm/gpgsm.c 2007-11-22 16:24:21 UTC (rev 4625) +++ trunk/sm/gpgsm.c 2007-11-26 11:00:39 UTC (rev 4626) @@ -1649,7 +1649,7 @@ case aVerify: { FILE *fp = NULL; - FILE *auditfp = NULL; + estream_t auditfp = NULL; set_binary (stdin); if (argc == 2 && opt.outfile) @@ -1661,7 +1661,7 @@ { audit_release (ctrl.audit); ctrl.audit = audit_new (); - auditfp = open_fwrite (auditlog); + auditfp = open_es_fwrite (auditlog); } if (!argc) @@ -1682,8 +1682,7 @@ if (fp && fp != stdout) fclose (fp); - if (auditfp && auditfp != stdout) - fclose (auditfp); + es_fclose (auditfp); } break; Modified: trunk/sm/server.c =================================================================== --- trunk/sm/server.c 2007-11-22 16:24:21 UTC (rev 4625) +++ trunk/sm/server.c 2007-11-26 11:00:39 UTC (rev 4626) @@ -934,36 +934,56 @@ -/* GETAUDITLOG +/* GETAUDITLOG [--data] !!!WORK in PROGRESS!!! + + If --data is used, the output is send using D-lines and not to the + source given by an OUTPUT command. */ static int cmd_getauditlog (assuan_context_t ctx, char *line) { ctrl_t ctrl = assuan_get_pointer (ctx); int out_fd; - FILE *out_fp; + estream_t out_stream; + int opt_data; int rc; + opt_data = has_option (line, "--data"); + line = skip_options (line); + if (!ctrl->audit) return gpg_error (GPG_ERR_NO_DATA); - out_fd = translate_sys2libc_fd (assuan_get_output_fd (ctx), 1); - if (out_fd == -1) - return set_error (GPG_ERR_ASS_NO_OUTPUT, NULL); - - out_fp = fdopen ( dup(out_fd), "w"); - if (!out_fp) + if (opt_data) { - return set_error (GPG_ERR_ASS_GENERAL, "fdopen() failed"); + out_stream = es_fopencookie (ctx, "w", data_line_cookie_functions); + if (!out_stream) + return set_error (GPG_ERR_ASS_GENERAL, + "error setting up a data stream"); } - audit_print_result (ctrl->audit, out_fp); + else + { + out_fd = translate_sys2libc_fd (assuan_get_output_fd (ctx), 1); + if (out_fd == -1) + return set_error (GPG_ERR_ASS_NO_OUTPUT, NULL); + + out_stream = es_fdopen_nc ( dup (out_fd), "w"); + if (!out_stream) + { + return set_error (GPG_ERR_ASS_GENERAL, "es_fdopen() failed"); + } + } + + audit_print_result (ctrl->audit, out_stream); rc = 0; - fclose (out_fp); + es_fclose (out_stream); + /* Close and reset the fd. */ - assuan_close_output_fd (ctx); + if (!opt_data) + assuan_close_output_fd (ctx); return rc; } From cvs at cvs.gnupg.org Mon Nov 26 11:59:12 2007 From: cvs at cvs.gnupg.org (svn author wk) Date: Mon, 26 Nov 2007 11:59:12 +0100 Subject: [svn] gpgme - r1281 - in trunk: gpgme tests/gpgsm Message-ID: Author: wk Date: 2007-11-26 11:59:11 +0100 (Mon, 26 Nov 2007) New Revision: 1281 Modified: trunk/gpgme/ChangeLog trunk/gpgme/engine-gpgsm.c trunk/tests/gpgsm/t-verify.c Log: Made autolog feature for if --enable-fd-passing has not been enabled. Pass HTML glag to test program. Modified: trunk/gpgme/ChangeLog =================================================================== --- trunk/gpgme/ChangeLog 2007-11-23 17:25:11 UTC (rev 1280) +++ trunk/gpgme/ChangeLog 2007-11-26 10:59:11 UTC (rev 1281) @@ -1,3 +1,11 @@ +2007-11-26 Werner Koch + + * engine-gpgsm.c (struct engine_gpgsm): Add field INLINE_DATA and + always reset it before calling start. + (gpgsm_new): Clear it. + (status_handler): Implement it. + (gpgsm_getauditlog) [USE_DESCRIPTOR_PASSING]: Use INLINE_DATA. + 2007-11-23 Werner Koch * op-support.c (_gpgme_op_reset): Implement a no-reset flag. Modified: trunk/gpgme/engine-gpgsm.c =================================================================== --- trunk/gpgme/engine-gpgsm.c 2007-11-23 17:25:11 UTC (rev 1280) +++ trunk/gpgme/engine-gpgsm.c 2007-11-26 10:59:11 UTC (rev 1281) @@ -94,6 +94,8 @@ int any; /* any data line seen */ } colon; + gpgme_data_t inline_data; /* Used to collect D lines. */ + struct gpgme_io_cbs io_cbs; }; @@ -373,6 +375,8 @@ gpgsm->colon.attic.linelen = 0; gpgsm->colon.any = 0; + gpgsm->inline_data = NULL; + gpgsm->io_cbs.add = NULL; gpgsm->io_cbs.add_priv = NULL; gpgsm->io_cbs.remove = NULL; @@ -899,8 +903,7 @@ char **aline = &gpgsm->colon.attic.line; int *alinelen = &gpgsm->colon.attic.linelen; - if (gpgsm->colon.attic.linesize - < *alinelen + linelen + 1) + if (gpgsm->colon.attic.linesize < *alinelen + linelen + 1) { char *newline = realloc (*aline, *alinelen + linelen + 1); if (!newline) @@ -958,6 +961,49 @@ fd, err? gpg_strerror (err):"ok"); } else if (linelen > 2 + && line[0] == 'D' && line[1] == ' ' + && gpgsm->inline_data) + { + char *src = line + 2; + char *end = line + linelen; + char *dst = src; + ssize_t nwritten; + + linelen = 0; + while (src < end) + { + if (*src == '%' && src + 2 < end) + { + /* Handle escaped characters. */ + ++src; + *dst++ = _gpgme_hextobyte (src); + src += 2; + } + else + *dst++ = *src++; + + linelen++; + } + + src = line + 2; + while (linelen > 0) + { + nwritten = gpgme_data_write (gpgsm->inline_data, src, linelen); + if (!nwritten || (nwritten < 0 && errno != EINTR) + || nwritten > linelen) + { + err = gpg_error_from_errno (errno); + break; + } + src += nwritten; + linelen -= nwritten; + } + + TRACE2 (DEBUG_CTX, "gpgme:status_handler", gpgsm, + "fd 0x%x: D inlinedata; final status: %s", + fd, err? gpg_strerror (err):"ok"); + } + else if (linelen > 2 && line[0] == 'S' && line[1] == ' ') { char *rest; @@ -1094,6 +1140,7 @@ if (err) return gpg_error (GPG_ERR_GENERAL); /* FIXME */ gpgsm_clear_fd (gpgsm, MESSAGE_FD); + gpgsm->inline_data = NULL; err = start (engine, "DECRYPT"); return err; @@ -1159,6 +1206,7 @@ gpgsm_clear_fd (gpgsm, OUTPUT_FD); gpgsm_clear_fd (gpgsm, INPUT_FD); gpgsm_clear_fd (gpgsm, MESSAGE_FD); + gpgsm->inline_data = NULL; err = start (gpgsm, line); free (line); @@ -1248,6 +1296,7 @@ if (err) return err; gpgsm_clear_fd (gpgsm, MESSAGE_FD); + gpgsm->inline_data = NULL; err = set_recipients (gpgsm, recp); @@ -1284,6 +1333,7 @@ return err; gpgsm_clear_fd (gpgsm, INPUT_FD); gpgsm_clear_fd (gpgsm, MESSAGE_FD); + gpgsm->inline_data = NULL; err = start (gpgsm, cmd); free (cmd); @@ -1375,6 +1425,7 @@ return err; gpgsm_clear_fd (gpgsm, INPUT_FD); gpgsm_clear_fd (gpgsm, MESSAGE_FD); + gpgsm->inline_data = NULL; err = start (gpgsm, line); free (line); @@ -1401,6 +1452,7 @@ if (err) return err; gpgsm_clear_fd (gpgsm, MESSAGE_FD); + gpgsm->inline_data = NULL; err = start (gpgsm, "GENKEY"); return err; @@ -1422,6 +1474,7 @@ return err; gpgsm_clear_fd (gpgsm, OUTPUT_FD); gpgsm_clear_fd (gpgsm, MESSAGE_FD); + gpgsm->inline_data = NULL; err = start (gpgsm, "IMPORT"); return err; @@ -1483,6 +1536,7 @@ gpgsm_clear_fd (gpgsm, INPUT_FD); gpgsm_clear_fd (gpgsm, OUTPUT_FD); gpgsm_clear_fd (gpgsm, MESSAGE_FD); + gpgsm->inline_data = NULL; err = start (gpgsm, line); free (line); @@ -1605,6 +1659,7 @@ gpgsm_clear_fd (gpgsm, INPUT_FD); gpgsm_clear_fd (gpgsm, OUTPUT_FD); gpgsm_clear_fd (gpgsm, MESSAGE_FD); + gpgsm->inline_data = NULL; err = start (gpgsm, line); free (line); @@ -1670,6 +1725,7 @@ if (err) return err; gpgsm_clear_fd (gpgsm, MESSAGE_FD); + gpgsm->inline_data = NULL; err = start (gpgsm, mode == GPGME_SIG_MODE_DETACH ? "SIGN --detached" : "SIGN"); @@ -1705,6 +1761,7 @@ err = gpgsm_set_fd (gpgsm, MESSAGE_FD, 0); gpgsm_clear_fd (gpgsm, OUTPUT_FD); } + gpgsm->inline_data = NULL; if (!err) err = start (gpgsm, "VERIFY"); @@ -1724,6 +1781,7 @@ if (!gpgsm || !output) return gpg_error (GPG_ERR_INV_VALUE); +#if USE_DESCRIPTOR_PASSING gpgsm->output_cb.data = output; err = gpgsm_set_fd (gpgsm, OUTPUT_FD, 0); if (err) @@ -1731,8 +1789,17 @@ gpgsm_clear_fd (gpgsm, INPUT_FD); gpgsm_clear_fd (gpgsm, MESSAGE_FD); + gpgsm->inline_data = NULL; +# define CMD "GETAUDITLOG" +#else + gpgsm_clear_fd (gpgsm, OUTPUT_FD); + gpgsm_clear_fd (gpgsm, INPUT_FD); + gpgsm_clear_fd (gpgsm, MESSAGE_FD); + gpgsm->inline_data = output; +# define CMD "GETAUDITLOG --data" +#endif - err = start (gpgsm, "GETAUDITLOG"); + err = start (gpgsm, (flags & GPGME_AUDITLOG_HTML)? CMD " --html" : CMD); return err; } Modified: trunk/tests/gpgsm/t-verify.c =================================================================== --- trunk/tests/gpgsm/t-verify.c 2007-11-23 17:25:11 UTC (rev 1280) +++ trunk/tests/gpgsm/t-verify.c 2007-11-26 10:59:11 UTC (rev 1281) @@ -118,7 +118,7 @@ err = gpgme_data_new (&data); fail_if_err (err); - err = gpgme_op_getauditlog (ctx, data, 0); + err = gpgme_op_getauditlog (ctx, data, GPGME_AUDITLOG_HTML); if (err) { fprintf (stderr, "%s:%i: Can't get audit log: %s\n", From cvs at cvs.gnupg.org Mon Nov 26 15:26:26 2007 From: cvs at cvs.gnupg.org (svn author marcus) Date: Mon, 26 Nov 2007 15:26:26 +0100 Subject: [svn] GpgEX - r44 - in trunk: . doc Message-ID: Author: marcus Date: 2007-11-26 15:26:26 +0100 (Mon, 26 Nov 2007) New Revision: 44 Modified: trunk/ChangeLog trunk/doc/gpgex-de.html trunk/doc/gpgex-en.html Log: 2007-11-26 Marcus Brinkmann * doc/gpgex-de.html, doc/gpgex-en.html: Add FIXME entries for missing hyperlinks. Modified: trunk/ChangeLog =================================================================== --- trunk/ChangeLog 2007-11-16 15:19:43 UTC (rev 43) +++ trunk/ChangeLog 2007-11-26 14:26:26 UTC (rev 44) @@ -1,3 +1,8 @@ +2007-11-26 Marcus Brinkmann + + * doc/gpgex-de.html, doc/gpgex-en.html: Add FIXME entries for + missing hyperlinks. + 2007-11-12 Marcus Brinkmann * configure.ac (WINVER): New symbol. Modified: trunk/doc/gpgex-de.html =================================================================== --- trunk/doc/gpgex-de.html 2007-11-16 15:19:43 UTC (rev 43) +++ trunk/doc/gpgex-de.html 2007-11-26 14:26:26 UTC (rev 44) @@ -18,22 +18,32 @@

Entschl?sseln und verifizieren, Entschl?sseln, Verifizieren

Entschl?sselt und/oder verifiziert die ausgew?hlten Dateien. + FIXME: Hier wird ein Link zur Kleopatra-Dokumentation f?r die + Entschl?ssel- und Verifizier-Funktionen eingestellt.

Verschl?sseln und signieren, Verschl?sseln, Signieren

Verschl?sselt und/oder signiert die ausgew?hlten Dateien. + FIXME: Hier wird ein Link zur Kleopatra-Dokumentation f?r die + Verschl?ssel- und Signier-Funktionen eingestellt.

Zertifikate importieren

- Import die Zertifikate in den ausgew?hlten Dateien. + Import die Zertifikate in den ausgew?hlten Dateien. FIXME: Hier + wird ein Link zur Kleopatra-Dokumentation f?r die + Import-Funktion eingestellt.

Pr?fsummen erstellen

- Erstellt Pr?fsummen f?r die ausgew?hlten Dateien. + Erstellt Pr?fsummen f?r die ausgew?hlten Dateien. FIXME: Hier + wird ein Link zur Kleopatra-Dokumentation f?r die Funktionen zur + Erstellung von Pr?fsummen eingestellt.

Pr?fsummen verifizieren

- Verifiziert die Pr?fsummen f?r die ausgew?hlten Dateien. + Verifiziert die Pr?fsummen f?r die ausgew?hlten Dateien. FIXME: + Hier wird ein Link zur Kleopatra-Dokumentation f?r die Funktion + zur Verifikation von Pr?fsummen eingestellt.

Hilfe zu GpgEX

Modified: trunk/doc/gpgex-en.html =================================================================== --- trunk/doc/gpgex-en.html 2007-11-16 15:19:43 UTC (rev 43) +++ trunk/doc/gpgex-en.html 2007-11-26 14:26:26 UTC (rev 44) @@ -17,23 +17,32 @@

Commands

Decrypt and verify, Decrypt, Verify

- Decrypt and/or verify the selected files. + Decrypt and/or verify the selected files. FIXME: Here will be a + link to the Kleopatra documentation for the decrypt and verify + functions.

Encrypt and sign, Encrypt, Sign

- Encrypt and/or sign the selected files. + Encrypt and/or sign the selected files. FIXME: Here will be a + link to the Kleopatra documentation for the sign and encrypt + functions.

Import keys

- Import certificates in the selected files. + Import certificates in the selected files. FIXME: Here will be + a link to the Kleopatra documentation for the import function.

Create checksums

- Create checksums for the selected files. + Create checksums for the selected files. FIXME: Here will be a + link to the Kleopatra documentation for the create checksum + function.

Verify checksums

- Verify the checksums for the selected files. + Verify the checksums for the selected files. FIXME: Here will + be a link to the Kleopatra documentation for the verify checksum + function.

Help on GpgEX

From cvs at cvs.gnupg.org Mon Nov 26 17:28:19 2007 From: cvs at cvs.gnupg.org (svn author marcus) Date: Mon, 26 Nov 2007 17:28:19 +0100 Subject: [svn] dirmngr - r275 - trunk/src Message-ID: Author: marcus Date: 2007-11-26 17:28:18 +0100 (Mon, 26 Nov 2007) New Revision: 275 Modified: trunk/src/ChangeLog trunk/src/get-path.c Log: 2007-11-26 Marcus Brinkmann * get-path.c (dirmngr_cachedir): Create intermediate directories. (default_socket_name): Use CSIDL_WINDOWS. Modified: trunk/src/ChangeLog =================================================================== --- trunk/src/ChangeLog 2007-11-14 19:07:43 UTC (rev 274) +++ trunk/src/ChangeLog 2007-11-26 16:28:18 UTC (rev 275) @@ -1,3 +1,8 @@ +2007-11-26 Marcus Brinkmann + + * get-path.c (dirmngr_cachedir): Create intermediate directories. + (default_socket_name): Use CSIDL_WINDOWS. + 2007-11-14 Werner Koch * dirmngr-client.c: Replace --lookup-url by --url. Modified: trunk/src/get-path.c =================================================================== --- trunk/src/get-path.c 2007-11-14 19:07:43 UTC (rev 274) +++ trunk/src/get-path.c 2007-11-26 16:28:18 UTC (rev 275) @@ -478,18 +478,34 @@ if (!dir) { char path[MAX_PATH]; - const char *s1; - - s1 = "\\GNU\\cache\\dirmngr"; + const char *s1[] = { "GNU", "cache", "dirmngr", NULL }; + int s1_len; + char **comp; + + s1_len = 0; + for (comp = s1; *comp; comp++) + { + /* Take account for the separator. */ + s1_len += 1 + strlen (*comp); + } + if (w32_shgetfolderpath (NULL, CSIDL_LOCAL_APPDATA|CSIDL_FLAG_CREATE, NULL, 0, path) >= 0) { - char *tmp = xmalloc (strlen (path) + strlen (s1) +1); - strcpy (stpcpy (tmp, path), s1); + char *tmp = xmalloc (strlen (path) + s1_len + 1); + char *p; + + p = stpcpy (tmp, path); + for (comp = s1; *comp; comp++) + { + p = stpcpy (p, "\\"); + p = stpcpy (p, *comp); + + if (access (tmp, F_OK)) + CreateDirectory (tmp, NULL); + } + dir = tmp; - - if (access (dir, F_OK)) - CreateDirectory (dir, NULL); } else dir = "c:\\temp\\cache\\dirmngr"; @@ -509,8 +525,13 @@ if (!name) { - const char *s1, *s2; - s1 = w32_rootdir (); /* FIXME: /var in windows? */ + char s1[MAX_PATH]; + const char *s2; + + /* We need something akin CSIDL_COMMON_PROGRAMS, but local + (non-roaming). */ + if (w32_shgetfolderpath (NULL, CSIDL_WINDOWS, NULL, 0, s1) < 0) + strcpy (s1, "C:\\WINDOWS"); s2 = DIRSEP_S "S.dirmngr"; name = xmalloc (strlen (s1) + strlen (s2) + 1); strcpy (stpcpy (name, s1), s2); From cvs at cvs.gnupg.org Tue Nov 27 09:01:22 2007 From: cvs at cvs.gnupg.org (svn author wk) Date: Tue, 27 Nov 2007 09:01:22 +0100 Subject: [svn] GnuPG - r4627 - in trunk: agent common doc po tests/openpgp Message-ID: Author: wk Date: 2007-11-27 09:01:19 +0100 (Tue, 27 Nov 2007) New Revision: 4627 Modified: trunk/agent/ChangeLog trunk/agent/agent.h trunk/agent/call-scd.c trunk/agent/command.c trunk/agent/gpg-agent.c trunk/common/ChangeLog trunk/common/homedir.c trunk/doc/ChangeLog trunk/doc/gpg.texi trunk/po/de.po trunk/tests/openpgp/ChangeLog trunk/tests/openpgp/Makefile.am Log: [W32] Changed default socket for dirmngr. [W32] Add some code for event notifications between scdaemon and gpg-agent. Modified: trunk/agent/ChangeLog =================================================================== --- trunk/agent/ChangeLog 2007-11-26 11:00:39 UTC (rev 4626) +++ trunk/agent/ChangeLog 2007-11-27 08:01:19 UTC (rev 4627) @@ -1,3 +1,15 @@ +2007-11-20 Werner Koch + + * gpg-agent.c (get_agent_scd_notify_event): New. + (handle_signal): Factor SIGUSR2 code out to: + (agent_sigusr2_action): .. New. + (agent_sighup_action): Print info message here and not in + handle_signal. + (handle_connections) [PTH_EVENT_HANDLE]: Call agent_sigusr2_action. + + * call-scd.c (agent_scd_check_aliveness) [W32]: Implemented. + (start_scd) [W32]: Send event-signal option. + 2007-11-19 Werner Koch * call-pinentry.c (agent_askpin): Set the tooltip for the quality Modified: trunk/agent/agent.h =================================================================== --- trunk/agent/agent.h 2007-11-26 11:00:39 UTC (rev 4626) +++ trunk/agent/agent.h 2007-11-27 08:01:19 UTC (rev 4627) @@ -205,6 +205,9 @@ void agent_exit (int rc) JNLIB_GCC_A_NR; /* Also implemented in other tools */ const char *get_agent_socket_name (void); const char *get_agent_ssh_socket_name (void); +#ifdef HAVE_W32_SYSTEM +void *get_agent_scd_notify_event (void); +#endif void agent_sighup_action (void); /*-- command.c --*/ Modified: trunk/agent/call-scd.c =================================================================== --- trunk/agent/call-scd.c 2007-11-26 11:00:39 UTC (rev 4626) +++ trunk/agent/call-scd.c 2007-11-27 08:01:19 UTC (rev 4627) @@ -374,14 +374,17 @@ } /* Tell the scdaemon we want him to send us an event signal. */ -#ifndef HAVE_W32_SYSTEM { char buf[100]; - sprintf (buf, "OPTION event-signal=%d", SIGUSR2); +#ifdef HAVE_W32_SYSTEM + snprintf (buf, sizeof buf, "OPTION event-signal=%lx", + (unsigned long)get_agent_scd_notify_event ()); +#else + snprintf (buf, sizeof buf, "OPTION event-signal=%d", SIGUSR2); +#endif assuan_transact (ctx, buf, NULL, NULL, NULL, NULL, NULL, NULL); } -#endif primary_scd_ctx = ctx; primary_scd_ctx_reusable = 0; @@ -408,6 +411,9 @@ pth_event_t evt; pid_t pid; int rc; +#ifdef HAVE_W32_SYSTEM + DWORD dummyec; +#endif if (!primary_scd_ctx) return; /* No scdaemon running. */ @@ -435,10 +441,12 @@ { pid = assuan_get_pid (primary_scd_ctx); #ifdef HAVE_W32_SYSTEM -#warning Need to implement an alive test for scdaemon + if (pid != (pid_t)(void*)(-1) && pid + && !GetExitCodeProcess ((HANDLE)pid, &dummyec)) #else if (pid != (pid_t)(-1) && pid && ((rc=waitpid (pid, NULL, WNOHANG))==-1 || (rc == pid)) ) +#endif { /* Okay, scdaemon died. Disconnect the primary connection now but take care that it won't do another wait. Also @@ -467,7 +475,6 @@ xfree (socket_name); socket_name = NULL; } -#endif } if (!pth_mutex_release (&start_scd_lock)) Modified: trunk/agent/command.c =================================================================== --- trunk/agent/command.c 2007-11-26 11:00:39 UTC (rev 4626) +++ trunk/agent/command.c 2007-11-27 08:01:19 UTC (rev 4627) @@ -353,7 +353,7 @@ /* This function should be called once for all key removals or - additions. Thus function is assured not to do any context + additions. This function is assured not to do any context switches. */ void bump_key_eventcounter (void) @@ -363,7 +363,7 @@ } /* This function should be called for all card reader status - changes. Thus function is assured not to do any context + changes. This function is assured not to do any context switches. */ void bump_card_eventcounter (void) Modified: trunk/agent/gpg-agent.c =================================================================== --- trunk/agent/gpg-agent.c 2007-11-26 11:00:39 UTC (rev 4626) +++ trunk/agent/gpg-agent.c 2007-11-27 08:01:19 UTC (rev 4627) @@ -1246,7 +1246,29 @@ } +/* Under W32, this function returns the handle of the scdaemon + notification event. Calling it the first time creates that + event. */ +#ifdef HAVE_W32_SYSTEM +void * +get_agent_scd_notify_event (void) +{ + static HANDLE the_event; + if (!the_event) + { + SECURITY_ATTRIBUTES sa = { sizeof (SECURITY_ATTRIBUTES), NULL, TRUE}; + + the_event = CreateEvent ( &sa, FALSE, FALSE, NULL); + if (!the_event) + log_error ("can't create scd notify event: %s\n", w32_strerror (-1) ); + } + return the_event; +} +#endif /*HAVE_W32_SYSTEM*/ + + + /* Create a name for the socket. With USE_STANDARD_SOCKET given as true using STANDARD_NAME in the home directory or if given as false from the mkdir type name TEMPLATE. In the latter case a @@ -1486,11 +1508,13 @@ } -/* A global fucntion which allows us to call the reload stuff from - other palces too. This is only used when build for W32. */ +/* A global function which allows us to call the reload stuff from + other places too. This is only used when build for W32. */ void agent_sighup_action (void) { + log_info ("SIGHUP received - " + "re-reading configuration and flushing cache\n"); agent_flush_cache (); reread_configuration (); agent_reload_trustlist (); @@ -1498,14 +1522,22 @@ static void +agent_sigusr2_action (void) +{ + if (opt.verbose) + log_info ("SIGUSR2 received - checking smartcard status\n"); + /* Nothing to check right now. We only increment a counter. */ + bump_card_eventcounter (); +} + + +static void handle_signal (int signo) { switch (signo) { #ifndef HAVE_W32_SYSTEM case SIGHUP: - log_info ("SIGHUP received - " - "re-reading configuration and flushing cache\n"); agent_sighup_action (); break; @@ -1517,10 +1549,7 @@ break; case SIGUSR2: - if (opt.verbose) - log_info ("SIGUSR2 received - checking smartcard status\n"); - /* Nothing to check right now. We only increment a counter. */ - bump_card_eventcounter (); + agent_sigusr2_action (); break; case SIGTERM: @@ -1652,8 +1681,15 @@ pth_sigmask (SIG_UNBLOCK, &sigs, NULL); ev = pth_event (PTH_EVENT_SIGS, &sigs, &signo); #else +# ifdef PTH_EVENT_HANDLE sigs = 0; + ev = pth_event (PTH_EVENT_HANDLE, get_agent_scd_notify_event ()); + signo = 0; +# else + /* Use a dummy event. */ + sigs = 0; ev = pth_event (PTH_EVENT_SIGS, &sigs, &signo); +# endif #endif time_ev = NULL; @@ -1706,7 +1742,13 @@ || (time_ev && pth_event_occurred (time_ev))) { if (pth_event_occurred (ev)) - handle_signal (signo); + { +#if defined(HAVE_W32_SYSTEM) && defined(PTH_EVENT_HANDLE) + agent_sigusr2_action (); +#else + handle_signal (signo); +#endif + } if (time_ev && pth_event_occurred (time_ev)) { pth_event_free (time_ev, PTH_FREE_ALL); @@ -1723,7 +1765,11 @@ if (pth_event_occurred (ev)) { +#if defined(HAVE_W32_SYSTEM) && defined(PTH_EVENT_HANDLE) + agent_sigusr2_action (); +#else handle_signal (signo); +#endif } if (time_ev && pth_event_occurred (time_ev)) Modified: trunk/common/ChangeLog =================================================================== --- trunk/common/ChangeLog 2007-11-26 11:00:39 UTC (rev 4626) +++ trunk/common/ChangeLog 2007-11-27 08:01:19 UTC (rev 4627) @@ -1,3 +1,7 @@ +2007-11-27 Werner Koch + + * homedir.c (dirmngr_socket_name): Use CSIDL_WINDOWS. + 2007-11-15 Werner Koch * asshelp.c (send_pinentry_environment): Add args XAUTHORITY and Modified: trunk/common/homedir.c =================================================================== --- trunk/common/homedir.c 2007-11-26 11:00:39 UTC (rev 4626) +++ trunk/common/homedir.c 2007-11-27 08:01:19 UTC (rev 4627) @@ -299,8 +299,13 @@ if (!name) { - const char *s1, *s2; - s1 = w32_rootdir (); + char s1[MAX_PATH]; + const char *s2; + + /* We need something akin CSIDL_COMMON_PROGRAMS, but local + (non-roaming). */ + if (w32_shgetfolderpath (NULL, CSIDL_WINDOWS, NULL, 0, s1) < 0) + strcpy (s1, "C:\\WINDOWS"); s2 = DIRSEP_S "S.dirmngr"; name = xmalloc (strlen (s1) + strlen (s2) + 1); strcpy (stpcpy (name, s1), s2); Modified: trunk/doc/ChangeLog =================================================================== --- trunk/doc/ChangeLog 2007-11-26 11:00:39 UTC (rev 4626) +++ trunk/doc/ChangeLog 2007-11-27 08:01:19 UTC (rev 4627) @@ -1,5 +1,8 @@ 2007-11-19 Werner Koch + * gpg.texi (GPG Configuration Options): English Grammar fix. + Thanks to Gerg Troxel. + * gpgsm.texi (Certificate Options): Document --auto-issuer-key-retrieve. Modified: trunk/doc/gpg.texi =================================================================== --- trunk/doc/gpg.texi 2007-11-26 11:00:39 UTC (rev 4626) +++ trunk/doc/gpg.texi 2007-11-27 08:01:19 UTC (rev 4627) @@ -1141,7 +1141,7 @@ Set the name of the native character set. This is used to convert some informational strings like user IDs to the proper UTF-8 encoding. Note that this has nothing to do with the character set of data to be -encrypted or signed; GnuPG does not recode user supplied data. If +encrypted or signed; GnuPG does not recode user-supplied data. If this option is not used, the default character set is determined from the current locale. A verbosity level of 3 shows the chosen set. Valid values for @code{name} are: Modified: trunk/po/de.po =================================================================== --- trunk/po/de.po 2007-11-26 11:00:39 UTC (rev 4626) +++ trunk/po/de.po 2007-11-27 08:01:19 UTC (rev 4627) @@ -10,7 +10,7 @@ "Project-Id-Version: gnupg-2.0.6\n" "Report-Msgid-Bugs-To: translations at gnupg.org\n" "POT-Creation-Date: 2007-11-19 16:02+0100\n" -"PO-Revision-Date: 2007-11-19 16:41+0100\n" +"PO-Revision-Date: 2007-11-20 14:43+0100\n" "Last-Translator: Walter Koch \n" "Language-Team: German \n" "MIME-Version: 1.0\n" @@ -7009,7 +7009,7 @@ #: sm/certchain.c:498 #, c-format msgid "number of issuers matching: %d\n" -msgstr "Anzahl der ?bereinstimmenden Heruasgeber: %d\n" +msgstr "Anzahl der ?bereinstimmenden Herausgeber: %d\n" #: sm/certchain.c:651 sm/certchain.c:1069 sm/certchain.c:1674 sm/decrypt.c:259 #: sm/encrypt.c:341 sm/sign.c:327 sm/verify.c:113 Modified: trunk/tests/openpgp/ChangeLog =================================================================== --- trunk/tests/openpgp/ChangeLog 2007-11-26 11:00:39 UTC (rev 4626) +++ trunk/tests/openpgp/ChangeLog 2007-11-27 08:01:19 UTC (rev 4627) @@ -1,3 +1,8 @@ +2007-11-22 Werner Koch + + * Makefile.am (./gpg_dearmor): Add --homedir so that we don't + auto create a ~/.gnupg/. From Gentoo. + 2007-10-25 Werner Koch Add missing copyright notices to *.test. Modified: trunk/tests/openpgp/Makefile.am =================================================================== --- trunk/tests/openpgp/Makefile.am 2007-11-26 11:00:39 UTC (rev 4626) +++ trunk/tests/openpgp/Makefile.am 2007-11-27 08:01:19 UTC (rev 4627) @@ -61,7 +61,7 @@ ./gpg_dearmor: echo '#!/bin/sh' >./gpg_dearmor - echo "../../g10/gpg2 --no-options --no-greeting \ + echo "../../g10/gpg2 --no-options --no-greeting --homedir . \ --no-secmem-warning --batch --dearmor" >>./gpg_dearmor chmod 755 ./gpg_dearmor From cvs at cvs.gnupg.org Tue Nov 27 14:34:53 2007 From: cvs at cvs.gnupg.org (svn author marcus) Date: Tue, 27 Nov 2007 14:34:53 +0100 Subject: [svn] dirmngr - r276 - in trunk: . doc/examples Message-ID: Author: marcus Date: 2007-11-27 14:34:52 +0100 (Tue, 27 Nov 2007) New Revision: 276 Modified: trunk/ChangeLog trunk/doc/examples/dirmngr.conf Log: 2007-11-27 Marcus Brinkmann * doc/examples/dirmngr.conf: Fix signer file path. Modified: trunk/ChangeLog =================================================================== --- trunk/ChangeLog 2007-11-26 16:28:18 UTC (rev 275) +++ trunk/ChangeLog 2007-11-27 13:34:52 UTC (rev 276) @@ -1,3 +1,7 @@ +2007-11-27 Marcus Brinkmann + + * doc/examples/dirmngr.conf: Fix signer file path. + 2007-10-16 Marcus Brinkmann * doc/examples/Makefile.am (dist_doc_example_DATA): Rename to ... Modified: trunk/doc/examples/dirmngr.conf =================================================================== --- trunk/doc/examples/dirmngr.conf 2007-11-26 16:28:18 UTC (rev 275) +++ trunk/doc/examples/dirmngr.conf 2007-11-27 13:34:52 UTC (rev 276) @@ -1,11 +1,11 @@ -# Sample configuration file for dirmngr +B# Sample configuration file for dirmngr -log-file /var/log/dirmngr/dirmngr.log +l1;1609;0cog-file /var/log/dirmngr/dirmngr.log allow-ocsp ocsp-responder http://ocsp.nrca-ds.de:8080/ocsp-ocspresponder -ocsp-signer bnetza-10r-ocsp.txt +ocsp-signer bnetza-10r-ocsp.signer ocsp-current-period 86400 From cvs at cvs.gnupg.org Wed Nov 28 11:37:21 2007 From: cvs at cvs.gnupg.org (svn author wk) Date: Wed, 28 Nov 2007 11:37:21 +0100 Subject: [svn] gcry - r1271 - trunk/cipher Message-ID: Author: wk Date: 2007-11-28 11:37:20 +0100 (Wed, 28 Nov 2007) New Revision: 1271 Modified: trunk/cipher/ChangeLog trunk/cipher/sha256.c Log: Fixed SHA-224 DER template. Modified: trunk/cipher/ChangeLog =================================================================== --- trunk/cipher/ChangeLog 2007-11-13 08:53:21 UTC (rev 1270) +++ trunk/cipher/ChangeLog 2007-11-28 10:37:20 UTC (rev 1271) @@ -1,3 +1,9 @@ +2007-11-28 Werner Koch + + * sha256.c (asn224): Fixed wrong template. It happened due to a + bug in RFC4880. SHA-224 is not in the stable version of libgcrypt + so the consequences are limited to users of this devel version. + 2007-10-31 Werner Koch * ac.c (gcry_ac_data_new): Remove due to the visibility wrapper. Modified: trunk/cipher/sha256.c =================================================================== --- trunk/cipher/sha256.c 2007-11-13 08:53:21 UTC (rev 1270) +++ trunk/cipher/sha256.c 2007-11-28 10:37:20 UTC (rev 1271) @@ -314,9 +314,9 @@ } static byte asn224[19] = /* Object ID is 2.16.840.1.101.3.4.2.4 */ - { 0x30, 0x31, 0x30, 0x0d, 0x06, 0x09, 0x60, 0x86, 0x48, + { 0x30, 0x2D, 0x30, 0x0d, 0x06, 0x09, 0x60, 0x86, 0x48, 0x01, 0x65, 0x03, 0x04, 0x02, 0x04, 0x05, 0x00, 0x04, - 0x20 + 0x1C }; static gcry_md_oid_spec_t oid_spec_sha224[] = From cvs at cvs.gnupg.org Wed Nov 28 16:09:54 2007 From: cvs at cvs.gnupg.org (svn author dshaw) Date: Wed, 28 Nov 2007 16:09:54 +0100 Subject: [svn] GnuPG - r4629 - branches/STABLE-BRANCH-1-4/g10 Message-ID: Author: dshaw Date: 2007-11-28 16:09:52 +0100 (Wed, 28 Nov 2007) New Revision: 4629 Modified: branches/STABLE-BRANCH-1-4/g10/ChangeLog branches/STABLE-BRANCH-1-4/g10/gpg.c Log: * gpg.c (print_algo_names): New. (list_config): Use it here for the "ciphername" and "digestname" config items so we can get a script-parseable list of the names. Modified: branches/STABLE-BRANCH-1-4/g10/ChangeLog =================================================================== --- branches/STABLE-BRANCH-1-4/g10/ChangeLog 2007-11-27 08:37:03 UTC (rev 4628) +++ branches/STABLE-BRANCH-1-4/g10/ChangeLog 2007-11-28 15:09:52 UTC (rev 4629) @@ -1,3 +1,9 @@ +2007-11-28 David Shaw + + * gpg.c (print_algo_names): New. + (list_config): Use it here for the "ciphername" and "digestname" + config items so we can get a script-parseable list of the names. + 2007-11-19 Werner Koch * keyedit.c (keyedit_menu): String grammar fix. Modified: branches/STABLE-BRANCH-1-4/g10/gpg.c =================================================================== --- branches/STABLE-BRANCH-1-4/g10/gpg.c 2007-11-27 08:37:03 UTC (rev 4628) +++ branches/STABLE-BRANCH-1-4/g10/gpg.c 2007-11-28 15:09:52 UTC (rev 4629) @@ -1324,7 +1324,6 @@ return 0; } - static void print_algo_numbers(int (*checker)(int)) { @@ -1343,7 +1342,24 @@ } } +static void +print_algo_names(int (*checker)(int),const char *(*mapper)(int)) +{ + int i,first=1; + for(i=0;i<=110;i++) + { + if(!checker(i)) + { + if(first) + first=0; + else + printf(";"); + printf("%s",mapper(i)); + } + } +} + /* In the future, we can do all sorts of interesting configuration output here. For now, just give "group" as the Enigmail folks need it, and pubkey, cipher, hash, and compress as they may be useful @@ -1410,6 +1426,14 @@ any=1; } + if(show_all || ascii_strcasecmp(name,"ciphername")==0) + { + printf("cfg:ciphername:"); + print_algo_names(check_cipher_algo,cipher_algo_to_string); + printf("\n"); + any=1; + } + if(show_all || ascii_strcasecmp(name,"digest")==0 || ascii_strcasecmp(name,"hash")==0) @@ -1420,6 +1444,16 @@ any=1; } + if(show_all + || ascii_strcasecmp(name,"digestname")==0 + || ascii_strcasecmp(name,"hashname")==0) + { + printf("cfg:digestname:"); + print_algo_names(check_digest_algo,digest_algo_to_string); + printf("\n"); + any=1; + } + if(show_all || ascii_strcasecmp(name,"compress")==0) { printf("cfg:compress:"); From cvs at cvs.gnupg.org Wed Nov 28 16:15:38 2007 From: cvs at cvs.gnupg.org (svn author dshaw) Date: Wed, 28 Nov 2007 16:15:38 +0100 Subject: [svn] GnuPG - r4630 - branches/STABLE-BRANCH-1-4/checks Message-ID: Author: dshaw Date: 2007-11-28 16:15:37 +0100 (Wed, 28 Nov 2007) New Revision: 4630 Modified: branches/STABLE-BRANCH-1-4/checks/ChangeLog branches/STABLE-BRANCH-1-4/checks/defs.inc branches/STABLE-BRANCH-1-4/checks/sigs-dsa.test Log: * defs.inc: Use new --list-config method to get cipher and digest names. Modified: branches/STABLE-BRANCH-1-4/checks/ChangeLog =================================================================== --- branches/STABLE-BRANCH-1-4/checks/ChangeLog 2007-11-28 15:09:52 UTC (rev 4629) +++ branches/STABLE-BRANCH-1-4/checks/ChangeLog 2007-11-28 15:15:37 UTC (rev 4630) @@ -1,3 +1,8 @@ +2007-11-28 David Shaw + + * defs.inc: Use new --list-config method to get cipher and digest + names. + 2007-07-18 David Shaw * defs.inc (all_hash_algos): See "all_cipher_algos", below. Modified: branches/STABLE-BRANCH-1-4/checks/defs.inc =================================================================== --- branches/STABLE-BRANCH-1-4/checks/defs.inc 2007-11-28 15:09:52 UTC (rev 4629) +++ branches/STABLE-BRANCH-1-4/checks/defs.inc 2007-11-28 15:15:37 UTC (rev 4630) @@ -131,11 +131,11 @@ } all_cipher_algos () { - ../g10/gpg --homedir . --version | grep "Cipher" | sed 's/^Cipher: //; s/,//g' + ../g10/gpg --homedir . --with-colons --list-config ciphername | sed 's/^cfg:ciphername://; s/;/ /g' } all_hash_algos () { - ../g10/gpg --homedir . --version | grep "Hash" | sed 's/^Hash: //; s/,//g' + ../g10/gpg --homedir . --with-colons --list-config digestname | sed 's/^cfg:digestname://; s/;/ /g' } set -e Modified: branches/STABLE-BRANCH-1-4/checks/sigs-dsa.test =================================================================== --- branches/STABLE-BRANCH-1-4/checks/sigs-dsa.test 2007-11-28 15:09:52 UTC (rev 4629) +++ branches/STABLE-BRANCH-1-4/checks/sigs-dsa.test 2007-11-28 15:15:37 UTC (rev 4630) @@ -19,4 +19,3 @@ break done done - From cvs at cvs.gnupg.org Wed Nov 28 17:31:07 2007 From: cvs at cvs.gnupg.org (svn author marcus) Date: Wed, 28 Nov 2007 17:31:07 +0100 Subject: [svn] gpgme - r1282 - trunk/gpgme Message-ID: Author: marcus Date: 2007-11-28 17:31:05 +0100 (Wed, 28 Nov 2007) New Revision: 1282 Modified: trunk/gpgme/ChangeLog trunk/gpgme/w32-util.c Log: 2007-11-28 Marcus Brinkmann * w32-util.c (_gpgme_get_gpg_path, _gpgme_get_gpgsm_path): Search for installation directory. Remove old fallback default. (find_program_in_inst_dir): New function. Modified: trunk/gpgme/ChangeLog =================================================================== --- trunk/gpgme/ChangeLog 2007-11-26 10:59:11 UTC (rev 1281) +++ trunk/gpgme/ChangeLog 2007-11-28 16:31:05 UTC (rev 1282) @@ -1,3 +1,9 @@ +2007-11-28 Marcus Brinkmann + + * w32-util.c (_gpgme_get_gpg_path, _gpgme_get_gpgsm_path): Search + for installation directory. Remove old fallback default. + (find_program_in_inst_dir): New function. + 2007-11-26 Werner Koch * engine-gpgsm.c (struct engine_gpgsm): Add field INLINE_DATA and Modified: trunk/gpgme/w32-util.c =================================================================== --- trunk/gpgme/w32-util.c 2007-11-26 10:59:11 UTC (rev 1281) +++ trunk/gpgme/w32-util.c 2007-11-28 16:31:05 UTC (rev 1282) @@ -245,6 +245,36 @@ static char * +find_program_in_inst_dir (const char *name) +{ + char *result = NULL; + char *tmp; + + tmp = read_w32_registry_string ("HKEY_LOCAL_MACHINE", + "Software\\GNU\\GnuPG", + "Install Directory"); + if (!tmp) + return NULL; + + result = malloc (strlen (tmp) + 1 + strlen (name) + 1); + if (!result) + { + free (tmp); + return NULL; + } + + strcpy (stpcpy (stpcpy (result, tmp), "\\"), name); + free (tmp); + if (access (result, F_OK)) + { + free (result); + return NULL; + } + + return result; +} + +static char * find_program_at_standard_place (const char *name) { char path[MAX_PATH]; @@ -266,6 +296,7 @@ return result; } + const char * _gpgme_get_gpg_path (void) { @@ -275,11 +306,9 @@ if (!gpg_program) gpg_program = find_program_in_registry ("gpgProgram"); if (!gpg_program) + gpg_program = find_program_in_inst_dir ("gpg.exe"); + if (!gpg_program) gpg_program = find_program_at_standard_place ("GNU\\GnuPG\\gpg.exe"); -#ifdef GPG_PATH - if (!gpg_program) - gpg_program = GPG_PATH; -#endif UNLOCK (get_path_lock); return gpg_program; } @@ -293,11 +322,9 @@ if (!gpgsm_program) gpgsm_program = find_program_in_registry ("gpgsmProgram"); if (!gpgsm_program) + gpgsm_program = find_program_in_inst_dir ("gpgsm.exe"); + if (!gpgsm_program) gpgsm_program = find_program_at_standard_place ("GNU\\GnuPG\\gpgsm.exe"); -#ifdef GPGSM_PATH - if (!gpgsm_program) - gpgsm_program = GPGSM_PATH; -#endif UNLOCK (get_path_lock); return gpgsm_program; } From cvs at cvs.gnupg.org Thu Nov 29 00:00:12 2007 From: cvs at cvs.gnupg.org (svn author dshaw) Date: Thu, 29 Nov 2007 00:00:12 +0100 Subject: [svn] GnuPG - r4631 - branches/STABLE-BRANCH-1-4/cipher Message-ID: Author: dshaw Date: 2007-11-29 00:00:11 +0100 (Thu, 29 Nov 2007) New Revision: 4631 Modified: branches/STABLE-BRANCH-1-4/cipher/ChangeLog branches/STABLE-BRANCH-1-4/cipher/sha256.c Log: * sha256.c (sha224_get_info): 4880 has an error in the SHA-224 OID and we inherited it. Fixing. Modified: branches/STABLE-BRANCH-1-4/cipher/ChangeLog =================================================================== --- branches/STABLE-BRANCH-1-4/cipher/ChangeLog 2007-11-28 15:15:37 UTC (rev 4630) +++ branches/STABLE-BRANCH-1-4/cipher/ChangeLog 2007-11-28 23:00:11 UTC (rev 4631) @@ -1,3 +1,8 @@ +2007-11-28 David Shaw + + * sha256.c (sha224_get_info): 4880 has an error in the SHA-224 OID + and we inherited it. Fixing. + 2007-10-23 Werner Koch Switched entire package to GPLv3+. Modified: branches/STABLE-BRANCH-1-4/cipher/sha256.c =================================================================== --- branches/STABLE-BRANCH-1-4/cipher/sha256.c 2007-11-28 15:15:37 UTC (rev 4630) +++ branches/STABLE-BRANCH-1-4/cipher/sha256.c 2007-11-28 23:00:11 UTC (rev 4631) @@ -356,9 +356,9 @@ { static byte asn[] = /* Object ID is 2.16.840.1.101.3.4.2.4 */ { - 0x30, 0x31, 0x30, 0x0d, 0x06, 0x09, 0x60, 0x86, + 0x30, 0x2D, 0x30, 0x0d, 0x06, 0x09, 0x60, 0x86, 0x48, 0x01, 0x65, 0x03, 0x04, 0x02, 0x04, 0x05, - 0x00, 0x04, 0x20 + 0x00, 0x04, 0x1C }; if( algo != 11 ) From cvs at cvs.gnupg.org Thu Nov 29 00:08:37 2007 From: cvs at cvs.gnupg.org (svn author dshaw) Date: Thu, 29 Nov 2007 00:08:37 +0100 Subject: [svn] GnuPG - r4632 - branches/STABLE-BRANCH-1-4/g10 Message-ID: Author: dshaw Date: 2007-11-29 00:08:35 +0100 (Thu, 29 Nov 2007) New Revision: 4632 Modified: branches/STABLE-BRANCH-1-4/g10/ChangeLog branches/STABLE-BRANCH-1-4/g10/main.h branches/STABLE-BRANCH-1-4/g10/seskey.c branches/STABLE-BRANCH-1-4/g10/sig-check.c Log: * sig-check.c (do_check): Code to try both the incorrect and correct SHA-224 DER prefixes when verifying a signature. See the change itself for more discussion. * main.h, seskey.c (do_encode_md): Rename to pkcs1_encode_md and make non-static. Modified: branches/STABLE-BRANCH-1-4/g10/ChangeLog =================================================================== --- branches/STABLE-BRANCH-1-4/g10/ChangeLog 2007-11-28 23:00:11 UTC (rev 4631) +++ branches/STABLE-BRANCH-1-4/g10/ChangeLog 2007-11-28 23:08:35 UTC (rev 4632) @@ -1,5 +1,12 @@ 2007-11-28 David Shaw + * sig-check.c (do_check): Code to try both the incorrect and + correct SHA-224 DER prefixes when verifying a signature. See the + change itself for more discussion. + + * main.h, seskey.c (do_encode_md): Rename to pkcs1_encode_md and + make non-static. + * gpg.c (print_algo_names): New. (list_config): Use it here for the "ciphername" and "digestname" config items so we can get a script-parseable list of the names. @@ -13210,8 +13217,8 @@ * pubkey-enc.c (get_session_key): rewritten - Copyright 1998, 1999, 2000, 2001, 2002, 2003, - 2004, 2005, 2006 Free Software Foundation, Inc. + Copyright 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, + 2007 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: branches/STABLE-BRANCH-1-4/g10/main.h =================================================================== --- branches/STABLE-BRANCH-1-4/g10/main.h 2007-11-28 23:00:11 UTC (rev 4631) +++ branches/STABLE-BRANCH-1-4/g10/main.h 2007-11-28 23:08:35 UTC (rev 4632) @@ -1,6 +1,6 @@ /* main.h - * Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, - * 2006 Free Software Foundation, Inc. + * Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, + * 2007 Free Software Foundation, Inc. * * This file is part of GnuPG. * @@ -200,6 +200,8 @@ /*-- seskey.c --*/ void make_session_key( DEK *dek ); MPI encode_session_key( DEK *dek, unsigned nbits ); +MPI pkcs1_encode_md( MD_HANDLE md, int algo, size_t len, unsigned nbits, + const byte *asn, size_t asnlen ); MPI encode_md_value( PKT_public_key *pk, PKT_secret_key *sk, MD_HANDLE md, int hash_algo ); Modified: branches/STABLE-BRANCH-1-4/g10/seskey.c =================================================================== --- branches/STABLE-BRANCH-1-4/g10/seskey.c 2007-11-28 23:00:11 UTC (rev 4631) +++ branches/STABLE-BRANCH-1-4/g10/seskey.c 2007-11-28 23:08:35 UTC (rev 4632) @@ -1,6 +1,6 @@ /* seskey.c - make sesssion keys etc. - * Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004, - * 2006 Free Software Foundation, Inc. + * Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2006, + * 2007 Free Software Foundation, Inc. * * This file is part of GnuPG. * @@ -29,7 +29,6 @@ #include "main.h" #include "i18n.h" - /**************** * Make a session key and put it into DEK */ @@ -142,10 +141,9 @@ return a; } - -static MPI -do_encode_md( MD_HANDLE md, int algo, size_t len, unsigned nbits, - const byte *asn, size_t asnlen ) +MPI +pkcs1_encode_md( MD_HANDLE md, int algo, size_t len, unsigned nbits, + const byte *asn, size_t asnlen ) { int nframe = (nbits+7) / 8; byte *frame; @@ -260,9 +258,9 @@ size_t asnlen,mdlen; asn = md_asn_oid( hash_algo, &asnlen, &mdlen ); - frame = do_encode_md( md, hash_algo, mdlen, - mpi_get_nbits(pk?pk->pkey[0]:sk->skey[0]), - asn, asnlen ); + frame = pkcs1_encode_md( md, hash_algo, mdlen, + mpi_get_nbits(pk?pk->pkey[0]:sk->skey[0]), + asn, asnlen ); } return frame; Modified: branches/STABLE-BRANCH-1-4/g10/sig-check.c =================================================================== --- branches/STABLE-BRANCH-1-4/g10/sig-check.c 2007-11-28 23:00:11 UTC (rev 4631) +++ branches/STABLE-BRANCH-1-4/g10/sig-check.c 2007-11-28 23:08:35 UTC (rev 4632) @@ -1,6 +1,6 @@ /* sig-check.c - Check a signature - * Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, - * 2004 Free Software Foundation, Inc. + * Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, + * 2007 Free Software Foundation, Inc. * * This file is part of GnuPG. * @@ -280,6 +280,32 @@ rc = pubkey_verify( pk->pubkey_algo, result, sig->data, pk->pkey ); mpi_free( result ); + if(rc==G10ERR_BAD_SIGN && is_RSA(pk->pubkey_algo) + && sig->digest_algo==DIGEST_ALGO_SHA224) + { + /* This code is to work around a SHA-224 problem. RFC-4880 + and the drafts leading up to it were published with the + wrong DER prefix for SHA-224. Unfortunately, GPG pre-1.4.8 + used this wrong prefix. What this code does is take all + bad RSA signatures that use SHA-224, and re-checks them + using the old, incorrect, DER prefix. Someday we should + remove this code, and when we do remove it, pkcs1_encode_md + can be made into a static function again. Note that GPG2 + does not have this issue as it uses libgcrypt, which is + being fixed while it is still a development version. */ + + /* The incorrect SHA-224 DER prefix used in pre-1.4.8 */ + static byte asn[]={0x30, 0x31, 0x30, 0x0d, 0x06, 0x09, 0x60, 0x86, + 0x48, 0x01, 0x65, 0x03, 0x04, 0x02, 0x04, 0x05, + 0x00, 0x04, 0x20}; + + result=pkcs1_encode_md(digest,DIGEST_ALGO_SHA224,28, + mpi_get_nbits(pk->pkey[0]),asn,DIM(asn)); + + rc=pubkey_verify(pk->pubkey_algo,result,sig->data,pk->pkey); + mpi_free(result); + } + if( !rc && sig->flags.unknown_critical ) { log_info(_("assuming bad signature from key %s" From cvs at cvs.gnupg.org Thu Nov 29 11:55:48 2007 From: cvs at cvs.gnupg.org (svn author wk) Date: Thu, 29 Nov 2007 11:55:48 +0100 Subject: [svn] gcry - r1272 - in trunk: . cipher src Message-ID: Author: wk Date: 2007-11-29 11:55:46 +0100 (Thu, 29 Nov 2007) New Revision: 1272 Modified: trunk/NEWS trunk/cipher/ChangeLog trunk/cipher/cipher.c trunk/cipher/rijndael.c trunk/src/ChangeLog trunk/src/g10lib.h trunk/src/hwfeatures.c Log: The ACE engine of VIA processors is now used for AES-128. Modified: trunk/NEWS =================================================================== --- trunk/NEWS 2007-11-28 10:37:20 UTC (rev 1271) +++ trunk/NEWS 2007-11-29 10:55:46 UTC (rev 1272) @@ -3,7 +3,9 @@ * Make use of the visibility attribute if supported. + * The ACE engine of VIA processors is now used for AES-128. + Noteworthy changes in version 1.3.1 (2007-10-26) ------------------------------------------------ Modified: trunk/cipher/ChangeLog =================================================================== --- trunk/cipher/ChangeLog 2007-11-28 10:37:20 UTC (rev 1271) +++ trunk/cipher/ChangeLog 2007-11-29 10:55:46 UTC (rev 1272) @@ -1,3 +1,20 @@ +2007-11-29 Werner Koch + + * rijndael.c (USE_PADLOCK): Define new macro used for ia32. + (RIJNDAEL_context) [USE_PADLOCK]: Add fields USE_PADLOCK and + PADLOCK_KEY. + (do_setkey) [USE_PADLOCK]: Enable padlock if available for 128 bit + AES. + (do_padlock) [USE_PADLOCK]: New. + (rijndael_encrypt, rijndael_decrypt) [USE_PADLOCK]: Divert to + do_padlock. + * cipher.c (cipher_context_alignment_t): New. Use it in this + module in place of PROPERLY_ALIGNED_TYPE. + (NEED_16BYTE_ALIGNED_CONTEXT): Define macro for ia32. + (struct gcry_cipher_handle): Add field HANDLE_OFFSET. + (gcry_cipher_open): Take care of increased alignment requirements. + (gcry_cipher_close): Ditto. + 2007-11-28 Werner Koch * sha256.c (asn224): Fixed wrong template. It happened due to a Modified: trunk/cipher/cipher.c =================================================================== --- trunk/cipher/cipher.c 2007-11-28 10:37:20 UTC (rev 1271) +++ trunk/cipher/cipher.c 2007-11-29 10:55:46 UTC (rev 1272) @@ -1,6 +1,6 @@ /* cipher.c - cipher dispatcher * Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003 - * 2005, Free Software Foundation, Inc. + * 2005, 2007 Free Software Foundation, Inc. * * This file is part of Libgcrypt. * @@ -15,8 +15,7 @@ * GNU Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public - * License along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA + * License along with this program; if not, see . */ #include @@ -34,6 +33,11 @@ #define CTX_MAGIC_NORMAL 0x24091964 #define CTX_MAGIC_SECURE 0x46919042 +#undef NEED_16BYTE_ALIGNED_CONTEXT +#if defined (__i386__) && SIZEOF_UNSIGNED_LONG == 4 && defined (__GNUC__) +#define NEED_16BYTE_ALIGNED_CONTEXT 1 +#endif + /* This is the list of the default ciphers, which are included in libgcrypt. */ static struct cipher_table_entry @@ -107,11 +111,30 @@ } \ while (0) + +/* A VIA processor with the Padlock engine requires an alignment of + most data on a 16 byte boundary. Because we trick out the compiler + while allocating the context, the align attribute as used in + rijndael.c does not work on its own. Thus we need to make sure + that the entire context structure is a aligned on that boundary. + We achieve this by defining a new type and use that instead of our + usual alignment type. */ +typedef union +{ + PROPERLY_ALIGNED_TYPE foo; +#ifdef NEED_16BYTE_ALIGNED_CONTEXT + char bar[16] __attribute__ ((aligned (16))); +#endif + char c[1]; +} cipher_context_alignment_t; + + /* The handle structure. */ struct gcry_cipher_handle { int magic; size_t actual_handle_size; /* Allocated size of this handle. */ + size_t handle_offset; /* Offset to the malloced block. */ gcry_cipher_spec_t *cipher; gcry_module_t module; int mode; @@ -120,7 +143,12 @@ unsigned char lastiv[MAX_BLOCKSIZE]; int unused; /* in IV */ unsigned char ctr[MAX_BLOCKSIZE]; /* For Counter (CTR) mode. */ - PROPERLY_ALIGNED_TYPE context; + /* 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 + used by cipher_reset. That second copy has no need for proper + aligment because it is only accessed by memcpy. */ + cipher_context_alignment_t context; }; @@ -635,14 +663,21 @@ err = GPG_ERR_INV_CIPHER_MODE; } - /* ? FIXME: perform selftest here and mark this with a flag in - cipher_table ? */ + /* Perform selftest here and mark this with a flag in cipher_table? + No, we should not do this as it takes too long. Further it does + not make sense to exclude algorithms with failing selftests at + runtime: If a selftest fails there is something seriously wrong + with the system and thus we better die immediately. */ if (! err) { size_t size = (sizeof (*h) + 2 * cipher->contextsize - - sizeof (PROPERLY_ALIGNED_TYPE)); + - sizeof (cipher_context_alignment_t) +#ifdef NEED_16BYTE_ALIGNED_CONTEXT + + 15 /* Space for leading alignment gap. */ +#endif /*NEED_16BYTE_ALIGNED_CONTEXT*/ + ); if (secure) h = gcry_calloc_secure (1, size); @@ -653,8 +688,21 @@ err = gpg_err_code_from_errno (errno); else { + size_t off = 0; + +#ifdef NEED_16BYTE_ALIGNED_CONTEXT + if ( ((unsigned long)h & 0x0f) ) + { + /* The malloced block is not aligned on a 16 byte + boundary. Correct for this. */ + off = 16 - ((unsigned long)h & 0x0f); + h = (void*)((char*)h + off); + } +#endif /*NEED_16BYTE_ALIGNED_CONTEXT*/ + h->magic = secure ? CTX_MAGIC_SECURE : CTX_MAGIC_NORMAL; - h->actual_handle_size = size; + h->actual_handle_size = size - off; + h->handle_offset = off; h->cipher = cipher; h->module = module; h->mode = mode; @@ -686,6 +734,8 @@ void gcry_cipher_close (gcry_cipher_hd_t h) { + size_t off; + if (! h) return; @@ -707,9 +757,10 @@ do the wiping. To accomplish this we need to keep track of the actual size of this structure because we have no way to known how large the allocated area was when using a standard malloc. */ + off = h->handle_offset; wipememory (h, h->actual_handle_size); - gcry_free (h); + gcry_free ((char*)h - off); } @@ -749,7 +800,7 @@ } -/* Reset the cipher context to the initial contex. This is basically +/* Reset the cipher context to the initial context. This is basically the same as an release followed by a new. */ static void cipher_reset (gcry_cipher_hd_t c) Modified: trunk/cipher/rijndael.c =================================================================== --- trunk/cipher/rijndael.c 2007-11-28 10:37:20 UTC (rev 1271) +++ trunk/cipher/rijndael.c 2007-11-29 10:55:46 UTC (rev 1272) @@ -14,8 +14,7 @@ * GNU Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public - * License along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA + * License along with this program; if not, see . ******************************************************************* * The code here is based on the optimized implementation taken from * http://www.esat.kuleuven.ac.be/~rijmen/rijndael/ on Oct 2, 2000, @@ -46,13 +45,26 @@ #define MAXROUNDS 14 +/* USE_PADLOCK indicates whether to compile the padlock specific + code. */ +#undef USE_PADLOCK +#if defined (__i386__) && SIZEOF_UNSIGNED_LONG == 4 && defined (__GNUC__) +#define USE_PADLOCK +#endif + + static const char *selftest(void); typedef struct { - int ROUNDS; /* key-length-dependent number of rounds */ - int decryption_prepared; - union + int ROUNDS; /* Key-length-dependent number of rounds. */ + int decryption_prepared; /* The decryption key schedule is available. */ +#ifdef USE_PADLOCK + int use_padlock; /* Padlock shall be used. */ + /* The key as passed to the padlock engine. */ + unsigned char padlock_key[16] __attribute__ ((aligned (16))); +#endif + union { PROPERLY_ALIGNED_TYPE dummy; byte keyschedule[MAXROUNDS+1][4][4]; @@ -69,26 +81,26 @@ static const byte S[256] = { - 99, 124, 119, 123, 242, 107, 111, 197, - 48, 1, 103, 43, 254, 215, 171, 118, + 99, 124, 119, 123, 242, 107, 111, 197, + 48, 1, 103, 43, 254, 215, 171, 118, 202, 130, 201, 125, 250, 89, 71, 240, 173, 212, 162, 175, 156, 164, 114, 192, 183, 253, 147, 38, 54, 63, 247, 204, - 52, 165, 229, 241, 113, 216, 49, 21, - 4, 199, 35, 195, 24, 150, 5, 154, - 7, 18, 128, 226, 235, 39, 178, 117, - 9, 131, 44, 26, 27, 110, 90, 160, - 82, 59, 214, 179, 41, 227, 47, 132, - 83, 209, 0, 237, 32, 252, 177, 91, + 52, 165, 229, 241, 113, 216, 49, 21, + 4, 199, 35, 195, 24, 150, 5, 154, + 7, 18, 128, 226, 235, 39, 178, 117, + 9, 131, 44, 26, 27, 110, 90, 160, + 82, 59, 214, 179, 41, 227, 47, 132, + 83, 209, 0, 237, 32, 252, 177, 91, 106, 203, 190, 57, 74, 76, 88, 207, 208, 239, 170, 251, 67, 77, 51, 133, - 69, 249, 2, 127, 80, 60, 159, 168, - 81, 163, 64, 143, 146, 157, 56, 245, + 69, 249, 2, 127, 80, 60, 159, 168, + 81, 163, 64, 143, 146, 157, 56, 245, 188, 182, 218, 33, 16, 255, 243, 210, 205, 12, 19, 236, 95, 151, 68, 23, 196, 167, 126, 61, 100, 93, 25, 115, - 96, 129, 79, 220, 34, 42, 144, 136, - 70, 238, 184, 20, 222, 94, 11, 219, + 96, 129, 79, 220, 34, 42, 144, 136, + 70, 238, 184, 20, 222, 94, 11, 219, 224, 50, 58, 10, 73, 6, 36, 92, 194, 211, 172, 98, 145, 149, 228, 121, 231, 200, 55, 109, 141, 213, 78, 169, @@ -96,11 +108,11 @@ 186, 120, 37, 46, 28, 166, 180, 198, 232, 221, 116, 31, 75, 189, 139, 138, 112, 62, 181, 102, 72, 3, 246, 14, - 97, 53, 87, 185, 134, 193, 29, 158, + 97, 53, 87, 185, 134, 193, 29, 158, 225, 248, 152, 17, 105, 217, 142, 148, 155, 30, 135, 233, 206, 85, 40, 223, 140, 161, 137, 13, 191, 230, 66, 104, - 65, 153, 45, 15, 176, 84, 187, 22 + 65, 153, 45, 15, 176, 84, 187, 22 }; @@ -1743,10 +1755,22 @@ if( selftest_failed ) return GPG_ERR_SELFTEST_FAILED; + ctx->decryption_prepared = 0; +#ifdef USE_PADLOCK + ctx->use_padlock = 0; +#endif + if( keylen == 128/8 ) { ROUNDS = 10; KC = 4; +#ifdef USE_PADLOCK + if ((_gcry_get_hw_features () & HWF_PADLOCK_AES)) + { + ctx->use_padlock = 1; + memcpy (ctx->padlock_key, key, keylen); + } +#endif } else if ( keylen == 192/8 ) { @@ -1762,68 +1786,29 @@ return GPG_ERR_INV_KEYLEN; ctx->ROUNDS = ROUNDS; - ctx->decryption_prepared = 0; - for (i = 0; i < keylen; i++) +#ifdef USE_PADLOCK + if (ctx->use_padlock) { - k[i >> 2][i & 3] = key[i]; + /* Nothing to do as we support only hardware key generation for + now. */ } + else +#endif /*USE_PADLOCK*/ + { #define W (ctx->keySched) - - for (j = KC-1; j >= 0; j--) - { - *((u32*)tk[j]) = *((u32*)k[j]); - } - r = 0; - t = 0; - /* copy values into round key array */ - for (j = 0; (j < KC) && (r < ROUNDS + 1); ) - { - for (; (j < KC) && (t < 4); j++, t++) + for (i = 0; i < keylen; i++) { - *((u32*)W[r][t]) = *((u32*)tk[j]); + k[i >> 2][i & 3] = key[i]; } - if (t == 4) + + for (j = KC-1; j >= 0; j--) { - r++; - t = 0; + *((u32*)tk[j]) = *((u32*)k[j]); } - } - - while (r < ROUNDS + 1) - { - /* While not enough round key material calculated */ - /* calculate new values. */ - tk[0][0] ^= S[tk[KC-1][1]]; - tk[0][1] ^= S[tk[KC-1][2]]; - tk[0][2] ^= S[tk[KC-1][3]]; - tk[0][3] ^= S[tk[KC-1][0]]; - tk[0][0] ^= rcon[rconpointer++]; - - if (KC != 8) - { - for (j = 1; j < KC; j++) - { - *((u32*)tk[j]) ^= *((u32*)tk[j-1]); - } - } - else - { - for (j = 1; j < KC/2; j++) - { - *((u32*)tk[j]) ^= *((u32*)tk[j-1]); - } - tk[KC/2][0] ^= S[tk[KC/2 - 1][0]]; - tk[KC/2][1] ^= S[tk[KC/2 - 1][1]]; - tk[KC/2][2] ^= S[tk[KC/2 - 1][2]]; - tk[KC/2][3] ^= S[tk[KC/2 - 1][3]]; - for (j = KC/2 + 1; j < KC; j++) - { - *((u32*)tk[j]) ^= *((u32*)tk[j-1]); - } - } - - /* Copy values into round key array. */ + r = 0; + t = 0; + /* Copy values into round key array. */ for (j = 0; (j < KC) && (r < ROUNDS + 1); ) { for (; (j < KC) && (t < 4); j++, t++) @@ -1836,12 +1821,61 @@ t = 0; } } - } - + + while (r < ROUNDS + 1) + { + /* While not enough round key material calculated calculate + new values. */ + tk[0][0] ^= S[tk[KC-1][1]]; + tk[0][1] ^= S[tk[KC-1][2]]; + tk[0][2] ^= S[tk[KC-1][3]]; + tk[0][3] ^= S[tk[KC-1][0]]; + tk[0][0] ^= rcon[rconpointer++]; + + if (KC != 8) + { + for (j = 1; j < KC; j++) + { + *((u32*)tk[j]) ^= *((u32*)tk[j-1]); + } + } + else + { + for (j = 1; j < KC/2; j++) + { + *((u32*)tk[j]) ^= *((u32*)tk[j-1]); + } + tk[KC/2][0] ^= S[tk[KC/2 - 1][0]]; + tk[KC/2][1] ^= S[tk[KC/2 - 1][1]]; + tk[KC/2][2] ^= S[tk[KC/2 - 1][2]]; + tk[KC/2][3] ^= S[tk[KC/2 - 1][3]]; + for (j = KC/2 + 1; j < KC; j++) + { + *((u32*)tk[j]) ^= *((u32*)tk[j-1]); + } + } + + /* Copy values into round key array. */ + for (j = 0; (j < KC) && (r < ROUNDS + 1); ) + { + for (; (j < KC) && (t < 4); j++, t++) + { + *((u32*)W[r][t]) = *((u32*)tk[j]); + } + if (t == 4) + { + r++; + t = 0; + } + } + } #undef W + } + return 0; } + static gcry_err_code_t rijndael_setkey (void *context, const byte *key, const unsigned keylen) { @@ -1998,13 +2032,70 @@ #undef rk } + +/* Encrypt or decrypt one block using the padlock engine. A and B may + be the same. */ +#ifdef USE_PADLOCK static void +do_padlock (const RIJNDAEL_context *ctx, int decrypt_flag, + unsigned char *bx, const unsigned char *ax) +{ + /* BX and AX are not necessary correctly aligned. Thus we need to + copy them here. */ + unsigned char a[16] __attribute__ ((aligned (16))); + unsigned char b[16] __attribute__ ((aligned (16))); + unsigned int cword[4] __attribute__ ((aligned (16))); + + /* The control word fields are: + 127:12 11:10 9 8 7 6 5 4 3:0 + RESERVED KSIZE CRYPT INTER KEYGN CIPHR ALIGN DGEST ROUND */ + cword[0] = (ctx->ROUNDS & 15); /* (The mask is just a safeguard.) */ + cword[1] = 0; + cword[2] = 0; + cword[3] = 0; + if (decrypt_flag) + cword[0] |= 0x00000200; + + memcpy (a, ax, 16); + + asm volatile + ("pushfl\n\t" /* Force key reload. */ + "popfl\n\t" + "pushl %%ebx\n\t" /* Save GOT register. */ + "movl %0, %%esi\n\t" /* Load input. */ + "movl %1, %%edi\n\t" /* Load output. */ + "movl %2, %%edx\n\t" /* Load control world. */ + "movl %3, %%ebx\n\t" /* Load key. */ + "movl $1, %%ecx\n\t" /* Init counter for just one block. */ + ".byte 0xf3, 0x0f, 0xa7, 0xc8\n\t" /* REP XSTORE ECB. */ + "popl %%ebx\n" /* Restore GOT register. */ + : /* No output */ + : "g" (a), "g" (b), "g" (cword), "g" (ctx->padlock_key) + : "%esi", "%edi", "%edx", "%ecx" + ); + + memcpy (bx, b, 16); +} +#endif /*USE_PADLOCK*/ + + +static void rijndael_encrypt (void *context, byte *b, const byte *a) { RIJNDAEL_context *ctx = context; - do_encrypt (ctx, b, a); - _gcry_burn_stack (48 + 2*sizeof(int)); +#ifdef USE_PADLOCK + if (ctx->use_padlock) + { + do_padlock (ctx, 0, b, a); + _gcry_burn_stack (48 + 15 /* possible padding for alignment */); + } + else +#endif /*USE_PADLOCK*/ + { + do_encrypt (ctx, b, a); + _gcry_burn_stack (48 + 2*sizeof(int)); + } } @@ -2124,10 +2215,21 @@ { RIJNDAEL_context *ctx = context; - do_decrypt (ctx, b, a); - _gcry_burn_stack (48+2*sizeof(int)); +#ifdef USE_PADLOCK + if (ctx->use_padlock) + { + do_padlock (ctx, 1, b, a); + _gcry_burn_stack (48 + 2*sizeof(int) /* FIXME */); + } + else +#endif /*USE_PADLOCK*/ + { + do_decrypt (ctx, b, a); + _gcry_burn_stack (48+2*sizeof(int)); + } } + /* Test a single encryption and decryption with each key size. */ static const char* Modified: trunk/src/ChangeLog =================================================================== --- trunk/src/ChangeLog 2007-11-28 10:37:20 UTC (rev 1271) +++ trunk/src/ChangeLog 2007-11-29 10:55:46 UTC (rev 1272) @@ -1,3 +1,7 @@ +2007-11-29 Werner Koch + + * hwfeatures.c (detect_ia32_gnuc): Detect Padlock engine. + 2007-11-13 Werner Koch * gcrypt.h.in (_GCRY_GCC_ATTR_MALLOC): Fixed gcc version check. Modified: trunk/src/g10lib.h =================================================================== --- trunk/src/g10lib.h 2007-11-28 10:37:20 UTC (rev 1271) +++ trunk/src/g10lib.h 2007-11-29 10:55:46 UTC (rev 1272) @@ -110,6 +110,7 @@ /*-- src/hwfeatures.c --*/ +/* (Do not change these values unless synced with the asm code.) */ #define HWF_PADLOCK_RNG 1 #define HWF_PADLOCK_AES 2 #define HWF_PADLOCK_SHA 4 Modified: trunk/src/hwfeatures.c =================================================================== --- trunk/src/hwfeatures.c 2007-11-28 10:37:20 UTC (rev 1271) +++ trunk/src/hwfeatures.c 2007-11-29 10:55:46 UTC (rev 1272) @@ -44,10 +44,102 @@ static void detect_ia32_gnuc (void) { + int has_cpuid = 0; + char vendor_id[12+1]; + /* Detect the CPUID feature by testing some undefined behaviour (16 + vs 32 bit pushf/popf). */ + asm volatile + ("pushf\n\t" /* Copy flags to EAX. */ + "popl %%eax\n\t" + "movl %%eax, %%ecx\n\t" /* Save flags into ECX. */ + "xorl $0x200000, %%eax\n\t" /* Toggle ID bit and copy it to the flags. */ + "pushl %%eax\n\t" + "popf\n\t" + "pushf\n\t" /* Copy changed flags again to EAX. */ + "popl %%eax\n\t" + "pushl %%ecx\n\t" /* Restore flags from ECX. */ + "popf\n\t" + "xorl %%eax, %%ecx\n\t" /* Compare flags against saved flags. */ + "jz .Lno_cpuid%=\n\t" /* Toggling did not work, thus no CPUID. */ + "movl $1, %0\n" /* Worked. true -> HAS_CPUID. */ + ".Lno_cpuid%=:\n\t" + : "=r" (has_cpuid) + : + : "%eax", "%ecx", "cc" + ); + + if (!has_cpuid) + return; /* No way. */ + + asm volatile + ("pushl %%ebx\n\t" /* Save GOT register. */ + "xorl %%eax, %%eax\n\t" /* 0 -> EAX. */ + "cpuid\n\t" /* Get vendor ID. */ + "leal %0, %%eax\n\t" /* EBX,EDX,ECX -> VENDOR_ID. */ + "movl %%ebx, (%%eax)\n\t" + "movl %%edx, 4(%%eax)\n\t" + "movl %%ecx, 8(%%eax)\n\t" + "popl %%ebx\n" + : "=m" (vendor_id) + : + : "%eax", "%ecx", "%edx", "cc" + ); + vendor_id[12] = 0; + /* Check whether this is a VIA CPU and what PadLock features we + have. */ + if (!strcmp (vendor_id, "CentaurHauls")) + { + asm volatile + ("pushl %%ebx\n\t" /* Save GOT register. */ + "movl $0xC0000000, %%eax\n\t" /* Check for extended centaur */ + "cpuid\n\t" /* feature flags. */ + "popl %%ebx\n\t" /* Restore GOT register. */ + "cmpl $0xC0000001, %%eax\n\t" + "jb .Lready%=\n\t" /* EAX < 0xC0000000 => no padlock. */ + "pushl %%ebx\n\t" /* Save GOT register. */ + "movl $0xC0000001, %%eax\n\t" /* Ask for the extended */ + "cpuid\n\t" /* feature flags. */ + "popl %%ebx\n\t" /* Restore GOT register. */ + + "movl %%edx, %%eax\n\t" /* Take copy of feature flags. */ + "andl $0x0C, %%eax\n\t" /* Test bits 2 and 3 to see whether */ + "cmpl $0x0C, %%eax\n\t" /* the RNG exists and is enabled. */ + "jnz .Lno_rng%=\n\t" + "orl $1, %0\n" /* Set our HWF_PADLOCK_RNG bit. */ + + ".Lno_rng%=:\n\t" + "movl %%edx, %%eax\n\t" /* Take copy of feature flags. */ + "andl $0xC0, %%eax\n\t" /* Test bits 6 and 7 to see whether */ + "cmpl $0xC0, %%eax\n\t" /* the ACE exists and is enabled. */ + "jnz .Lno_ace%=\n\t" + "orl $2, %0\n" /* Set our HWF_PADLOCK_AES bit. */ + + ".Lno_ace%=:\n\t" + "movl %%edx, %%eax\n\t" /* Take copy of feature flags. */ + "andl $0xC00, %%eax\n\t" /* Test bits 10, 11 to see whether */ + "cmpl $0xC00, %%eax\n\t" /* the PHE exists and is enabled. */ + "jnz .Lno_phe%=\n\t" + "orl $4, %0\n" /* Set our HWF_PADLOCK_SHA bit. */ + + ".Lno_phe%=:\n\t" + "movl %%edx, %%eax\n\t" /* Take copy of feature flags. */ + "andl $0x3000, %%eax\n\t" /* Test bits 12, 13 to see whether */ + "cmpl $0x3000, %%eax\n\t" /* MONTMUL exists and is enabled. */ + "jnz .Lready%=\n\t" + "orl $8, %0\n" /* Set our HWF_PADLOCK_MMUL bit. */ + + ".Lready%=:\n" + : "+r" (hw_features) + : + : "%eax", "%edx", "cc" + ); + } + } + #endif /* __i386__ && SIZEOF_UNSIGNED_LONG == 4 && __GNUC__ */ @@ -58,6 +150,8 @@ void _gcry_detect_hw_features (void) { + hw_features = 0; + #if defined (__i386__) && SIZEOF_UNSIGNED_LONG == 4 #ifdef __GNUC__ detect_ia32_gnuc (); From cvs at cvs.gnupg.org Thu Nov 29 13:19:21 2007 From: cvs at cvs.gnupg.org (svn author wk) Date: Thu, 29 Nov 2007 13:19:21 +0100 Subject: [svn] pinentry - r173 - in trunk: . qt Message-ID: Author: wk Date: 2007-11-29 13:19:21 +0100 (Thu, 29 Nov 2007) New Revision: 173 Modified: trunk/NEWS trunk/qt/pinentrydialog.cpp Log: From cvs at cvs.gnupg.org Thu Nov 29 15:11:34 2007 From: cvs at cvs.gnupg.org (svn author marcus) Date: Thu, 29 Nov 2007 15:11:34 +0100 Subject: [svn] pinentry - r174 - trunk Message-ID: Author: marcus Date: 2007-11-29 15:11:33 +0100 (Thu, 29 Nov 2007) New Revision: 174 Modified: trunk/ChangeLog trunk/NEWS trunk/configure.ac Log: 2007-11-29 Marcus Brinkmann Released 0.7.4. Modified: trunk/ChangeLog =================================================================== --- trunk/ChangeLog 2007-11-29 12:19:21 UTC (rev 173) +++ trunk/ChangeLog 2007-11-29 14:11:33 UTC (rev 174) @@ -1,3 +1,7 @@ +2007-11-29 Marcus Brinkmann + + Released 0.7.4. + 2007-11-19 Werner Koch * doc/pinentry.texi (Protocol): Typo fixes by Bernhard Herzog. Modified: trunk/NEWS =================================================================== --- trunk/NEWS 2007-11-29 12:19:21 UTC (rev 173) +++ trunk/NEWS 2007-11-29 14:11:33 UTC (rev 174) @@ -1,4 +1,4 @@ -Noteworthy changes in version 0.7.4 +Noteworthy changes in version 0.7.4 (2007-11-29) ------------------------------------------------ * Pinentry-gtk-2 and pinentry-qt now support a simple passphrase Modified: trunk/configure.ac =================================================================== --- trunk/configure.ac 2007-11-29 12:19:21 UTC (rev 173) +++ trunk/configure.ac 2007-11-29 14:11:33 UTC (rev 174) @@ -1,6 +1,6 @@ # configure.ac # Copyright (C) 1999 Robert Bihlmeyer -# Copyright (C) 2001, 2002, 2003, 2004 g10 Code GmbH +# Copyright (C) 2001, 2002, 2003, 2004, 2007 g10 Code GmbH # # This file is part of PINENTRY. # @@ -24,7 +24,7 @@ # Remember to remove the "-cvs" suffix *before* a release and to bump the # version number immediately *after* a release and to re-append the suffix. -AC_INIT(pinentry, 0.7.4-cvs, [gnupg-devel at gnupg.org]) +AC_INIT(pinentry, 0.7.4, [gnupg-devel at gnupg.org]) AM_CONFIG_HEADER(config.h) AC_CONFIG_SRCDIR(pinentry/pinentry.h) AM_INIT_AUTOMAKE($PACKAGE_NAME, $PACKAGE_VERSION) From cvs at cvs.gnupg.org Thu Nov 29 15:51:10 2007 From: cvs at cvs.gnupg.org (svn author dshaw) Date: Thu, 29 Nov 2007 15:51:10 +0100 Subject: [svn] GnuPG - r4633 - in branches/STABLE-BRANCH-1-4: cipher include Message-ID: Author: dshaw Date: 2007-11-29 15:51:08 +0100 (Thu, 29 Nov 2007) New Revision: 4633 Modified: branches/STABLE-BRANCH-1-4/cipher/ChangeLog branches/STABLE-BRANCH-1-4/cipher/camellia-glue.c branches/STABLE-BRANCH-1-4/cipher/cipher.c branches/STABLE-BRANCH-1-4/include/ChangeLog branches/STABLE-BRANCH-1-4/include/cipher.h Log: Add 128-bit variant of Camellia. Modified: branches/STABLE-BRANCH-1-4/cipher/ChangeLog =================================================================== --- branches/STABLE-BRANCH-1-4/cipher/ChangeLog 2007-11-28 23:08:35 UTC (rev 4632) +++ branches/STABLE-BRANCH-1-4/cipher/ChangeLog 2007-11-29 14:51:08 UTC (rev 4633) @@ -1,3 +1,8 @@ +2007-11-29 David Shaw + + * camellia-glue.c (camellia_get_info), cipher.c + (setup_cipher_table): Add 128-bit variant of Camellia. + 2007-11-28 David Shaw * sha256.c (sha224_get_info): 4880 has an error in the SHA-224 OID Modified: branches/STABLE-BRANCH-1-4/cipher/camellia-glue.c =================================================================== --- branches/STABLE-BRANCH-1-4/cipher/camellia-glue.c 2007-11-28 23:08:35 UTC (rev 4632) +++ branches/STABLE-BRANCH-1-4/cipher/camellia-glue.c 2007-11-29 14:51:08 UTC (rev 4633) @@ -58,7 +58,7 @@ static int initialized=0; static const char *selftest_failed=NULL; - if(keylen!=32) + if(keylen!=16 && keylen!=32) return G10ERR_WRONG_KEYLEN; if(!initialized) @@ -117,14 +117,22 @@ selftest(void) { CAMELLIA_context ctx; - byte scratch[16]; - /* These test vectors are from RFC-3713 */ const byte plaintext[]= { 0x01,0x23,0x45,0x67,0x89,0xab,0xcd,0xef, 0xfe,0xdc,0xba,0x98,0x76,0x54,0x32,0x10 }; + const byte key_128[]= + { + 0x01,0x23,0x45,0x67,0x89,0xab,0xcd,0xef, + 0xfe,0xdc,0xba,0x98,0x76,0x54,0x32,0x10 + }; + const byte ciphertext_128[]= + { + 0x67,0x67,0x31,0x38,0x54,0x96,0x69,0x73, + 0x08,0x57,0x06,0x56,0x48,0xea,0xbe,0x43 + }; const byte key_256[]= { 0x01,0x23,0x45,0x67,0x89,0xab,0xcd,0xef,0xfe,0xdc,0xba, @@ -136,14 +144,23 @@ 0x9a,0xcc,0x23,0x7d,0xff,0x16,0xd7,0x6c, 0x20,0xef,0x7c,0x91,0x9e,0x3a,0x75,0x09 }; + byte scratch[sizeof(plaintext)]; + camellia_setkey(&ctx,key_128,sizeof(key_128)); + camellia_encrypt(&ctx,scratch,plaintext); + if(memcmp(scratch,ciphertext_128,sizeof(scratch))!=0) + return "CAMELLIA128 test encryption failed."; + camellia_decrypt(&ctx,scratch,scratch); + if(memcmp(scratch,plaintext,sizeof(scratch))!=0) + return "CAMELLIA128 test decryption failed."; + camellia_setkey(&ctx,key_256,sizeof(key_256)); camellia_encrypt(&ctx,scratch,plaintext); - if(memcmp(scratch,ciphertext_256,sizeof(ciphertext_256))!=0) - return "CAMELLIA-256 test encryption failed."; + if(memcmp(scratch,ciphertext_256,sizeof(scratch))!=0) + return "CAMELLIA256 test encryption failed."; camellia_decrypt(&ctx,scratch,scratch); - if(memcmp(scratch,plaintext,sizeof(plaintext))!=0) - return "CAMELLIA-256 test decryption failed."; + if(memcmp(scratch,plaintext,sizeof(scratch))!=0) + return "CAMELLIA256 test decryption failed."; return NULL; } @@ -156,7 +173,6 @@ void (**r_decrypt)(void *c, byte *outbuf, const byte *inbuf) ) { - *keylen = 256; *blocksize = CAMELLIA_BLOCK_SIZE; *contextsize = sizeof (CAMELLIA_context); @@ -164,8 +180,16 @@ *r_encrypt = camellia_encrypt; *r_decrypt = camellia_decrypt; - if(algo==CIPHER_ALGO_CAMELLIA) - return "CAMELLIA"; - - return NULL; + if(algo==CIPHER_ALGO_CAMELLIA128) + { + *keylen = 128; + return "CAMELLIA128"; + } + else if(algo==CIPHER_ALGO_CAMELLIA256) + { + *keylen = 256; + return "CAMELLIA256"; + } + else + return NULL; } Modified: branches/STABLE-BRANCH-1-4/cipher/cipher.c =================================================================== --- branches/STABLE-BRANCH-1-4/cipher/cipher.c 2007-11-28 23:08:35 UTC (rev 4632) +++ branches/STABLE-BRANCH-1-4/cipher/cipher.c 2007-11-29 14:51:08 UTC (rev 4633) @@ -178,7 +178,7 @@ i++; #ifdef USE_CAMELLIA - cipher_table[i].algo = CIPHER_ALGO_CAMELLIA; + cipher_table[i].algo = CIPHER_ALGO_CAMELLIA128; cipher_table[i].name = camellia_get_info( cipher_table[i].algo, &cipher_table[i].keylen, &cipher_table[i].blocksize, @@ -189,6 +189,17 @@ if( !cipher_table[i].name ) BUG(); i++; + cipher_table[i].algo = CIPHER_ALGO_CAMELLIA256; + cipher_table[i].name = camellia_get_info( cipher_table[i].algo, + &cipher_table[i].keylen, + &cipher_table[i].blocksize, + &cipher_table[i].contextsize, + &cipher_table[i].setkey, + &cipher_table[i].encrypt, + &cipher_table[i].decrypt ); + if( !cipher_table[i].name ) + BUG(); + i++; #endif #ifdef USE_IDEA Modified: branches/STABLE-BRANCH-1-4/include/ChangeLog =================================================================== --- branches/STABLE-BRANCH-1-4/include/ChangeLog 2007-11-28 23:08:35 UTC (rev 4632) +++ branches/STABLE-BRANCH-1-4/include/ChangeLog 2007-11-29 14:51:08 UTC (rev 4633) @@ -1,3 +1,7 @@ +2007-11-29 David Shaw + + * cipher.h: Add the 128-bit variant of Camellia. + 2007-10-23 Werner Koch Switched entire package to GPLv3+. Modified: branches/STABLE-BRANCH-1-4/include/cipher.h =================================================================== --- branches/STABLE-BRANCH-1-4/include/cipher.h 2007-11-28 23:08:35 UTC (rev 4632) +++ branches/STABLE-BRANCH-1-4/include/cipher.h 2007-11-29 14:51:08 UTC (rev 4633) @@ -36,7 +36,8 @@ #define CIPHER_ALGO_AES192 8 #define CIPHER_ALGO_AES256 9 #define CIPHER_ALGO_TWOFISH 10 /* twofish 256 bit */ -#define CIPHER_ALGO_CAMELLIA 11 /* camellia 256 bit */ +#define CIPHER_ALGO_CAMELLIA128 11 +#define CIPHER_ALGO_CAMELLIA256 12 #define CIPHER_ALGO_DUMMY 110 /* no encryption at all */ From cvs at cvs.gnupg.org Fri Nov 30 12:31:54 2007 From: cvs at cvs.gnupg.org (svn author marcus) Date: Fri, 30 Nov 2007 12:31:54 +0100 Subject: [svn] GpgEX - r45 - trunk/src Message-ID: Author: marcus Date: 2007-11-30 12:31:53 +0100 (Fri, 30 Nov 2007) New Revision: 45 Modified: trunk/src/ChangeLog trunk/src/gpgex.cc Log: 2007-11-30 Marcus Brinkmann * gpgex.cc (start_help): Fix URL string format. Modified: trunk/src/ChangeLog =================================================================== --- trunk/src/ChangeLog 2007-11-26 14:26:26 UTC (rev 44) +++ trunk/src/ChangeLog 2007-11-30 11:31:53 UTC (rev 45) @@ -1,3 +1,7 @@ +2007-11-30 Marcus Brinkmann + + * gpgex.cc (start_help): Fix URL string format. + 2007-11-16 Marcus Brinkmann * gpgex.cc (start_help): Fix URL for Windows Exploder. Modified: trunk/src/gpgex.cc =================================================================== --- trunk/src/gpgex.cc 2007-11-26 14:26:26 UTC (rev 44) +++ trunk/src/gpgex.cc 2007-11-30 11:31:53 UTC (rev 45) @@ -525,7 +525,7 @@ sep = 1; _snwprintf (url, URLSIZE, L"file:///%S%Sshare\\doc\\gpgex\\gpgex-%S.html", - dir, get_lang_name (), sep ? "" : "\\"); + dir, sep ? "" : "\\", get_lang_name ()); } url[URLSIZE - 1] = '\0'; } From cvs at cvs.gnupg.org Fri Nov 30 17:33:12 2007 From: cvs at cvs.gnupg.org (svn author wk) Date: Fri, 30 Nov 2007 17:33:12 +0100 Subject: [svn] gcry - r1273 - in trunk: cipher tests Message-ID: Author: wk Date: 2007-11-30 17:33:09 +0100 (Fri, 30 Nov 2007) New Revision: 1273 Modified: trunk/cipher/ChangeLog trunk/cipher/Makefile.am trunk/cipher/rand-internal.h trunk/cipher/random.c trunk/cipher/rndlinux.c trunk/cipher/rndw32.c trunk/tests/ChangeLog trunk/tests/benchmark.c Log: Add support for the HW RNG. However i was not able to test it because it seems to be disabled by the OS. Modified: trunk/cipher/ChangeLog =================================================================== --- trunk/cipher/ChangeLog 2007-11-29 10:55:46 UTC (rev 1272) +++ trunk/cipher/ChangeLog 2007-11-30 16:33:09 UTC (rev 1273) @@ -1,3 +1,11 @@ +2007-11-30 Werner Koch + + * rndhw.c: New. + * rndlinux.c (_gcry_rndlinux_gather_random): Try to read 50% + directly from the hwrng. + * random.c (do_fast_random_poll): Also run the hw rng fast poll. + (_gcry_random_dump_stats): Tell whether the hw rng failed. + 2007-11-29 Werner Koch * rijndael.c (USE_PADLOCK): Define new macro used for ia32. Modified: trunk/cipher/Makefile.am =================================================================== --- trunk/cipher/Makefile.am 2007-11-29 10:55:46 UTC (rev 1272) +++ trunk/cipher/Makefile.am 2007-11-30 16:33:09 UTC (rev 1273) @@ -41,6 +41,7 @@ bithelp.h \ primegen.c \ random.c random.h \ +rndhw.c \ rand-internal.h \ rmd.h Modified: trunk/cipher/rand-internal.h =================================================================== --- trunk/cipher/rand-internal.h 2007-11-29 10:55:46 UTC (rev 1272) +++ trunk/cipher/rand-internal.h 2007-11-30 16:33:09 UTC (rev 1273) @@ -61,6 +61,14 @@ enum random_origins), enum random_origins origin ); +int _gcry_rndhw_failed_p (void); +void _gcry_rndhw_poll_fast (void (*add)(const void*, size_t, + enum random_origins), + enum random_origins origin); +size_t _gcry_rndhw_poll_slow (void (*add)(const void*, size_t, + enum random_origins), + enum random_origins origin); + #endif /*G10_RAND_INTERNAL_H*/ Modified: trunk/cipher/random.c =================================================================== --- trunk/cipher/random.c 2007-11-29 10:55:46 UTC (rev 1272) +++ trunk/cipher/random.c 2007-11-30 16:33:09 UTC (rev 1273) @@ -15,8 +15,7 @@ * GNU Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public - * License along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA + * License along with this program; if not, see . */ /* @@ -398,11 +397,12 @@ might_ run into problems. Needs to be checked. -wk */ log_info ("random usage: poolsize=%d mixed=%lu polls=%lu/%lu added=%lu/%lu\n" - " outmix=%lu getlvl1=%lu/%lu getlvl2=%lu/%lu\n", + " outmix=%lu getlvl1=%lu/%lu getlvl2=%lu/%lu%s\n", POOLSIZE, rndstats.mixrnd, rndstats.slowpolls, rndstats.fastpolls, rndstats.naddbytes, rndstats.addbytes, rndstats.mixkey, rndstats.ngetbytes1, rndstats.getbytes1, - rndstats.ngetbytes2, rndstats.getbytes2 ); + rndstats.ngetbytes2, rndstats.getbytes2, + _gcry_rndhw_failed_p()? " (hwrng failed)":""); } @@ -1251,8 +1251,8 @@ # endif /*!RUSAGE_SELF*/ #endif /*HAVE_GETRUSAGE*/ - /* time and clock are availabe on all systems - so we better do it - just in case one of the above functions didn't work */ + /* Time and clock are availabe on all systems - so we better do it + just in case one of the above functions didn't work. */ { time_t x = time(NULL); add_randomness( &x, sizeof(x), RANDOM_ORIGIN_FASTPOLL ); @@ -1261,6 +1261,10 @@ clock_t x = clock(); add_randomness( &x, sizeof(x), RANDOM_ORIGIN_FASTPOLL ); } + + /* If the system features a fast hardware RNG, read some bytes from + there. */ + _gcry_rndhw_poll_fast (add_randomness, RANDOM_ORIGIN_FASTPOLL); } Modified: trunk/cipher/rndlinux.c =================================================================== --- trunk/cipher/rndlinux.c 2007-11-29 10:55:46 UTC (rev 1272) +++ trunk/cipher/rndlinux.c 2007-11-30 16:33:09 UTC (rev 1273) @@ -1,5 +1,5 @@ /* rndlinux.c - raw random number for OSes with /dev/random - * Copyright (C) 1998, 2001, 2002, 2003 Free Software Foundation, Inc. + * Copyright (C) 1998, 2001, 2002, 2003, 2007 Free Software Foundation, Inc. * * This file is part of Libgcrypt. * @@ -14,8 +14,7 @@ * GNU Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public - * License along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA + * License along with this program; if not, see . */ @@ -96,8 +95,18 @@ int n; int warn=0; byte buffer[768]; + size_t n_hw; - if( level >= 2 ) + /* First read from a hardware source. However let it account only + for up to 50% of the requested bytes. */ + n_hw = _gcry_rndhw_poll_slow (add, origin); + if (n_hw > length/2) + n_hw = length/2; + if (length > 1) + length -= n_hw; + + /* Open the requested device. */ + if (level >= 2) { if( fd_random == -1 ) fd_random = open_device ( NAME_OF_DEV_RANDOM ); @@ -110,6 +119,7 @@ fd = fd_urandom; } + /* And enter the read loop. */ while (length) { fd_set rfds; Modified: trunk/cipher/rndw32.c =================================================================== --- trunk/cipher/rndw32.c 2007-11-29 10:55:46 UTC (rev 1272) +++ trunk/cipher/rndw32.c 2007-11-30 16:33:09 UTC (rev 1273) @@ -958,4 +958,6 @@ (*add) (&aword, sizeof (aword), origin ); } } + + } Modified: trunk/tests/ChangeLog =================================================================== --- trunk/tests/ChangeLog 2007-11-29 10:55:46 UTC (rev 1272) +++ trunk/tests/ChangeLog 2007-11-30 16:33:09 UTC (rev 1273) @@ -1,3 +1,9 @@ +2007-11-30 Werner Koch + + * benchmark.c (main): Add optione --verbose and reworked the + option parsing. + (random_bench): Dump random stats. + 2007-10-31 Werner Koch * benchmark.c (start_timer, stop_timer, elapsed_time) [W32]: Fixed. Modified: trunk/tests/benchmark.c =================================================================== --- trunk/tests/benchmark.c 2007-11-29 10:55:46 UTC (rev 1272) +++ trunk/tests/benchmark.c 2007-11-30 16:33:09 UTC (rev 1273) @@ -14,8 +14,7 @@ * GNU Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public - * License along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA + * License along with this program; if not, see . */ #ifdef HAVE_CONFIG_H @@ -34,6 +33,8 @@ #define PGM "benchmark" +static int verbose; + static const char sample_private_dsa_key_1024[] = "(private-key\n" " (dsa\n" @@ -347,6 +348,8 @@ printf (" %s", elapsed_time ()); putchar ('\n'); + if (verbose) + gcry_control (GCRYCTL_DUMP_RANDOM_STATS); } @@ -928,6 +931,8 @@ int main( int argc, char **argv ) { + int last_argc = -1; + if (argc) { argc--; argv++; } @@ -942,6 +947,33 @@ gcry_control (GCRYCTL_USE_RANDOM_DAEMON, 1); argc--; argv++; } + + while (argc && last_argc != argc ) + { + last_argc = argc; + if (!strcmp (*argv, "--")) + { + argc--; argv++; + break; + } + else if (!strcmp (*argv, "--help")) + { + fputs ("usage: benchmark " + "[md|cipher|random|mpi|rsa|dsa|ecc [algonames]]\n", + stdout); + exit (0); + } + else if (!strcmp (*argv, "--verbose")) + { + verbose = 1; + argc--; argv++; + } + else if (!strcmp (*argv, "--use-random-daemon")) + { + gcry_control (GCRYCTL_USE_RANDOM_DAEMON, 1); + argc--; argv++; + } + } gcry_control (GCRYCTL_INITIALIZATION_FINISHED, 0); @@ -960,10 +992,6 @@ putchar ('\n'); random_bench (0); } - else if ( !strcmp (*argv, "--help")) - fputs ("usage: benchmark " - "[md|cipher|random|mpi|rsa|dsa|ecc [algonames]]\n", - stdout); else if ( !strcmp (*argv, "random") || !strcmp (*argv, "strongrandom")) { if (argc == 1)