-
Notifications
You must be signed in to change notification settings - Fork 0
/
dnssec_ta_tool_wrapper.sh
48 lines (41 loc) · 2.12 KB
/
dnssec_ta_tool_wrapper.sh
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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
#!/bin/sh
URL_ROOT_ANCHORS_XML="https://data.iana.org/root-anchors/root-anchors.xml"
URL_ROOT_ANCHORS_SIG="https://data.iana.org/root-anchors/root-anchors.p7s"
FILE_ROOT_ANCHORS_XML=`mktemp /tmp/root-anchors.xml.XXXXXX` || exit 1
FILE_ROOT_ANCHORS_SIG=`mktemp /tmp/root-anchors.p7s.XXXXXX` || exit 1
FILE_ICANN_ROOT_CA_CERT=`mktemp /tmp/icannbundle.pem.XXXXXX` || exit 1
cat >$FILE_ICANN_ROOT_CA_CERT <<ICANN_ROOT_CA_CERT
-----BEGIN CERTIFICATE-----
MIIDdzCCAl+gAwIBAgIBATANBgkqhkiG9w0BAQsFADBdMQ4wDAYDVQQKEwVJQ0FO
TjEmMCQGA1UECxMdSUNBTk4gQ2VydGlmaWNhdGlvbiBBdXRob3JpdHkxFjAUBgNV
BAMTDUlDQU5OIFJvb3QgQ0ExCzAJBgNVBAYTAlVTMB4XDTA5MTIyMzA0MTkxMloX
DTI5MTIxODA0MTkxMlowXTEOMAwGA1UEChMFSUNBTk4xJjAkBgNVBAsTHUlDQU5O
IENlcnRpZmljYXRpb24gQXV0aG9yaXR5MRYwFAYDVQQDEw1JQ0FOTiBSb290IENB
MQswCQYDVQQGEwJVUzCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAKDb
cLhPNNqc1NB+u+oVvOnJESofYS9qub0/PXagmgr37pNublVThIzyLPGCJ8gPms9S
G1TaKNIsMI7d+5IgMy3WyPEOECGIcfqEIktdR1YWfJufXcMReZwU4v/AdKzdOdfg
ONiwc6r70duEr1IiqPbVm5T05l1e6D+HkAvHGnf1LtOPGs4CHQdpIUcy2kauAEy2
paKcOcHASvbTHK7TbbvHGPB+7faAztABLoneErruEcumetcNfPMIjXKdv1V1E3C7
MSJKy+jAqqQJqjZoQGB0necZgUMiUv7JK1IPQRM2CXJllcyJrm9WFxY0c1KjBO29
iIKK69fcglKcBuFShUECAwEAAaNCMEAwDwYDVR0TAQH/BAUwAwEB/zAOBgNVHQ8B
Af8EBAMCAf4wHQYDVR0OBBYEFLpS6UmDJIZSL8eZzfyNa2kITcBQMA0GCSqGSIb3
DQEBCwUAA4IBAQAP8emCogqHny2UYFqywEuhLys7R9UKmYY4suzGO4nkbgfPFMfH
6M+Zj6owwxlwueZt1j/IaCayoKU3QsrYYoDRolpILh+FPwx7wseUEV8ZKpWsoDoD
2JFbLg2cfB8u/OlE4RYmcxxFSmXBg0yQ8/IoQt/bxOcEEhhiQ168H2yE5rxJMt9h
15nu5JBSewrCkYqYYmaxyOC3WrVGfHZxVI7MpIFcGdvSb2a1uyuua8l0BKgk3ujF
0/wsHNeP22qNyVO+XVBzrM8fk8BSUFuiT/6tZTYXRtEt5aKQZgXbKU5dUF3jT9qg
j/Br5BZw3X/zd325TvnswzMC1+ljLzHnQGGk
-----END CERTIFICATE-----
ICANN_ROOT_CA_CERT
curl --silent --output $FILE_ROOT_ANCHORS_XML $URL_ROOT_ANCHORS_XML
curl --silent --output $FILE_ROOT_ANCHORS_SIG $URL_ROOT_ANCHORS_SIG
openssl smime -verify -inform der \
-CAfile $FILE_ICANN_ROOT_CA_CERT \
-in $FILE_ROOT_ANCHORS_SIG -out /dev/null \
-content $FILE_ROOT_ANCHORS_XML
if [ $? -eq 0 ]; then
python3 dnssec_ta_tool.py --anchors $FILE_ROOT_ANCHORS_XML $@
fi
rm -f $FILE_ROOT_ANCHORS_XML
rm -f $FILE_ROOT_ANCHORS_SIG
rm -f $FILE_ICANN_ROOT_CA_CERT