sign.sh 1.58 KB
Newer Older
1
#!/bin/sh -e
Michael Sawyer's avatar
Michael Sawyer committed
2
#
3
# Copyright (C) Internet Systems Consortium, Inc. ("ISC")
Mark Andrews's avatar
Mark Andrews committed
4
#
5 6 7
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
8 9 10
#
# See the COPYRIGHT file distributed with this work for additional
# information regarding copyright ownership.
Mark Andrews's avatar
Mark Andrews committed
11

12
# shellcheck source=conf.sh
13
. ../../conf.sh
Michael Sawyer's avatar
Michael Sawyer committed
14

15 16
set -e

Michael Sawyer's avatar
Michael Sawyer committed
17 18 19 20
zone=.
infile=root.db.in
zonefile=root.db

21 22
(cd ../ns2 && $SHELL sign.sh )
(cd ../ns6 && $SHELL sign.sh )
23
(cd ../ns7 && $SHELL sign.sh )
Michael Sawyer's avatar
Michael Sawyer committed
24

25 26
echo_i "ns1/sign.sh"

27 28
cp "../ns2/dsset-example$TP" .
cp "../ns2/dsset-in-addr.arpa$TP" .
29

30 31
grep "$DEFAULT_ALGORITHM_NUMBER [12] " "../ns2/dsset-algroll$TP" > "dsset-algroll$TP"
cp "../ns6/dsset-optout-tld$TP" .
Michael Sawyer's avatar
Michael Sawyer committed
32

Evan Hunt's avatar
Evan Hunt committed
33 34
ksk=$("$KEYGEN" -q -fk -a "$DEFAULT_ALGORITHM" -b "$DEFAULT_BITS" -n zone "$zone")
zsk=$("$KEYGEN" -q -a "$DEFAULT_ALGORITHM" -b "$DEFAULT_BITS" -n zone "$zone")
Michael Sawyer's avatar
Michael Sawyer committed
35

Evan Hunt's avatar
Evan Hunt committed
36
cat "$infile" "$ksk.key" "$zsk.key" > "$zonefile"
Michael Sawyer's avatar
Michael Sawyer committed
37

38
"$SIGNER" -P -g -o "$zone" "$zonefile" > /dev/null 2>&1
Michael Sawyer's avatar
Michael Sawyer committed
39

40
# Configure the resolving server with a staitc key.
41
keyfile_to_static_ds "$ksk" > trusted.conf
Michael Sawyer's avatar
Michael Sawyer committed
42 43 44
cp trusted.conf ../ns2/trusted.conf
cp trusted.conf ../ns3/trusted.conf
cp trusted.conf ../ns4/trusted.conf
45
cp trusted.conf ../ns6/trusted.conf
46
cp trusted.conf ../ns7/trusted.conf
47
cp trusted.conf ../ns9/trusted.conf
48

49 50
keyfile_to_trusted_keys "$ksk" > trusted.keys

51
# ...or with an initializing key.
52
keyfile_to_initial_ds "$ksk" > managed.conf
53
cp managed.conf ../ns4/managed.conf
54

55 56 57
#
#  Save keyid for managed key id test.
#
58

Evan Hunt's avatar
Evan Hunt committed
59
keyfile_to_key_id "$ksk" > managed.key.id