1*19261079SEd Maste# $OpenBSD: keygen-moduli.sh,v 1.4 2020/01/02 13:25:38 dtucker Exp $ 2ca86bcf2SDag-Erling Smørgrav# Placed in the Public Domain. 3ca86bcf2SDag-Erling Smørgrav 4ca86bcf2SDag-Erling Smørgravtid="keygen moduli" 5ca86bcf2SDag-Erling Smørgrav 6*19261079SEd Mastedhgex=0 7*19261079SEd Mastefor kex in `${SSH} -Q kex`; do 8*19261079SEd Maste case $kex in 9*19261079SEd Maste diffie-hellman-group*) dhgex=1 ;; 10*19261079SEd Maste esac 11*19261079SEd Mastedone 12*19261079SEd Maste 13ca86bcf2SDag-Erling Smørgrav# Try "start at the beginning and stop after 1", "skip 1 then stop after 1" 14ca86bcf2SDag-Erling Smørgrav# and "skip 2 and run to the end with checkpointing". Since our test data 15ca86bcf2SDag-Erling Smørgrav# file has 3 lines, these should always result in 1 line of output. 16*19261079SEd Masteif [ "x$dhgex" = "x1" ]; then 17*19261079SEd Maste for i in "-O lines=1" "-O start-line=1 -O lines=1" "-O start-line=2 -O checkpoint=$OBJ/moduli.ckpt"; do 18ca86bcf2SDag-Erling Smørgrav trace "keygen $i" 19ca86bcf2SDag-Erling Smørgrav rm -f $OBJ/moduli.out $OBJ/moduli.ckpt 20*19261079SEd Maste ${SSHKEYGEN} -M screen -f ${SRC}/moduli.in $i $OBJ/moduli.out 2>/dev/null || \ 21ca86bcf2SDag-Erling Smørgrav fail "keygen screen failed $i" 22ca86bcf2SDag-Erling Smørgrav lines=`wc -l <$OBJ/moduli.out` 23ca86bcf2SDag-Erling Smørgrav test "$lines" -eq "1" || fail "expected 1 line, got $lines" 24ca86bcf2SDag-Erling Smørgrav done 25*19261079SEd Mastefi 26ca86bcf2SDag-Erling Smørgrav 27ca86bcf2SDag-Erling Smørgravrm -f $OBJ/moduli.out $OBJ/moduli.ckpt 28