summaryrefslogtreecommitdiff
path: root/hscript/meta.cc
diff options
context:
space:
mode:
authorA. Wilcox <AWilcox@Wilcox-Tech.com>2019-10-31 20:38:27 -0500
committerA. Wilcox <AWilcox@Wilcox-Tech.com>2019-10-31 20:38:27 -0500
commit7ab44372d81e86df99b3aefa114a5003df98bc61 (patch)
treea376b212f73518f7633925bf77d403fc33792953 /hscript/meta.cc
parentbc96edb1c20b0031479cbf23055651c2c92f7afe (diff)
downloadhorizon-7ab44372d81e86df99b3aefa114a5003df98bc61.tar.gz
horizon-7ab44372d81e86df99b3aefa114a5003df98bc61.tar.bz2
horizon-7ab44372d81e86df99b3aefa114a5003df98bc61.tar.xz
horizon-7ab44372d81e86df99b3aefa114a5003df98bc61.zip
hscript: Implement SigningKey, add tests
Diffstat (limited to 'hscript/meta.cc')
-rw-r--r--hscript/meta.cc21
1 files changed, 21 insertions, 0 deletions
diff --git a/hscript/meta.cc b/hscript/meta.cc
index 5885c1e..640743c 100644
--- a/hscript/meta.cc
+++ b/hscript/meta.cc
@@ -466,3 +466,24 @@ bool Repository::execute(ScriptOptions opts) const {
return false;
#endif /* HAS_INSTALL_ENV */
}
+
+
+Key *SigningKey::parseFromData(const std::string &data, int lineno,
+ int *errors, int *) {
+ if(data.empty() || (data[0] != '/' && data.compare(0, 8, "https://"))) {
+ if(errors) *errors += 1;
+ output_error("installfile:" + std::to_string(lineno),
+ "signingkey: must be absolute path or HTTPS URL");
+ return nullptr;
+ }
+
+ return new SigningKey(lineno, data);
+}
+
+bool SigningKey::validate(ScriptOptions) const {
+ return true;
+}
+
+bool SigningKey::execute(ScriptOptions) const {
+ return false;
+}