-
Notifications
You must be signed in to change notification settings - Fork 45
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Enable Dual Signing for akmods (#215)
- Loading branch information
Showing
13 changed files
with
207 additions
and
65 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
-----BEGIN PRIVATE KEY----- | ||
MIIEvgIBADANBgkqhkiG9w0BAQEFAASCBKgwggSkAgEAAoIBAQCnVfa8014cwVhH | ||
8SKJFg94/krdWYAAbEG+BVMWfJf84v19bqEUWO9GKYUHTXIOYTzOcdyyYkBDm8hL | ||
DpUGHWtgAut4l4cDpDCkL9sJzAhKS6lOW0pCqaZzqJoq8AUyK84j/l3vEBwuucZo | ||
HypEyK+GeaWFc5fo3P/UQmYML78YgS2Lbb/MDwH+Zfrmt9IoKv75oIdmOVC/dpzS | ||
MiJZB1trjKyS+31o6gXCI43kpMsRGSHHqW6k5zhNNEA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Iulw8O+jpliN9WYxk/l2Pacg9kH4NTbhwmQPK | ||
UpcNyGhJypPtln49ASGZGhgWqzkWlJ12eu+5eEgXnVUEH3zR5YBNcdQsPt4Utbcm | ||
iOoVeTZvp4OCmUSLIpg+6Zwp9/V7ARuJ2GoeLnTJAoGBANOjf4lQBz1/U0aeog/H | ||
OCscSv+pbfHLo778FDJYcEBL0twofifnMLoED2E28F3ptbwUoE89KUrBvvDTgiXj | ||
4Gd5eMU64iKo2utA9crzcxXEhvEyl04fQyZtaqOIfmUHiV5CHV1oCgoa8Rq1Zxc/ | ||
5bzd1lBjif4fuc6RXjooHX+3 | ||
-----END PRIVATE KEY----- |
Binary file not shown.
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
#!/usr/bin/bash | ||
|
||
set -eoux pipefail | ||
|
||
KERNEL="$(rpm -q "${KERNEL_NAME}" --queryformat '%{VERSION}-%{RELEASE}.%{ARCH}')" | ||
SIGNING_KEY_1="/tmp/certs/signing_key_1.pem" | ||
SIGNING_KEY_2="/tmp/certs/signing_key_2.pem" | ||
PUBLIC_CHAIN="/tmp/certs/public_key_chain.pem" | ||
|
||
if [[ "${DUAL_SIGN}" == "true" ]]; then | ||
dnf install -y /var/cache/rpms/kmods/zfs/*.rpm pv | ||
modinfo /usr/lib/modules/"${KERNEL}"/extra/zfs/spl.ko | ||
for module in /usr/lib/modules/"${KERNEL}"/extra/zfs/*.ko*; | ||
do | ||
module_basename=${module:0:-3} | ||
module_suffix=${module: -3} | ||
if [[ "$module_suffix" == ".xz" ]]; then | ||
xz --decompress "$module" | ||
openssl cms -sign -signer "${SIGNING_KEY_1}" -signer "${SIGNING_KEY_2}" -binary -in "$module_basename" -outform DER -out "${module_basename}.cms" -nocerts -noattr -nosmimecap | ||
/usr/src/kernels/"${KERNEL}"/scripts/sign-file -s "${module_basename}.cms" sha256 "${PUBLIC_CHAIN}" "${module_basename}" | ||
xz -f "${module_basename}" | ||
elif [[ "$module_suffix" == ".gz" ]]; then | ||
gzip -d "$module" | ||
openssl cms -sign -signer "${SIGNING_KEY_1}" -signer "${SIGNING_KEY_2}" -binary -in "$module_basename" -outform DER -out "${module_basename}.cms" -nocerts -noattr -nosmimecap | ||
/usr/src/kernels/"${KERNEL}"/scripts/sign-file -s "${module_basename}.cms" sha256 "${PUBLIC_CHAIN}" "${module_basename}" | ||
gzip -9f "${module_basename}" | ||
else | ||
openssl cms -sign -signer "${SIGNING_KEY_1}" -signer "${SIGNING_KEY_2}" -binary -in "$module" -outform DER -out "${module}.cms" -nocerts -noattr -nosmimecap | ||
/usr/src/kernels/"${KERNEL}"/scripts/sign-file -s "${module}.cms" sha256 "${PUBLIC_CHAIN}" "${module}" | ||
fi | ||
done | ||
rpmrebuild --batch /var/cache/rpms/kmods/zfs/kmod-zfs-*.rpm | ||
rm -rf /usr/lib/modules/"${KERNEL}"/extra | ||
dnf reinstall -y /root/rpmbuild/RPMS/"$(uname -m)"/kmod-*-"${KERNEL}"-*.rpm | ||
for module in /usr/lib/modules/"${KERNEL}"/extra/*/*.ko*; do | ||
if ! modinfo "${module}"; then | ||
exit 1 | ||
fi | ||
done | ||
mv -f /root/rpmbuild/RPMS/"$(uname -m)"/kmod-*.rpm /var/cache/rpms/kmods/zfs/ | ||
fi | ||
|
||
for RPM in $(find /var/cache/akmods/ -type f -name \*.rpm); do | ||
cp "${RPM}" /var/cache/rpms/kmods/ | ||
done | ||
|
||
find /var/cache/rpms |
Oops, something went wrong.