aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/helpers/peertube-crypto.ts
diff options
context:
space:
mode:
authorChocobozzz <florian.bigard@gmail.com>2017-11-16 11:08:25 +0100
committerChocobozzz <florian.bigard@gmail.com>2017-11-27 19:40:52 +0100
commitefc32059d980c51793e8e9ac0fb6a885a8026f94 (patch)
treec272e63fd57a9625b53dc26ceb1b46aee35d21d3 /server/helpers/peertube-crypto.ts
parentd846501818c2d29e66e6fd141789cb04fd55a437 (diff)
downloadPeerTube-efc32059d980c51793e8e9ac0fb6a885a8026f94.tar.gz
PeerTube-efc32059d980c51793e8e9ac0fb6a885a8026f94.tar.zst
PeerTube-efc32059d980c51793e8e9ac0fb6a885a8026f94.zip
Send server announce when users upload a video
Diffstat (limited to 'server/helpers/peertube-crypto.ts')
-rw-r--r--server/helpers/peertube-crypto.ts10
1 files changed, 5 insertions, 5 deletions
diff --git a/server/helpers/peertube-crypto.ts b/server/helpers/peertube-crypto.ts
index 6d50e446f..04a8d5681 100644
--- a/server/helpers/peertube-crypto.ts
+++ b/server/helpers/peertube-crypto.ts
@@ -1,4 +1,6 @@
1import * as jsonld from 'jsonld'
1import * as jsig from 'jsonld-signatures' 2import * as jsig from 'jsonld-signatures'
3jsig.use('jsonld', jsonld)
2 4
3import { 5import {
4 PRIVATE_RSA_KEY_SIZE, 6 PRIVATE_RSA_KEY_SIZE,
@@ -9,9 +11,7 @@ import {
9 bcryptGenSaltPromise, 11 bcryptGenSaltPromise,
10 bcryptHashPromise, 12 bcryptHashPromise,
11 createPrivateKey, 13 createPrivateKey,
12 getPublicKey, 14 getPublicKey
13 jsonldSignPromise,
14 jsonldVerifyPromise
15} from './core-utils' 15} from './core-utils'
16import { logger } from './logger' 16import { logger } from './logger'
17import { AccountInstance } from '../models/account/account-interface' 17import { AccountInstance } from '../models/account/account-interface'
@@ -45,7 +45,7 @@ function isSignatureVerified (fromAccount: AccountInstance, signedDocument: obje
45 publicKeyOwner: publicKeyOwnerObject 45 publicKeyOwner: publicKeyOwnerObject
46 } 46 }
47 47
48 return jsonldVerifyPromise(signedDocument, options) 48 return jsig.promises.verify(signedDocument, options)
49 .catch(err => { 49 .catch(err => {
50 logger.error('Cannot check signature.', err) 50 logger.error('Cannot check signature.', err)
51 return false 51 return false
@@ -58,7 +58,7 @@ function signObject (byAccount: AccountInstance, data: any) {
58 creator: byAccount.url 58 creator: byAccount.url
59 } 59 }
60 60
61 return jsonldSignPromise(data, options) 61 return jsig.promises.sign(data, options)
62} 62}
63 63
64function comparePassword (plainPassword: string, hashPassword: string) { 64function comparePassword (plainPassword: string, hashPassword: string) {