FlowCrypt / flowcrypt-browser

FlowCrypt Browser extension for Chrome and Firefox
https://flowcrypt.com
Other
372 stars 46 forks source link

"Cannot read property 'toUint8Array' of undefined" when uploading private key #3748

Open seisvelas opened 3 years ago

seisvelas commented 3 years ago

The user has a key created via keybase and can't import it into FlowCrypt. Here is what the compatibility check says:

(1) Primary keys found: 1 
(2) ----- Testing key 0 ----- 
(3) PK 0 > Key type: openpgp 
(4) PK 0 > Is Private?: [-] true 
(5) PK 0 > User id 0: REDACTED_USER0
(6) PK 0 > User id 1: REDACTED_USER1
(7) PK 0 > Primary User: REDACTED_USER0
(8) PK 0 > Fingerprint: REDACTED_XXX
(9) PK 0 > Subkeys: [-] 1 
(10) PK 0 > Primary key algo: [-] rsa_encrypt_sign 
(11) PK 0 > Usage flags: [-] [sign_data, certify_keys] 
(12) PK 0 > key decrypt: [-] true 
(13) PK 0 > isFullyDecrypted: [-] true 
(14) PK 0 > isFullyEncrypted: [-] false 
(15) PK 0 > Primary key verify: [-] valid 
(16) PK 0 > Primary key creation?: [-] 1490277161 or 2017-03-23T13:52:41.000Z 
(17) PK 0 > Primary key expiration?: [-] 1994853161 or 2033-03-19T13:52:41.000Z 
(18) PK 0 > Encrypt/Decrypt test: Encryption with key was successful:  
(19) PK 0 > Encrypt/Decrypt test: Got error performing encryption/decryption test: TypeError: Error decrypting message: Cannot read property 'toUint8Array' of undefined:  
(20) PK 0 > Sign/Verify test: [-] sign msg ok|verify ok 
(21) PK 0 > SK 0 > LongId: [-] REDACTED_16bytes_hex_string
(22) PK 0 > SK 0 > Created: [-] 1490277161 or 2017-03-23T13:52:41.000Z 
(23) PK 0 > SK 0 > Algo: [-] rsa_encrypt_sign 
(24) PK 0 > SK 0 > Usage flags: [-] [encrypt_communication, encrypt_storage] 
(25) PK 0 > SK 0 > Verify: [-] OK 
(26) PK 0 > SK 0 > Subkey tag: [-] 7 
(27) PK 0 > SK 0 > Subkey getBitSize: [-] 4096 
(28) PK 0 > SK 0 > Subkey decrypted: [-] true 
(29) PK 0 > SK 0 > Binding signature length: [-] 1 
(30) PK 0 > SK 0 > SIG 0 > Key flags: [-] 12 
(31) PK 0 > SK 0 > SIG 0 > Tag: [-] 2 
(32) PK 0 > SK 0 > SIG 0 > Version: [-] 4 
(33) PK 0 > SK 0 > SIG 0 > Public key algorithm: [-] 1 
(34) PK 0 > SK 0 > SIG 0 > Sig creation time: [-] 1490277161 or 2017-03-23T13:52:41.000Z 
(35) PK 0 > SK 0 > SIG 0 > Sig expiration time: [-] 1490277161 + 504576000 seconds, which is: 1994853161 or 2033-03-19T13:52:41.000Z 
(36) PK 0 > SK 0 > SIG 0 > Verified: [-] true 
(37) PK 0 > expiration: [-] 1994853161000 
(38) PK 0 > internal dateBeforeExpiration: [-] undefined 
(39) PK 0 > internal usableForEncryptionButExpired: [-] false 
(40) PK 0 > internal usableForSigningButExpired: [-] false 

I've tried recreating this, but keys I make on keybase work just fine with FlowCrypt. So I'm posting this here in hopes that someone else has suggestions for how I can troubleshoot this from here.

ref: https://mail.google.com/mail/u/human@flowcrypt.com/#inbox/FMfcgzGkXcwqFsxjnSJLkzfJgqdMQxNr

tomholub commented 3 years ago

This would be hard to fix if we can't replicate it, unfortunately.

Could the user try if their key works in Mailvelope?

seisvelas commented 3 years ago

Asked user but have not received response, so I'm closing this for now. Will reopen if I receive a reply.

seisvelas commented 3 years ago

The key does indeed work on Mailvelope!

tomholub commented 3 years ago

They can encrypt/decrypt with this key on Mailvelope?

They could then export from Mailvelope and input into the compatibility check - see if it's any better.

seisvelas commented 3 years ago

From the user:

using mailvelope i can encrypt and the cyphertext can be decrypted on keybase with no issue. trying to decrypt an armor created with both keybase and command line gpg ( echo hello | gpg -a -r [user's email address here] --encrypt ) gives an error: Decryption of the text is not possible. Error decrypting message: Cannot read property 'toBN' of undefined

googling "gpg tobn property" throws fishes on my face :)

github-actions[bot] commented 3 years ago

There were 1 email addresses found in the above comment. Please:

1) click three dots -> edit to remove the email addresses 2) click edited in the comment header, and click on the previous revision of the comment 3) when viewing the old revision with an email in it, click options -> delete this revision from history

tomholub commented 3 years ago

When they open debug console and run the compatibility check, does it print any error to the console?