aboutsummaryrefslogtreecommitdiffstats
path: root/Zotlabs/Web
diff options
context:
space:
mode:
Diffstat (limited to 'Zotlabs/Web')
-rw-r--r--Zotlabs/Web/HTTPSig.php14
1 files changed, 13 insertions, 1 deletions
diff --git a/Zotlabs/Web/HTTPSig.php b/Zotlabs/Web/HTTPSig.php
index f6228da5c..e53bcb3e9 100644
--- a/Zotlabs/Web/HTTPSig.php
+++ b/Zotlabs/Web/HTTPSig.php
@@ -13,6 +13,8 @@ use Zotlabs\Lib\Webfinger;
use Zotlabs\Lib\Zotfinger;
use Zotlabs\Lib\Libzot;
use HttpSignature\HttpMessageSigner;
+use HttpSignature\UnProcessableSignatureException;
+
/**
* @brief Implements HTTP Signatures per draft-cavage-http-signatures-10.
@@ -135,7 +137,17 @@ class HTTPSig {
$messageSigner->setCreated(preg_match('/created=([0-9]+)/', $headers['signature-input'], $matches) ? $matches[1] : '');
$messageSigner->setExpires(preg_match('/expires=([0-9]+)/', $headers['signature-input'], $matches) ? $matches[1] : '');
- $verified = $messageSigner->verifyRequest(App::$request);
+ try {
+ $verified = $messageSigner->verifyRequest(App::$request);
+ if (!$verified) {
+ btlogger('RFC9421: Unable to verify request: ' . print_r($headers, true), LOGGER_DATA);
+ }
+ }
+ catch (\Exception $exception) {
+ btlogger($exception->getMessage(), LOGGER_DATA);
+ $verified = false;
+ }
+
logger('verified (RFC9421): ' . (($verified) ? 'true' : 'false'), LOGGER_DEBUG);
return [