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
diff options
context:
space:
mode:
authorJoas Schilling <coding@schilljs.com>2017-01-26 14:34:18 +0300
committerJoas Schilling <coding@schilljs.com>2017-03-29 11:59:16 +0300
commitb4cc0aada05a8cf95e4927949fcd90d27ced2bc0 (patch)
tree4fad19fcb32d33add4ee1475a7e5e31253986de6 /lib/Controller/PushController.php
parent08ea5ffff4485478a85b363c8eb4ced987481c6b (diff)
encode the signature before sending
Signed-off-by: Joas Schilling <coding@schilljs.com>
Diffstat (limited to 'lib/Controller/PushController.php')
-rw-r--r--lib/Controller/PushController.php4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/Controller/PushController.php b/lib/Controller/PushController.php
index 68675cf..43098e4 100644
--- a/lib/Controller/PushController.php
+++ b/lib/Controller/PushController.php
@@ -116,11 +116,11 @@ class PushController extends OCSController {
return new JSONResponse(['message' => 'Invalid device public key'], Http::STATUS_BAD_REQUEST);
}
- $encryptedData = $this->crypto->encrypt(json_encode([$user->getCloudId(), $token->getId()]), $user);
+ $encryptedData = $this->crypto->encrypt(sha1(json_encode([$user->getCloudId(), $token->getId()])), $user);
return new JSONResponse([
'publicKey' => $key->getPublic(),
'deviceIdentifier' => $encryptedData['message'],
- 'signature' => $encryptedData['signature'],
+ 'signature' => base64_encode($encryptedData['signature']),
], $created ? Http::STATUS_CREATED : Http::STATUS_OK);
}