Teach dnssec-settime to read times that it writes

The dnssec-settime -p and -up options print times in asctime() and
UNIX time_t formats, respectively. The asctime() format can also be
found inside K*.key public key files. Key files also contain times in
the YYYYMMDDHHMMSS format that can be used in timing parameter
options.

The dnssec-settime -p and -up time formats are now acceptable in
timing parameter options to dnssec-settime and dnssec-keygen, so it is
no longer necessary to parse key files to retrieve times that are
acceptable in timing parameter options.
This commit is contained in:
Tony Finch
2019-04-29 13:56:05 +01:00
committed by Ondřej Surý
parent 745d9db746
commit c38a323082
6 changed files with 92 additions and 32 deletions

View File

@@ -208,5 +208,21 @@ n=`expr $n + 1`
if [ $ret != 0 ]; then echo_i "failed"; fi
status=`expr $status + $ret`
key=`$KEYGEN -q -a RSASHA1 $czone`
echo_i "checking -p output time is accepted ($n)"
t=`$SETTIME -pA $key | sed 's/.*: //'`
$SETTIME -Psync "$t" $key > /dev/null 2>&1 || ret=1
n=`expr $n + 1`
if [ $ret != 0 ]; then echo_i "failed"; fi
status=`expr $status + $ret`
echo_i "checking -up output time is accepted ($n)"
t=`$SETTIME -upA $key | sed 's/.*: //'`
$SETTIME -Dsync "$t" $key > /dev/null 2>&1 || ret=1
n=`expr $n + 1`
if [ $ret != 0 ]; then echo_i "failed"; fi
status=`expr $status + $ret`
echo_i "exit status: $status"
[ $status -eq 0 ] || exit 1