|
1 | | -const {Routines} = require('@dataparty/crypto') |
| 1 | +const {Routines, Identity} = require('@dataparty/crypto') |
2 | 2 | const debug = require('debug')('dataparty.comms.peercomms') |
3 | 3 | const uuidv4 = require('uuid/v4') |
4 | 4 | const HttpMocks = require('node-mocks-http') |
@@ -365,9 +365,9 @@ class PeerComms extends ISocketComms { |
365 | 365 |
|
366 | 366 | const offerBSON = Routines.BSON.serializeBSONWithoutOptimiser( op.input.offer ) |
367 | 367 | const offer = { |
368 | | - sender: aesStreamOffer.sender, |
369 | | - pqCipherText: aesStreamOffer.pqCipherText, |
370 | | - streamNonce: aesStreamOffer.streamNonce |
| 368 | + sender: new Identity(op.input.offer.sender), |
| 369 | + pqCipherText: op.input.offer.pqCipherText, |
| 370 | + streamNonce: op.input.offer.streamNonce |
371 | 371 | } |
372 | 372 |
|
373 | 373 | const signature = { |
@@ -400,10 +400,12 @@ class PeerComms extends ISocketComms { |
400 | 400 | debug('DENY - client not allowed - ', this.remoteIdentity) |
401 | 401 | } |
402 | 402 |
|
403 | | - this.aesStream = this.party.privateIdentity.recoverStream(offer, true) |
| 403 | + |
404 | 404 |
|
405 | 405 | debug('ALLOW - allowing client - ', this.remoteIdentity) |
406 | 406 |
|
| 407 | + this.aesStream = await this.party.privateIdentity.recoverStream(offer, true) |
| 408 | + |
407 | 409 | clearTimeout(this._host_auth_timeout) |
408 | 410 | this._host_auth_timeout = null |
409 | 411 |
|
|
0 commit comments