summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorClombrong <cromblong@egregore.fun>2025-06-24 16:18:31 +0200
committerClombrong <cromblong@egregore.fun>2025-06-24 16:42:23 +0200
commitce05db432e444f99d4c8448f2a85721faf489c67 (patch)
treeb049ff8e3f7ac3172b2514dc54a321e7a3550b3b
parentebb9d672d8078672b29414f4ecdaa173a29297c3 (diff)
fix(sasl): depend on Stream.get to get auth response as Xml.element
-rw-r--r--lib/sasl.ml8
1 files changed, 1 insertions, 7 deletions
diff --git a/lib/sasl.ml b/lib/sasl.ml
index d72f11d..0dc58c2 100644
--- a/lib/sasl.ml
+++ b/lib/sasl.ml
@@ -1,6 +1,5 @@
open Lwt.Infix
open Stream
-open Markup
type auth_config = {
jid : string;
@@ -23,12 +22,7 @@ let send_auth_stanza (stream, push) localpart pass mechanism =
let gen_auth = function
| PLAIN -> Base64.encode_exn ("\x00" ^ localpart ^ "\x00" ^ pass)
| Unknown s -> failwith "Unsupported authentication mechanism " ^ s
- and parse_sasl_response (signal : (signal, sync) stream) =
- let stanza : Xml.element =
- match Xml.tree signal with
- | None -> raise (InvalidStanza (signal |> write_xml |> to_string))
- | Some s -> s
- in
+ and parse_sasl_response (stanza : Xml.element) =
let nsless = match stanza with
| {namespace; attributes = []; local_name; children=rest}
when namespace = Xmlns.sasl -> (local_name, rest)