diff options
author | Sam Whited <sam@samwhited.com> | 2014-12-02 19:33:41 -0500 |
---|---|---|
committer | Sam Whited <sam@samwhited.com> | 2014-12-02 19:33:41 -0500 |
commit | feec659b08661e822c700347c4cf4734a79841a8 (patch) | |
tree | 01afbd0c350fac3dc215c01dfd7c12c0c36743e8 /src/main/java/eu/siacs/conversations/crypto/sasl/Tokenizer.java | |
parent | 46b2760069874cda80a8f23f20adaa886c422f59 (diff) |
Make sure SASL tokenizer strips strings
Fix DIGEST-MD5 auth (make sure we're not splitting on BASE64 `==')
Diffstat (limited to '')
-rw-r--r-- | src/main/java/eu/siacs/conversations/crypto/sasl/Tokenizer.java | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/main/java/eu/siacs/conversations/crypto/sasl/Tokenizer.java b/src/main/java/eu/siacs/conversations/crypto/sasl/Tokenizer.java index 39be02246..e37e0fa71 100644 --- a/src/main/java/eu/siacs/conversations/crypto/sasl/Tokenizer.java +++ b/src/main/java/eu/siacs/conversations/crypto/sasl/Tokenizer.java @@ -16,6 +16,10 @@ public final class Tokenizer implements Iterator<String>, Iterable<String> { public Tokenizer(final byte[] challenge) { final String challengeString = new String(challenge); parts = new ArrayList<>(Arrays.asList(challengeString.split(","))); + // Trim parts. + for (int i = 0; i < parts.size(); i++) { + parts.set(i, parts.get(i).trim()); + } index = 0; } |