flutter-openpgp icon indicating copy to clipboard operation
flutter-openpgp copied to clipboard

Crash in readPrivateKeys when the input contains both public and private keys

Open tallinn1960 opened this issue 3 years ago • 2 comments

Is it correct that the current version of openpgp, 3.4.0, does not support DSA/ElGamal keys, but RSA keys only?

As openpgp is crashing within the go code in

  • thread #43, name = 'DartWorker', stop reason = EXC_BAD_ACCESS (code=1, address=0xe0) frame #0: 0x00000001049e50cc Runnergithub.com/jerson/openpgp-mobile/openpgp.(*FastOpenPGP).readPrivateKeys + 124 Runnergithub.com/jerson/openpgp-mobile/openpgp.(*FastOpenPGP).readPrivateKeys: -> 0x1049e50cc <+124>: ldrb w6, [x6, #0xe0] 0x1049e50d0 <+128>: cbz x6, 0x1049e50b8 ; <+104> 0x1049e50d4 <+132>: str x3, [sp, #0x60] 0x1049e50d8 <+136>: str x5, [sp, #0x78]

(this is on iOS)

when asked to decypt a cryptotext with a DSA/Elgamal key.

tallinn1960 avatar Aug 05 '22 13:08 tallinn1960

Hi @tallinn1960 yeah you are right currently we only support RSA but Im gonna start doing a research to include more, it May require some extra time but I will notify you when that become implemented

jerson avatar Aug 05 '22 13:08 jerson

Well, it turned out that not the key algorithm was the problem, but the mix of private and public keys in the string I gave to a verify operation. I changed the subject here accordingly.

And now suprisingly the test I wrote using a DSA/ElGamal-Key for decryption worked and produced plaintext. So there is support for those keys. Note that these type of keys is different to ECC keys, although the algorithms share some of the math

tallinn1960 avatar Aug 05 '22 16:08 tallinn1960