1
0
Fork 0
mirror of https://github.com/pgpainless/pgpainless.git synced 2024-11-27 06:42:05 +01:00

Fix equality check in CallbackBasedKeyringProtector

This commit is contained in:
Paul Schaub 2021-02-25 23:11:17 +01:00
parent e661908c5f
commit 8c041e6856
Signed by: vanitasvitae
GPG key ID: 62BEE9264BF17311

View file

@ -50,7 +50,7 @@ public class CallbackBasedKeyringProtector implements SecretKeyRingProtector2 {
@Override @Override
public PBESecretKeyEncryptor getEncryptor(PGPSecretKey key) throws PGPException { public PBESecretKeyEncryptor getEncryptor(PGPSecretKey key) throws PGPException {
Passphrase passphrase = lookupPassphraseInCache(key); Passphrase passphrase = lookupPassphraseInCache(key);
if (passphrase != null) { if (passphrase == null) {
passphrase = callback.getPassphraseFor(key); passphrase = callback.getPassphraseFor(key);
passphraseCache.put(key.getKeyID(), passphrase); passphraseCache.put(key.getKeyID(), passphrase);
} }