From b62d1266c14a64b39ba53cf54ebee812c3d6804d Mon Sep 17 00:00:00 2001 From: Daniel Golle Date: Thu, 7 Jun 2018 15:16:41 +0200 Subject: [PATCH] allow append also on non-existing certfile Just in case someone just wants a single plain signature without any chain. Signed-off-by: Daniel Golle This work was sponsored by WIO (wiowireless.com) --- ucert.c | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/ucert.c b/ucert.c index 4beb499..7be2f8f 100644 --- a/ucert.c +++ b/ucert.c @@ -161,15 +161,9 @@ static int cert_append(const char *certfile, const char *sigfile) { FILE *fs; char filebuf[CERT_BUF_LEN]; struct blob_buf sigbuf; - struct stat st; int len; int ret; - if (stat(certfile, &st) != 0) { - fprintf(stderr, "certfile %s doesn't exist, can't append.\n", certfile); - return -1; - } - fs = fopen(sigfile, "r"); if (!fs) return 1; @@ -481,7 +475,7 @@ static int usage(const char *cmd) fprintf(stderr, "Usage: %s \n" "Commands:\n" - " -A: append (needs -c and -x)\n" + " -A: append signature (needs -c and -x)\n" " -D: dump\n" " -I: issue cert and revoker (needs -c and -p and -s)\n" " -R: process revoker certificate (needs -c)\n" -- 2.25.1