verify signature after build
authorMichael Wallner <root@s201809.m6w6.name>
Fri, 25 Oct 2019 08:18:06 +0000 (10:18 +0200)
committerMichael Wallner <root@s201809.m6w6.name>
Fri, 25 Oct 2019 08:18:06 +0000 (10:18 +0200)
bin/gpg-vrfy [new file with mode: 0755]
bin/pecl+sig
bin/rsa-vrfy [new file with mode: 0755]

diff --git a/bin/gpg-vrfy b/bin/gpg-vrfy
new file mode 100755 (executable)
index 0000000..ff37a95
--- /dev/null
@@ -0,0 +1,17 @@
+#!/usr/bin/env php
+<?php
+
+ini_set("error_reporting", E_ALL);
+ini_set("display_errors", true);
+
+if ($argc != 3) {
+       fprintf(STDERR, "Usage: %s <pkg name> <phar path>\n\n", basename($argv[0]));
+       exit(1);
+}
+
+list(, $pkg, $src) = $argv;
+$basename = basename($src);
+$dir = __DIR__."/../public/sigs/$pkg";
+
+$cmd = sprintf("gpg --verify %s/%s.asc %s", $dir, $basename, $src);
+passthru($cmd);
index 7c6b9af7ec5acb99b86aee0e3332d4a28aff458c..b093c0e369636418c20b6c009b0ba401800302d8 100755 (executable)
@@ -24,10 +24,11 @@ function fail($pkg, $ver, $skp, $fmt) {
 }
 
 function sign($pkg, $ext) {
-       $fmt = "%s/%s-sign %s %s%s";
+       $fmt = "%s/%s-%s %s %s%s";
        foreach (["rsa", "gpg"] as $sig) {
                foreach (["", ".gz", ".bz2"] as $typ) {
-                       passthru(sprintf($fmt, __DIR__, $sig, $pkg, $ext, $typ));
+                       passthru(sprintf($fmt, __DIR__, $sig, "sign", $pkg, $ext, $typ));
+                       passthru(sprintf($fmt, __DIR__, $sig, "vrfy", $pkg, $ext, $typ));
                }
        }
 }
diff --git a/bin/rsa-vrfy b/bin/rsa-vrfy
new file mode 100755 (executable)
index 0000000..1d43ec1
--- /dev/null
@@ -0,0 +1,18 @@
+#!/usr/bin/env php
+<?php
+
+ini_set("error_reporting", E_ALL);
+ini_set("display_errors", true);
+
+if ($argc != 3) {
+       fprintf(STDERR, "Usage: %s <pkg name> <phar path>\n\n", basename($argv[0]));
+       exit(1);
+}
+
+list(, $pkg, $src) = $argv;
+$basename = basename($src);
+$dir = __DIR__."/../public/sigs/$pkg";
+$pub = __DIR__."/../public/replicator.pub";
+
+$cmd = sprintf("openssl dgst -verify %s -signature %s/%s.sig %s", $pub, $dir, $basename, $src);
+passthru($cmd);