summaryrefslogtreecommitdiffstats
path: root/update-root-anchors.sh
blob: 298c2244ba0d5ccabd5d2cd225d1afe2461b445d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#!/bin/sh -e
# This data is documented at <https://www.iana.org/dnssec/files>.

wget -O root-anchors.xml.NEW https://data.iana.org/root-anchors/root-anchors.xml

# ignore the update date, which changes daily
if diff -u root-anchors.xml root-anchors.xml.NEW; then
  echo "root-anchors.xml has NOT changed."
  rm root-anchors.xml.NEW
  exit
fi

echo "root-anchors.xml has changed."

wget -O root-anchors.p7s.NEW https://data.iana.org/root-anchors/root-anchors.p7s

openssl smime -verify -content signed-file -CAfile icannbundle.pem -inform DER -in root-anchors.p7s -content root-anchors.xml -out /dev/null

mv root-anchors.xml.NEW root-anchors.xml
mv root-anchors.p7s.NEW root-anchors.p7s