Ircxd.SASL (ircxd v1.1.0)

Copy Markdown View Source

SASL helpers for IRC authentication.

IRC networks commonly use SASL PLAIN during registration after the sasl capability is acknowledged. The payload is base64 encoded as:

authzid NUL authcid NUL password

Summary

Functions

Splits a SASL payload into IRC AUTHENTICATE chunks.

Builds a base64-encoded SASL EXTERNAL payload.

Returns the maximum payload size of one AUTHENTICATE command.

Builds a base64-encoded SASL PLAIN payload.

Builds the final SCRAM-SHA-256 client message and server signature.

Builds the first SCRAM-SHA-256 client message.

Verifies the signature in a final SCRAM-SHA-256 server message.

Functions

authenticate_chunks(payload)

Splits a SASL payload into IRC AUTHENTICATE chunks.

external_payload(authzid)

Builds a base64-encoded SASL EXTERNAL payload.

max_authenticate_payload_bytes()

Returns the maximum payload size of one AUTHENTICATE command.

plain_payload(username, password, authzid \\ "")

Builds a base64-encoded SASL PLAIN payload.

scram_sha256_client_final(client_first_bare, server_first, password)

Builds the final SCRAM-SHA-256 client message and server signature.

scram_sha256_client_first(username, nonce)

Builds the first SCRAM-SHA-256 client message.

verify_scram_sha256_server_final(server_final, expected_signature)

Verifies the signature in a final SCRAM-SHA-256 server message.