mirror of
https://github.com/moparisthebest/open-keychain
synced 2024-11-30 12:32:17 -05:00
This commit is contained in:
parent
4e425495e6
commit
51bb96742f
@ -178,13 +178,20 @@ public class PgpSignEncryptOperation extends BaseOperation {
|
|||||||
case PIN:
|
case PIN:
|
||||||
case PATTERN:
|
case PATTERN:
|
||||||
case PASSPHRASE: {
|
case PASSPHRASE: {
|
||||||
if (cryptoInput.getPassphrase() == null) {
|
Passphrase localPassphrase = cryptoInput.getPassphrase();
|
||||||
|
if (localPassphrase == null) {
|
||||||
|
try {
|
||||||
|
localPassphrase = getCachedPassphrase(signingKeyRing.getMasterKeyId(), signingKey.getKeyId());
|
||||||
|
} catch (PassphraseCacheInterface.NoSecretKeyException ignored) {
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (localPassphrase == null) {
|
||||||
log.add(LogType.MSG_PSE_PENDING_PASSPHRASE, indent + 1);
|
log.add(LogType.MSG_PSE_PENDING_PASSPHRASE, indent + 1);
|
||||||
return new PgpSignEncryptResult(log, RequiredInputParcel.createRequiredSignPassphrase(
|
return new PgpSignEncryptResult(log, RequiredInputParcel.createRequiredSignPassphrase(
|
||||||
signingKeyRing.getMasterKeyId(), signingKey.getKeyId(),
|
signingKeyRing.getMasterKeyId(), signingKey.getKeyId(),
|
||||||
cryptoInput.getSignatureTime()));
|
cryptoInput.getSignatureTime()));
|
||||||
}
|
}
|
||||||
if (!signingKey.unlock(cryptoInput.getPassphrase())) {
|
if (!signingKey.unlock(localPassphrase)) {
|
||||||
log.add(LogType.MSG_PSE_ERROR_BAD_PASSPHRASE, indent);
|
log.add(LogType.MSG_PSE_ERROR_BAD_PASSPHRASE, indent);
|
||||||
return new PgpSignEncryptResult(PgpSignEncryptResult.RESULT_ERROR, log);
|
return new PgpSignEncryptResult(PgpSignEncryptResult.RESULT_ERROR, log);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user