diff options
| author | frosty <frostinator33@airmail.cc> | 2026-10-26 10:21:57 -0400 |
|---|---|---|
| committer | frosty <frostinator33@airmail.cc> | 2026-10-26 10:21:57 -0400 |
| commit | 74aecd8b0986d07b50b7ce310d64e645b8b54e38 (patch) | |
| tree | 560e6434f183eb54cd779936f3a4c9575146a066 /xmpp-vala/src/module/xep/0388_extensible_sasl_profile.vala | |
| parent | 3d7e90d401da02d430a87db0ec7e1db3a6f1a68f (diff) | |
| parent | 4436001bb361ad4f9e4e05819214ecf0ea77c063 (diff) | |
Merge 'upstream/master'
Diffstat (limited to 'xmpp-vala/src/module/xep/0388_extensible_sasl_profile.vala')
| -rw-r--r-- | xmpp-vala/src/module/xep/0388_extensible_sasl_profile.vala | 24 |
1 files changed, 16 insertions, 8 deletions
diff --git a/xmpp-vala/src/module/xep/0388_extensible_sasl_profile.vala b/xmpp-vala/src/module/xep/0388_extensible_sasl_profile.vala index 1c6afb30..54d00482 100644 --- a/xmpp-vala/src/module/xep/0388_extensible_sasl_profile.vala +++ b/xmpp-vala/src/module/xep/0388_extensible_sasl_profile.vala @@ -43,19 +43,27 @@ namespace Xmpp.Xep.ExtensibleSaslProfile { stream.expect_further_negotiation_stanzas = true; var authorisation_identifier = node.get_subnode("authorization-identifier", NS_URI); - string jid_string = authorisation_identifier.get_string_content(); - Jid jid = Jid.from_string(jid_string); + string jid_string = authorisation_identifier != null ? authorisation_identifier.get_string_content() : ""; + try { + Jid jid = Jid.from_string(jid_string); - foreach (var inline_provider in inline_activation_providers.values) { - inline_provider.on_bound(stream, jid, node); + foreach (var inline_provider in inline_activation_providers.values) { + inline_provider.on_bound(stream, jid, node); + } + } catch (InvalidJidError e) { + warning("Server provided invalid authorization-identifier \"%s\": %s", jid_string, e.message); } } else if (node.name == "challenge" && stream.has_flag(Flag.IDENTITY)) { Flag flag = stream.get_flag(Flag.IDENTITY); if (flag.mechanism == Mechanism.SCRAM_SHA_1) { - var challenge_response = compute_challenge_response(node.get_string_content(), flag.password, flag.client_nonce, flag.name); - flag.server_signature = challenge_response.expected_server_signature; - stream.write(new StanzaNode.build("response", NS_URI).add_self_xmlns() - .put_node(new StanzaNode.text(Base64.encode((uchar[]) (challenge_response.response).to_utf8())))); + try { + var challenge_response = compute_challenge_response(node.get_string_content(), flag.password, flag.client_nonce, flag.name); + flag.server_signature = challenge_response.expected_server_signature; + stream.write(new StanzaNode.build("response", NS_URI).add_self_xmlns() + .put_node(new StanzaNode.text(Base64.encode((uchar[]) (challenge_response.response).to_utf8())))); + } catch (Error e) { + warning("Error computing challenge response: %s", e.message); + } } } else if (node.name == "failure") { stream.remove_flag(stream.get_flag(Flag.IDENTITY)); |
