aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--NEWS7
-rw-r--r--doc/gpg.sgml9
-rw-r--r--doc/gph/Makefile.am2
-rw-r--r--g10/ChangeLog10
-rw-r--r--g10/g10.c8
-rw-r--r--g10/main.h1
-rw-r--r--g10/verify.c58
7 files changed, 90 insertions, 5 deletions
diff --git a/NEWS b/NEWS
index d5d2c5f13..5629e321d 100644
--- a/NEWS
+++ b/NEWS
@@ -1,3 +1,10 @@
+
+ * New command --verify-files.
+
+ * Fixed some minor bugs.
+
+ * Add Indonesian and Portugese translations.
+
Noteworthy changes in version 1.0.0 (1999-09-07)
-----------------------------------
diff --git a/doc/gpg.sgml b/doc/gpg.sgml
index 1297737fd..0cae9b476 100644
--- a/doc/gpg.sgml
+++ b/doc/gpg.sgml
@@ -156,6 +156,15 @@ filename to force a read from stdin). With more than
and the remaining files are the signed stuff.
</para></listitem></varlistentry>
+<varlistentry>
+<term>--verify-files <optional><optional><parameter/files/</optional>
+<listitem><para>
+This is a special version of the --verify command which does not work with
+detached signatures. The command expects the files to bee verified either
+on the commandline or reads the filenames from stdin; each anem muts be on
+separate line. The command is intended for quick checking of many files.
+</para></listitem></varlistentry>
+
<!--
B<-k> [I<username>] [I<keyring>]
Kludge to be somewhat compatible with PGP.
diff --git a/doc/gph/Makefile.am b/doc/gph/Makefile.am
index 732c3e3e6..7e469505a 100644
--- a/doc/gph/Makefile.am
+++ b/doc/gph/Makefile.am
@@ -11,7 +11,7 @@ all-local: ./signatures.jpg
./signatures.jpg: $(srcdir)/signatures.jpg.asc
../../g10/gpg --yes --dearmor \
-o ./signatures.jpg $(srcdir)/signatures.jpg.asc
- test -d manual && cp ./signatures.jpg ./manual/signatures.jpg
+ -test -d manual && cp ./signatures.jpg ./manual/signatures.jpg
index.html: $(PARTS)
diff --git a/g10/ChangeLog b/g10/ChangeLog
index a614d0f25..73a9c4a7e 100644
--- a/g10/ChangeLog
+++ b/g10/ChangeLog
@@ -1,5 +1,10 @@
-Fri Sep 17 12:56:42 CEST 1999 Werner Koch <[email protected]>
+Mon Sep 20 12:24:41 CEST 1999 Werner Koch <[email protected]>
+
+ * verify.c (verify_files, ferify_one_file): New.
+ * g10.c: New command --verify-files
+
+Fri Sep 17 12:56:42 CEST 1999 Werner Koch <[email protected]>
* g10.c: Add UK spelling as alias for armor options ;-)
@@ -9,16 +14,13 @@ Fri Sep 17 12:56:42 CEST 1999 Werner Koch <[email protected]>
Wed Sep 15 16:22:17 CEST 1999 Werner Koch <[email protected]>
-
* g10.c: New option --entropy-dll-name
Mon Sep 13 10:51:29 CEST 1999 Werner Koch <[email protected]>
-
* signal.c (got_fatal_signal): Print message using write(2) and
only for development versions.
-
Mon Sep 6 19:59:08 CEST 1999 Werner Koch <[email protected]>
* tdbio.c (tdbio_set_dbname): Use mkdir macro
diff --git a/g10/g10.c b/g10/g10.c
index 5fa2cade5..7a9e9238d 100644
--- a/g10/g10.c
+++ b/g10/g10.c
@@ -79,6 +79,7 @@ enum cmd_and_opt_values { aNull = 0,
aImport,
aFastImport,
aVerify,
+ aVerifyFiles,
aListKeys,
aListSigs,
aListSecretKeys,
@@ -193,6 +194,7 @@ static ARGPARSE_OPTS opts[] = {
{ aStore, "store", 256, N_("store only")},
{ aDecrypt, "decrypt", 256, N_("decrypt data (default)")},
{ aVerify, "verify" , 256, N_("verify a signature")},
+ { aVerifyFiles, "verify-files" , 256, "@" },
{ aListKeys, "list-keys", 256, N_("list keys")},
{ aListKeys, "list-public-keys", 256, "@" },
{ aListSigs, "list-sigs", 256, N_("list keys and signatures")},
@@ -697,6 +699,7 @@ main( int argc, char **argv )
case aClearsign: set_cmd( &cmd, aClearsign); break;
case aGenRevoke: set_cmd( &cmd, aGenRevoke); break;
case aVerify: set_cmd( &cmd, aVerify); break;
+ case aVerifyFiles: set_cmd( &cmd, aVerifyFiles); break;
case aPrimegen: set_cmd( &cmd, aPrimegen); break;
case aGenRandom: set_cmd( &cmd, aGenRandom); break;
case aPrintMD: set_cmd( &cmd, aPrintMD); break;
@@ -1116,6 +1119,11 @@ main( int argc, char **argv )
log_error("verify signatures failed: %s\n", g10_errstr(rc) );
break;
+ case aVerifyFiles:
+ if( (rc = verify_files( argc, argv ) ))
+ log_error("verify files failed: %s\n", g10_errstr(rc) );
+ break;
+
case aDecrypt:
if( argc > 1 )
wrong_args(_("--decrypt [filename]"));
diff --git a/g10/main.h b/g10/main.h
index df04f408d..3cca94a11 100644
--- a/g10/main.h
+++ b/g10/main.h
@@ -138,6 +138,7 @@ void secret_key_list( int nnames, char **names );
/*-- verify.c --*/
int verify_signatures( int nfiles, char **files );
+int verify_files( int nfiles, char **files );
/*-- decrypt.c --*/
int decrypt_message( const char *filename );
diff --git a/g10/verify.c b/g10/verify.c
index 589b1b7bb..171bff7b2 100644
--- a/g10/verify.c
+++ b/g10/verify.c
@@ -83,5 +83,63 @@ verify_signatures( int nfiles, char **files )
return rc;
}
+static int
+verify_one_file( const char *name )
+{
+ IOBUF fp;
+ armor_filter_context_t afx;
+ int rc;
+
+ 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;
+}