Generate signing key

This commit is contained in:
aptalca 2020-06-22 10:54:50 -04:00
parent ea3d6fcd32
commit 98516feb83

View File

@ -106,7 +106,30 @@ fi
if [ "$SKIP_COMPILE" != "true" ]; then
if [ -e /lib/modules/$(uname -r)/build ]; then
echo "**** Kernel headers seem to be present, attempting to build the wireguard module. . . ****"
if [ ! -f /lib/modules/$(uname -r)/build/certs/signing_key.pem ]; then
cd /lib/modules/$(uname -r)/build/certs
cat <<DUDE >> x509.genkey
[ req ]
default_bits = 4096
distinguished_name = req_distinguished_name
prompt = no
string_mask = utf8only
x509_extensions = myexts
[ req_distinguished_name ]
CN = Modules
[ myexts ]
basicConstraints=critical,CA:FALSE
keyUsage=digitalSignature
subjectKeyIdentifier=hash
authorityKeyIdentifier=keyid
DUDE
echo "**** Generating signing key ****"
openssl req -new -nodes -utf8 -sha512 -days 36500 -batch -x509 -config x509.genkey -outform DER -out signing_key.x509 -keyout signing_key.pem
fi
cd /app
echo "**** Building the module ****"
make -C wireguard-linux-compat/src -j$(nproc)
make -C wireguard-linux-compat/src install
echo "**** Let's test our new module. ****"