| 1 |
#! /bin/sh |
| 2 |
|
| 3 |
echo lsh, encrypted key test |
| 4 |
|
| 5 |
if [ -z "$srcdir" ] ; then |
| 6 |
srcdir=`pwd` |
| 7 |
fi |
| 8 |
|
| 9 |
. $srcdir/functions.sh |
| 10 |
|
| 11 |
#exec 2>/dev/null >/dev/null |
| 12 |
|
| 13 |
|
| 14 |
fname="$TEST_HOME/lsh-encrypted-key-test-helper" |
| 15 |
keyname="$TEST_HOME/lsh-encrypted-key-test-key" |
| 16 |
|
| 17 |
rm -f "$fname" "$keyname" |
| 18 |
|
| 19 |
LSH_FLAGS="$LSH_FLAGS --identity=$keyname --askpass=$fname" |
| 20 |
|
| 21 |
# Set up the helper program |
| 22 |
# The password output should not include any trailing newline |
| 23 |
echo '#!/bin/sh' > $fname |
| 24 |
echo 'printf bar' >> $fname |
| 25 |
|
| 26 |
chmod u+rx $fname |
| 27 |
|
| 28 |
../lsh-keygen | ../lsh-writekey -o $keyname -caes256-cbc -pbar || die "lsh-keygen failed" |
| 29 |
HOME=$TEST_HOME "$srcdir/../lsh-authorize" $keyname.pub |
| 30 |
|
| 31 |
HOME=$TEST_HOME spawn_lshd && run_lsh 'echo Hello world' && test_success |
| 32 |
|
| 33 |
test_done |