summaryrefslogtreecommitdiff
path: root/hscript
diff options
context:
space:
mode:
authorA. Wilcox <AWilcox@Wilcox-Tech.com>2019-11-06 00:57:45 -0600
committerA. Wilcox <AWilcox@Wilcox-Tech.com>2019-11-06 00:57:45 -0600
commitd3f9715777ee32b7c3d38f8b520597eea2d79a79 (patch)
treedff6c0e4602ea8ab722dbbe44c4a6b5ceb7f7ef0 /hscript
parentada546b6002360169570a72c83fadc574b936c18 (diff)
downloadhorizon-d3f9715777ee32b7c3d38f8b520597eea2d79a79.tar.gz
horizon-d3f9715777ee32b7c3d38f8b520597eea2d79a79.tar.bz2
horizon-d3f9715777ee32b7c3d38f8b520597eea2d79a79.tar.xz
horizon-d3f9715777ee32b7c3d38f8b520597eea2d79a79.zip
hscript: Implement Runner.Execute.signingkey.Firmware
Diffstat (limited to 'hscript')
-rw-r--r--hscript/script_v.cc25
1 files changed, 24 insertions, 1 deletions
diff --git a/hscript/script_v.cc b/hscript/script_v.cc
index 9453c62..0052ad2 100644
--- a/hscript/script_v.cc
+++ b/hscript/script_v.cc
@@ -151,7 +151,7 @@ bool add_default_repos(std::vector<std::unique_ptr<Repository>> &repos,
std::unique_ptr<Repository> fw_repo(fw_key);
repos.push_back(std::move(fw_repo));
}
-#endif
+#endif /* NON_LIBRE_FIRMWARE */
return true;
}
@@ -172,6 +172,29 @@ bool add_default_repo_keys(std::vector<std::unique_ptr<SigningKey>> &keys) {
}
std::unique_ptr<SigningKey> repo_key(key);
keys.push_back(std::move(repo_key));
+
+#ifdef NON_LIBRE_FIRMWARE
+ /* REQ: Runner.Execute.signingkey.Firmware */
+ if(firmware) {
+ SigningKey *fkey = dynamic_cast<SigningKey *>(SigningKey::parseFromData(
+ "/etc/apk/keys/packages@pleroma.apkfission.net-5ac0b300.rsa.pub",
+ 0, nullptr, nullptr)
+ );
+ if(!fkey) {
+ output_error("internal", "failed to create firmware signing key");
+ return false;
+ }
+ std::unique_ptr<SigningKey> fw_key(fkey);
+ keys.push_back(std::move(fw_key));
+ fkey = dynamic_cast<SigningKey *>(SigningKey::parseFromData(
+ "/etc/apk/keys/packages@pleroma.apkfission.net-5ac04808.rsa.pub",
+ 0, nullptr, nullptr));
+ if(fkey) {
+ std::unique_ptr<SigningKey> fw_key2(fkey);
+ keys.push_back(std::move(fw_key2));
+ }
+ }
+#endif /* NON_LIBRE_FIRMWARE */
return true;
}