From mboxrd@z Thu Jan 1 00:00:00 1970 Return-path: Received: from mail-lb0-x22a.google.com ([2a00:1450:4010:c04::22a]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1ZAulI-0007Gm-S2 for barebox@lists.infradead.org; Fri, 03 Jul 2015 06:47:49 +0000 Received: by lbcpe5 with SMTP id pe5so44460403lbc.2 for ; Thu, 02 Jul 2015 23:47:27 -0700 (PDT) MIME-Version: 1.0 Date: Fri, 3 Jul 2015 08:47:26 +0200 Message-ID: From: Philippe Leduc List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "barebox" Errors-To: barebox-bounces+u.kleine-koenig=pengutronix.de@lists.infradead.org Subject: [PATCH] digest: digest doesn't return an error if the signature length is incorrect To: barebox@lists.infradead.org Hi, I noticed that digest return 0 even if the signature length is detected as incorrect. This patch also fix the documentation that seems obsolete (I considered that the patch was simply enough to make two corrections, but tell me if I should propose two patch). Subject: [PATCH] digest: digest doesn't return an error if the signature length is incorrect fix: digest return no error even if the digest length is wrong fix: documentation error (-v -> -s / -V -> -S) Signed-off-by: Philippe Leduc --- commands/digest.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/commands/digest.c b/commands/digest.c index 340c07a..5304f32 100644 --- a/commands/digest.c +++ b/commands/digest.c @@ -167,6 +167,7 @@ static int do_digest(int argc, char *argv[]) } else if (siglen != digestlen) { eprintf("%s wrong size %zu, expected %zu\n", sigfile, siglen, digestlen); + ret = 1; goto err; } } @@ -186,8 +187,8 @@ BAREBOX_CMD_HELP_TEXT("Options:") BAREBOX_CMD_HELP_OPT ("-a \t", "hash or signature algorithm to use") BAREBOX_CMD_HELP_OPT ("-k \t", "use supplied (ASCII or hex) for MAC") BAREBOX_CMD_HELP_OPT ("-K \t", "use key from (binary) for MAC") -BAREBOX_CMD_HELP_OPT ("-v \t", "verify data against supplied (hash, MAC or signature)") -BAREBOX_CMD_HELP_OPT ("-V \t", "verify data against (hash, MAC or signature)") +BAREBOX_CMD_HELP_OPT ("-s \t", "verify data against supplied (hash, MAC or signature)") +BAREBOX_CMD_HELP_OPT ("-S \t", "verify data against (hash, MAC or signature)") BAREBOX_CMD_HELP_END BAREBOX_CMD_START(digest) -- 2.1.4 Philippe LEDUC ledphilippe@gmail.com _______________________________________________ barebox mailing list barebox@lists.infradead.org http://lists.infradead.org/mailman/listinfo/barebox