Browse Source

check sig length

hosting-provider
Evan Feenstra 5 years ago
parent
commit
482e15eb5f
  1. 6
      api/network/receive.ts
  2. 6
      dist/api/network/receive.js
  3. 2
      dist/api/network/receive.js.map

6
api/network/receive.ts

@ -181,8 +181,12 @@ async function parseAndVerifyPayload(data){
console.log('=======> payload.sender.pub_key',payload.sender.pub_key)
console.log('=======> sig',sig)
console.log('=======> sig.length',sig.length)
const v = await signer.verifyAscii(msg, sig, payload.sender.pub_key)
let v
if(sig.length===96) {
v = await signer.verifyAscii(msg, sig, payload.sender.pub_key)
}
if(v && v.valid) {
console.log("IS VALID => ",v.valid)
return payload
} else {
return payload // => RM THIS

6
dist/api/network/receive.js

@ -205,8 +205,12 @@ function parseAndVerifyPayload(data) {
console.log('=======> payload.sender.pub_key', payload.sender.pub_key);
console.log('=======> sig', sig);
console.log('=======> sig.length', sig.length);
const v = yield signer.verifyAscii(msg, sig, payload.sender.pub_key);
let v;
if (sig.length === 96) {
v = yield signer.verifyAscii(msg, sig, payload.sender.pub_key);
}
if (v && v.valid) {
console.log("IS VALID => ", v.valid);
return payload;
}
else {

2
dist/api/network/receive.js.map

File diff suppressed because one or more lines are too long
Loading…
Cancel
Save