Skip to main content

Module scram

Module scram 

Source
Expand description

SCRAM-SHA-256 client (RFC 5802 / RFC 7677), used for PostgreSQL password authentication.

Channel binding (SCRAM-SHA-256-PLUS) is not implemented; the GS2 header advertises no channel binding (n,,).

The server is unauthenticated when sslmode is require, so every value taken from the server is treated as hostile: iteration counts and salt lengths are bounded and the nonce is validated before any key derivation runs.

The password is prepared with SASLprep (RFC 4013) before key derivation, so it matches the form PostgreSQL stored the verifier for. See [saslprep] for the implemented profile.

Structs§

ScramClient
A SCRAM-SHA-256 exchange in progress.

Constants§

DEFAULT_MAX_SCRAM_ITERATIONS
Default highest accepted PBKDF2 iteration count.
MAX_SALT_LEN
Highest accepted salt length, in bytes.
MAX_SERVER_FIRST_LEN
Highest accepted length for a server-first or server-final message.