aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEric Biggers <ebiggers@google.com>2019-06-26 17:25:52 -0700
committerEric Biggers <ebiggers@google.com>2019-06-26 17:25:52 -0700
commit6033f555d1cb9c17abf3b860922d3ae6457cb1b1 (patch)
tree996472762d975f4507c0962ed689ed295e947f8d
parent10696edab6436f21a8e7c564571d302c751f5d9c (diff)
downloadfsverity-utils-6033f555d1cb9c17abf3b860922d3ae6457cb1b1.tar.gz
cmd_sign: print file measurement on success
Signed-off-by: Eric Biggers <ebiggers@google.com>
-rw-r--r--cmd_sign.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/cmd_sign.c b/cmd_sign.c
index 0c1dfe7..19dff63 100644
--- a/cmd_sign.c
+++ b/cmd_sign.c
@@ -540,6 +540,7 @@ int fsverity_cmd_sign(const struct fsverity_command *cmd,
const char *keyfile = NULL;
const char *certfile = NULL;
struct fsverity_signed_digest *digest = NULL;
+ char digest_hex[FS_VERITY_MAX_DIGEST_SIZE * 2 + 1];
u8 *sig = NULL;
u32 sig_size;
int status;
@@ -618,6 +619,9 @@ int fsverity_cmd_sign(const struct fsverity_command *cmd,
if (!write_signature(argv[1], sig, sig_size))
goto out_err;
+ bin2hex(digest->digest, hash_alg->digest_size, digest_hex);
+ printf("Signed file \"%s\" (%s:%s)\n", argv[0], hash_alg->name,
+ digest_hex);
status = 0;
out:
free(salt);