Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/notifications.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorJoas Schilling <coding@schilljs.com>2021-10-26 21:38:31 +0300
committerJoas Schilling <coding@schilljs.com>2021-10-26 21:58:33 +0300
commit65fea4f244b94afa32811e32175b060866eb2426 (patch)
tree7dcb4d2bd94cd05ffc7947880747ee460a37aa05 /lib
parent298c227f5265a5ee8c50369fc4c2724e6f35b42c (diff)
Restore old device signature so the proxy works again
Signed-off-by: Joas Schilling <coding@schilljs.com>
Diffstat (limited to 'lib')
-rw-r--r--lib/Controller/PushController.php7
1 files changed, 6 insertions, 1 deletions
diff --git a/lib/Controller/PushController.php b/lib/Controller/PushController.php
index 544c17b..8d86d81 100644
--- a/lib/Controller/PushController.php
+++ b/lib/Controller/PushController.php
@@ -118,8 +118,13 @@ class PushController extends OCSController {
$key = $this->identityProof->getKey($user);
$deviceIdentifier = json_encode([$user->getCloudId(), $token->getId()]);
- $deviceIdentifier = base64_encode(hash('sha512', $deviceIdentifier, true));
openssl_sign($deviceIdentifier, $signature, $key->getPrivate(), OPENSSL_ALGO_SHA512);
+ /**
+ * For some reason the push proxy's golang code needs the signature
+ * of the deviceIdentifier before the sha512 hashing. Assumption is that
+ * openssl_sign already does the sha512 internally.
+ */
+ $deviceIdentifier = base64_encode(hash('sha512', $deviceIdentifier, true));
$appType = 'unknown';
if ($this->request->isUserAgent([