mirror of
https://github.com/fluencelabs/js-libp2p-noise
synced 2025-04-25 04:42:28 +00:00
fix errors
This commit is contained in:
parent
6fa34d43f8
commit
ab94e8966e
@ -2,11 +2,11 @@
|
||||
"nested": {
|
||||
"NoiseHandshakePayload": {
|
||||
"fields": {
|
||||
"identity_key": {
|
||||
"identityKey": {
|
||||
"type": "bytes",
|
||||
"id": 1
|
||||
},
|
||||
"identity_sig": {
|
||||
"identitySig": {
|
||||
"type": "bytes",
|
||||
"id": 2
|
||||
},
|
||||
|
@ -79,8 +79,8 @@ export async function verifySignedPayload(noiseStaticKey: bytes, plaintext: byte
|
||||
);
|
||||
//temporary fix until protobufsjs conversion options starts working
|
||||
//by default it ends up as Uint8Array
|
||||
receivedPayload.libp2pKey = Buffer.from(receivedPayload.libp2pKey);
|
||||
receivedPayload.noiseStaticKeySignature = Buffer.from(receivedPayload.noiseStaticKeySignature);
|
||||
receivedPayload.identityKey = Buffer.from(receivedPayload.identityKey);
|
||||
receivedPayload.identitySig = Buffer.from(receivedPayload.identitySig);
|
||||
} catch (e) {
|
||||
throw new Error("Failed to decode received payload. Reason: " + e.message);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user