summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--buildmaster/gpg-keys.php33
1 files changed, 31 insertions, 2 deletions
diff --git a/buildmaster/gpg-keys.php b/buildmaster/gpg-keys.php
index db990c2..ed33418 100644
--- a/buildmaster/gpg-keys.php
+++ b/buildmaster/gpg-keys.php
@@ -1,6 +1,35 @@
<?php
require_once "../init.php";
require_once BASE . "/lib/mysql.php";
+require_once BASE . "/lib/http.php";
+
+ if (array_key_exists('fp', $_GET)) {
+ $result = mysql_run_query(
+ "SELECT" .
+ " `gpg_keys`.`fingerprint`," .
+ "`gpg_keys`.`public_key`" .
+ " FROM `gpg_keys`" .
+ " WHERE `gpg_keys`.`fingerprint`=from_base64(\"" . base64_encode(strtoupper($_GET['fp'])) . "\")"
+ );
+ if ($result -> num_rows == 0)
+ throw_http_error(400, 'Key not found');
+ $result = $result -> fetch_assoc();
+ print "<html>\n";
+ print " <head>\n";
+ print " <title>\n";
+ print " Archlinux 32 Key Server -- Get \"" . $result['fingerprint'] . "\"\n";
+ print " </title>\n";
+ print " <meta http-equiv=\"Content-Type\" content=\"text/html;charset=utf-8\">\n";
+ print " </head>\n";
+ print " <body>\n";
+ print " <h1>Archlinux 32 Key Server -- Get \"" . $result['fingerprint'] . "\"</h1>\n";
+ print " <pre>\n";
+ print $result['public_key'] . "\n";
+ print " </pre>\n";
+ print " </body>\n";
+ print "</html>\n";
+ die();
+ };
$result = mysql_run_query(
"SELECT" .
@@ -36,8 +65,8 @@ show_warning_on_offline_slave();
print "<tr>";
print "<td>" . $row["person"] . "</td>";
print "<td>" . $row["action"] . "</td>";
- print "<td><a href=\"http://pgp.mit.edu/pks/lookup?op=get&search=0x" .
- substr($row["fingerprint"],-16) .
+ print "<td><a href=\"?fp=" .
+ $row["fingerprint"] .
"\">" . $row["fingerprint"] . "</a></td>";
print "</tr>\n";
}