From 3bc9b00df4090e171e74fcdaf03078e46b664408 Mon Sep 17 00:00:00 2001 From: tedu Date: Mon, 29 Dec 2014 14:16:04 +0000 Subject: [PATCH] remove the inspect debug command. should not be used by users, who are not supposed to know what fingerprints are or that they exist. --- usr.bin/signify/signify.1 | 11 ++--------- usr.bin/signify/signify.c | 39 ++------------------------------------- 2 files changed, 4 insertions(+), 46 deletions(-) diff --git a/usr.bin/signify/signify.1 b/usr.bin/signify/signify.1 index 2bed6c83fc2..4eb046dad2c 100644 --- a/usr.bin/signify/signify.1 +++ b/usr.bin/signify/signify.1 @@ -1,4 +1,4 @@ -.\" $OpenBSD: signify.1,v 1.27 2014/08/07 19:03:38 lteo Exp $ +.\" $OpenBSD: signify.1,v 1.28 2014/12/29 14:16:04 tedu Exp $ .\" .\"Copyright (c) 2013 Marc Espie .\"Copyright (c) 2013 Ted Unangst @@ -14,7 +14,7 @@ .\"WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN .\"ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF .\"OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. -.Dd $Mdocdate: August 7 2014 $ +.Dd $Mdocdate: December 29 2014 $ .Dt SIGNIFY 1 .Os .Sh NAME @@ -34,11 +34,6 @@ .Fl p Ar pubkey .Fl s Ar seckey .Nm signify -.Fl I -.Op Fl p Ar pubkey -.Op Fl s Ar seckey -.Op Fl x Ar sigfile -.Nm signify .Fl S .Op Fl e .Op Fl x Ar sigfile @@ -67,8 +62,6 @@ should be the signed output of .Xr sha256 1 . .It Fl G Generate a new key pair. -.It Fl I -Inspect the specified keys or signature and print their fingerprint. .It Fl S Sign the specified message file and create a signature. .It Fl V diff --git a/usr.bin/signify/signify.c b/usr.bin/signify/signify.c index 614d49ae41a..f8faad5c2c0 100644 --- a/usr.bin/signify/signify.c +++ b/usr.bin/signify/signify.c @@ -1,4 +1,4 @@ -/* $OpenBSD: signify.c,v 1.92 2014/11/20 14:51:42 krw Exp $ */ +/* $OpenBSD: signify.c,v 1.93 2014/12/29 14:16:04 tedu Exp $ */ /* * Copyright (c) 2013 Ted Unangst * @@ -82,7 +82,6 @@ usage(const char *error) #ifndef VERIFYONLY "\t%1$s -C [-q] -p pubkey -x sigfile [file ...]\n" "\t%1$s -G [-n] [-c comment] -p pubkey -s seckey\n" - "\t%1$s -I [-p pubkey] [-s seckey] [-x sigfile]\n" "\t%1$s -S [-e] [-x sigfile] -s seckey -m message\n" #endif "\t%1$s -V [-eq] [-x sigfile] -p pubkey -m message\n", @@ -398,31 +397,6 @@ sign(const char *seckeyfile, const char *msgfile, const char *sigfile, free(msg); } - -static void -inspect(const char *seckeyfile, const char *pubkeyfile, const char *sigfile) -{ - struct sig sig; - struct enckey enckey; - struct pubkey pubkey; - char fp[(FPLEN + 2) / 3 * 4 + 1]; - - if (seckeyfile) { - readb64file(seckeyfile, &enckey, sizeof(enckey), NULL); - b64_ntop(enckey.fingerprint, FPLEN, fp, sizeof(fp)); - printf("sec fp: %s\n", fp); - } - if (pubkeyfile) { - readb64file(pubkeyfile, &pubkey, sizeof(pubkey), NULL); - b64_ntop(pubkey.fingerprint, FPLEN, fp, sizeof(fp)); - printf("pub fp: %s\n", fp); - } - if (sigfile) { - readb64file(sigfile, &sig, sizeof(sig), NULL); - b64_ntop(sig.fingerprint, FPLEN, fp, sizeof(fp)); - printf("sig fp: %s\n", fp); - } -} #endif static void @@ -684,7 +658,6 @@ main(int argc, char **argv) NONE, CHECK, GENERATE, - INSPECT, SIGN, VERIFY } verb = NONE; @@ -692,7 +665,7 @@ main(int argc, char **argv) rounds = 42; - while ((ch = getopt(argc, argv, "CGISVc:em:np:qs:x:")) != -1) { + while ((ch = getopt(argc, argv, "CGSVc:em:np:qs:x:")) != -1) { switch (ch) { #ifndef VERIFYONLY case 'C': @@ -705,11 +678,6 @@ main(int argc, char **argv) usage(NULL); verb = GENERATE; break; - case 'I': - if (verb) - usage(NULL); - verb = INSPECT; - break; case 'S': if (verb) usage(NULL); @@ -782,9 +750,6 @@ main(int argc, char **argv) usage("must specify pubkey and seckey"); generate(pubkeyfile, seckeyfile, rounds, comment); break; - case INSPECT: - inspect(seckeyfile, pubkeyfile, sigfile); - break; case SIGN: if (!msgfile || !seckeyfile) usage("must specify message and seckey"); -- 2.20.1