disable opportunistic encryption mode

This commit is contained in:
Vincent Breitmoser 2017-06-27 15:51:46 +02:00
parent 96c8396422
commit 9ab04c0931

View file

@ -144,7 +144,7 @@ public class PgpMessageBuilder extends MessageBuilder {
if(!isDraft()) {
pgpApiIntent.putExtra(OpenPgpApi.EXTRA_USER_IDS, cryptoStatus.getRecipientAddresses());
pgpApiIntent.putExtra(OpenPgpApi.EXTRA_OPPORTUNISTIC_ENCRYPTION, cryptoStatus.isEncryptionOpportunistic());
// pgpApiIntent.putExtra(OpenPgpApi.EXTRA_ENCRYPT_OPPORTUNISTIC, cryptoStatus.isEncryptionOpportunistic());
}
} else {
pgpApiIntent = new Intent(isPgpInlineMode ? OpenPgpApi.ACTION_SIGN : OpenPgpApi.ACTION_DETACHED_SIGN);
@ -202,6 +202,7 @@ public class PgpMessageBuilder extends MessageBuilder {
if (error == null) {
throw new MessagingException("internal openpgp api error");
}
/*
boolean isOpportunisticError = error.getErrorId() == OpenPgpError.OPPORTUNISTIC_MISSING_KEYS;
if (isOpportunisticError) {
if (!cryptoStatus.isEncryptionOpportunistic()) {
@ -211,6 +212,7 @@ public class PgpMessageBuilder extends MessageBuilder {
Timber.d("Skipping encryption due to opportunistic mode");
return null;
}
*/
throw new MessagingException(error.getMessage());
}