diff options
author | Damien Miller <djm@cvs.openbsd.org> | 2005-05-29 07:34:35 +0000 |
---|---|---|
committer | Damien Miller <djm@cvs.openbsd.org> | 2005-05-29 07:34:35 +0000 |
commit | d492cd9b983d10d23c3703d56f83e01cb80e2c53 (patch) | |
tree | 7b3835bd796494f8464f12c2bcb672f6bea071f1 /usr.bin/gzsig | |
parent | 90e5e9c3f6845ac60765acb1b92a846f63812630 (diff) |
provide feedback on success; ok marius@
Diffstat (limited to 'usr.bin/gzsig')
-rw-r--r-- | usr.bin/gzsig/gzsig.1 | 12 | ||||
-rw-r--r-- | usr.bin/gzsig/sign.c | 19 | ||||
-rw-r--r-- | usr.bin/gzsig/verify.c | 19 |
3 files changed, 28 insertions, 22 deletions
diff --git a/usr.bin/gzsig/gzsig.1 b/usr.bin/gzsig/gzsig.1 index ec1b8bc35c1..e2ab81718e5 100644 --- a/usr.bin/gzsig/gzsig.1 +++ b/usr.bin/gzsig/gzsig.1 @@ -1,5 +1,5 @@ -.\" $OpenBSD: gzsig.1,v 1.2 2005/05/29 02:41:42 marius Exp $ -.\" $Id: gzsig.1,v 1.2 2005/05/29 02:41:42 marius Exp $ +.\" $OpenBSD: gzsig.1,v 1.3 2005/05/29 07:34:34 djm Exp $ +.\" $Id: gzsig.1,v 1.3 2005/05/29 07:34:34 djm Exp $ .\" .\" Copyright (c) 2001 Dug Song <dugsong@arbor.net> .\" Copyright (c) 2001 Arbor Networks, Inc. @@ -35,12 +35,12 @@ .Nd gzip signing utility .Sh SYNOPSIS .Nm gzsig sign -.Op Fl v +.Op Fl q .Ar privkey .Op Ar .Pp .Nm gzsig verify -.Op Fl v +.Op Fl q .Ar pubkey .Op Ar .Sh DESCRIPTION @@ -67,8 +67,8 @@ Sign the input using the private key in .It Nm verify Verify the signature using the public key in .Ar pubkey . -.It Fl v -Enable verbose mode. +.It Fl q +Enable quiet mode. .It Fl p Supply a passphrase for decrypting private keys when signing. .El diff --git a/usr.bin/gzsig/sign.c b/usr.bin/gzsig/sign.c index aca93d75e01..6171f1b4d7c 100644 --- a/usr.bin/gzsig/sign.c +++ b/usr.bin/gzsig/sign.c @@ -1,4 +1,4 @@ -/* $OpenBSD: sign.c,v 1.2 2005/05/28 08:07:45 marius Exp $ */ +/* $OpenBSD: sign.c,v 1.3 2005/05/29 07:34:34 djm Exp $ */ /* * sign.c @@ -184,7 +184,7 @@ embed_signature(struct key *key, FILE *fin, FILE *fout) void sign_usage(void) { - fprintf(stderr, "Usage: gzsig sign [-v] privkey [file ...]\n"); + fprintf(stderr, "Usage: gzsig sign [-q] privkey [file ...]\n"); } int @@ -211,14 +211,17 @@ sign(int argc, char *argv[]) struct key *key; char *gzipfile, tmpfile[MAXPATHLEN]; FILE *fin, *fout; - int i, fd, error, vflag; + int i, fd, error, qflag; - vflag = 0; + qflag = 0; - while ((i = getopt(argc, argv, "vh?p:")) != -1) { + while ((i = getopt(argc, argv, "qvh?p:")) != -1) { switch (i) { + case 'q': + qflag = 1; + break; case 'v': - vflag = 1; + qflag = 0; break; case 'p': passphrase = optarg; @@ -247,7 +250,7 @@ sign(int argc, char *argv[]) argc = 0; if (embed_signature(key, stdin, stdout) == 0) { - if (vflag) + if (!qflag) fprintf(stderr, "Signed input\n"); } else fatal(1, "Couldn't sign input"); @@ -292,7 +295,7 @@ sign(int argc, char *argv[]) unlink(tmpfile); fatal(1, "Couldn't sign %s", gzipfile); } - if (vflag) + if (!qflag) fprintf(stderr, "Signed %s\n", gzipfile); } else { unlink(tmpfile); diff --git a/usr.bin/gzsig/verify.c b/usr.bin/gzsig/verify.c index f4801abd593..756b2bfd3bc 100644 --- a/usr.bin/gzsig/verify.c +++ b/usr.bin/gzsig/verify.c @@ -1,4 +1,4 @@ -/* $OpenBSD: verify.c,v 1.2 2005/05/28 08:07:45 marius Exp $ */ +/* $OpenBSD: verify.c,v 1.3 2005/05/29 07:34:34 djm Exp $ */ /* * verify.c @@ -144,7 +144,7 @@ verify_signature(struct key *key, FILE *fin) void verify_usage(void) { - fprintf(stderr, "Usage: gzsig verify [-v] pubkey [file ...]\n"); + fprintf(stderr, "Usage: gzsig verify [-q] pubkey [file ...]\n"); } void @@ -153,14 +153,17 @@ verify(int argc, char *argv[]) struct key *key; char *gzipfile; FILE *fin; - int i, error, vflag; + int i, error, qflag; - vflag = 0; + qflag = 0; - while ((i = getopt(argc, argv, "vh?")) != -1) { + while ((i = getopt(argc, argv, "qvh?")) != -1) { switch (i) { + case 'q': + qflag = 1; + break; case 'v': - vflag = 1; + qflag = 0; break; default: verify_usage(); @@ -186,7 +189,7 @@ verify(int argc, char *argv[]) argc = 0; if (verify_signature(key, stdin) == 0) { - if (vflag) + if (!qflag) fprintf(stderr, "Verified input\n"); } else fatal(1, "Couldn't verify input"); @@ -203,7 +206,7 @@ verify(int argc, char *argv[]) fclose(fin); if (!error) { - if (vflag) + if (!qflag) fprintf(stderr, "Verified %s\n", gzipfile); } else fatal(1, "Couldn't verify %s", gzipfile); |