mirror of
https://github.com/vanitasvitae/Smack.git
synced 2025-09-09 00:59:39 +02:00
Fix provided SASL DIGEST-MD5 mechanism
In case the server provided nonce contained one or more equals characters ("=") the part.split("=") call would return more then the expected two key/value parts. Hence we simply use part.split("=", 2). Also made the unit test check for this case. Fixes SMACK-755
This commit is contained in:
parent
16ede9806a
commit
d421b2fa1b
2 changed files with 5 additions and 8 deletions
|
@ -1,6 +1,6 @@
|
|||
/**
|
||||
*
|
||||
* Copyright 2014 Florian Schmaus
|
||||
* Copyright 2014-2017 Florian Schmaus
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
|
@ -115,8 +115,7 @@ public class SASLDigestMD5Mechanism extends SASLMechanism {
|
|||
switch (state) {
|
||||
case INITIAL:
|
||||
for (String part : challengeParts) {
|
||||
String[] keyValue = part.split("=");
|
||||
assert (keyValue.length == 2);
|
||||
String[] keyValue = part.split("=", 2);
|
||||
String key = keyValue[0];
|
||||
// RFC 2831 § 7.1 about the formating of the digest-challenge:
|
||||
// "The full form is "<n>#<m>element" indicating at least <n> and
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue