diff options
author | Joas Schilling <coding@schilljs.com> | 2017-01-26 14:34:18 +0300 |
---|---|---|
committer | Joas Schilling <coding@schilljs.com> | 2017-03-29 11:59:16 +0300 |
commit | b4cc0aada05a8cf95e4927949fcd90d27ced2bc0 (patch) | |
tree | 4fad19fcb32d33add4ee1475a7e5e31253986de6 /lib/Controller/PushController.php | |
parent | 08ea5ffff4485478a85b363c8eb4ced987481c6b (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.php | 4 |
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); } |