sigildocs

(sigil xmpp sasl)

(sigil xmpp sasl) - SASL Authentication for XMPP

Implements SCRAM-SHA-1 (RFC 5802) and PLAIN authentication mechanisms.

Exports

Create a SCRAM-SHA-1 authentication state.

(define scram (make-scram-sha1 "user" "password"))

Generate the SCRAM client-first-message (base64-encoded).

Returns the base64-encoded message to send in the SASL auth element.

Process SCRAM server challenge and generate client-final-message.

Takes the base64-encoded server challenge, returns the base64-encoded client-final-message.

Verify the server's final response.

Returns #t if the server signature matches, #f otherwise.

Generate a PLAIN SASL response (base64-encoded).

Format: base64(0username0password)

Select the best SASL mechanism from a list of server-offered mechanisms.

Returns a symbol: 'scram-sha-1, 'plain, or #f if none supported.