SCRAM authentication in Zig — RFC 5802 and RFC 7677, with a CLI for computing PostgreSQL password verifiers.

List the standards this implementation answers to

Five headings' worth: the mechanism itself, string preparation, channel binding, the primitives underneath, and the three IANA registries. Each row says what this project takes from the document rather than what the document is about, since the point of the list is to be usable by someone checking this code against its specifications. Titles, numbers and statuses were checked against the RFC Editor, the IETF datatracker, IANA and NIST rather than written from memory, and every one of the 27 links resolves. Two things that turned up while doing it are worth having in the file: RFC 4013 has been obsoleted twice -- by RFC 7613 and then by RFC 8265's PRECIS profiles -- so the SASLprep this implements is a superseded specification. It stays, and the list says why: RFC 7677 still specifies it, PostgreSQL still uses it, and a verifier that disagrees with the server is worthless however current its string preparation is. Better to name that as a decision than to leave a reader to discover it as a surprise. And IANA's "Hash Function Textual Names" registry holds sha-1, sha-224, sha-256, sha-384 and sha-512 and nothing else, which is what RFC 5802 section 4 prefixes `SCRAM-` to. That explains exactly why SHA-3 is the one hash here that needs a draft pointing at it -- its name cannot be derived, only specified -- and the comment in mechanism.zig said something vaguer and partly wrong: it credited SCRAM-SHA-512 and SCRAM-SHA3-512 to one draft when there are two, and treated the SHA-2 names as unexplained. The SASL mechanism registry is also worth knowing about: the registration is the family `SCRAM-*`, so there is no individual row for SCRAM-SHA-256 to look up. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01V2ixKUDEicj9EJJxqxZGoJ


Author jcollie.dev
Co-author Claude Opus 5 (1M context) Date Commit Parent b5b486e3
+83 -4
2 changed files
+83 -4
2 changed files