xref: /netbsd-src/external/mpl/bind/dist/bin/tests/system/dnssec/ns1/sign.sh (revision ae082add65442546470c0ba499a860ee89eed305)
1#!/bin/sh -e
2
3# Copyright (C) Internet Systems Consortium, Inc. ("ISC")
4#
5# SPDX-License-Identifier: MPL-2.0
6#
7# This Source Code Form is subject to the terms of the Mozilla Public
8# License, v. 2.0.  If a copy of the MPL was not distributed with this
9# file, you can obtain one at https://mozilla.org/MPL/2.0/.
10#
11# See the COPYRIGHT file distributed with this work for additional
12# information regarding copyright ownership.
13
14# shellcheck source=conf.sh
15. "$SYSTEMTESTTOP/conf.sh"
16
17set -e
18
19zone=.
20infile=root.db.in
21zonefile=root.db
22
23(cd ../ns2 && $SHELL sign.sh )
24(cd ../ns6 && $SHELL sign.sh )
25(cd ../ns7 && $SHELL sign.sh )
26
27echo_i "ns1/sign.sh"
28
29cp "../ns2/dsset-example$TP" .
30cp "../ns2/dsset-in-addr.arpa$TP" .
31cp "../ns2/dsset-too-many-iterations$TP" .
32
33grep "$DEFAULT_ALGORITHM_NUMBER [12] " "../ns2/dsset-algroll$TP" > "dsset-algroll$TP"
34cp "../ns6/dsset-optout-tld$TP" .
35
36ksk=$("$KEYGEN" -q -fk -a "$DEFAULT_ALGORITHM" -b "$DEFAULT_BITS" -n zone "$zone")
37zsk=$("$KEYGEN" -q -a "$DEFAULT_ALGORITHM" -b "$DEFAULT_BITS" -n zone "$zone")
38
39cat "$infile" "$ksk.key" "$zsk.key" > "$zonefile"
40
41"$SIGNER" -P -g -o "$zone" "$zonefile" > /dev/null 2>&1
42
43# Configure the resolving server with a staitc key.
44keyfile_to_static_ds "$ksk" > trusted.conf
45cp trusted.conf ../ns2/trusted.conf
46cp trusted.conf ../ns3/trusted.conf
47cp trusted.conf ../ns4/trusted.conf
48cp trusted.conf ../ns6/trusted.conf
49cp trusted.conf ../ns7/trusted.conf
50cp trusted.conf ../ns9/trusted.conf
51
52keyfile_to_trusted_keys "$ksk" > trusted.keys
53
54# ...or with an initializing key.
55keyfile_to_initial_ds "$ksk" > managed.conf
56cp managed.conf ../ns4/managed.conf
57
58#
59#  Save keyid for managed key id test.
60#
61
62keyfile_to_key_id "$ksk" > managed.key.id
63