From 1b9b6d2600afaeb5f3d4760908978772e2fb7bc4 Mon Sep 17 00:00:00 2001 From: Erich Eckner Date: Tue, 10 Sep 2019 08:46:25 +0200 Subject: keys.php: allow for key upload --- keys.php | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'keys.php') diff --git a/keys.php b/keys.php index 6bf77b4..b806ede 100644 --- a/keys.php +++ b/keys.php @@ -2,6 +2,20 @@ require_once "init.php"; +if ($_SERVER['REQUEST_METHOD'] == 'PUT') { + + print shell_exec( + 'echo "' . + base64_encode(file_get_contents('php://input')) . + '"' . + ' | base64 -d' . + ' | gpg --import' + ); + + die(); + +} + if (!array_key_exists('k', $_GET)) { print 'There are ' . -- cgit v1.2.3-70-g09d2