fix(xep): Fix failure with multiple SCRAM negotiators and SASL2

This commit is contained in:
2024-11-16 17:57:29 +01:00
parent 9eb94e5f48
commit 09a849c6eb
5 changed files with 26 additions and 11 deletions

View File

@@ -96,7 +96,9 @@ class SaslPlainNegotiator extends Sasl2AuthenticationNegotiator {
@override
Future<Result<bool, NegotiatorError>> onSasl2Success(XMLNode response) async {
state = NegotiatorState.done;
if (pickedForSasl2) {
state = NegotiatorState.done;
}
return const Result(true);
}

View File

@@ -363,6 +363,11 @@ class SaslScramNegotiator extends Sasl2AuthenticationNegotiator {
@override
Future<Result<bool, NegotiatorError>> onSasl2Success(XMLNode response) async {
// Don't do anything if we have not been picked for SASL2.
if (!pickedForSasl2) {
return const Result(true);
}
// When we're done with SASL2, check the additional data to verify the server
// signature.
state = NegotiatorState.done;