abhidas17695 / dweb-ext

0 stars 0 forks source link

signature not verifying #14

Closed mitra42 closed 6 years ago

mitra42 commented 6 years ago

I'm seeing sometimes (but not always) that signatures aren't verifying, I havent figured out the pattern of why yet. .. I'll try and debug this as it looks like its in my code.

mitra42 commented 6 years ago
dweb-ext.start: https://dweb.archive.org/
transports-bundle.js:27309 WebTorrent options {webtorrent: {…}, statuselement: null, transports: Array(0)}
2transports-bundle.js:27294 WEBTORRENT READY
2transports-bundle.js:28603 Fetch finished loading: GET "https://dweb.me/info".
loopfetch @ transports-bundle.js:28603
httptools.p_httpfetch @ transports-bundle.js:28634
httptools.p_GET @ transports-bundle.js:28679
p_info @ transports-bundle.js:26818
p_status @ transports-bundle.js:26663
p_setup1 @ transports-bundle.js:26653
Promise.all._transports.filter.map @ transports-bundle.js:28432
p_setup1 @ transports-bundle.js:28432
p_connect @ transports-bundle.js:28486
main @ bootloader.js:7
start @ bootloader.js:63
chrome.webRequest.onCompleted.addListener.urls @ bootloader.js:53
EventImpl.dispatchToListener @ extensions::event_bindings:403
publicClassPrototype.(anonymous function) @ extensions::utils:138
EventImpl.dispatch_ @ extensions::event_bindings:387
dispatchArgs @ extensions::event_bindings:260
dispatchEvent @ extensions::event_bindings:269
transports-bundle.js:26942 IPFS READY {version: "0.29.3", repo: 6, commit: ""}
transports-bundle.js:26942 IPFS READY {version: "0.29.3", repo: 6, commit: ""}
bootloader.js:2 dweb-ext loading URL:  https://dweb.archive.org/
bootloader.js:2 Resolving name:  arc/archive.org
objects-bundle.js:23407 Resolving: arc/archive.org
objects-bundle.js:23430 resolving arc/archive.org in 
objects-bundle.js:23430 resolving archive.org in arc
objects-bundle.js:23416 Resolved path arc/archive.org to archive.org @ https://dweb.me:443/getall/table/NACL%20VERIFY%3AdZHrTMea0OgOF2zI6GsAN-rlcTa4ejcyGj_TSg_cwEY%3D/domain
... 
objects-bundle.js:23430 resolving . in archive.org
objects-bundle.js:23146 Invalid signature SigningError: Signature not verified
    at KeyPair.verify (chrome-extension://bpegplgnpnglnnhlepfjiahmfnbmcegp/scripts/objects-bundle.js:24341:28)
    at Leaf.SignatureMixin._verifySig (chrome-extension://bpegplgnpnglnnhlepfjiahmfnbmcegp/scripts/objects-bundle.js:23144:53)
    at signatures.filter.sig (chrome-extension://bpegplgnpnglnnhlepfjiahmfnbmcegp/scripts/objects-bundle.js:23156:33)
    at Array.filter (<anonymous>)
    at Leaf.SignatureMixin._verifyOwnSigs (chrome-extension://bpegplgnpnglnnhlepfjiahmfnbmcegp/scripts/objects-bundle.js:23156:14)
    at Domain.verify (chrome-extension://bpegplgnpnglnnhlepfjiahmfnbmcegp/scripts/objects-bundle.js:23367:26)
    at Domain.p_resolve (chrome-extension://bpegplgnpnglnnhlepfjiahmfnbmcegp/scripts/objects-bundle.js:23437:18)
SignatureMixin._verifySig @ objects-bundle.js:23146
signatures.filter.sig @ objects-bundle.js:23156
SignatureMixin._verifyOwnSigs @ objects-bundle.js:23156
verify @ objects-bundle.js:23367
p_resolve @ objects-bundle.js:23437
async function (async)
p_resolve @ objects-bundle.js:23448
p_resolveAndBoot @ objects-bundle.js:23636
async function (async)
p_resolveAndBoot @ objects-bundle.js:23646
p_bootname @ bootloader.js:36
main @ bootloader.js:29
async function (async)
main @ bootloader.js:6
start @ bootloader.js:63
chrome.webRequest.onCompleted.addListener.urls @ bootloader.js:53
EventImpl.dispatchToListener @ extensions::event_bindings:403
publicClassPrototype.(anonymous function) @ extensions::utils:138
EventImpl.dispatch_ @ extensions::event_bindings:387
dispatchArgs @ extensions::event_bindings:260
dispatchEvent @ extensions::event_bindings:269
bootloader.js:38 Got error Error: Unable to open any URL in Leaf
    at Leaf.p_boot (objects-bundle.js:23291)
    at Function.p_resolveAndBoot (objects-bundle.js:23640)
p_bootname @ bootloader.js:38
async function (async)
p_bootname @ bootloader.js:41
main @ bootloader.js:29
async function (async)
main @ bootloader.js:6
start @ bootloader.js:63
chrome.webRequest.onCompleted.addListener.urls @ bootloader.js:53
EventImpl.dispatchToListener @ extensions::event_bindings:403
publicClassPrototype.(anonymous function) @ extensions::utils:138
EventImpl.dispatch_ @ extensions::event_bindings:387
dispatchArgs @ extensions::event_bindings:260
dispatchEvent @ extensions::event_bindings:269
bootloader.js:2 Unable to open any URL in Leaf
bootloader.js:61 dweb-ext.start: https://dweb.me/archive/archive.html
bootloader.js:61 dweb-ext.start: https://dweb.me/getall/table/NACL%20VERIFY%3AdZHrTMea0OgOF2zI6GsAN-rlcTa4ejcyGj_TSg_cwEY%3D/domain
mitra42 commented 6 years ago

I'm seeing verification of a "signable" that misses the URLs but not succeeding in catching it with a breakpoint I can make happen.

mitra42 commented 6 years ago

This is complex, because it involves your code and mine (including some recently changed code), so its only going to be solvable if we have a process to solve it. This should not be happening on current code, using current data - but its always possible (even likely) there is a bug in my code.

a) We need to check that you have current code with the changes - this requires #18 (build instructions) so I can see what code you've got in the extension and how it is being built.

b) You need to have a repeatable way to build the extension so that it demonstrates this bug, and then a series of steps to repeat the bug so that I can repeat this test while looking at my code and potentially adding debugging info and recompiling (see #18 again).

c) I have some suspicions that it is caused by #16 and that something in the load of bootloader.html is interfering, for example loading a different library that sets the same globals. This is hard to pin down because if you intercept www.iskme.org then you don't hit bootloader.html (because www.iskme.org is not a resolvable name) but its quite possible that the reason we aren't seeing the problem with the new test code because the new test procedure with www.iskme.org doesnt ever try and load bootloader.html

mitra42 commented 6 years ago

Re (a) - I've checked using diff, and the code appears to only have minor other divergences from the current master branch of dweb-transports and dweb-objects, see #18 to make sure we have a process for keeping them updated.

mitra42 commented 6 years ago

21 (new commit) says this error is back again, I am unable to repeat it.

Can you a) make sure to completely clear your cache, and check that in the Network tab you have disabled cache b) try and repeat - if you can, then post STR (Steps To Repeat). c) if you can't repeat in that mode, turn back on the caching and see if it repeats, again STR reqd

mitra42 commented 6 years ago

This is fixed in #27 - it was a nasty bug where p_boot was looping on urls in the Leaf record, shifting them from the Array, but this wasnt a copy of the Leaf, it was the same actual object as the one in the cache. So on the next load this record had been changed and no longer verified its signature.