otpcli/t/0001-RFC-6238-SHA-1-Test-Vectors.t
Lucas 2fe090286d Rework tests
Split along multiple files, produce TAP output, rely on Perl's prove for
running them. Improves clarity and hopefully makes it easier to add new
tests in the future.
2021-02-12 22:58:09 +00:00

21 lines
657 B
Bash

#!/bin/sh
[ -n "${0%/*}" ] && cd "${0%/*}"
. ./lib.sh
if [ ! -x ../otpcli ]; then
plan 0 "skip: build otpcli first"
exit 1
fi
plan 6
# base32("12345678901234567890")
key=GEZDGNBVGY3TQOJQGEZDGNBVGY3TQOJQ
check "time 59" 94287082 ../otpcli -d 8 -a sha1 -T 59 "$key"
check "time 1111111109" 07081804 ../otpcli -d 8 -a sha1 -T 1111111109 "$key"
check "time 1111111111" 14050471 ../otpcli -d 8 -a sha1 -T 1111111111 "$key"
check "time 1234567890" 89005924 ../otpcli -d 8 -a sha1 -T 1234567890 "$key"
check "time 2000000000" 69279037 ../otpcli -d 8 -a sha1 -T 2000000000 "$key"
check "time 20000000000" 65353130 ../otpcli -d 8 -a sha1 -T 20000000000 "$key"