fix errors

This commit is contained in:
Marin Petrunić 2020-02-06 09:57:10 +01:00
parent 6fa34d43f8
commit ab94e8966e
No known key found for this signature in database
GPG Key ID: 834D07135E110DA5
2 changed files with 4 additions and 4 deletions

View File

@ -2,11 +2,11 @@
"nested": {
"NoiseHandshakePayload": {
"fields": {
"identity_key": {
"identityKey": {
"type": "bytes",
"id": 1
},
"identity_sig": {
"identitySig": {
"type": "bytes",
"id": 2
},

View File

@ -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);
}