From: Daniel Golle Date: Thu, 7 Jun 2018 10:32:21 +0000 (+0200) Subject: always include complete signature file including trailing newline X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=f75cdc54535caea98faafc6a16da4f0e5b3c22b9;p=oweals%2Fucert.git always include complete signature file including trailing newline just to harmonize things Signed-off-by: Daniel Golle This work was sponsored by WIO (wiowireless.com) --- diff --git a/ucert.c b/ucert.c index a319529..f4a4b84 100644 --- a/ucert.c +++ b/ucert.c @@ -341,7 +341,7 @@ static void cert_dump_blob(struct blob_attr *cert[CERT_ATTR_MAX]) { switch(cert_policy[i].type) { case BLOB_ATTR_BINARY: - fprintf(stdout, "signature:\n---\n%s\n---\n", (char *) blob_data(v)); + fprintf(stdout, "signature:\n---\n%s---\n", (char *) blob_data(v)); break; case BLOB_ATTR_NESTED: fprintf(stdout, "payload:\n---\n%s\n---\n", blobmsg_format_json_indent(blob_data(v), false, 0)); @@ -434,7 +434,7 @@ static int cert_issue(const char *certfile, const char *pubkeyfile, const char * if (siglen < 1) return 1; - sigb[siglen-1] = '\0'; + sigb[siglen] = '\0'; fclose(sigf); unlink(fname);