3 # Consider this file an example.
5 # For Junos this is how we obtain trust anchor .pems
6 # the signing server (http://www.crufty.net/sjg/blog/signing-server.htm)
7 # for each key will provide the appropriate certificate chain on request
9 # force these for Junos
10 MANIFEST_SKIP_ALWAYS= boot
19 VE_SIGNATURE_EXT_LIST= \
24 .if ${MACHINE} == "host" && ${.CURDIR:T} == "tests"
33 VE_SIGNATURE_EXT_LIST+= \
37 SIGNER ?= ${SB_TOOLS_PATH:U/volume/buildtools/bin}/sign.py
40 SIGN_HOST ?= ${SB_SITE:Usvl}-junos-signer.juniper.net
41 ECDSA_PORT:= ${133%y:L:gmtime}
42 SIGN_ECDSA= ${PYTHON} ${SIGNER} -u ${SIGN_HOST}:${ECDSA_PORT} -h sha256
43 RSA2_PORT:= ${163%y:L:gmtime}
44 SIGN_RSA2= ${PYTHON} ${SIGNER} -u ${SIGN_HOST}:${RSA2_PORT} -h sha256
46 .if !empty(OPENPGP_SIGN_URL)
47 VE_SIGNATURE_LIST+= OPENPGP
48 VE_SIGNATURE_EXT_LIST+= asc
50 SIGN_OPENPGP= ${PYTHON} ${SIGNER:H}/openpgp-sign.py -a -u ${OPENPGP_SIGN_URL}
53 ${SIGN_OPENPGP} -C ${.TARGET}
57 .if ${VE_SELF_TESTS} != "no"
59 vc_openpgp.asc: ta_openpgp.asc
60 ${SIGN_OPENPGP} ${.ALLSRC:M*.asc}
61 mv ta_openpgp.asc.asc ${.TARGET}
68 ${SIGN_RSA2} -C ${.TARGET}
71 ${SIGN_ECDSA} -C ${.TARGET}
73 .if ${VE_SIGNATURE_LIST:tu:MECDSA} != ""
74 # the last cert in the chain is the one we want
75 ta_ec.pem: ecerts.pem _LAST_PEM_USE
77 .if ${VE_SELF_TESTS} != "no"
78 # these are for verification self test
79 vc_ec.pem: ecerts.pem _2ndLAST_PEM_USE
83 .if ${VE_SIGNATURE_LIST:tu:MRSA} != ""
84 ta_rsa.pem: rcerts.pem _LAST_PEM_USE
85 .if ${VE_SELF_TESTS} != "no"
86 vc_rsa.pem: rcerts.pem _2ndLAST_PEM_USE
90 # we take the mtime of this as our baseline time
91 BUILD_UTC_FILE= ecerts.pem
96 # you need to provide t*.pem or t*.asc files for each trust anchor
97 .if empty(TRUST_ANCHORS)
98 TRUST_ANCHORS!= cd ${.CURDIR} && 'ls' -1 *.pem t*.asc 2> /dev/null
100 .if empty(TRUST_ANCHORS)
101 .error Need TRUST_ANCHORS see ${.CURDIR}/README.rst
103 .if ${TRUST_ANCHORS:T:Mt*.pem} != ""
104 ta.h: ${TRUST_ANCHORS:M*.pem}
106 .if ${TRUST_ANCHORS:T:Mt*.asc} != ""
107 VE_SIGNATURE_LIST+= OPENPGP
108 VE_SIGNATURE_EXT_LIST+= asc
109 ta_asc.h: ${TRUST_ANCHORS:M*.asc}
111 # we take the mtime of this as our baseline time
112 BUILD_UTC_FILE?= ${TRUST_ANCHORS:[1]}