Hello Folks,
Maybe some of the devs can look into:
https://github.com/openpgpjs/openpgpjs/issues/310
A minor issue:
I am the developer of Zimbra OpenPGP Zimlet extenstion that adds PGP to Zimbra 
using OpenPGP.js.For some time I have been ignoring a type error, that I 
believe may be a bug in OpenPGP.js.
The following type error is thrown when a user tries to decrypt a message with 
a wrong private key. For example when Jeff tries to decrypt a message encrypted 
to Barry [email protected] with the private key of [email protected], this 
should not work and it isn't, but I cannot suppress the error thrown in the 
browsers console:TypeError: Cannot read property 'isDecrypted' of nullat 
Message.decrypt (deflate.js:13)at deflate.js:13at deflate.js:13at execute 
(deflate.js:13)at Object.decryptMessage (deflate.js:13)at 
DedicatedWorkerGlobalScope.self.onmessage (openpgp.worker.js:94)
Without worker.js the error is:TypeError: Cannot read property 'isDecrypted' of 
nullat Message.decrypt (deflate.js:13)at deflate.js:13at deflate.js:13at 
execute (deflate.js:13)at Object.decryptMessage (deflate.js:13)at 
decrypt-test1.html:175
This happens using the latest code on Github,
Example code:var message = 
openpgp.message.readArmored(document.getElementById('message').value);openpgp.decryptMessage(privKey,
 message).then(// I cannot place a try statement herefunction(decrypted) 
{console.log(decrypted);document.write(decrypted);},function(err) 
{alert('Decryption failed!');});
The function (err) is executed and I see an alert, but I also get the console 
TypeError.Please handle the TypeError, at least when an error function is 
defined, or maybe explain how I should put a try...catch to avoid it.
I also created a test case for this issue. It can be git cloned 
from:https://github.com/barrydegraaff/pgp-zimlet/blob/master/test/decrypt-test1.html
                                      
_______________________________________________

http://openpgpjs.org
Subscribe/unsubscribe: http://list.openpgpjs.org

Reply via email to