always include complete signature file including trailing newline
authorDaniel Golle <daniel@makrotopia.org>
Thu, 7 Jun 2018 10:32:21 +0000 (12:32 +0200)
committerDaniel Golle <daniel@makrotopia.org>
Thu, 14 Jun 2018 16:51:22 +0000 (18:51 +0200)
just to harmonize things

Signed-off-by: Daniel Golle <daniel@makrotopia.org>
This work was sponsored by WIO (wiowireless.com)

ucert.c

diff --git a/ucert.c b/ucert.c
index a319529..f4a4b84 100644 (file)
--- 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);