xref: /freebsd/lib/libsecureboot/openpgp/Makefile.inc (revision e9ac41698b2f322d55ccf9da50a3596edb2c1800)
15fff9558SSimon J. Gerraty# decode OpenPGP signatures per rfc4880
25fff9558SSimon J. Gerraty.PATH: ${.PARSEDIR}
35fff9558SSimon J. Gerraty
45fff9558SSimon J. GerratyCFLAGS+= -DUSE_BEARSSL
55fff9558SSimon J. Gerraty
65fff9558SSimon J. GerratyBRSSL_SRCS+= dearmor.c
75fff9558SSimon J. GerratySRCS+= \
85fff9558SSimon J. Gerraty	decode.c \
95fff9558SSimon J. Gerraty	opgp_key.c \
105fff9558SSimon J. Gerraty	opgp_sig.c
115fff9558SSimon J. Gerraty
125fff9558SSimon J. Gerratyopgp_key.o opgp_key.po opgp_key.pico: ta_asc.h
135fff9558SSimon J. Gerraty
145fff9558SSimon J. Gerraty# Generate ta_asc.h containing one or more OpenPGP trust anchors.
155fff9558SSimon J. Gerraty#
165fff9558SSimon J. Gerraty# Since each trust anchor must be processed individually,
175fff9558SSimon J. Gerraty# we create ta_ASC as a list of pointers to them.
185fff9558SSimon J. Gerraty#
195fff9558SSimon J. Gerraty# If we are doing self-tests, we define another arrary vc_ASC
205fff9558SSimon J. Gerraty# containing pointers to a signature of each trust anchor.
215fff9558SSimon J. Gerraty# It is assumed that these v*.asc files are named similarly to
225fff9558SSimon J. Gerraty# the appropriate t*.asc so that the relative order of vc_ASC
235fff9558SSimon J. Gerraty# entries matches ta_ASC.
245fff9558SSimon J. Gerraty#
25*9bee6a60SSimon J. GerratyTA_ASC_LIST ?= ${.ALLSRC:Mt*.asc}
26*9bee6a60SSimon J. GerratyVC_ASC_LIST ?= ${.ALLSRC:Mv*.asc}
27*9bee6a60SSimon J. Gerraty
28*9bee6a60SSimon J. Gerratyta_asc.h:
295fff9558SSimon J. Gerraty.if ${VE_SIGNATURE_LIST:MOPENPGP} != ""
305fff9558SSimon J. Gerraty	@( echo '/* Autogenerated - DO NOT EDIT!!! */'; echo; \
315fff9558SSimon J. Gerraty	echo "#define HAVE_TA_ASC 1"; \
32*9bee6a60SSimon J. Gerraty	set -- ${TA_ASC_LIST:@f@$f ${f:T:R}@}; \
335fff9558SSimon J. Gerraty	while test $$# -ge 2; do \
345fff9558SSimon J. Gerraty		file2c -sx "static const char $$2[] = {" ', 0x00 };' < $$1; \
355fff9558SSimon J. Gerraty		shift 2; \
365fff9558SSimon J. Gerraty	done; \
37*9bee6a60SSimon J. Gerraty	echo 'static const char *ta_ASC[] = { ${TA_ASC_LIST:T:R:ts,}, NULL };'; \
385fff9558SSimon J. Gerraty	echo; ) > ${.TARGET}
395fff9558SSimon J. Gerraty.if ${VE_SELF_TESTS} != "no"
405fff9558SSimon J. Gerraty	@( echo "#define HAVE_VC_ASC 1"; \
41*9bee6a60SSimon J. Gerraty	set -- ${VC_ASC_LIST:@f@$f ${f:T:R}@}; \
425fff9558SSimon J. Gerraty	while test $$# -ge 2; do \
435fff9558SSimon J. Gerraty		file2c -sx "static const char $$2[] = {" ', 0x00 };' < $$1; \
445fff9558SSimon J. Gerraty		shift 2; \
455fff9558SSimon J. Gerraty	done; \
46*9bee6a60SSimon J. Gerraty	echo 'static const char *vc_ASC[] = { ${VC_ASC_LIST:T:R:ts,}, NULL };'; \
475fff9558SSimon J. Gerraty	echo; ) >> ${.TARGET}
485fff9558SSimon J. Gerraty.endif
495fff9558SSimon J. Gerraty.endif
50