Merge pull request #908 from betheg/otr4j

otr4j: update to 0.22
This commit is contained in:
Daniel Gultsch 2015-01-21 11:48:42 +01:00
commit 818c0e609c
4 changed files with 9 additions and 3 deletions

View file

@ -32,7 +32,7 @@ dependencies {
compile project(':libs:MemorizingTrustManager') compile project(':libs:MemorizingTrustManager')
compile 'com.android.support:support-v13:21.0.3' compile 'com.android.support:support-v13:21.0.3'
compile 'org.bouncycastle:bcprov-jdk15on:1.50' compile 'org.bouncycastle:bcprov-jdk15on:1.50'
compile 'net.java:otr4j:0.21' compile 'net.java:otr4j:0.22'
compile 'org.gnu.inet:libidn:1.15' compile 'org.gnu.inet:libidn:1.15'
compile 'com.google.zxing:core:3.1.0' compile 'com.google.zxing:core:3.1.0'
compile 'com.google.zxing:android-integration:3.1.0' compile 'com.google.zxing:android-integration:3.1.0'

View file

@ -33,6 +33,7 @@ import net.java.otr4j.crypto.OtrCryptoEngineImpl;
import net.java.otr4j.crypto.OtrCryptoException; import net.java.otr4j.crypto.OtrCryptoException;
import net.java.otr4j.session.InstanceTag; import net.java.otr4j.session.InstanceTag;
import net.java.otr4j.session.SessionID; import net.java.otr4j.session.SessionID;
import net.java.otr4j.session.FragmenterInstructions;
public class OtrEngine extends OtrCryptoEngineImpl implements OtrEngineHost { public class OtrEngine extends OtrCryptoEngineImpl implements OtrEngineHost {
@ -269,4 +270,9 @@ public class OtrEngine extends OtrCryptoEngineImpl implements OtrEngineHost {
} }
} }
@Override
public FragmenterInstructions getFragmenterInstructions(SessionID sessionID) {
return null;
}
} }

View file

@ -68,7 +68,7 @@ public class MessageGenerator extends AbstractGenerator {
packet.addChild("private", "urn:xmpp:carbons:2"); packet.addChild("private", "urn:xmpp:carbons:2");
packet.addChild("no-copy", "urn:xmpp:hints"); packet.addChild("no-copy", "urn:xmpp:hints");
try { try {
packet.setBody(otrSession.transformSending(message.getBody())); packet.setBody(otrSession.transformSending(message.getBody())[0]);
return packet; return packet;
} catch (OtrException e) { } catch (OtrException e) {
return null; return null;

View file

@ -1688,7 +1688,7 @@ public class XmppConnectionService extends Service implements OnPhoneContactsLoa
try { try {
packet.setBody(otrSession packet.setBody(otrSession
.transformSending(CryptoHelper.FILETRANSFER .transformSending(CryptoHelper.FILETRANSFER
+ CryptoHelper.bytesToHex(symmetricKey))); + CryptoHelper.bytesToHex(symmetricKey))[0]);
sendMessagePacket(account, packet); sendMessagePacket(account, packet);
conversation.setSymmetricKey(symmetricKey); conversation.setSymmetricKey(symmetricKey);
return true; return true;