[svn] GnuPG - r4608 - in trunk: g10 keyserver tests/openpgp

svn author wk cvs at cvs.gnupg.org
Thu Oct 25 11:06:43 CEST 2007


Author: wk
Date: 2007-10-25 11:06:21 +0200 (Thu, 25 Oct 2007)
New Revision: 4608

Modified:
   trunk/g10/ChangeLog
   trunk/g10/armor.c
   trunk/g10/encode.c
   trunk/g10/gpg.c
   trunk/g10/import.c
   trunk/g10/keyedit.c
   trunk/g10/misc.c
   trunk/g10/options.h
   trunk/g10/sign.c
   trunk/keyserver/ChangeLog
   trunk/keyserver/gpgkeys_ldap.c
   trunk/tests/openpgp/ChangeLog
   trunk/tests/openpgp/armdetach.test
   trunk/tests/openpgp/armdetachm.test
   trunk/tests/openpgp/armencrypt.test
   trunk/tests/openpgp/armencryptp.test
   trunk/tests/openpgp/armor.test
   trunk/tests/openpgp/armsignencrypt.test
   trunk/tests/openpgp/armsigs.test
   trunk/tests/openpgp/clearsig.test
   trunk/tests/openpgp/conventional-mdc.test
   trunk/tests/openpgp/conventional.test
   trunk/tests/openpgp/decrypt-dsa.test
   trunk/tests/openpgp/decrypt.test
   trunk/tests/openpgp/defs.inc
   trunk/tests/openpgp/detach.test
   trunk/tests/openpgp/detachm.test
   trunk/tests/openpgp/encrypt-dsa.test
   trunk/tests/openpgp/encrypt.test
   trunk/tests/openpgp/encryptp.test
   trunk/tests/openpgp/genkey1024.test
   trunk/tests/openpgp/mds.test
   trunk/tests/openpgp/multisig.test
   trunk/tests/openpgp/seat.test
   trunk/tests/openpgp/signencrypt-dsa.test
   trunk/tests/openpgp/signencrypt.test
   trunk/tests/openpgp/sigs-dsa.test
   trunk/tests/openpgp/sigs.test
   trunk/tests/openpgp/verify.test
   trunk/tests/openpgp/version.test
Log:
Ported changes from 1.4.
Add copyright notices.


Modified: trunk/g10/ChangeLog
===================================================================
--- trunk/g10/ChangeLog	2007-10-24 15:34:23 UTC (rev 4607)
+++ trunk/g10/ChangeLog	2007-10-25 09:06:21 UTC (rev 4608)
@@ -1,3 +1,58 @@
+2007-10-25  David Shaw  <dshaw at jabberwocky.com>  (wk)
+
+	From 1.4 (October):
+
+	* gpg.c (main): Add --require-cross-certification to
+	--openpgp/--rfc4880 mode.
+
+	* gpg.c (main): Disable --rfc2440-text and --force-v3-sigs by
+	default.  Enable --require-cross-certification by default.
+	--openpgp (--rfc4880) is the same as --rfc2440 except with
+	"--enable-dsa2 --no-rfc2440-text --escape-from-lines".
+
+	* misc.c (compliance_option_string, compliance_failure): Minor
+	cleanup.
+
+	* armor.c (is_armor_header): Comment about 4880.
+
+	* options.h, gpg.c (main): Add --rfc4880, and make --openpgp an
+	alias to it.  --rfc2440 now stands alone.  For now, use the old
+	2440 defaults for 4880.
+	* misc.c (compliance_option_string): Ditto.
+	
+	* keyedit.c (keyedit_menu): Use compliance_option_string() instead
+	of printing the compliance modes here.
+
+2007-10-25  David Shaw  <dshaw at jabberwocky.com>  (wk)
+
+	From 1.4 (September):
+
+	* import.c (collapse_uids): Significant speedup for de-duping user
+	IDs.
+
+2007-10-25  David Shaw  <dshaw at jabberwocky.com>  (wk)
+
+	From 1.4 (July):
+	
+	* armor.c (parse_header_line): Improve test so that the header
+	test only allows "Hash" in the signed data section.
+
+	* armor.c (is_armor_tag): New.  Detect if an armor header matches
+	2440bis-21.
+	(parse_header_line): Call it here, as bis-21 requires warning the
+	user (but continuing to process the message) when seeing an
+	unknown header.
+
+	* encode.c (encode_crypt): Missed one call to
+	setup_plaintext_name().  This is bug#809.
+
+	* sign.c (mk_notation_policy_etc): Expect all sigs that this is
+	called for are >=v4.
+	(write_signature_packets, make_keysig_packet): Only call it for
+	>=v4 sigs.  This allows --force-v3-sigs and --force-v4-certs to
+	enable or disable notations, policies, and keyserver URLs.  This
+	is bug#800.
+
 2007-10-19  Werner Koch  <wk at g10code.com>
 
 	* passphrase.c (passphrase_get): Use new utf8 switching fucntions.

Modified: trunk/g10/armor.c
===================================================================
--- trunk/g10/armor.c	2007-10-24 15:34:23 UTC (rev 4607)
+++ trunk/g10/armor.c	2007-10-25 09:06:21 UTC (rev 4608)
@@ -1,6 +1,6 @@
 /* armor.c - Armor flter
- * 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.
  *
@@ -308,7 +308,19 @@
     return found;
 }
 
+/* Returns true if this is a valid armor tag as per RFC-2440bis-21. */
+static int
+is_armor_tag(const char *line)
+{
+  if(strncmp(line,"Version",7)==0
+     || strncmp(line,"Comment",7)==0
+     || strncmp(line,"MessageID",9)==0
+     || strncmp(line,"Hash",4)==0
+     || strncmp(line,"Charset",7)==0)
+    return 1;
 
+  return 0;
+}
 
 /****************
  * Check whether this is a armor line.
@@ -338,7 +350,8 @@
        --rfc2440 is set since 2440 reads "The header lines, therefore,
        MUST start at the beginning of a line, and MUST NOT have text
        following them on the same line."  It is unclear whether "text"
-       refers to all text or just non-whitespace text. */
+       refers to all text or just non-whitespace text.  4880 clarified
+       this was only non-whitespace text. */
 
     if(RFC2440)
       {
@@ -418,16 +431,32 @@
 	putc('\n', stderr);
     }
 
-    if( afx->in_cleartext ) {
+    if( afx->in_cleartext )
+      {
 	if( (hashes=parse_hash_header( line )) )
-	    afx->hashes |= hashes;
+	  afx->hashes |= hashes;
 	else if( strlen(line) > 15 && !memcmp( line, "NotDashEscaped:", 15 ) )
-	    afx->not_dash_escaped = 1;
-	else {
+	  afx->not_dash_escaped = 1;
+	else
+	  {
 	    log_error(_("invalid clearsig header\n"));
 	    return -1;
-	}
-    }
+	  }
+      }
+    else if(!is_armor_tag(line))
+      {
+	/* Section 6.2: "Unknown keys should be reported to the user,
+	   but OpenPGP should continue to process the message."  Note
+	   that in a clearsigned message this applies to the signature
+	   part (i.e. "BEGIN PGP SIGNATURE") and not the signed data
+	   ("BEGIN PGP SIGNED MESSAGE").  The only key allowed in the
+	   signed data section is "Hash". */
+
+	log_info(_("unknown armor header: "));
+	print_string( stderr, line, len, 0 );
+	putc('\n', stderr);
+      }
+
     return 1;
 }
 

Modified: trunk/g10/encode.c
===================================================================
--- trunk/g10/encode.c	2007-10-24 15:34:23 UTC (rev 4607)
+++ trunk/g10/encode.c	2007-10-25 09:06:21 UTC (rev 4608)
@@ -598,22 +598,8 @@
     if(use_symkey && (rc=write_symkey_enc(symkey_s2k,symkey_dek,cfx.dek,out)))
       goto leave;
 
-    if (!opt.no_literal) {
-	/* setup the inner packet */
-	if( filename || opt.set_filename ) {
-	    char *s = make_basename( opt.set_filename ? opt.set_filename
-						      : filename,
-				     iobuf_get_real_fname( inp ) );
-	    pt = xmalloc( sizeof *pt + strlen(s) - 1 );
-	    pt->namelen = strlen(s);
-	    memcpy(pt->name, s, pt->namelen );
-	    xfree(s);
-	}
-	else { /* no filename */
-	    pt = xmalloc( sizeof *pt - 1 );
-	    pt->namelen = 0;
-	}
-    }
+    if (!opt.no_literal)
+      pt=setup_plaintext_name(filename,inp);
 
     if (!iobuf_is_pipe_filename (filename) && *filename && !opt.textmode )
       {

Modified: trunk/g10/gpg.c
===================================================================
--- trunk/g10/gpg.c	2007-10-24 15:34:23 UTC (rev 4607)
+++ trunk/g10/gpg.c	2007-10-25 09:06:21 UTC (rev 4608)
@@ -1,6 +1,6 @@
 /* gpg.c - The GnuPG utility (main for gpg)
  * Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005,
- *               2006 Free Software Foundation, Inc.
+ *               2006, 2007 Free Software Foundation, Inc.
  *
  * This file is part of GnuPG.
  *
@@ -194,6 +194,7 @@
     oGnuPG,
     oRFC1991,
     oRFC2440,
+    oRFC4880,
     oOpenPGP,
     oPGP2,
     oPGP6,
@@ -520,6 +521,7 @@
     { oGnuPG, "no-pgp8", 0, "@"},
     { oRFC1991, "rfc1991",   0, "@"},
     { oRFC2440, "rfc2440", 0, "@" },
+    { oRFC4880, "rfc4880", 0, "@" },
     { oOpenPGP, "openpgp", 0, N_("use strict OpenPGP behavior")},
     { oPGP2, "pgp2", 0, N_("generate PGP 2.x compatible messages")},
     { oPGP6, "pgp6", 0, "@"},
@@ -1902,8 +1904,8 @@
     opt.marginals_needed = 3;
     opt.max_cert_depth = 5;
     opt.pgp2_workarounds = 1;
-    opt.force_v3_sigs = 1;
     opt.escape_from = 1;
+    opt.flags.require_cross_cert = 1;
     opt.import_options=IMPORT_SK2PK;
     opt.export_options=EXPORT_ATTRIBUTES;
     opt.keyserver_options.import_options=IMPORT_REPAIR_PKS_SUBKEY_BUG;
@@ -1917,7 +1919,6 @@
     opt.min_cert_level=2;
     set_screen_dimensions();
     opt.keyid_format=KF_SHORT;
-    opt.rfc2440_text=1;
     opt.def_sig_expire="0";
     opt.def_cert_expire="0";
     set_homedir ( default_homedir () );
@@ -2303,11 +2304,34 @@
 	    opt.escape_from = 1;
 	    break;
 	  case oOpenPGP:
+	  case oRFC4880:
+	    /* This is effectively the same as RFC2440, but with
+	       "--enable-dsa2 --no-rfc2440-text --escape-from-lines
+	       --require-cross-certification". */
+	    opt.compliance = CO_RFC4880;
+	    opt.flags.dsa2 = 1;
+	    opt.flags.require_cross_cert = 1;
+	    opt.rfc2440_text = 0;
+	    opt.allow_non_selfsigned_uid = 1;
+	    opt.allow_freeform_uid = 1;
+	    opt.pgp2_workarounds = 0;
+	    opt.escape_from = 1;
+	    opt.force_v3_sigs = 0;
+	    opt.compress_keys = 0;	    /* not mandated, but we do it */
+	    opt.compress_sigs = 0;	    /* ditto. */
+	    opt.not_dash_escaped = 0;
+	    opt.def_cipher_algo = 0;
+	    opt.def_digest_algo = 0;
+	    opt.cert_digest_algo = 0;
+	    opt.compress_algo = -1;
+            opt.s2k_mode = 3; /* iterated+salted */
+	    opt.s2k_digest_algo = DIGEST_ALGO_SHA1;
+	    opt.s2k_cipher_algo = CIPHER_ALGO_3DES;
+	    break;
 	  case oRFC2440:
-	    /* TODO: When 2440bis becomes a RFC, set new values for
-	       oOpenPGP. */
-	    opt.rfc2440_text=1;
 	    opt.compliance = CO_RFC2440;
+	    opt.flags.dsa2 = 0;
+	    opt.rfc2440_text = 1;
 	    opt.allow_non_selfsigned_uid = 1;
 	    opt.allow_freeform_uid = 1;
 	    opt.pgp2_workarounds = 0;

Modified: trunk/g10/import.c
===================================================================
--- trunk/g10/import.c	2007-10-24 15:34:23 UTC (rev 4607)
+++ trunk/g10/import.c	2007-10-25 09:06:21 UTC (rev 4608)
@@ -1,6 +1,6 @@
 /* import.c - import a key into our key storage.
- * 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.
  *
@@ -1649,90 +1649,102 @@
  * It may happen that the imported keyblock has duplicated user IDs.
  * We check this here and collapse those user IDs together with their
  * sigs into one.
- * Returns: True if the keyblock hash changed.
+ * Returns: True if the keyblock has changed.
  */
 int
 collapse_uids( KBNODE *keyblock )
 {
-    KBNODE n, n2;
-    int in_uid;
-    int any=0;
+  KBNODE uid1;
+  int any=0;
 
-  restart:
-    for( n = *keyblock; n; n = n->next ) {
-	if( n->pkt->pkttype != PKT_USER_ID )
+  for(uid1=*keyblock;uid1;uid1=uid1->next)
+    {
+      KBNODE uid2;
+
+      if(uid1->pkt->pkttype!=PKT_USER_ID)
+	continue;
+
+      for(uid2=uid1->next;uid2;uid2=uid2->next)
+	{
+	  if(uid2->pkt->pkttype!=PKT_USER_ID)
 	    continue;
-	for( n2 = n->next; n2; n2 = n2->next ) {
-	    if( n2->pkt->pkttype == PKT_USER_ID
-		&& !cmp_user_ids( n->pkt->pkt.user_id,
-				  n2->pkt->pkt.user_id ) ) {
-		/* found a duplicate */
-		any = 1;
-		if( !n2->next
-		    || n2->next->pkt->pkttype == PKT_USER_ID
-		    || n2->next->pkt->pkttype == PKT_PUBLIC_SUBKEY
-		    || n2->next->pkt->pkttype == PKT_SECRET_SUBKEY  ) {
-		    /* no more signatures: delete the user ID
-		     * and start over */
-		    remove_kbnode( keyblock, n2 );
+
+	  if(cmp_user_ids(uid1->pkt->pkt.user_id,
+			  uid2->pkt->pkt.user_id)==0)
+	    {
+	      /* We have a duplicated uid */
+	      KBNODE sig1,last;
+
+	      any=1;
+
+	      /* Now take uid2's signatures, and attach them to
+		 uid1 */
+	      for(last=uid2;last->next;last=last->next)
+		{
+		  if(last->next->pkt->pkttype==PKT_USER_ID
+		     || last->next->pkt->pkttype==PKT_PUBLIC_SUBKEY
+		     || last->next->pkt->pkttype==PKT_SECRET_SUBKEY)
+		    break;
 		}
-		else {
-		    /* The simple approach: Move one signature and
-		     * then start over to delete the next one :-( */
-		    move_kbnode( keyblock, n2->next, n->next );
-		}
-		goto restart;
-	    }
-	}
-    }
-    if( !any )
-	return 0;
 
-  restart_sig:
-    /* now we may have duplicate signatures on one user ID: fix this */
-    for( in_uid = 0, n = *keyblock; n; n = n->next ) {
-	if( n->pkt->pkttype == PKT_USER_ID )
-	    in_uid = 1;
-	else if( n->pkt->pkttype == PKT_PUBLIC_SUBKEY
-		 || n->pkt->pkttype == PKT_SECRET_SUBKEY )
-	    in_uid = 0;
-	else if( in_uid ) {
-	    n2 = n;
-	    do {
-		KBNODE ncmp = NULL;
-		for( ; n2; n2 = n2->next ) {
-		    if(    n2->pkt->pkttype == PKT_USER_ID
-			|| n2->pkt->pkttype == PKT_PUBLIC_SUBKEY
-			|| n2->pkt->pkttype == PKT_SECRET_SUBKEY )
+	      /* Snip out uid2 */
+	      (find_prev_kbnode(*keyblock,uid2,0))->next=last->next;
+
+	      /* Now put uid2 in place as part of uid1 */
+	      last->next=uid1->next;
+	      uid1->next=uid2;
+	      remove_kbnode(keyblock,uid2);
+
+	      /* Now dedupe uid1 */
+	      for(sig1=uid1->next;sig1;sig1=sig1->next)
+		{
+		  KBNODE sig2;
+
+		  if(sig1->pkt->pkttype==PKT_USER_ID
+		     || sig1->pkt->pkttype==PKT_PUBLIC_SUBKEY
+		     || sig1->pkt->pkttype==PKT_SECRET_SUBKEY)
+		    break;
+
+		  if(sig1->pkt->pkttype!=PKT_SIGNATURE)
+		    continue;
+
+		  for(sig2=sig1->next,last=sig1;sig2;last=sig2,sig2=sig2->next)
+		    {
+		      if(sig2->pkt->pkttype==PKT_USER_ID
+			 || sig2->pkt->pkttype==PKT_PUBLIC_SUBKEY
+			 || sig2->pkt->pkttype==PKT_SECRET_SUBKEY)
 			break;
-		    if( n2->pkt->pkttype != PKT_SIGNATURE )
-			;
-		    else if( !ncmp )
-			ncmp = n2;
-		    else if( !cmp_signatures( ncmp->pkt->pkt.signature,
-						n2->pkt->pkt.signature )) {
-			remove_kbnode( keyblock, n2 );
-			goto restart_sig;
+
+		      if(sig2->pkt->pkttype!=PKT_SIGNATURE)
+			continue;
+
+		      if(cmp_signatures(sig1->pkt->pkt.signature,
+					sig2->pkt->pkt.signature)==0)
+			{
+			  /* We have a match, so delete the second
+			     signature */
+			  remove_kbnode(&uid1,sig2);
+			  sig2=last;
+			}
 		    }
 		}
-		n2 = ncmp? ncmp->next : NULL;
-	    } while( n2 );
+	    }
 	}
     }
 
-    if(!opt.quiet)
-      {
-	const char *key="???";
+  if(any && !opt.quiet)
+    {
+      const char *key="???";
 
-	if( (n = find_kbnode( *keyblock, PKT_PUBLIC_KEY )) )
-	  key=keystr_from_pk(n->pkt->pkt.public_key);
-	else if( (n = find_kbnode( *keyblock, PKT_SECRET_KEY )) )
-	  key=keystr_from_sk(n->pkt->pkt.secret_key);
+      if( (uid1=find_kbnode( *keyblock, PKT_PUBLIC_KEY )) )
+	key=keystr_from_pk(uid1->pkt->pkt.public_key);
+      else if( (uid1 = find_kbnode( *keyblock, PKT_SECRET_KEY )) )
+	key=keystr_from_sk(uid1->pkt->pkt.secret_key);
 
-	log_info(_("key %s: duplicated user ID detected - merged\n"),key);
-      }
+      log_info(_("key %s: duplicated user ID detected - merged\n"),key);
+    }
 
-    return 1;
+  return any;
 }
 
 /* Check for a 0x20 revocation from a revocation key that is not

Modified: trunk/g10/keyedit.c
===================================================================
--- trunk/g10/keyedit.c	2007-10-24 15:34:23 UTC (rev 4607)
+++ trunk/g10/keyedit.c	2007-10-25 09:06:21 UTC (rev 4608)
@@ -1803,7 +1803,7 @@
               {
                 tty_printf(
                    _("This command is not allowed while in %s mode.\n"),
-		   RFC2440?"OpenPGP":PGP2?"PGP2":"RFC-1991");
+		   compliance_option_string());
                 break;
               }
 	    photo=1;

Modified: trunk/g10/misc.c
===================================================================
--- trunk/g10/misc.c	2007-10-24 15:34:23 UTC (rev 4607)
+++ trunk/g10/misc.c	2007-10-25 09:06:21 UTC (rev 4608)
@@ -831,47 +831,64 @@
 const char *
 compliance_option_string(void)
 {
+  char *ver="???";
+
   switch(opt.compliance)
     {
-    case CO_RFC2440:
-      return "--openpgp";
-    case CO_PGP2:
-      return "--pgp2";
-    case CO_PGP6:
-      return "--pgp6";
-    case CO_PGP7:
-      return "--pgp7";
-    case CO_PGP8:
-      return "--pgp8";
-    default:
-      return "???";
+    case CO_GNUPG:   return "--gnupg";
+    case CO_RFC4880: return "--openpgp";
+    case CO_RFC2440: return "--rfc2440";
+    case CO_RFC1991: return "--rfc1991";
+    case CO_PGP2:    return "--pgp2";
+    case CO_PGP6:    return "--pgp6";
+    case CO_PGP7:    return "--pgp7";
+    case CO_PGP8:    return "--pgp8";
     }
+
+  return ver;
 }
 
-static const char *
-compliance_string(void)
+void
+compliance_failure(void)
 {
+  char *ver="???";
+
   switch(opt.compliance)
     {
+    case CO_GNUPG:
+      ver="GnuPG";
+      break;
+
+    case CO_RFC4880:
+      ver="OpenPGP";
+      break;
+
     case CO_RFC2440:
-      return "OpenPGP";
+      ver="OpenPGP (older)";
+      break;
+
+    case CO_RFC1991:
+      ver="old PGP";
+      break;
+
     case CO_PGP2:
-      return "PGP 2.x";
+      ver="PGP 2.x";
+      break;
+
     case CO_PGP6:
-      return "PGP 6.x";
+      ver="PGP 6.x";
+      break;
+
     case CO_PGP7:
-      return "PGP 7.x";
+      ver="PGP 7.x";
+      break;
+
     case CO_PGP8:
-      return "PGP 8.x";
-    default:
-      return "???";
+      ver="PGP 8.x";
+      break;
     }
-}
 
-void
-compliance_failure(void)
-{
-  log_info(_("this message may not be usable by %s\n"),compliance_string());
+  log_info(_("this message may not be usable by %s\n"),ver);
   opt.compliance=CO_GNUPG;
 }
 

Modified: trunk/g10/options.h
===================================================================
--- trunk/g10/options.h	2007-10-24 15:34:23 UTC (rev 4607)
+++ trunk/g10/options.h	2007-10-25 09:06:21 UTC (rev 4608)
@@ -1,6 +1,6 @@
 /* options.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.
  *
@@ -103,7 +103,8 @@
   int force_ownertrust;
   enum
     {
-      CO_GNUPG=0, CO_RFC2440, CO_RFC1991, CO_PGP2, CO_PGP6, CO_PGP7, CO_PGP8
+      CO_GNUPG, CO_RFC4880, CO_RFC2440, CO_RFC1991, CO_PGP2,
+      CO_PGP6, CO_PGP7, CO_PGP8
     } compliance;
   enum
     {
@@ -290,10 +291,12 @@
 #define GNUPG   (opt.compliance==CO_GNUPG)
 #define RFC1991 (opt.compliance==CO_RFC1991 || opt.compliance==CO_PGP2)
 #define RFC2440 (opt.compliance==CO_RFC2440)
+#define RFC4880 (opt.compliance==CO_RFC4880)
 #define PGP2    (opt.compliance==CO_PGP2)
 #define PGP6    (opt.compliance==CO_PGP6)
 #define PGP7    (opt.compliance==CO_PGP7)
 #define PGP8    (opt.compliance==CO_PGP8)
+#define PGPX    (PGP2 || PGP6 || PGP7 || PGP8)
 
 /* Various option flags.  Note that there should be no common string
    names between the IMPORT_ and EXPORT_ flags as they can be mixed in

Modified: trunk/g10/sign.c
===================================================================
--- trunk/g10/sign.c	2007-10-24 15:34:23 UTC (rev 4607)
+++ trunk/g10/sign.c	2007-10-25 09:06:21 UTC (rev 4608)
@@ -1,6 +1,6 @@
 /* sign.c - sign data
- * 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.
  *
@@ -66,32 +66,17 @@
     struct notation *nd=NULL;
     struct expando_args args;
 
+    assert(sig->version>=4);
+
     memset(&args,0,sizeof(args));
     args.pk=pk;
     args.sk=sk;
 
-    /* It is actually impossible to get here when making a v3 key
-       signature since keyedit.c:sign_uids will automatically bump a
-       signature with a notation or policy url up to v4, but it is
-       good to do these checks anyway. */
-
     /* notation data */
     if(IS_SIG(sig) && opt.sig_notations)
-      {
-	if(sig->version<4)
-	  log_error(_("can't put notation data into v3 (PGP 2.x style) "
-		      "signatures\n"));
-	else
-	  nd=opt.sig_notations;
-      }
+      nd=opt.sig_notations;
     else if( IS_CERT(sig) && opt.cert_notations )
-      {
-	if(sig->version<4)
-	  log_error(_("can't put notation data into v3 (PGP 2.x style) "
-		      "key signatures\n"));
-	else
-	  nd=opt.cert_notations;
-      }
+      nd=opt.cert_notations;
 
     if(nd)
       {
@@ -116,21 +101,9 @@
 
     /* set policy URL */
     if( IS_SIG(sig) && opt.sig_policy_url )
-      {
-	if(sig->version<4)
-	  log_error(_("can't put a policy URL into v3 (PGP 2.x style) "
-		      "signatures\n"));
-	else
-	  pu=opt.sig_policy_url;
-      }
+      pu=opt.sig_policy_url;
     else if( IS_CERT(sig) && opt.cert_policy_url )
-      {
-	if(sig->version<4)
-	  log_error(_("can't put a policy URL into v3 key (PGP 2.x style) "
-		      "signatures\n"));
-	else
-	  pu=opt.cert_policy_url;
-      }
+      pu=opt.cert_policy_url;
 
     for(;pu;pu=pu->next)
       {
@@ -153,12 +126,7 @@
 
     /* preferred keyserver URL */
     if( IS_SIG(sig) && opt.sig_keyserver_url )
-      {
-	if(sig->version<4)
-	  log_info("can't put a preferred keyserver URL into v3 signatures\n");
-	else
-	  pu=opt.sig_keyserver_url;
-      }
+      pu=opt.sig_keyserver_url;
 
     for(;pu;pu=pu->next)
       {
@@ -689,8 +657,10 @@
           BUG ();
 
 	if (sig->version >= 4)
+          {
 	    build_sig_subpkt_from_sig (sig);
-	mk_notation_policy_etc (sig, NULL, sk);
+            mk_notation_policy_etc (sig, NULL, sk);
+          }
 
         hash_sigversion_to_magic (md, sig);
 	gcry_md_final (md);
@@ -1487,8 +1457,10 @@
       sig->expiredate=sig->timestamp+duration;
     sig->sig_class = sigclass;
     if( sig->version >= 4 )
+      {
 	build_sig_subpkt_from_sig( sig );
-    mk_notation_policy_etc( sig, pk, sk );
+	mk_notation_policy_etc( sig, pk, sk );
+      }
 
     /* Crucial that the call to mksubpkt comes LAST before the calls
        to finalize the sig as that makes it possible for the mksubpkt

Modified: trunk/keyserver/ChangeLog
===================================================================
--- trunk/keyserver/ChangeLog	2007-10-24 15:34:23 UTC (rev 4607)
+++ trunk/keyserver/ChangeLog	2007-10-25 09:06:21 UTC (rev 4608)
@@ -1,3 +1,15 @@
+2007-10-25  David Shaw  <dshaw at jabberwocky.com>  (wk)
+
+	From 1.4 (July):
+	
+	* gpgkeys_ldap.c (main): Fix bug in setting up whether to verify
+	peer SSL cert.  This used to work with older OpenLDAP, but is now
+	more strictly handled.
+
+	* gpgkeys_ldap.c (search_key, main): Fix bug where searching for
+	foo bar (no quotes) on the command line resulted in searching for
+	"foo\2Abar" due to LDAP quoting.  The proper search is "foo*bar".
+
 2007-06-11  Werner Koch  <wk at g10code.com>
 
 	* gpgkeys_hkp.c (send_key): Rename eof to r_eof as some Windows
@@ -1208,8 +1220,8 @@
 	gpgkeys_mailto (email keyserver helper)
 
 
- Copyright 1998, 1999, 2000, 2001, 2002, 2003,
-	   2004 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: trunk/keyserver/gpgkeys_ldap.c
===================================================================
--- trunk/keyserver/gpgkeys_ldap.c	2007-10-24 15:34:23 UTC (rev 4607)
+++ trunk/keyserver/gpgkeys_ldap.c	2007-10-25 09:06:21 UTC (rev 4608)
@@ -1,5 +1,6 @@
 /* gpgkeys_ldap.c - talk to a LDAP keyserver
- * Copyright (C) 2001, 2002, 2004, 2005, 2006 Free Software Foundation, Inc.
+ * Copyright (C) 2001, 2002, 2004, 2005, 2006
+ *               2007  Free Software Foundation, Inc.
  *
  * This file is part of GnuPG.
  *
@@ -1288,18 +1289,25 @@
 static int
 search_key(const char *searchkey)
 {
-  char **vals;
+  char **vals,*search;
   LDAPMessage *res,*each;
   int err,count=0;
   struct keylist *dupelist=NULL;
   /* The maximum size of the search, including the optional stuff and
      the trailing \0 */
-  char search[2+1+9+1+3+(MAX_LINE*3)+3+1+15+14+1+1+20];
   char *attrs[]={"pgpcertid","pgpuserid","pgprevoked","pgpdisabled",
 		 "pgpkeycreatetime","pgpkeyexpiretime","modifytimestamp",
 		 "pgpkeysize","pgpkeytype",NULL};
   enum ks_search_type search_type;
 
+  search=malloc(2+1+9+1+3+strlen(searchkey)+3+1+15+14+1+1+20);
+  if(!search)
+    {
+      fprintf(console,"gpgkeys: out of memory when building search list\n");
+      fprintf(output,"SEARCH %s FAILED %d\n",searchkey,KEYSERVER_NO_MEMORY);
+      return KEYSERVER_NO_MEMORY;
+    }
+
   fprintf(output,"SEARCH %s BEGIN\n",searchkey);
 
   search_type=classify_ks_search(&searchkey);
@@ -1354,7 +1362,7 @@
       break;
     }
 
-  ldap_quote(search,searchkey);
+  strcat(search,searchkey);
 
   switch(search_type)
     {
@@ -1392,6 +1400,7 @@
 
   err=ldap_search_s(ldap,basekeyspacedn,
 		    LDAP_SCOPE_SUBTREE,search,attrs,0,&res);
+  free(search);
   if(err!=LDAP_SUCCESS && err!=LDAP_SIZELIMIT_EXCEEDED)
     {
       int errtag=ldap_err_to_gpg_err(err);
@@ -2172,7 +2181,7 @@
 	      else
 		ver=LDAP_OPT_X_TLS_NEVER;
 
-	      err=ldap_set_option(ldap,LDAP_OPT_X_TLS_REQUIRE_CERT,&ver);
+	      err=ldap_set_option(NULL,LDAP_OPT_X_TLS_REQUIRE_CERT,&ver);
 	    }
 #endif
 
@@ -2308,7 +2317,7 @@
 	  keyptr=keyptr->next;
 	}
 
-      searchkey=malloc(len+1);
+      searchkey=malloc((len*3)+1);
       if(searchkey==NULL)
 	{
 	  ret=KEYSERVER_NO_MEMORY;
@@ -2321,7 +2330,7 @@
       keyptr=keylist;
       while(keyptr!=NULL)
 	{
-	  strcat(searchkey,keyptr->str);
+	  ldap_quote(searchkey,keyptr->str);
 	  strcat(searchkey,"*");
 	  keyptr=keyptr->next;
 	}

Modified: trunk/tests/openpgp/ChangeLog
===================================================================
--- trunk/tests/openpgp/ChangeLog	2007-10-24 15:34:23 UTC (rev 4607)
+++ trunk/tests/openpgp/ChangeLog	2007-10-25 09:06:21 UTC (rev 4608)
@@ -1,3 +1,22 @@
+2007-10-25  Werner Koch  <wk at g10code.com>
+
+	Add missing copyright notices to *.test.
+
+2007-10-25  David Shaw  <dshaw at jabberwocky.com>  (wk)
+
+	From 1.4 (July):
+
+	* defs.inc (all_cipher_algos): New function to return all ciphers.
+	* defs.inc (all_cipher_algos): New function to return all ciphers
+	we support.  This is safer than the previous setup which could
+	hide that some ciphers weren't being tested.  Plus, this
+	automatically tests any new ciphers libgcrypt supports.
+	(all_hash_algos): New. 
+	* sigs.test: Use it here, and also test with >=160 bit hashes for
+	DSA2.
+	* conventional.test, encrypt.test, encrypt-dsa.test,
+	* conventional-mdc.test: Use it here.
+
 2007-05-02  David Shaw  <dshaw at jabberwocky.com>
 
 	* conventional.test, encrypt.test, encrypt-dsa.test,
@@ -289,7 +308,7 @@
 	* ChangeLog: New.
 
 
- Copyright 1998, 1999, 2000, 2001 Free Software Foundation, Inc.
+ Copyright 1998, 1999, 2000, 2001, 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: trunk/tests/openpgp/armdetach.test
===================================================================
--- trunk/tests/openpgp/armdetach.test	2007-10-24 15:34:23 UTC (rev 4607)
+++ trunk/tests/openpgp/armdetach.test	2007-10-25 09:06:21 UTC (rev 4608)
@@ -1,4 +1,12 @@
 #!/bin/sh
+# 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
+# modifications, as long as this notice is preserved.  This file is
+# distributed in the hope that it will be useful, but WITHOUT ANY
+# WARRANTY, to the extent permitted by law; without even the implied
+# warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
 
 . $srcdir/defs.inc || exit 3
 

Modified: trunk/tests/openpgp/armdetachm.test
===================================================================
--- trunk/tests/openpgp/armdetachm.test	2007-10-24 15:34:23 UTC (rev 4607)
+++ trunk/tests/openpgp/armdetachm.test	2007-10-25 09:06:21 UTC (rev 4608)
@@ -1,4 +1,12 @@
 #!/bin/sh
+# 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
+# modifications, as long as this notice is preserved.  This file is
+# distributed in the hope that it will be useful, but WITHOUT ANY
+# WARRANTY, to the extent permitted by law; without even the implied
+# warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
 
 . $srcdir/defs.inc || exit 3
 

Modified: trunk/tests/openpgp/armencrypt.test
===================================================================
--- trunk/tests/openpgp/armencrypt.test	2007-10-24 15:34:23 UTC (rev 4607)
+++ trunk/tests/openpgp/armencrypt.test	2007-10-25 09:06:21 UTC (rev 4608)
@@ -1,4 +1,12 @@
 #!/bin/sh
+# 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
+# modifications, as long as this notice is preserved.  This file is
+# distributed in the hope that it will be useful, but WITHOUT ANY
+# WARRANTY, to the extent permitted by law; without even the implied
+# warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
 
 . $srcdir/defs.inc || exit 3
 

Modified: trunk/tests/openpgp/armencryptp.test
===================================================================
--- trunk/tests/openpgp/armencryptp.test	2007-10-24 15:34:23 UTC (rev 4607)
+++ trunk/tests/openpgp/armencryptp.test	2007-10-25 09:06:21 UTC (rev 4608)
@@ -1,4 +1,12 @@
 #!/bin/sh
+# 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
+# modifications, as long as this notice is preserved.  This file is
+# distributed in the hope that it will be useful, but WITHOUT ANY
+# WARRANTY, to the extent permitted by law; without even the implied
+# warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
 
 . $srcdir/defs.inc || exit 3
 

Modified: trunk/tests/openpgp/armor.test
===================================================================
--- trunk/tests/openpgp/armor.test	2007-10-24 15:34:23 UTC (rev 4607)
+++ trunk/tests/openpgp/armor.test	2007-10-25 09:06:21 UTC (rev 4608)
@@ -1,5 +1,12 @@
 #!/bin/sh
 # Regression tests pertaining to the armoring.
+# Copyright 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
+# modifications, as long as this notice is preserved.  This file is
+# distributed in the hope that it will be useful, but WITHOUT ANY
+# WARRANTY, to the extent permitted by law; without even the implied
+# warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
 
 . $srcdir/defs.inc || exit 3
 

Modified: trunk/tests/openpgp/armsignencrypt.test
===================================================================
--- trunk/tests/openpgp/armsignencrypt.test	2007-10-24 15:34:23 UTC (rev 4607)
+++ trunk/tests/openpgp/armsignencrypt.test	2007-10-25 09:06:21 UTC (rev 4608)
@@ -1,4 +1,12 @@
 #!/bin/sh
+# 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
+# modifications, as long as this notice is preserved.  This file is
+# distributed in the hope that it will be useful, but WITHOUT ANY
+# WARRANTY, to the extent permitted by law; without even the implied
+# warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
 
 . $srcdir/defs.inc || exit 3
 

Modified: trunk/tests/openpgp/armsigs.test
===================================================================
--- trunk/tests/openpgp/armsigs.test	2007-10-24 15:34:23 UTC (rev 4607)
+++ trunk/tests/openpgp/armsigs.test	2007-10-25 09:06:21 UTC (rev 4608)
@@ -1,4 +1,12 @@
 #!/bin/sh
+# 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
+# modifications, as long as this notice is preserved.  This file is
+# distributed in the hope that it will be useful, but WITHOUT ANY
+# WARRANTY, to the extent permitted by law; without even the implied
+# warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
 
 . $srcdir/defs.inc || exit 3
 

Modified: trunk/tests/openpgp/clearsig.test
===================================================================
--- trunk/tests/openpgp/clearsig.test	2007-10-24 15:34:23 UTC (rev 4607)
+++ trunk/tests/openpgp/clearsig.test	2007-10-25 09:06:21 UTC (rev 4608)
@@ -1,4 +1,12 @@
 #!/bin/sh
+# 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
+# modifications, as long as this notice is preserved.  This file is
+# distributed in the hope that it will be useful, but WITHOUT ANY
+# WARRANTY, to the extent permitted by law; without even the implied
+# warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
 
 # Fixme: we should not only do a --verify but also the output.
 

Modified: trunk/tests/openpgp/conventional-mdc.test
===================================================================
--- trunk/tests/openpgp/conventional-mdc.test	2007-10-24 15:34:23 UTC (rev 4607)
+++ trunk/tests/openpgp/conventional-mdc.test	2007-10-25 09:06:21 UTC (rev 4608)
@@ -1,32 +1,19 @@
 #!/bin/sh
+# Copyright 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
+# modifications, as long as this notice is preserved.  This file is
+# distributed in the hope that it will be useful, but WITHOUT ANY
+# WARRANTY, to the extent permitted by law; without even the implied
+# warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
 
 . $srcdir/defs.inc || exit 3
 
-algos="3des"
-
-if have_cipher_algo "IDEA"; then
-   algos="$algos idea"
-fi
-
-if have_cipher_algo "CAST5"; then
-   algos="$algos cast5"
-fi
-
-if have_cipher_algo "BLOWFISH"; then
-   algos="$algos blowfish"
-fi
-
-if have_cipher_algo "AES"; then
-   algos="$algos aes aes192 aes256"
-fi
-
-if have_cipher_algo "TWOFISH"; then
-   algos="$algos twofish"
-fi
-
 #info Checking conventional encryption
-for i in 0 1 2 3 9 10 11 19 20 21 22 23 39 40 41 8192 32000 ; do
-  for ciph in $algos; do
+for ciph in `all_cipher_algos`; do
+  echo_n "$ciph "
+  for i in 0 1 2 3 9 10 11 19 20 21 22 23 39 40 41 8192 32000 ; do
     # *BSD's dd can't cope with a count of 0
     if test "$i" = "0"; then
         : >z
@@ -40,3 +27,4 @@
     cmp z y || error "$ciph/$i: mismatch"
   done
 done
+echo_n "| "

Modified: trunk/tests/openpgp/conventional.test
===================================================================
--- trunk/tests/openpgp/conventional.test	2007-10-24 15:34:23 UTC (rev 4607)
+++ trunk/tests/openpgp/conventional.test	2007-10-25 09:06:21 UTC (rev 4608)
@@ -1,4 +1,12 @@
 #!/bin/sh
+# 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
+# modifications, as long as this notice is preserved.  This file is
+# distributed in the hope that it will be useful, but WITHOUT ANY
+# WARRANTY, to the extent permitted by law; without even the implied
+# warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
 
 . $srcdir/defs.inc || exit 3
 
@@ -9,29 +17,8 @@
     cmp $i y || error "$i: mismatch"
 done
 
-algos="3des"
-
-if have_cipher_algo "IDEA"; then
-   algos="$algos idea"
-fi
-
-if have_cipher_algo "CAST5"; then
-   algos="$algos cast5"
-fi
-
-if have_cipher_algo "BLOWFISH"; then
-   algos="$algos blowfish"
-fi
-
-if have_cipher_algo "AES"; then
-   algos="$algos aes aes192 aes256"
-fi
-
-if have_cipher_algo "TWOFISH"; then
-   algos="$algos twofish"
-fi
-
-for a in $algos; do
+for a in `all_cipher_algos`; do
+    echo_n "$a "
     for i in plain-1 data-80000 ; do
       echo "Hier spricht HAL" | $GPG --passphrase-fd 0 \
 					  --cipher-algo $a -c -o x --yes $i
@@ -39,3 +26,4 @@
       cmp $i y || error "$i: ($a) mismatch"
     done
 done
+echo_n "| "

Modified: trunk/tests/openpgp/decrypt-dsa.test
===================================================================
--- trunk/tests/openpgp/decrypt-dsa.test	2007-10-24 15:34:23 UTC (rev 4607)
+++ trunk/tests/openpgp/decrypt-dsa.test	2007-10-25 09:06:21 UTC (rev 4608)
@@ -1,4 +1,12 @@
 #!/bin/sh
+# 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
+# modifications, as long as this notice is preserved.  This file is
+# distributed in the hope that it will be useful, but WITHOUT ANY
+# WARRANTY, to the extent permitted by law; without even the implied
+# warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
 
 . $srcdir/defs.inc || exit 3
 

Modified: trunk/tests/openpgp/decrypt.test
===================================================================
--- trunk/tests/openpgp/decrypt.test	2007-10-24 15:34:23 UTC (rev 4607)
+++ trunk/tests/openpgp/decrypt.test	2007-10-25 09:06:21 UTC (rev 4608)
@@ -1,4 +1,12 @@
 #!/bin/sh
+# 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
+# modifications, as long as this notice is preserved.  This file is
+# distributed in the hope that it will be useful, but WITHOUT ANY
+# WARRANTY, to the extent permitted by law; without even the implied
+# warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
 
 . $srcdir/defs.inc || exit 3
 

Modified: trunk/tests/openpgp/defs.inc
===================================================================
--- trunk/tests/openpgp/defs.inc	2007-10-24 15:34:23 UTC (rev 4607)
+++ trunk/tests/openpgp/defs.inc	2007-10-25 09:06:21 UTC (rev 4608)
@@ -1,4 +1,12 @@
-# definitions for the check scripts
+# Definitions for the OpenPGP test scripts                     -*- sh -*-
+# 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
+# modifications, as long as this notice is preserved.  This file is
+# distributed in the hope that it will be useful, but WITHOUT ANY
+# WARRANTY, to the extent permitted by law; without even the implied
+# warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
 
 #--------------------------------
 #------ constants ---------------
@@ -139,6 +147,15 @@
   fi
 }
 
+all_cipher_algos () {
+  ../../g10/gpg2 --homedir . --version | grep "Cipher" | sed 's/^Cipher: //; s/,//g'
+}
+
+all_hash_algos () {
+  ../../g10/gpg2 --homedir . --version | grep "Hash" | sed 's/^Hash: //; s/,//g'
+}
+
+
 set -e
 pgmname=`basename $0`
 #trap cleanup SIGHUP SIGINT SIGQUIT

Modified: trunk/tests/openpgp/detach.test
===================================================================
--- trunk/tests/openpgp/detach.test	2007-10-24 15:34:23 UTC (rev 4607)
+++ trunk/tests/openpgp/detach.test	2007-10-25 09:06:21 UTC (rev 4608)
@@ -1,4 +1,12 @@
 #!/bin/sh
+# 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
+# modifications, as long as this notice is preserved.  This file is
+# distributed in the hope that it will be useful, but WITHOUT ANY
+# WARRANTY, to the extent permitted by law; without even the implied
+# warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
 
 . $srcdir/defs.inc || exit 3
 

Modified: trunk/tests/openpgp/detachm.test
===================================================================
--- trunk/tests/openpgp/detachm.test	2007-10-24 15:34:23 UTC (rev 4607)
+++ trunk/tests/openpgp/detachm.test	2007-10-25 09:06:21 UTC (rev 4608)
@@ -1,4 +1,12 @@
 #!/bin/sh
+# 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
+# modifications, as long as this notice is preserved.  This file is
+# distributed in the hope that it will be useful, but WITHOUT ANY
+# WARRANTY, to the extent permitted by law; without even the implied
+# warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
 
 . $srcdir/defs.inc || exit 3
 

Modified: trunk/tests/openpgp/encrypt-dsa.test
===================================================================
--- trunk/tests/openpgp/encrypt-dsa.test	2007-10-24 15:34:23 UTC (rev 4607)
+++ trunk/tests/openpgp/encrypt-dsa.test	2007-10-25 09:06:21 UTC (rev 4608)
@@ -1,4 +1,12 @@
 #!/bin/sh
+# 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
+# modifications, as long as this notice is preserved.  This file is
+# distributed in the hope that it will be useful, but WITHOUT ANY
+# WARRANTY, to the extent permitted by law; without even the implied
+# warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
 
 . $srcdir/defs.inc || exit 3
 
@@ -9,29 +17,8 @@
     cmp $i y || error "$i: mismatch"
 done
 
-algos="3des"
-
-if have_cipher_algo "IDEA"; then
-   algos="$algos idea"
-fi
-
-if have_cipher_algo "CAST5"; then
-   algos="$algos cast5"
-fi
-
-if have_cipher_algo "BLOWFISH"; then
-   algos="$algos blowfish"
-fi
-
-if have_cipher_algo "AES"; then
-   algos="$algos aes aes192 aes256"
-fi
-
-if have_cipher_algo "TWOFISH"; then
-   algos="$algos twofish"
-fi
-
-for ca in $algos ; do
+for ca in `all_cipher_algos` ; do
+    echo_n "$ca "
     for i in $plain_files $data_files ; do
 	$GPG $dsa_keyrings --always-trust --cipher-algo $ca -e \
 	    -o x --yes -r "$dsa_usrname2" $i
@@ -39,3 +26,4 @@
 	cmp $i y || error "$i: mismatch"
     done
 done
+echo_n "| "

Modified: trunk/tests/openpgp/encrypt.test
===================================================================
--- trunk/tests/openpgp/encrypt.test	2007-10-24 15:34:23 UTC (rev 4607)
+++ trunk/tests/openpgp/encrypt.test	2007-10-25 09:06:21 UTC (rev 4608)
@@ -1,4 +1,12 @@
 #!/bin/sh
+# 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
+# modifications, as long as this notice is preserved.  This file is
+# distributed in the hope that it will be useful, but WITHOUT ANY
+# WARRANTY, to the extent permitted by law; without even the implied
+# warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
 
 . $srcdir/defs.inc || exit 3
 
@@ -9,32 +17,12 @@
     cmp $i y || error "$i: mismatch"
 done
 
-algos="3des"
-
-if have_cipher_algo "IDEA"; then
-   algos="$algos idea"
-fi
-
-if have_cipher_algo "CAST5"; then
-   algos="$algos cast5"
-fi
-
-if have_cipher_algo "BLOWFISH"; then
-   algos="$algos blowfish"
-fi
-
-if have_cipher_algo "AES"; then
-   algos="$algos aes aes192 aes256"
-fi
-
-if have_cipher_algo "TWOFISH"; then
-   algos="$algos twofish"
-fi
-
-for ca in $algos ; do
+for ca in `all_cipher_algos` ; do
+    echo_n "$ca "
     for i in $plain_files $data_files ; do
 	$GPG --always-trust -e -o x --yes -r "$usrname2" --cipher-algo $ca $i
 	$GPG -o y --yes x
 	cmp $i y || error "$i: mismatch"
     done
 done
+echo_n "| "

Modified: trunk/tests/openpgp/encryptp.test
===================================================================
--- trunk/tests/openpgp/encryptp.test	2007-10-24 15:34:23 UTC (rev 4607)
+++ trunk/tests/openpgp/encryptp.test	2007-10-25 09:06:21 UTC (rev 4608)
@@ -1,4 +1,12 @@
 #!/bin/sh
+# 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
+# modifications, as long as this notice is preserved.  This file is
+# distributed in the hope that it will be useful, but WITHOUT ANY
+# WARRANTY, to the extent permitted by law; without even the implied
+# warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
 
 . $srcdir/defs.inc || exit 3
 

Modified: trunk/tests/openpgp/genkey1024.test
===================================================================
--- trunk/tests/openpgp/genkey1024.test	2007-10-24 15:34:23 UTC (rev 4607)
+++ trunk/tests/openpgp/genkey1024.test	2007-10-25 09:06:21 UTC (rev 4608)
@@ -1,4 +1,12 @@
 #!/bin/sh
+# 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
+# modifications, as long as this notice is preserved.  This file is
+# distributed in the hope that it will be useful, but WITHOUT ANY
+# WARRANTY, to the extent permitted by law; without even the implied
+# warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
 
 . $srcdir/defs.inc || exit 3
 

Modified: trunk/tests/openpgp/mds.test
===================================================================
--- trunk/tests/openpgp/mds.test	2007-10-24 15:34:23 UTC (rev 4607)
+++ trunk/tests/openpgp/mds.test	2007-10-25 09:06:21 UTC (rev 4608)
@@ -1,4 +1,12 @@
 #!/bin/sh
+# 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
+# modifications, as long as this notice is preserved.  This file is
+# distributed in the hope that it will be useful, but WITHOUT ANY
+# WARRANTY, to the extent permitted by law; without even the implied
+# warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
 
 
 . $srcdir/defs.inc || exit 3

Modified: trunk/tests/openpgp/multisig.test
===================================================================
--- trunk/tests/openpgp/multisig.test	2007-10-24 15:34:23 UTC (rev 4607)
+++ trunk/tests/openpgp/multisig.test	2007-10-25 09:06:21 UTC (rev 4608)
@@ -1,4 +1,13 @@
 #!/bin/sh
+# Copyright 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
+# modifications, as long as this notice is preserved.  This file is
+# distributed in the hope that it will be useful, but WITHOUT ANY
+# WARRANTY, to the extent permitted by law; without even the implied
+# warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+
 # Check that gpg verifies only signatures where there is no ambiguity
 # in the order of packets.  Needs the Demo Keys Lima and Mike.
 

Modified: trunk/tests/openpgp/seat.test
===================================================================
--- trunk/tests/openpgp/seat.test	2007-10-24 15:34:23 UTC (rev 4607)
+++ trunk/tests/openpgp/seat.test	2007-10-25 09:06:21 UTC (rev 4608)
@@ -1,4 +1,12 @@
 #!/bin/sh
+# 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
+# modifications, as long as this notice is preserved.  This file is
+# distributed in the hope that it will be useful, but WITHOUT ANY
+# WARRANTY, to the extent permitted by law; without even the implied
+# warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
 
 . $srcdir/defs.inc || exit 3
 

Modified: trunk/tests/openpgp/signencrypt-dsa.test
===================================================================
--- trunk/tests/openpgp/signencrypt-dsa.test	2007-10-24 15:34:23 UTC (rev 4607)
+++ trunk/tests/openpgp/signencrypt-dsa.test	2007-10-25 09:06:21 UTC (rev 4608)
@@ -1,4 +1,12 @@
 #!/bin/sh
+# 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
+# modifications, as long as this notice is preserved.  This file is
+# distributed in the hope that it will be useful, but WITHOUT ANY
+# WARRANTY, to the extent permitted by law; without even the implied
+# warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
 
 . $srcdir/defs.inc || exit 3
 

Modified: trunk/tests/openpgp/signencrypt.test
===================================================================
--- trunk/tests/openpgp/signencrypt.test	2007-10-24 15:34:23 UTC (rev 4607)
+++ trunk/tests/openpgp/signencrypt.test	2007-10-25 09:06:21 UTC (rev 4608)
@@ -1,4 +1,12 @@
 #!/bin/sh
+# 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
+# modifications, as long as this notice is preserved.  This file is
+# distributed in the hope that it will be useful, but WITHOUT ANY
+# WARRANTY, to the extent permitted by law; without even the implied
+# warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
 
 . $srcdir/defs.inc || exit 3
 

Modified: trunk/tests/openpgp/sigs-dsa.test
===================================================================
--- trunk/tests/openpgp/sigs-dsa.test	2007-10-24 15:34:23 UTC (rev 4607)
+++ trunk/tests/openpgp/sigs-dsa.test	2007-10-25 09:06:21 UTC (rev 4608)
@@ -1,4 +1,12 @@
 #!/bin/sh
+# 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
+# modifications, as long as this notice is preserved.  This file is
+# distributed in the hope that it will be useful, but WITHOUT ANY
+# WARRANTY, to the extent permitted by law; without even the implied
+# warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
 
 . $srcdir/defs.inc || exit 3
 

Modified: trunk/tests/openpgp/sigs.test
===================================================================
--- trunk/tests/openpgp/sigs.test	2007-10-24 15:34:23 UTC (rev 4607)
+++ trunk/tests/openpgp/sigs.test	2007-10-25 09:06:21 UTC (rev 4608)
@@ -1,48 +1,26 @@
 #!/bin/sh
+# 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
+# modifications, as long as this notice is preserved.  This file is
+# distributed in the hope that it will be useful, but WITHOUT ANY
+# WARRANTY, to the extent permitted by law; without even the implied
+# warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
 
 . $srcdir/defs.inc || exit 3
 
-set -x
-
-#info Checking signatures
 for i in $plain_files $data_files; do
     echo "$usrpass1" | $GPG --passphrase-fd 0 -s -o x --yes $i
     $GPG -o y --yes x
     cmp $i y || error "$i: mismatch"
 done
 
-# Using the DSA sig key - only 160 bit hashes
-for da in ripemd160 sha1 ; do
-    for i in $plain_files; do
-	echo "$usrpass1" | $GPG --passphrase-fd 0 --digest-algo $da \
-				-s -o x --yes $i
-	$GPG -o y --yes x
-	cmp $i y || error "$i: mismatch"
-	# process only the first one
-	break
-    done
-done
+for da in `all_hash_algos` ; do
+    echo_n "$da "
 
-# TODO: add the new SHAs here once we allow them to be used in new
-# documents.
-
-if have_pubkey_algo "RSA"; then
-    # Using the RSA sig key - all hashes
-    hash_algo_list="ripemd160 sha1 md5"
-    if have_hash_algo "SHA224"; then
-	hash_algo_list="$hash_algo_list sha224"
-    fi
-    if have_hash_algo "SHA256"; then
-	hash_algo_list="$hash_algo_list sha256"
-    fi
-    if have_hash_algo "SHA384"; then
-	hash_algo_list="$hash_algo_list sha384"
-    fi
-    if have_hash_algo "SHA512"; then
-	hash_algo_list="$hash_algo_list sha512"
-    fi
-
-    for da in $hash_algo_list ; do
+    # RSA key, so any hash is okay
+    if have_pubkey_algo "RSA"; then
 	for i in $plain_files; do
 	    $GPG -u $usrname3 --digest-algo $da -s -o x --yes $i
 	    $GPG -o y --yes x
@@ -50,5 +28,18 @@
   	    # process only the first one
 	    break
 	done
-    done
-fi
+    fi
+
+    # Using the DSA sig key - only 160 bit or larger hashes
+    if test $da != "MD5"; then
+        for i in $plain_files; do
+	    echo "$usrpass1" | $GPG --passphrase-fd 0 --digest-algo $da \
+				-s -o x --yes $i
+	    $GPG -o y --yes x
+	    cmp $i y || error "$i: mismatch"
+	    # process only the first one
+	    break
+        done
+    fi
+done
+echo_n "| "

Modified: trunk/tests/openpgp/verify.test
===================================================================
--- trunk/tests/openpgp/verify.test	2007-10-24 15:34:23 UTC (rev 4607)
+++ trunk/tests/openpgp/verify.test	2007-10-25 09:06:21 UTC (rev 4608)
@@ -1,4 +1,12 @@
 #!/bin/sh
+# 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
+# modifications, as long as this notice is preserved.  This file is
+# distributed in the hope that it will be useful, but WITHOUT ANY
+# WARRANTY, to the extent permitted by law; without even the implied
+# warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
 
 . $srcdir/defs.inc || exit 3
 

Modified: trunk/tests/openpgp/version.test
===================================================================
--- trunk/tests/openpgp/version.test	2007-10-24 15:34:23 UTC (rev 4607)
+++ trunk/tests/openpgp/version.test	2007-10-25 09:06:21 UTC (rev 4608)
@@ -1,4 +1,12 @@
 #!/bin/sh
+# 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
+# modifications, as long as this notice is preserved.  This file is
+# distributed in the hope that it will be useful, but WITHOUT ANY
+# WARRANTY, to the extent permitted by law; without even the implied
+# warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
 
 . $srcdir/defs.inc || exit 3
 




More information about the Gnupg-commits mailing list