summaryrefslogtreecommitdiff
path: root/gecko
diff options
context:
space:
mode:
Diffstat (limited to 'gecko')
-rwxr-xr-xgecko/genpub.sh11
-rwxr-xr-xgecko/gensig.sh22
-rw-r--r--gecko/install.ttl4
-rw-r--r--gecko/updates.ttl20
4 files changed, 56 insertions, 1 deletions
diff --git a/gecko/genpub.sh b/gecko/genpub.sh
new file mode 100755
index 0000000..12768dd
--- /dev/null
+++ b/gecko/genpub.sh
@@ -0,0 +1,11 @@
+#!/bin/sh
+
+if test $# -ne 1; then
+ echo "Usage: $0 pem"
+ echo "Outputs a public key suitable for use in install.rdf"
+ exit 1
+fi
+
+openssl rsa -pubout -outform DER < "$1" 2>/dev/null \
+| openssl enc -e -a 2>/dev/null \
+| awk '{printf("%s", $0)}' | sed 's/\//\\\//g'
diff --git a/gecko/gensig.sh b/gecko/gensig.sh
new file mode 100755
index 0000000..13c0447
--- /dev/null
+++ b/gecko/gensig.sh
@@ -0,0 +1,22 @@
+#!/bin/sh
+#
+# Currently not working - using uhura instead.
+
+if test $# -ne 2; then
+ echo "Usage: $0 update.rdf pem"
+ echo "Outputs a signature suitable for use in update.rdf"
+ exit 1
+fi
+
+# serialise all but the signature entry
+# in mccoy this is serializeResource(), in mexumgen it's ser()
+# exerything else seems to rewrite things, but we *might* get away with sed-ing away the bad line and outputting as rdfxml
+# sha512 hash
+# sign the hash
+# der encode & base64
+
+sed '/em:signature/d' < "$1" | rapper -i turtle -o rdfxml /dev/stdin 2>/dev/null \
+| sha512sum \
+| openssl sha1 -sha1 -binary -sign "$2" \
+| openssl enc -e -a 2>/dev/null \
+| awk '{printf("%s", $0)}' | sed 's/\//\\\//g'
diff --git a/gecko/install.ttl b/gecko/install.ttl
index 655f3d6..dc40853 100644
--- a/gecko/install.ttl
+++ b/gecko/install.ttl
@@ -13,5 +13,7 @@
em:name "SimplyRead";
em:description "Stop browsing, start reading. Press Ctrl-Alt-r or click the 'sr' icon in the status bar to toggle SimplyRead.";
em:creator "Nick White";
- em:homepageUrl "http://njw.me.uk/software/simplyread/";
+ em:homepageURL "http://njw.me.uk/software/simplyread/";
+ em:updateURL "http://njw.me.uk/software/simplyread/gecko-updates.rdf";
+ em:updateKey "PUBKEY";
<http://usefulinc.com/ns/doap#license> <http://www.gnu.org/licenses/agpl.html>.
diff --git a/gecko/updates.ttl b/gecko/updates.ttl
new file mode 100644
index 0000000..34325db
--- /dev/null
+++ b/gecko/updates.ttl
@@ -0,0 +1,20 @@
+# currently not used as uhura is generating it.
+
+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>.
+@prefix em: <http://www.mozilla.org/2004/em-rdf#>.
+
+<urn:mozilla:extension:simplyread@njw.me.uk>
+ em:signature "SIG";
+ em:updates [ a rdf:Seq ;
+ rdf:li <:VERSION>;
+ ].
+
+<:VERSION>
+ em:version "VERSION";
+ em:targetApplication [
+ em:id "{ec8030f7-c20a-464f-9b0e-13a3a9e97384}";
+ em:minVersion "3.0";
+ em:maxVersion "4.0.*";
+ em:updateLink "http://njw.me.uk/simplyread/simplyread-VERSION.xpi";
+ em:updateHash "sha1:HASH";
+ ].