diff options
author | Joas Schilling <coding@schilljs.com> | 2021-10-26 21:38:31 +0300 |
---|---|---|
committer | Joas Schilling <coding@schilljs.com> | 2021-10-26 21:58:33 +0300 |
commit | 65fea4f244b94afa32811e32175b060866eb2426 (patch) | |
tree | 7dcb4d2bd94cd05ffc7947880747ee460a37aa05 /lib | |
parent | 298c227f5265a5ee8c50369fc4c2724e6f35b42c (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.php | 7 |
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([ |