Re: La racine est signée et la clé distribuée

Stephane Bortzmeyer <[email protected]>
Newsgroups gmane.network.dns.french
Message-ID <[email protected]>
On Fri, Jul 16, 2010 at 11:08:22AM +0200,
 Stephane Bortzmeyer <[email protected]> wrote 
 a message of 62 lines which said:

> Une des façons :

On peut l'automatiser avec le Makefile et le script XSLT ci-joint. Ils
produisent des fichiers de « trust anchors » pour Unbound et pour
BIND.
Makefile (text/plain, 1.3 KB)
KEYFLAGS=257
HASHALG=2 # For dnssec-dsfromkey

all: root-anchors.txt root-anchors.dnskey

root-anchors.txt: root-anchors.xml
	xsltproc -o root-anchors.txt anchors2ds.xsl root-anchors.xml

root-anchors.xml:
	wget -nc https://data.iana.org/root-anchors/root-anchors.xml
	wget -nc https://data.iana.org/root-anchors/root-anchors.asc
	gpg --verify root-anchors.asc root-anchors.xml || \
		rm -f root-anchors.asc root-anchors.xml

root-anchors.dnskey: root-anchors.txt
	dig DNSKEY . | grep -w ${KEYFLAGS} > untrusted.key
	# Verify the key
	# Thanks to Kazunori Fujiwara for the idea
	dnssec-dsfromkey -${HASHALG} untrusted.key > untrusted.ds
	cut -d' ' -f1-6 untrusted.ds | tr '\n' ' ' > root-anchors.tmp
	cut -d' ' -f7- untrusted.ds | sed 's/ //g' | tr '\n' ' ' >> root-anchors.tmp
	echo >> root-anchors.tmp
	@diff root-anchors.txt root-anchors.tmp || \
		sh -c 'echo "Invalid DNSKEY, deleting temporary files"; rm -f root-anchors.tmp untrusted.key untrusted.ds'
	awk  '{print  $$1 " " $$5 " " $$6 " " $$7 " " "\""; for (i = 8; i <= NF; i++) printf $$i " "; print  "\";"  }' untrusted.key > root-anchors.dnskey
	@echo "OK, root-anchors.dnskey is correct"

clean:
	rm -f root-anchors.txt untrusted.key untrusted.ds root-anchors.tmp

realclean: clean
	rm -f root-anchors.xml root-anchors.asc
anchors2ds.xsl (application/xml, 855 B) - not displayed
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.