mirror of
https://github.com/pgpainless/pgpainless.git
synced 2024-12-27 13:28:00 +01:00
Fix BaseSecretKeyRingProtector misinterpreting empty passphrases
This commit is contained in:
parent
14c1cf013e
commit
e7d0cf9c00
1 changed files with 2 additions and 2 deletions
|
@ -36,7 +36,7 @@ public class BaseSecretKeyRingProtector implements SecretKeyRingProtector {
|
|||
@Nullable
|
||||
public PBESecretKeyDecryptor getDecryptor(Long keyId) throws PGPException {
|
||||
Passphrase passphrase = passphraseProvider.getPassphraseFor(keyId);
|
||||
return passphrase == null ? null :
|
||||
return passphrase == null || passphrase.isEmpty() ? null :
|
||||
ImplementationFactory.getInstance().getPBESecretKeyDecryptor(passphrase);
|
||||
}
|
||||
|
||||
|
@ -44,7 +44,7 @@ public class BaseSecretKeyRingProtector implements SecretKeyRingProtector {
|
|||
@Nullable
|
||||
public PBESecretKeyEncryptor getEncryptor(Long keyId) throws PGPException {
|
||||
Passphrase passphrase = passphraseProvider.getPassphraseFor(keyId);
|
||||
return passphrase == null ? null :
|
||||
return passphrase == null || passphrase.isEmpty() ? null :
|
||||
ImplementationFactory.getInstance().getPBESecretKeyEncryptor(
|
||||
protectionSettings.getEncryptionAlgorithm(),
|
||||
protectionSettings.getHashAlgorithm(),
|
||||
|
|
Loading…
Reference in a new issue