diff options
author | Philippe Leduc <ledphilippe@gmail.com> | 2015-07-03 08:47:26 +0200 |
---|---|---|
committer | Sascha Hauer <s.hauer@pengutronix.de> | 2015-07-06 13:29:35 +0200 |
commit | d46b6785c4bcd3ceb7d90895e9f44a7bf7d6757d (patch) | |
tree | 582d6420c2362ce41ce44c9735216fa5df81e0a5 /commands/digest.c | |
parent | d297851b1a79997b19d9c816ca737f0f48e768dd (diff) | |
download | barebox-d46b6785c4bcd3ceb7d90895e9f44a7bf7d6757d.tar.gz barebox-d46b6785c4bcd3ceb7d90895e9f44a7bf7d6757d.tar.xz |
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 <ledphilippe@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'commands/digest.c')
-rw-r--r-- | commands/digest.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/commands/digest.c b/commands/digest.c index 4cc615d775..02a9f6f0de 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 = COMMAND_ERROR; goto err; } } @@ -186,8 +187,8 @@ BAREBOX_CMD_HELP_TEXT("Options:") BAREBOX_CMD_HELP_OPT ("-a <algo>\t", "hash or signature algorithm to use") BAREBOX_CMD_HELP_OPT ("-k <key>\t", "use supplied <key> (ASCII or hex) for MAC") BAREBOX_CMD_HELP_OPT ("-K <file>\t", "use key from <file> (binary) for MAC") -BAREBOX_CMD_HELP_OPT ("-v <hex>\t", "verify data against supplied <hex> (hash, MAC or signature)") -BAREBOX_CMD_HELP_OPT ("-V <file>\t", "verify data against <file> (hash, MAC or signature)") +BAREBOX_CMD_HELP_OPT ("-s <hex>\t", "verify data against supplied <hex> (hash, MAC or signature)") +BAREBOX_CMD_HELP_OPT ("-S <file>\t", "verify data against <file> (hash, MAC or signature)") BAREBOX_CMD_HELP_END BAREBOX_CMD_START(digest) |