abuild/tests/bin/openssl
Natanael Copa f2978eb33f abuild-keygen: add support for creating kernel signing key
We need to have a key that can be used to sign kernel modules and
specifically 3rd party kernel modules. Add support for creating this key
in abuild-keygen.

ref: https://gitlab.alpinelinux.org/alpine/aports/-/issues/14873
2023-05-05 13:39:47 +02:00

45 lines
635 B
Bash
Executable File

#!/bin/sh
# fake openssl
while [ $# -gt 0 ]; do
case "$1" in
genrsa|rsa|req)
cmd="$1"
;;
-config)
shift
config="$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"
;;
req)
echo "Using configuration from $config" >&2
echo "Generating RSA key with 4096 bits" >&2
echo "Writing private key to '$outfile'" >&2
cat "$FAKEKEY" "$FAKEKEYPUB" > "$outfile"
;;
*)
echo "unimplemented fake openssl command: $cmd" >&2
exit 1
;;
esac