hx509: Fix hxtool building w/o ASN.1 templating

This commit is contained in:
Nicolas Williams
2021-03-10 15:59:55 -06:00
parent 230580d21c
commit 6595f080e1
2 changed files with 9 additions and 0 deletions

View File

@@ -110,6 +110,10 @@ hxtool_LDADD = \
$(LIB_roken) \
$(top_builddir)/lib/sl/libsl.la
if ASN1_TEMPLATING
hxtool_CPPFLAGS = -DASN1_PRINTING_WORKS
endif
CLEANFILES = $(BUILT_SOURCES) sel-gram.c sel-lex.c \
$(TESTS) \
hxtool-commands.c hxtool-commands.h *.tmp \

View File

@@ -718,6 +718,7 @@ print_f(hx509_context hxcontext, void *ctx, hx509_cert cert)
static int HX509_LIB_CALL
print_fjson(hx509_context hxcontext, void *ctx, hx509_cert cert)
{
#ifdef ASN1_PRINTING_WORKS
const Certificate *c = NULL;
char *json = NULL;
@@ -730,6 +731,10 @@ print_fjson(hx509_context hxcontext, void *ctx, hx509_cert cert)
hx509_err(context, 1, errno, "Could not format certificate as JSON");
free(json);
return 0;
#else
err(1, "JSON printing of certificates not supported; try enabling or "
"not disabling ASN.1 templating in Heimdal build configuration");
#endif
}