From: Daniel Golle Date: Thu, 7 Jun 2018 13:16:41 +0000 (+0200) Subject: allow append also on non-existing certfile X-Git-Url: https://git.librecmc.org/?p=oweals%2Fucert.git;a=commitdiff_plain;h=b62d1266c14a64b39ba53cf54ebee812c3d6804d 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) --- 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"