diff options
author | Chocobozzz <florian.bigard@gmail.com> | 2017-01-04 22:23:07 +0100 |
---|---|---|
committer | Chocobozzz <florian.bigard@gmail.com> | 2017-01-04 22:23:07 +0100 |
commit | bdfbd4f162d66c3a6bd7c312a99e0b692e830792 (patch) | |
tree | 30b857f73fe62771a94320e3e78030a1345dc3a8 /server/middlewares/secure.js | |
parent | b981a525c37d226b3fa59287a6ce338f54583d0c (diff) | |
download | PeerTube-bdfbd4f162d66c3a6bd7c312a99e0b692e830792.tar.gz PeerTube-bdfbd4f162d66c3a6bd7c312a99e0b692e830792.tar.zst PeerTube-bdfbd4f162d66c3a6bd7c312a99e0b692e830792.zip |
Server: use crypto instead of ursa for pod signature
Diffstat (limited to 'server/middlewares/secure.js')
-rw-r--r-- | server/middlewares/secure.js | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/server/middlewares/secure.js b/server/middlewares/secure.js index 2aae715c4..b6e6d818b 100644 --- a/server/middlewares/secure.js +++ b/server/middlewares/secure.js | |||
@@ -23,7 +23,14 @@ function checkSignature (req, res, next) { | |||
23 | 23 | ||
24 | logger.debug('Checking signature from %s.', host) | 24 | logger.debug('Checking signature from %s.', host) |
25 | 25 | ||
26 | const signatureOk = peertubeCrypto.checkSignature(pod.publicKey, host, req.body.signature.signature) | 26 | let signatureShouldBe |
27 | if (req.body.data) { | ||
28 | signatureShouldBe = req.body.data | ||
29 | } else { | ||
30 | signatureShouldBe = host | ||
31 | } | ||
32 | |||
33 | const signatureOk = peertubeCrypto.checkSignature(pod.publicKey, signatureShouldBe, req.body.signature.signature) | ||
27 | 34 | ||
28 | if (signatureOk === true) { | 35 | if (signatureOk === true) { |
29 | res.locals.secure = { | 36 | res.locals.secure = { |