mirror of
https://gitlab.alpinelinux.org/alpine/abuild.git
synced 2024-12-22 15:02:59 +00:00
f2978eb33f
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
45 lines
635 B
Bash
Executable File
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
|
|
|