Funky little bug

Werner Koch wk at gnupg.org
Mon Sep 20 13:34:14 CEST 1999


Okay, here is what you need:


$ ls *.dsc | gpg --verify-files 

or

$ gpg --verify-files *.dsc


Index: g10.c
===================================================================
RCS file: /home/koch/cvs/gnupg/g10/g10.c,v
retrieving revision 1.127
retrieving revision 1.129.2.1
diff -r1.127 -r1.129.2.1
81a82
>     aVerifyFiles,
179a181
>     oEntropyDLLName,
194a197
>     { aVerifyFiles, "verify-files" , 256, "@" },
224a228
>     { aDeArmor, "dearmour", 256, "@" },
225a230
>     { aEnArmor, "enarmour", 256, "@" },
232a238
>     { oArmor, "armour",     0, "@" },
304a311
>     { oNoArmor, "no-armour",   0, "@"},
340a348
>     { oEntropyDLLName, "entropy-dll-name", 2, "@" },
440a449,451
>   #ifdef USE_SIMPLE_GETTEXT
>     set_gettext_file( PACKAGE );
>   #else
450a462
>   #endif
689a702
> 	  case aVerifyFiles: set_cmd( &cmd, aVerifyFiles); break;
861a875,881
> 	  case oEntropyDLLName:
> 	      #ifdef USE_STATIC_RNDW32
> 		log_info("set dllname to `%s'\n", pargs.r.ret_str );
> 		rndw32_set_dll_name( pargs.r.ret_str );
> 	      #endif
> 		break;
> 
1099a1120,1124
> 	break;
> 
>       case aVerifyFiles:
> 	if( (rc = verify_files( argc, argv ) ))
> 	    log_error("verify files failed: %s\n", g10_errstr(rc) );
Index: helptext.c
===================================================================
RCS file: /home/koch/cvs/gnupg/g10/helptext.c,v
retrieving revision 1.15
retrieving revision 1.16
diff -r1.15 -r1.16
213c213
<  "Give the name fo the file to which the signature applies"
---
>  "Give the name of the file to which the signature applies"
Index: import.c
===================================================================
RCS file: /home/koch/cvs/gnupg/g10/import.c,v
retrieving revision 1.48
retrieving revision 1.49
diff -r1.48 -r1.49
1127c1127
<     if( node->next->pkt->pkttype == PKT_USER_ID ) {
---
>     if( !node->next || node->next->pkt->pkttype == PKT_USER_ID ) {
1180,1182c1180
<     /* at least a self signature comes next to the user IDs */
<     assert(src->next->pkt->pkttype != PKT_USER_ID );
<     if( dst->next->pkt->pkttype == PKT_USER_ID ) {
---
>     if( !dst->next || dst->next->pkt->pkttype == PKT_USER_ID ) {
Index: mainproc.c
===================================================================
RCS file: /home/koch/cvs/gnupg/g10/mainproc.c,v
retrieving revision 1.97
retrieving revision 1.98
diff -r1.97 -r1.98
315c315,317
< 	/* assume this is old conventional encrypted data */
---
> 	/* assume this is old conventional encrypted data
> 	 * Actually we should use IDEA and MD5 in this case, but becuase
> 	 * IDEA is patented we can't do so */
Index: signal.c
===================================================================
RCS file: /home/koch/cvs/gnupg/g10/signal.c,v
retrieving revision 1.10
retrieving revision 1.11
diff -r1.10 -r1.11
2c2
<  *	Copyright (C) 1998 Free Software Foundation, Inc.
---
>  *	Copyright (C) 1998, 1999 Free Software Foundation, Inc.
42c42
< signal_name( int signum )
---
> get_signal_name( int signum )
47,49c47
<     static char buf[20];
<     sprintf(buf, "signal %d", signum );
<     return buf;
---
>     return "some signal";
52a51
> 
55a55,56
>     const char *s;
> 
60,61d60
<     fprintf( stderr, "\n%s: %s caught ... exiting\n",
< 	      log_get_name(), signal_name(sig) );
63c62,69
<     exit( 8 );
---
>   #ifdef IS_DEVELOPMENT_VERSION
>     write(2, "\n", 1 );
>     s = log_get_name(); if( s ) write(2, s, strlen(s) );
>     write(2, ": ", 2 );
>     s = get_signal_name(sig); write(2, s, strlen(s) );
>     write(2, " caught ... exiting\n", 21 );
>   #endif
>     exit(8); /* Hmmm, for some reasons rais2e does not work */
Index: verify.c
===================================================================
RCS file: /home/koch/cvs/gnupg/g10/verify.c,v
retrieving revision 1.6
retrieving revision 1.6.2.1
diff -r1.6 -r1.6.2.1
85a86,91
> static int
> verify_one_file( const char *name )
> {
>     IOBUF fp;
>     armor_filter_context_t afx;
>     int rc;
86a93,144
>     fp = iobuf_open(name);
>     if( !fp ) {
> 	log_error(_("can't open `%s'\n"), print_fname_stdin(name));
> 	return G10ERR_OPEN_FILE;
>     }
> 
>     if( !opt.no_armor ) {
> 	if( use_armor_filter( fp ) ) {
> 	    memset( &afx, 0, sizeof afx);
> 	    iobuf_push_filter( fp, armor_filter, &afx );
> 	}
>     }
> 
>     rc = proc_signature_packets( NULL, fp, NULL, name );
>     iobuf_close(fp);
>     return rc;
> }
> 
> /****************
>  * Verify each file given in the files array or read the names of the
>  * files from stdin.
>  * Note:  This function can not handle detached signatures.
>  */
> int
> verify_files( int nfiles, char **files )
> {
>     int i;
> 
>     if( !nfiles ) { /* read the filenames from stdin */
> 	char line[2048];
> 	unsigned int lno = 0;
> 
> 	while( fgets(line, DIM(line), stdin) ) {
> 	    lno++;
> 	    if( !*line || line[strlen(line)-1] != '\n' ) {
> 		log_error(_("input line %u too long or missing LF\n"), lno );
> 		return G10ERR_GENERAL;
> 	    }
> 	    /* This code does not work on MSDOS but how cares there are
> 	     * also no script languages available.  We don't strip any
> 	     * spaces, so that we can process nearly all filenames */
> 	    line[strlen(line)-1] = 0;
> 	    verify_one_file( line );
> 	}
> 
>     }
>     else {  /* take filenames from the array */
> 	for(i=0; i < nfiles; i++ )
> 	    verify_one_file( files[i] );
>     }
>     return 0;
> }
Index: main.h
===================================================================
RCS file: /home/koch/cvs/gnupg/g10/main.h,v
retrieving revision 1.59
retrieving revision 1.59.2.1
diff -r1.59 -r1.59.2.1
140a141
> int verify_files( int nfiles, char **files );




-- 
Werner Koch at guug.de           www.gnupg.org           keyid 621CC013



More information about the Gnupg-devel mailing list