standardnotes / desktop

[Moved to https://github.com/standardnotes/app] A free, open-source, and end-to-end encrypted notes app. https://standardnotes.com
GNU Affero General Public License v3.0
1.4k stars 115 forks source link

Can't unlock 2.3.5 #234

Closed Marsup closed 5 years ago

Marsup commented 6 years ago

When I try to unlock the new 2.3.5, I get this stack trace:

Uncaught (in promise) TypeError: Cannot read property 'length' of null
    at SFCryptoWeb._callee106$ (file:///tmp/.mount_standa7BBIQk/app/resources/app.asar/dist/standard-notes-web/javascripts/compiled.js:62508:48)
    at tryCatch (file:///tmp/.mount_standa7BBIQk/app/resources/app.asar/dist/standard-notes-web/javascripts/compiled.js:62:40)
    at Generator.invoke [as _invoke] (file:///tmp/.mount_standa7BBIQk/app/resources/app.asar/dist/standard-notes-web/javascripts/compiled.js:296:22)
    at Generator.prototype.(anonymous function) [as next] (file:///tmp/.mount_standa7BBIQk/app/resources/app.asar/dist/standard-notes-web/javascripts/compiled.js:114:21)
    at step (file:///tmp/.mount_standa7BBIQk/app/resources/app.asar/dist/standard-notes-web/javascripts/compiled.js:55356:191)
    at file:///tmp/.mount_standa7BBIQk/app/resources/app.asar/dist/standard-notes-web/javascripts/compiled.js:55356:437
    at Promise (<anonymous>)
    at SFCryptoWeb.<anonymous> (file:///tmp/.mount_standa7BBIQk/app/resources/app.asar/dist/standard-notes-web/javascripts/compiled.js:55356:99)
    at SFCryptoWeb.hexStringToArrayBuffer (file:///tmp/.mount_standa7BBIQk/app/resources/app.asar/dist/standard-notes-web/javascripts/compiled.js:62521:24)
    at SFCryptoWeb._callee99$ (file:///tmp/.mount_standa7BBIQk/app/resources/app.asar/dist/standard-notes-web/javascripts/compiled.js:62215:29)

I'm using the AppImage version. Not sure which other detail to provide.

moughxyz commented 6 years ago

Can you confirm whether this also happens in 2.3.4?

Marsup commented 6 years ago

It didn't, should I downgrade to check?

moughxyz commented 6 years ago

Yes, try that downgrading temporarily.

Marsup commented 6 years ago

2.3.4 works.

There's also another regression:

Error: /tmp/.org.chromium.Chromium.1Zpz68: invalid ELF header
    at process.module.(anonymous function) [as dlopen] (ELECTRON_ASAR.js:172:20)
    at Object.Module._extensions..node (module.js:598:18)
    at Object.module.(anonymous function) [as .node] (ELECTRON_ASAR.js:186:18)
    at Module.load (module.js:503:32)
    at tryModuleLoad (module.js:466:12)
    at Function.Module._load (module.js:458:3)
    at Module.require (module.js:513:17)
    at require (internal/module.js:11:18)
    at Object.<anonymous> (/tmp/.mount_standaUWMctt/app/resources/app.asar/node_modules/spellchecker/lib/spellchecker.js:3:16)
    at Object.<anonymous> (/tmp/.mount_standaUWMctt/app/resources/app.asar/node_modules/spellchecker/lib/spellchecker.js:108:3)
moughxyz commented 6 years ago

I just spent some time trying to replicate this but was unable to do so. The issue in this case appears to be a null IV when attempting decryption. This is the line in question: https://github.com/standardfile/sfjs/blob/master/lib/crypto/api/webcrypto.js#L78

Can you shoot me an email at mo@standardnotes.org with the localStorage of these two keys: encryptedStorage and offlineParams. You can retrieve these values using the developer console Application tab, then Local Storage, then file://. The params are encrypted, so I will not be able to see any sensitive data. Just want to ensure that the required params are still there. If you'd like, you can replace some letters in the ciphertext with other random ones, keeping the general structure intact. I won't be machine processing these keys, just looking at them with my eyes, so they don't actually need to be correct values (if that makes sense).

If you randomize the info enough, you're also free to post the info here as well.

moughxyz commented 6 years ago

Actually, hold on that. I think I may have reproduced the issue. Putting together an update right now.

moughxyz commented 6 years ago

Can you try the 2.3.6 prerelease here and see if that fixes the issue? https://github.com/standardnotes/desktop/releases/tag/v2.3.6

Marsup commented 6 years ago

I can now access the app, the last stack trace is still there, meaning the spellchecker is broken, but I don't really mind. Feel free to close this issue unless you want to keep track of it here.

moughxyz commented 6 years ago

Ah didn't realize the other issue was related to spellcheck. Will have to investigate that one.