From 1f6706be37a2ff60d2967806ea7c792cebe46a8b Mon Sep 17 00:00:00 2001 From: inoguchi <> Date: Fri, 30 Aug 2019 11:43:34 +0000 Subject: Simplify checking and more readable descriptions in openssl(1) dgst suggested from jsing@ --- src/usr.bin/openssl/dgst.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'src/usr.bin/openssl') diff --git a/src/usr.bin/openssl/dgst.c b/src/usr.bin/openssl/dgst.c index b8253a8fb8..6592d2b194 100644 --- a/src/usr.bin/openssl/dgst.c +++ b/src/usr.bin/openssl/dgst.c @@ -1,4 +1,4 @@ -/* $OpenBSD: dgst.c,v 1.15 2019/08/30 11:19:00 inoguchi Exp $ */ +/* $OpenBSD: dgst.c,v 1.16 2019/08/30 11:43:34 inoguchi Exp $ */ /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) * All rights reserved. * @@ -122,11 +122,11 @@ dgst_opt_md(int argc, char **argv, int *argsused) if (*name++ != '-') return (1); - if ((dgst_config.m = EVP_get_digestbyname(name)) != NULL) - dgst_config.md = dgst_config.m; - else + if ((dgst_config.m = EVP_get_digestbyname(name)) == NULL) return (1); + dgst_config.md = dgst_config.m; + *argsused = 1; return (0); } @@ -173,21 +173,21 @@ dgst_opt_verify(char *arg) static const struct option dgst_options[] = { { .name = "binary", - .desc = "Output in binary form", + .desc = "Output the digest or signature in binary form", .type = OPTION_VALUE, .opt.value = &dgst_config.out_bin, .value = 1, }, { .name = "c", - .desc = "To output the digest with separating colons", + .desc = "Print the digest in two-digit groups separated by colons", .type = OPTION_VALUE, .opt.value = &dgst_config.separator, .value = 1, }, { .name = "d", - .desc = "To output debug info", + .desc = "Print BIO debugging information", .type = OPTION_FLAG, .opt.flag = &dgst_config.debug, }, @@ -249,7 +249,7 @@ static const struct option dgst_options[] = { }, { .name = "r", - .desc = "To output the digest in coreutils format", + .desc = "Output the digest in coreutils format", .type = OPTION_VALUE, .opt.value = &dgst_config.separator, .value = 2, -- cgit v1.2.3-55-g6feb