Fix passphrase retrieval

This commit is contained in:
Dominik Schürmann 2014-03-05 02:06:44 +01:00
parent 875adae40c
commit a1230bbe53

View File

@ -310,16 +310,18 @@ public class PgpDecryptVerify {
pbe = encData; pbe = encData;
// passphrase handling... // if no passphrase was explicitly set try to get it from the cache service
if (passphrase == null) { if (passphrase == null) {
// try to get cached passphrase // returns "" if key has no passphrase
passphrase = PassphraseCacheService.getCachedPassphrase(context, encData.getKeyID()); passphrase = PassphraseCacheService.getCachedPassphrase(context, encData.getKeyID());
}
// if passphrase was not cached, return here! // if passphrase was not cached, return here indicating that a passphrase is missing!
if (passphrase == null) { if (passphrase == null) {
returnData.setKeyPassphraseNeeded(true); returnData.setKeyPassphraseNeeded(true);
return returnData; return returnData;
} }
}
break; break;
} }