aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDaniel Gultsch <daniel@gultsch.de>2016-03-20 17:24:15 +0100
committerDaniel Gultsch <daniel@gultsch.de>2016-03-20 17:24:15 +0100
commitb51ce43d36aad7633ac504b952be65a05116e20e (patch)
treed539b10a127dcee18e3e42a006f6b91d4b22431e
parentc4b1f6171d2bf82e44a3ba567f7732cc8beef717 (diff)
don't show v\omemo keys as such if not enabled
-rw-r--r--src/main/java/eu/siacs/conversations/ui/ContactDetailsActivity.java2
-rw-r--r--src/main/java/eu/siacs/conversations/ui/XmppActivity.java7
2 files changed, 5 insertions, 4 deletions
diff --git a/src/main/java/eu/siacs/conversations/ui/ContactDetailsActivity.java b/src/main/java/eu/siacs/conversations/ui/ContactDetailsActivity.java
index 4165b4be..e4fc59fa 100644
--- a/src/main/java/eu/siacs/conversations/ui/ContactDetailsActivity.java
+++ b/src/main/java/eu/siacs/conversations/ui/ContactDetailsActivity.java
@@ -456,7 +456,7 @@ public class ContactDetailsActivity extends XmppActivity implements OnAccountUpd
private void onOmemoKeyClicked(Account account, String fingerprint) {
final XmppAxolotlSession.Trust trust = account.getAxolotlService().getFingerprintTrust(fingerprint);
- if (trust != null && trust == XmppAxolotlSession.Trust.TRUSTED_X509) {
+ if (Config.X509_VERIFICATION && trust != null && trust == XmppAxolotlSession.Trust.TRUSTED_X509) {
X509Certificate x509Certificate = account.getAxolotlService().getFingerprintCertificate(fingerprint);
if (x509Certificate != null) {
showCertificateInformationDialog(CryptoHelper.extractCertificateInformation(x509Certificate));
diff --git a/src/main/java/eu/siacs/conversations/ui/XmppActivity.java b/src/main/java/eu/siacs/conversations/ui/XmppActivity.java
index c7bf738c..fe3a3031 100644
--- a/src/main/java/eu/siacs/conversations/ui/XmppActivity.java
+++ b/src/main/java/eu/siacs/conversations/ui/XmppActivity.java
@@ -737,14 +737,15 @@ public abstract class XmppActivity extends Activity {
view.setOnLongClickListener(purge);
key.setOnLongClickListener(purge);
keyType.setOnLongClickListener(purge);
- boolean x509 = trust == XmppAxolotlSession.Trust.TRUSTED_X509 || trust == XmppAxolotlSession.Trust.INACTIVE_TRUSTED_X509;
+ boolean x509 = Config.X509_VERIFICATION
+ && (trust == XmppAxolotlSession.Trust.TRUSTED_X509 || trust == XmppAxolotlSession.Trust.INACTIVE_TRUSTED_X509);
switch (trust) {
case UNTRUSTED:
case TRUSTED:
case TRUSTED_X509:
trustToggle.setChecked(trust.trusted(), false);
- trustToggle.setEnabled(trust != XmppAxolotlSession.Trust.TRUSTED_X509);
- if (trust == XmppAxolotlSession.Trust.TRUSTED_X509) {
+ trustToggle.setEnabled(!Config.X509_VERIFICATION || trust != XmppAxolotlSession.Trust.TRUSTED_X509);
+ if (Config.X509_VERIFICATION && trust == XmppAxolotlSession.Trust.TRUSTED_X509) {
trustToggle.setOnClickListener(null);
}
key.setTextColor(getPrimaryTextColor());