21 lines
784 B
Perl
21 lines
784 B
Perl
|
#!/bin/sh
|
||
|
[ -n "${0%/*}" ] && cd "${0%/*}"
|
||
|
. ./lib.sh
|
||
|
|
||
|
if [ ! -x ../otpcli ]; then
|
||
|
plan 0 "skip: build otpcli first"
|
||
|
exit 1
|
||
|
fi
|
||
|
|
||
|
plan 6
|
||
|
|
||
|
# base32("1234567890123456789012345678901234567890123456789012345678901234")
|
||
|
key=GEZDGNBVGY3TQOJQGEZDGNBVGY3TQOJQGEZDGNBVGY3TQOJQGEZDGNBVGY3TQOJQGEZDGNBVGY3TQOJQGEZDGNBVGY3TQOJQGEZDGNA
|
||
|
|
||
|
check "time 59" 90693936 ../otpcli -d 8 -a sha512 -T 59 "$key"
|
||
|
check "time 1111111109" 25091201 ../otpcli -d 8 -a sha512 -T 1111111109 "$key"
|
||
|
check "time 1111111111" 99943326 ../otpcli -d 8 -a sha512 -T 1111111111 "$key"
|
||
|
check "time 1234567890" 93441116 ../otpcli -d 8 -a sha512 -T 1234567890 "$key"
|
||
|
check "time 2000000000" 38618901 ../otpcli -d 8 -a sha512 -T 2000000000 "$key"
|
||
|
check "time 20000000000" 47863826 ../otpcli -d 8 -a sha512 -T 20000000000 "$key"
|