aboutsummaryrefslogtreecommitdiffstats
path: root/src/main/java/eu/siacs/conversations
diff options
context:
space:
mode:
authorDaniel Gultsch <daniel@gultsch.de>2016-01-22 11:20:31 +0100
committerDaniel Gultsch <daniel@gultsch.de>2016-01-22 11:20:31 +0100
commit40005cec1b1a864c529ead082a6e41a1471c874c (patch)
tree8e42c210500630e14e354d9724871afc69aa2fef /src/main/java/eu/siacs/conversations
parent77c0fb0b2ae257b7bf257417ed689f2334507f2c (diff)
added config variable to allow non-tls connections
Diffstat (limited to 'src/main/java/eu/siacs/conversations')
-rw-r--r--src/main/java/eu/siacs/conversations/Config.java3
-rw-r--r--src/main/java/eu/siacs/conversations/entities/Conversation.java2
-rw-r--r--src/main/java/eu/siacs/conversations/ui/ConversationActivity.java2
-rw-r--r--src/main/java/eu/siacs/conversations/xmpp/XmppConnection.java5
4 files changed, 7 insertions, 5 deletions
diff --git a/src/main/java/eu/siacs/conversations/Config.java b/src/main/java/eu/siacs/conversations/Config.java
index aff27504..9ee221cc 100644
--- a/src/main/java/eu/siacs/conversations/Config.java
+++ b/src/main/java/eu/siacs/conversations/Config.java
@@ -12,7 +12,8 @@ public final class Config {
public static final String DOMAIN_LOCK = null; //only allow account creation for this domain
public static final boolean DISALLOW_REGISTRATION_IN_UI = false; //hide the register checkbox
public static final boolean HIDE_PGP_IN_UI = false; //some more consumer focused clients might want to disable OpenPGP
- public static final boolean FORCE_ENCRYPTION = false; //disables ability to send unencrypted 1-on-1
+ public static final boolean FORCE_E2E_ENCRYPTION = false; //disables ability to send unencrypted 1-on-1
+ public static final boolean ALLOW_NON_TLS_CONNECTIONS = false; //very dangerous. you should have a good reason to set this to true
public static final boolean FORCE_ORBOT = false; // always use TOR
public static final boolean HIDE_MESSAGE_TEXT_IN_NOTIFICATION = false;
public static final boolean SHOW_CONNECTED_ACCOUNTS = false; //show number of connected accounts in foreground notification
diff --git a/src/main/java/eu/siacs/conversations/entities/Conversation.java b/src/main/java/eu/siacs/conversations/entities/Conversation.java
index dea9d661..22607fc6 100644
--- a/src/main/java/eu/siacs/conversations/entities/Conversation.java
+++ b/src/main/java/eu/siacs/conversations/entities/Conversation.java
@@ -626,7 +626,7 @@ public class Conversation extends AbstractEntity implements Blockable {
next = outgoing;
}
}
- if (Config.FORCE_ENCRYPTION && mode == MODE_SINGLE && next <= 0) {
+ if (Config.FORCE_E2E_ENCRYPTION && mode == MODE_SINGLE && next <= 0) {
if (axolotlService != null && axolotlService.isContactAxolotlCapable(getContact())) {
return Message.ENCRYPTION_AXOLOTL;
} else {
diff --git a/src/main/java/eu/siacs/conversations/ui/ConversationActivity.java b/src/main/java/eu/siacs/conversations/ui/ConversationActivity.java
index f54ace3d..ba6077c4 100644
--- a/src/main/java/eu/siacs/conversations/ui/ConversationActivity.java
+++ b/src/main/java/eu/siacs/conversations/ui/ConversationActivity.java
@@ -854,7 +854,7 @@ public class ConversationActivity extends XmppActivity
MenuItem pgp = popup.getMenu().findItem(R.id.encryption_choice_pgp);
MenuItem axolotl = popup.getMenu().findItem(R.id.encryption_choice_axolotl);
pgp.setVisible(!Config.HIDE_PGP_IN_UI && !Config.X509_VERIFICATION);
- none.setVisible(!Config.FORCE_ENCRYPTION);
+ none.setVisible(!Config.FORCE_E2E_ENCRYPTION);
otr.setVisible(!Config.X509_VERIFICATION);
if (conversation.getMode() == Conversation.MODE_MULTI) {
otr.setVisible(false);
diff --git a/src/main/java/eu/siacs/conversations/xmpp/XmppConnection.java b/src/main/java/eu/siacs/conversations/xmpp/XmppConnection.java
index 1f114141..273a7381 100644
--- a/src/main/java/eu/siacs/conversations/xmpp/XmppConnection.java
+++ b/src/main/java/eu/siacs/conversations/xmpp/XmppConnection.java
@@ -727,7 +727,7 @@ public class XmppConnection implements Runnable {
if (this.streamFeatures.hasChild("starttls") && !features.encryptionEnabled) {
sendStartTLS();
} else if (this.streamFeatures.hasChild("register") && account.isOptionSet(Account.OPTION_REGISTER)) {
- if (features.encryptionEnabled) {
+ if (features.encryptionEnabled || Config.ALLOW_NON_TLS_CONNECTIONS) {
sendRegistryRequest();
} else {
throw new IncompatibleServerException();
@@ -737,7 +737,8 @@ public class XmppConnection implements Runnable {
changeStatus(Account.State.REGISTRATION_NOT_SUPPORTED);
disconnect(true);
} else if (this.streamFeatures.hasChild("mechanisms")
- && shouldAuthenticate && features.encryptionEnabled) {
+ && shouldAuthenticate
+ && (features.encryptionEnabled || Config.ALLOW_NON_TLS_CONNECTIONS)) {
final List<String> mechanisms = extractMechanisms(streamFeatures
.findChild("mechanisms"));
final Element auth = new Element("auth");