[svn] GnuPG - r3909 - trunk/g10

svn author dshaw cvs at cvs.gnupg.org
Wed Oct 12 22:44:27 CEST 2005


Author: dshaw
Date: 2005-10-12 22:44:24 +0200 (Wed, 12 Oct 2005)
New Revision: 3909

Modified:
   trunk/g10/ChangeLog
   trunk/g10/getkey.c
   trunk/g10/gpg.c
   trunk/g10/options.h
   trunk/g10/sig-check.c
Log:
* options.h, getkey.c (merge_selfsigs_subkey), gpg.c (main), sig-check.c
(signature_check2): Add --require-backsigs and --no-require-backsigs.  
Currently defaults to --no-require-backsigs.


Modified: trunk/g10/ChangeLog
===================================================================
--- trunk/g10/ChangeLog	2005-10-11 22:13:49 UTC (rev 3908)
+++ trunk/g10/ChangeLog	2005-10-12 20:44:24 UTC (rev 3909)
@@ -1,3 +1,10 @@
+2005-10-12  David Shaw  <dshaw at jabberwocky.com>
+
+	* options.h, getkey.c (merge_selfsigs_subkey), gpg.c (main),
+	sig-check.c (signature_check2): Add --require-backsigs and
+	--no-require-backsigs.  Currently defaults to
+	--no-require-backsigs.
+
 2005-10-11  David Shaw  <dshaw at jabberwocky.com>
 
 	* getkey.c (merge_selfsigs_subkey), sig-check.c

Modified: trunk/g10/getkey.c
===================================================================
--- trunk/g10/getkey.c	2005-10-11 22:13:49 UTC (rev 3908)
+++ trunk/g10/getkey.c	2005-10-12 20:44:24 UTC (rev 3909)
@@ -2082,13 +2082,6 @@
 	    free_seckey_enc(backsig);
 	  }
       }
-
-#ifdef FAKE_BACKSIGS
-    /* If there is no backsig, pretend there is a valid one.  If there
-       is a backsig (or an invalid backsig), use it. */
-    if(subpk->backsig==0)
-      subpk->backsig=2;
-#endif
 }
 
 

Modified: trunk/g10/gpg.c
===================================================================
--- trunk/g10/gpg.c	2005-10-11 22:13:49 UTC (rev 3908)
+++ trunk/g10/gpg.c	2005-10-12 20:44:24 UTC (rev 3909)
@@ -355,6 +355,9 @@
     opcscDriver,
     oDisableCCID,
 
+    oRequireBacksigs,
+    oNoRequireBacksigs,
+
     oNoop
   };
 
@@ -695,6 +698,8 @@
        the favor. */
     { oLocalUser, "sign-with", 2, "@" },
     { oRecipient, "user", 2, "@" },
+    { oRequireBacksigs, "require-backsigs", 0, "@"},
+    { oNoRequireBacksigs, "no-require-backsigs", 0, "@"},
     {0,NULL,0,NULL}
 };
 
@@ -2586,7 +2591,9 @@
             opt.limit_card_insert_tries = pargs.r.ret_int; 
             break;
 
-  
+	  case oRequireBacksigs: opt.require_backsigs=1; break;
+	  case oNoRequireBacksigs: opt.require_backsigs=0; break;
+
 	  case oNoop: break;
 
 	  default : pargs.err = configfp? 1:2; break;

Modified: trunk/g10/options.h
===================================================================
--- trunk/g10/options.h	2005-10-11 22:13:49 UTC (rev 3908)
+++ trunk/g10/options.h	2005-10-12 20:44:24 UTC (rev 3909)
@@ -162,6 +162,8 @@
   STRLIST sig_policy_url;
   STRLIST cert_policy_url;
   STRLIST sig_keyserver_url;
+  STRLIST cert_subpackets;
+  STRLIST sig_subpackets;
   int use_embedded_filename;
   int allow_non_selfsigned_uid;
   int allow_freeform_uid;
@@ -207,6 +209,11 @@
   int disable_ccid;    /* Disable the use of the internal CCID driver. */
 #endif /*ENABLE_CARD_SUPPORT*/
 
+  /* If set, require an 0x19 backsig to be present on signatures made
+     by signing subkeys.  If not set, a missing backsig is not an
+     error (but an invalid backsig still is). */
+  int require_backsigs;
+
 } opt;
 
 /* CTRL is used to keep some global variables we currently can't

Modified: trunk/g10/sig-check.c
===================================================================
--- trunk/g10/sig-check.c	2005-10-11 22:13:49 UTC (rev 3908)
+++ trunk/g10/sig-check.c	2005-10-12 20:44:24 UTC (rev 3909)
@@ -96,11 +96,18 @@
 	   signaures issued by it. */
 	if(rc==0 && !pk->is_primary && pk->backsig<2)
 	  {
-	    if(pk->backsig==0)
-	      log_info(_("WARNING: signing subkey %s is not"
-			 " cross-certified\n"),keystr_from_pk(pk));
-	    else
+	    /* TODO: In a future version, once enough signing subkeys
+	       have backsigs, change this to always give the warning,
+	       and have --require-backsigs enable or disable the
+	       G10ERR_GENERAL. */
+	    if(pk->backsig==0 && opt.require_backsigs)
 	      {
+		log_info(_("WARNING: signing subkey %s is not"
+			   " cross-certified\n"),keystr_from_pk(pk));
+		rc=G10ERR_GENERAL;
+	      }
+	    else if(pk->backsig==1)
+	      {
 		log_info(_("WARNING: signing subkey %s has an invalid"
 			   " cross-certification\n"),keystr_from_pk(pk));
 		rc=G10ERR_GENERAL;




More information about the Gnupg-commits mailing list