Home | History | Annotate | Line # | Download | only in eddsa
      1      1.1  christos #!/bin/sh
      2  1.1.1.5  christos 
      3      1.1  christos # Copyright (C) Internet Systems Consortium, Inc. ("ISC")
      4      1.1  christos #
      5  1.1.1.5  christos # SPDX-License-Identifier: MPL-2.0
      6  1.1.1.5  christos #
      7      1.1  christos # This Source Code Form is subject to the terms of the Mozilla Public
      8  1.1.1.5  christos # License, v. 2.0.  If a copy of the MPL was not distributed with this
      9  1.1.1.3  christos # file, you can obtain one at https://mozilla.org/MPL/2.0/.
     10      1.1  christos #
     11      1.1  christos # See the COPYRIGHT file distributed with this work for additional
     12      1.1  christos # information regarding copyright ownership.
     13      1.1  christos 
     14  1.1.1.6  christos set -e
     15  1.1.1.6  christos 
     16  1.1.1.6  christos . ../conf.sh
     17      1.1  christos 
     18      1.1  christos status=0
     19  1.1.1.4  christos n=0
     20      1.1  christos 
     21  1.1.1.4  christos dig_with_opts() {
     22  1.1.1.6  christos   "$DIG" +tcp +noau +noadd +nosea +nostat +nocmd +dnssec -p "$PORT" "$@"
     23  1.1.1.4  christos }
     24  1.1.1.4  christos 
     25  1.1.1.7  christos if [ $ED25519_SUPPORTED = 1 ]; then
     26  1.1.1.6  christos   # Check the example. domain
     27  1.1.1.6  christos   n=$((n + 1))
     28  1.1.1.6  christos   echo_i "checking that Ed25519 positive validation works ($n)"
     29  1.1.1.6  christos   ret=0
     30  1.1.1.6  christos   dig_with_opts . @10.53.0.1 soa >dig.out.ns1.test$n || ret=1
     31  1.1.1.6  christos   dig_with_opts . @10.53.0.2 soa >dig.out.ns2.test$n || ret=1
     32  1.1.1.6  christos   $PERL ../digcomp.pl dig.out.ns1.test$n dig.out.ns2.test$n || ret=1
     33  1.1.1.6  christos   grep "flags:.*ad.*QUERY" dig.out.ns2.test$n >/dev/null || ret=1
     34  1.1.1.6  christos   if [ $ret != 0 ]; then echo_i "failed"; fi
     35  1.1.1.6  christos   status=$((status + ret))
     36  1.1.1.6  christos 
     37  1.1.1.6  christos   # Check test vectors (RFC 8080 + errata)
     38  1.1.1.6  christos   n=$((n + 1))
     39  1.1.1.6  christos   echo_i "checking that Ed25519 test vectors match ($n)"
     40  1.1.1.6  christos   ret=0
     41  1.1.1.6  christos   grep 'oL9krJun7xfBOIWcGHi7mag5/hdZrKWw15jP' ns2/example.com.db.signed >/dev/null || ret=1
     42  1.1.1.6  christos   grep 'VrbpMngwcrqNAg==' ns2/example.com.db.signed >/dev/null || ret=1
     43  1.1.1.6  christos   grep 'zXQ0bkYgQTEFyfLyi9QoiY6D8ZdYo4wyUhVi' ns2/example.com.db.signed >/dev/null || ret=1
     44  1.1.1.6  christos   grep 'R0O7KuI5k2pcBg==' ns2/example.com.db.signed >/dev/null || ret=1
     45  1.1.1.6  christos   if [ $ret != 0 ]; then echo_i "failed"; fi
     46  1.1.1.6  christos   status=$((status + ret))
     47  1.1.1.4  christos else
     48  1.1.1.6  christos   echo_i "algorithm Ed25519 not supported, skipping vectors match test"
     49  1.1.1.4  christos fi
     50  1.1.1.4  christos 
     51  1.1.1.6  christos n=$((n + 1))
     52  1.1.1.6  christos ret=0
     53  1.1.1.7  christos if [ $ED448_SUPPORTED = 1 ]; then
     54  1.1.1.6  christos   # Check the example. domain
     55  1.1.1.6  christos   n=$((n + 1))
     56  1.1.1.6  christos   echo_i "checking that Ed448 positive validation works ($n)"
     57  1.1.1.6  christos   ret=0
     58  1.1.1.6  christos   dig_with_opts . @10.53.0.1 soa >dig.out.ns1.test$n || ret=1
     59  1.1.1.6  christos   dig_with_opts . @10.53.0.3 soa >dig.out.ns3.test$n || ret=1
     60  1.1.1.6  christos   $PERL ../digcomp.pl dig.out.ns1.test$n dig.out.ns3.test$n || ret=1
     61  1.1.1.6  christos   grep "flags:.*ad.*QUERY" dig.out.ns3.test$n >/dev/null || ret=1
     62  1.1.1.6  christos   if [ $ret != 0 ]; then echo_i "failed"; fi
     63  1.1.1.6  christos   status=$((status + ret))
     64  1.1.1.6  christos 
     65  1.1.1.6  christos   # Check test vectors (RFC 8080 + errata)
     66  1.1.1.6  christos   n=$((n + 1))
     67  1.1.1.6  christos   echo_i "checking that Ed448 test vectors match ($n)"
     68  1.1.1.6  christos   ret=0
     69  1.1.1.6  christos   grep '3cPAHkmlnxcDHMyg7vFC34l0blBhuG1qpwLm' ns3/example.com.db.signed >/dev/null || ret=1
     70  1.1.1.6  christos   grep 'jInI8w1CMB29FkEAIJUA0amxWndkmnBZ6SKi' ns3/example.com.db.signed >/dev/null || ret=1
     71  1.1.1.6  christos   grep 'wZSAxGILn/NBtOXft0+Gj7FSvOKxE/07+4RQ' ns3/example.com.db.signed >/dev/null || ret=1
     72  1.1.1.6  christos   grep 'vE581N3Aj/JtIyaiYVdnYtyMWbSNyGEY2213' ns3/example.com.db.signed >/dev/null || ret=1
     73  1.1.1.6  christos   grep 'WKsJlwEA' ns3/example.com.db.signed >/dev/null || ret=1
     74  1.1.1.6  christos 
     75  1.1.1.6  christos   grep 'E1/oLjSGIbmLny/4fcgM1z4oL6aqo+izT3ur' ns3/example.com.db.signed >/dev/null || ret=1
     76  1.1.1.6  christos   grep 'CyHyvEp4Sp8Syg1eI+lJ57CSnZqjJP41O/9l' ns3/example.com.db.signed >/dev/null || ret=1
     77  1.1.1.6  christos   grep '4m0AsQ4f7qI1gVnML8vWWiyW2KXhT9kuAICU' ns3/example.com.db.signed >/dev/null || ret=1
     78  1.1.1.6  christos   grep 'Sxv5OWbf81Rq7Yu60npabODB0QFPb/rkW3kU' ns3/example.com.db.signed >/dev/null || ret=1
     79  1.1.1.6  christos   grep 'ZmQ0YQUA' ns3/example.com.db.signed >/dev/null || ret=1
     80  1.1.1.6  christos   if [ $ret != 0 ]; then echo_i "failed"; fi
     81  1.1.1.6  christos   status=$((status + ret))
     82  1.1.1.4  christos else
     83  1.1.1.6  christos   echo_i "algorithm Ed448 not supported, skipping vectors match test"
     84  1.1.1.4  christos fi
     85  1.1.1.2  christos 
     86  1.1.1.3  christos echo_i "exit status: $status"
     87      1.1  christos [ $status -eq 0 ] || exit 1
     88