The only variable really needed for the script to work is the path to
the $KEYGEN binary. Allow setting this via an environment variable to
avoid loading conf.sh (and causing a chicken-egg problem). Also make
testcrypto.sh executable to allow its use from conf.sh.
(cherry picked from commit
bb1c6bbdc701cdbadfe7c796acf8b5ecd719f1b9)
# information regarding copyright ownership.
SYSTEMTESTTOP=${SYSTEMTESTTOP:=..}
-. $SYSTEMTESTTOP/conf.sh
-prog=$0
+if test -z "$KEYGEN"; then
+ . $SYSTEMTESTTOP/conf.sh
+ alg="-a $DEFAULT_ALGORITHM -b $DEFAULT_BITS"
+else
+ alg=""
+fi
+prog=$0
args=""
-alg="-a $DEFAULT_ALGORITHM -b $DEFAULT_BITS"
quiet=0
-
msg="cryptography"
while test "$#" -gt 0; do
case $1 in
shift
done
+if test -z "$alg"; then
+ echo "${prog}: no algorithm selected"
+ exit 1
+fi
+
if $KEYGEN $args $alg foo > /dev/null 2>&1
then
rm -f Kfoo*