diff options
author | Christian Schneppe <christian@pix-art.de> | 2016-11-18 22:11:16 +0100 |
---|---|---|
committer | Christian Schneppe <christian@pix-art.de> | 2016-11-18 22:11:16 +0100 |
commit | 4ba3797c29dfacea5c7be3afb6cef42f2121afe8 (patch) | |
tree | fb7818ff52dea0321caf82c0b18a33fc754bc88b /src/main/java/de/pixart/messenger/crypto | |
parent | 5d7ef6daf7e4cbafbbc1ba805d6ecab1c74df3c5 (diff) |
use base64.nowrap for omemo keys
Diffstat (limited to 'src/main/java/de/pixart/messenger/crypto')
-rw-r--r-- | src/main/java/de/pixart/messenger/crypto/axolotl/XmppAxolotlMessage.java | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/src/main/java/de/pixart/messenger/crypto/axolotl/XmppAxolotlMessage.java b/src/main/java/de/pixart/messenger/crypto/axolotl/XmppAxolotlMessage.java index 06bb011e7..431f81d9b 100644 --- a/src/main/java/de/pixart/messenger/crypto/axolotl/XmppAxolotlMessage.java +++ b/src/main/java/de/pixart/messenger/crypto/axolotl/XmppAxolotlMessage.java @@ -91,11 +91,11 @@ public class XmppAxolotlMessage { private XmppAxolotlMessage(final Element axolotlMessage, final Jid from) throws IllegalArgumentException { this.from = from; Element header = axolotlMessage.findChild(HEADER); - try { - this.sourceDeviceId = Integer.parseInt(header.getAttribute(SOURCEID)); - } catch (NumberFormatException e) { - throw new IllegalArgumentException("invalid source id"); - } + try { + this.sourceDeviceId = Integer.parseInt(header.getAttribute(SOURCEID)); + } catch (NumberFormatException e) { + throw new IllegalArgumentException("invalid source id"); + } List<Element> keyElements = header.getChildren(); this.keys = new HashMap<>(keyElements.size()); for (Element keyElement : keyElements) { @@ -204,13 +204,13 @@ public class XmppAxolotlMessage { for (Map.Entry<Integer, byte[]> keyEntry : keys.entrySet()) { Element keyElement = new Element(KEYTAG); keyElement.setAttribute(REMOTEID, keyEntry.getKey()); - keyElement.setContent(Base64.encodeToString(keyEntry.getValue(), Base64.DEFAULT)); + keyElement.setContent(Base64.encodeToString(keyEntry.getValue(), Base64.NO_WRAP)); headerElement.addChild(keyElement); } - headerElement.addChild(IVTAG).setContent(Base64.encodeToString(iv, Base64.DEFAULT)); + headerElement.addChild(IVTAG).setContent(Base64.encodeToString(iv, Base64.NO_WRAP)); if (ciphertext != null) { Element payload = encryptionElement.addChild(PAYLOAD); - payload.setContent(Base64.encodeToString(ciphertext, Base64.DEFAULT)); + payload.setContent(Base64.encodeToString(ciphertext, Base64.NO_WRAP)); } return encryptionElement; } |