sign.sh revision 1.1.1.6
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
14SYSTEMTESTTOP=../..
15. $SYSTEMTESTTOP/conf.sh
16
17zone=.
18infile=root.db.in
19zonefile=root.db
20
21echo_i "ns1/sign.sh"
22
23cp $infile $zonefile
24
25if [ -f ../ed25519-supported.file ]; then
26	zsk25519=$($KEYGEN -q -a ED25519 -n zone "$zone")
27	ksk25519=$($KEYGEN -q -a ED25519 -n zone -f KSK "$zone")
28	cat "$ksk25519.key" "$zsk25519.key" >> "$zonefile"
29	$DSFROMKEY -a sha-256 "$ksk25519.key" >> dsset-256
30fi
31
32if [ -f ../ed448-supported.file ]; then
33	zsk448=$($KEYGEN -q -a ED448 -n zone "$zone")
34	ksk448=$($KEYGEN -q -a ED448 -n zone -f KSK "$zone")
35	cat "$ksk448.key" "$zsk448.key" >> "$zonefile"
36	$DSFROMKEY -a sha-256 "$ksk448.key" >> dsset-256
37fi
38
39# Configure the resolving server with a static key.
40if [ -f ../ed25519-supported.file ]; then
41	keyfile_to_static_ds $ksk25519 > trusted.conf
42	cp trusted.conf ../ns2/trusted.conf
43else
44	keyfile_to_static_ds $ksk448 > trusted.conf
45	cp trusted.conf ../ns2/trusted.conf
46fi
47
48if [ -f ../ed448-supported.file ]; then
49	keyfile_to_static_ds $ksk448 > trusted.conf
50	cp trusted.conf ../ns3/trusted.conf
51else
52	keyfile_to_static_ds $ksk25519 > trusted.conf
53	cp trusted.conf ../ns3/trusted.conf
54fi
55
56$SIGNER -P -g -o "$zone" "$zonefile" > /dev/null 2> signer.err || cat signer.err
57