abuild/tests/bin/openssl
Natanael Copa 94122d7bec tests: pre-generate abuild keys
use a fake openssl for abuild-keykey and pre-generate the abuild keys.
This makes tests run significantly faster as we dont need to generate
new keys for each abuild-keygen test.
2022-11-29 09:08:14 +00:00

30 lines
322 B
Bash
Executable File

#!/bin/sh
# fake openssl
while [ $# -gt 0 ]; do
case "$1" in
genrsa|rsa)
cmd="$1"
;;
-out)
shift
outfile="$1"
;;
-in)
shift
infile="$1"
esac
shift
done
case "$cmd" in
genrsa)
cat "$FAKEKEY" > "$outfile"
;;
rsa)
echo "writing RSA key" >&2
cat "$FAKEKEYPUB" > "$outfile"
;;
esac