From a1d826e37684c2ecd93fb4516f660f931a2d63ff Mon Sep 17 00:00:00 2001 From: Derrick Hammer Date: Sat, 19 Nov 2022 20:35:23 -0500 Subject: [PATCH] *Ensure we are parsing the public key in hex format --- src/DHTDataBase.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/DHTDataBase.ts b/src/DHTDataBase.ts index 24e0abc..43c036a 100644 --- a/src/DHTDataBase.ts +++ b/src/DHTDataBase.ts @@ -281,7 +281,11 @@ export default class DHTDataBase extends EventEmitter { if ( signature && - crypto.verify(b4a.from(`${timestamp}${data}`), signature, b4a.from(id)) + crypto.verify( + b4a.from(`${timestamp}${data}`), + signature, + b4a.from(id, "hex") + ) ) { const parsedData = data ? orderedJSON.parse(data) : null; let peerData = parsedData || {};