mirror of
https://github.com/waku-org/js-noise.git
synced 2025-02-22 07:58:19 +00:00
fix: Send non-empty payload during handshake
This commit is contained in:
parent
056e6509a1
commit
698b8c9802
@ -240,7 +240,7 @@ export class WakuPairing {
|
|||||||
// At this point wakuMsg is sent over the Waku network to responder content topic
|
// At this point wakuMsg is sent over the Waku network to responder content topic
|
||||||
let encoder = new NoiseHandshakeEncoder(this.contentTopic, this.pubsubTopic, hsStep);
|
let encoder = new NoiseHandshakeEncoder(this.contentTopic, this.pubsubTopic, hsStep);
|
||||||
await this.sender.send(encoder, {
|
await this.sender.send(encoder, {
|
||||||
payload: new Uint8Array(),
|
payload: Uint8Array.from(Array.from("1st step of initiator handshake").map((letter) => letter.charCodeAt(0))),
|
||||||
});
|
});
|
||||||
|
|
||||||
// We generate an authorization code using the handshake state
|
// We generate an authorization code using the handshake state
|
||||||
@ -285,7 +285,7 @@ export class WakuPairing {
|
|||||||
|
|
||||||
encoder = new NoiseHandshakeEncoder(this.contentTopic, this.pubsubTopic, hsStep);
|
encoder = new NoiseHandshakeEncoder(this.contentTopic, this.pubsubTopic, hsStep);
|
||||||
await this.sender.send(encoder, {
|
await this.sender.send(encoder, {
|
||||||
payload: new Uint8Array(),
|
payload: Uint8Array.from(Array.from("3rd step of initiator handshake").map((letter) => letter.charCodeAt(0))),
|
||||||
});
|
});
|
||||||
|
|
||||||
// Secure Transfer Phase
|
// Secure Transfer Phase
|
||||||
@ -331,7 +331,7 @@ export class WakuPairing {
|
|||||||
// We prepare a Waku message from responder's payload2
|
// We prepare a Waku message from responder's payload2
|
||||||
const encoder = new NoiseHandshakeEncoder(this.contentTopic, this.pubsubTopic, hsStep);
|
const encoder = new NoiseHandshakeEncoder(this.contentTopic, this.pubsubTopic, hsStep);
|
||||||
await this.sender.send(encoder, {
|
await this.sender.send(encoder, {
|
||||||
payload: new Uint8Array(),
|
payload: Uint8Array.from(Array.from("2nd step of responder handshake").map((letter) => letter.charCodeAt(0))),
|
||||||
});
|
});
|
||||||
|
|
||||||
// 3rd step
|
// 3rd step
|
||||||
|
Loading…
x
Reference in New Issue
Block a user