-/* $OpenBSD: parser.c,v 1.70 2022/04/20 10:46:20 job Exp $ */
+/* $OpenBSD: parser.c,v 1.71 2022/04/20 15:13:08 job Exp $ */
/*
* Copyright (c) 2019 Claudio Jeker <claudio@openbsd.org>
* Copyright (c) 2019 Kristaps Dzonsons <kristaps@bsd.lv>
cert = ta_parse(file, cert, tal->pkey, tal->pkeysz);
if (cert != NULL)
printf("OK");
+ else
+ printf("Failed");
+ if (outformats & FORMAT_JSON)
+ printf("\",\n\t\"tal\": \"%s", tal->descr);
+ else
+ printf("\nTAL: %s", tal->descr);
+ tal = NULL;
} else {
cert_free(cert);
cert = NULL;
}
}
- if (is_ta) {
- if (outformats & FORMAT_JSON) {
- printf("\",\n\t\"tal\": \"%s\"\n", tal->descr);
- printf("}");
- } else {
- printf("\nTAL: %s\n", tal->descr);
- }
- tal = NULL;
- } else if (outformats & FORMAT_JSON)
- printf("\"\n}");
+ if (outformats & FORMAT_JSON)
+ printf("\"\n}");
else
printf("\n");