1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
|
all: cert-0.crt
rel3_dodroot_2048.cac:
wget -O "$@.new" http://dodpki.c3pki.chamb.disa.mil/rel3_dodroot_2048.cac
mv "$@.new" "$@"
cert-%.crt: rel3_dodroot_2048.cac
idx=0; \
( \
openssl pkcs7 -in rel3_dodroot_2048.cac -inform DER -print_certs -text; \
) | while IFS='' read -r line; do \
if [ -z "$${line}" ]; then \
continue; \
fi; \
echo "$${line}" >> "cert-$${idx}.crt"; \
if [ "$${line}" == "-----END CERTIFICATE-----" ]; then \
idx=$$[$$idx + 1]; \
fi; \
done
clean:
rm -f cert-*.crt
rm -f rel3_dodroot_2048.cac.new
distclean: clean
rm -f rel3_dodroot_2048.cac
|
>
>
|
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
|
all: certs USG-dod-bundle.pem
certs: cert-0.crt
rel3_dodroot_2048.cac:
wget -O "$@.new" http://dodpki.c3pki.chamb.disa.mil/rel3_dodroot_2048.cac
mv "$@.new" "$@"
cert-%.crt: rel3_dodroot_2048.cac
idx=0; \
( \
openssl pkcs7 -in rel3_dodroot_2048.cac -inform DER -print_certs -text; \
) | while IFS='' read -r line; do \
if [ -z "$${line}" ]; then \
continue; \
fi; \
echo "$${line}" >> "cert-$${idx}.crt"; \
if [ "$${line}" == "-----END CERTIFICATE-----" ]; then \
idx=$$[$$idx + 1]; \
fi; \
done
USG-dod-bundle.pem: certs
../build-tree.sh > "$@"
clean:
rm -f cert-*.crt
rm -f rel3_dodroot_2048.cac.new
distclean: clean
rm -f rel3_dodroot_2048.cac
.PHONY: all certs
|