gnupg/g10 (ChangeLog parse-packet.c)

cvs user dshaw cvs at cvs.gnupg.org
Sun Oct 17 00:45:27 CEST 2004


    Date: Sunday, October 17, 2004 @ 00:48:20
  Author: dshaw
    Path: /cvs/gnupg/gnupg/g10

Modified: ChangeLog parse-packet.c

* parse-packet.c (parse_one_sig_subpkt, enum_sig_subpkt): Don't BUG() on
unknown subpackets.  Rather, just return them silently.


----------------+
 ChangeLog      |    5 +++++
 parse-packet.c |   17 +++++++----------
 2 files changed, 12 insertions(+), 10 deletions(-)


Index: gnupg/g10/ChangeLog
diff -u gnupg/g10/ChangeLog:1.621 gnupg/g10/ChangeLog:1.622
--- gnupg/g10/ChangeLog:1.621	Fri Oct 15 15:16:57 2004
+++ gnupg/g10/ChangeLog	Sun Oct 17 00:48:20 2004
@@ -1,3 +1,8 @@
+2004-10-16  David Shaw  <dshaw at jabberwocky.com>
+
+	* parse-packet.c (parse_one_sig_subpkt, enum_sig_subpkt): Don't
+	BUG() on unknown subpackets.  Rather, just return them silently.
+	
 2004-10-15  Werner Koch  <wk at g10code.com>
 
 	* status.h (STATUS_NEED_PASSPHRASE_PIN): New.
Index: gnupg/g10/parse-packet.c
diff -u gnupg/g10/parse-packet.c:1.113 gnupg/g10/parse-packet.c:1.114
--- gnupg/g10/parse-packet.c:1.113	Thu Sep  9 14:42:10 2004
+++ gnupg/g10/parse-packet.c	Sun Oct 17 00:48:20 2004
@@ -955,10 +955,9 @@
 }
 
 /****************
- * Returns: >= 0 offset into buffer
- *	    -1 unknown type
- *	    -2 unsupported type
- *	    -3 subpacket too short
+ * Returns: >= 0 use this offset into buffer
+ *	    -1 explicitly reject returning this type
+ *	    -2 subpacket too short
  */
 int
 parse_one_sig_subpkt( const byte *buffer, size_t n, int type )
@@ -1008,9 +1007,9 @@
       if ( n != 2 )
 	break;
       return 0;
-    default: return -1;
+    default: return 0;
     }
-  return -3;
+  return -2;
 }
 
 
@@ -1130,13 +1129,11 @@
 		*ret_n = n;
 	    offset = parse_one_sig_subpkt(buffer, n, type );
 	    switch( offset ) {
-	      case -3:
-		log_error("subpacket of type %d too short\n", type);
-		return NULL;
 	      case -2:
+		log_error("subpacket of type %d too short\n", type);
 		return NULL;
 	      case -1:
-		BUG(); /* not yet needed */
+		return NULL;
 	      default:
 		break;
 	    }




More information about the Gnupg-commits mailing list