PGPro icon indicating copy to clipboard operation
PGPro copied to clipboard

Add support for keys with subkeys only

Open craisp opened this issue 3 years ago • 4 comments

Hi there

I've followed the Debian's guide on generating a keypair using subkeys for decrypt, authenticate and sign. When I try to import this key to the App, it crashes.

Here are 3 files, like I use them: private.gpg-key.txt private.master.gpg-key.txt public.gpg-key.txt

  • private.master.gpg-key.txt: this is the master secret key. Only this key has the capability to certify. This one I have on an encrypted usb drive and not on my laptop.
  • private.gpg-key.txt: this is the secret key (only subkeys) I store on the laptop and use all the time to decrypt, authenticate and sign. But it has no capabilities to certify. Therefore the damage is limited, if it gets compromised.
  • public.gpg-key.txt: the corresponding public key to encrypt and verify.

Steps to reproduce: Click the "+" Symbol in the app to import a key. Select private.gpg-key.txt from a USB drive or iPhone Documents. App crashes.

I'd be happy if you could take a look. Thanks

craisp avatar Jul 19 '20 18:07 craisp

Thanks reporting this! Importing the secret key in private.gpg-key.txt triggers an assertion failure in the cryptography framework:

2020-07-20 19:58:40.439760+0200 PGPro[35698:1882528] *** Assertion failure in -[PGPSecretKeyPacket buildSecretKeyDataAndForceV4:], /Users/marcinkrzyzanowski/Devel/ObjectivePGP/ObjectivePGP/Packets/PGPSecretKeyPacket.m:354
2020-07-20 19:58:40.458873+0200 PGPro[35698:1882528] *** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'Require IV'

It seems that ObjectivePGP doesn't find an initialization vector in the key packet. I'll try and look further into this.

lucanaef avatar Jul 20 '20 18:07 lucanaef

Thanks for replying so quickly! Ok, this seems to me, that it is rather a problem with the ObjectivePGP library than in the app? Would it be better to open an issue there? By the way: if you need the passphrase for the secret key posted above, it's: "very secure passphrase!" (without the quotes but with whitespace and exclamation mark).

craisp avatar Jul 20 '20 19:07 craisp

Hello Luca, Many thanks for your app. I realize that the bug report I mailed to you on April 21st was probably about the same problem. Best regards Pascal

Details :

  • The app crashes each time I try to import my personal keys (exported into an .asc file through gpg keychain (MacOS Catalina).
  • The asc file is copied to the iPhone through a usb cable using MacOS finder.
  • My keys includes : one main pair of keys, three subkeys for signing, encrypting, authenticating, all using RSA 4096.
  • The crash only occurs when the main secret key is not present in the .asc file.
  • When both the secret key and subkeys are present, all is fine.
  • iPhone X, iOS 14.4.2

SailingDad avatar May 01 '21 09:05 SailingDad

Thank you @craisp and @SailingDad! Good news: I've now finally been able to fix this issue. Bad news: Keys with subkeys only are still not supported (because the cryptography framework can't handle them), but at least the app won't crash anymore.

lucanaef avatar May 05 '21 11:05 lucanaef