mirror of
https://github.com/moparisthebest/open-keychain
synced 2024-11-23 17:22:16 -05:00
Fix nullpointer with getS2K()
This commit is contained in:
parent
675d2bd6dd
commit
a125b51b1c
@ -145,7 +145,8 @@ public class CanonicalizedSecretKey extends CanonicalizedPublicKey {
|
||||
*/
|
||||
public boolean unlock(String passphrase) throws PgpGeneralException {
|
||||
// handle keys on OpenPGP cards like they were unlocked
|
||||
if (mSecretKey.getS2K().getType() == S2K.GNU_DUMMY_S2K
|
||||
if (mSecretKey.getS2K() != null
|
||||
&& mSecretKey.getS2K().getType() == S2K.GNU_DUMMY_S2K
|
||||
&& mSecretKey.getS2K().getProtectionMode() == S2K.GNU_PROTECTION_MODE_DIVERT_TO_CARD) {
|
||||
mPrivateKeyState = PRIVATE_KEY_STATE_DIVERT_TO_CARD;
|
||||
return true;
|
||||
|
Loading…
Reference in New Issue
Block a user