ident
All repositories: gitoria
2.2 KB
# hl:crypto — Web Push primitives (ticket #173)Beside passwords/hashing/base64 (see `server.hl`), hl:crypto carries what RFC 8030 / 8291 /8292 need, in Zig `std.crypto` (no OpenSSL) with a node:crypto twin in `server.js`.Everything takes and returns `Bytes`; calls that can be handed bad input answer `null`(or `false`) instead of throwing.| call | in | out ||---|---|---|| `base64urlEncode(data)` | String (its UTF-8) or Bytes | String, URL-safe alphabet, **no padding** || `base64urlDecode(text)` | String | Bytes, or `null` (not base64url; `+` `/` refused; padded or unpadded accepted) || `p256Generate()` | – | `{ privateKey: Bytes 32, publicKey: Bytes 65 }` (uncompressed `04‖X‖Y`); for ES256 **and** ECDH || `p256PublicKey(privateKey)` | Bytes 32 | Bytes 65, or `null` (invalid scalar) || `es256Sign(privateKey, message)` | Bytes 32, Bytes | Bytes 64 = raw `r‖s` (JWS, not DER); hedged (fresh noise per signature) || `es256Verify(publicKey, message, signature)` | Bytes 65, Bytes, Bytes 64 | Boolean (`false` for any malformed input) || `ecdhSharedSecret(privateKey, peerPublicKey)` | Bytes 32, Bytes 65 | Bytes 32 (the X coordinate), or `null` (peer not on the curve) || `hkdfExtract(salt, ikm)` | Bytes, Bytes | Bytes 32 (PRK); empty salt allowed || `hkdfExpand(prk, info, length)` | Bytes 32, Bytes, Number 1..8160 | Bytes `length` || `hkdf(salt, ikm, info, length)` | as above | extract then expand || `aes128gcmEncrypt(key, nonce, plaintext, aad)` | Bytes 16, Bytes 12, Bytes, Bytes or `null` | Bytes = ciphertext ‖ 16-byte tag (`plaintext.length + 16`) || `aes128gcmDecrypt(key, nonce, data, aad)` | Bytes 16, Bytes 12, Bytes (ct‖tag), Bytes or `null` | Bytes plaintext, or `null` when the tag fails / input shorter than 16 |Wrong-size key, nonce, private key or PRK is a located error (programmer mistake); a wrong*peer* value is `null`/`false` (remote data).Known-answer tests: `plugins/build.sh test` (RFC 5869 A.1–A.3, McGrew-Viega GCM cases 1, 2, 4,node:crypto P-256 key / ECDH secret / ES256 signature), `tests/pass/plugins/038_*` (the samethrough the language, plus both engines) and `tests/pass/plugins/037_crypto_rfc8291.hl`(RFC 8291 §5/Appendix A end to end, composed only from these calls).
Branches
Latest commits
- a22d2daaident#31: the sign-in frame is no taller than the tallest step needs (plain CSS height per width), gate check for itmre
- a77d1b22ident#31: the welcome form keeps editId a plain value (browser gate), README, wider rows in the framemre
- 5c481bfdident#31: sign in to ident inside the selector's panel (email, code, identity in an iframe; a new address goes to ident in the same tab and comes back)mre
- 061abfe2ident: the apps gate waits until the test app's login button stops moving before it clicks (the page grows after load and the click missed about every second run)mre
- 45f7e4daident: the user menu's Sign out waits for the server before it reloads (the apps gate failed because the session could still be signed in)mre
- f07658c7ident: home page shows the account once (account bar removed, the user menu carries email, Sign out, Sign out everywhere); wildcard origins https://*.domain for apps on many subdomains; gates follow (WIP: gates not re-run after the last edits)mre
- f2c43bbbtheme: sync from layouts 4994037 (list rows stack, td word-keep, heading code, edited tap target)mre
- 6d4f996esessions last 99 years (creator 2026-10-23: logins never expire; only sign out ends them)mre
- 029eb5e5deploy: security gate (tests/security.mjs)mre
- d3c065a8security audit (SI): uploadMax 0, Secure __Host- cookie behind https, headers on function routes/files, page CSP+referrer meta, app/identity caps, tests/security.mjs, reportmre
- 5561a0cbreport I4-mobilemre
- 4ca2ed20404 page in the shell (viewport, status 404, way home); phone: account actions live in the user menu so the open menu covers nothing; mobile gate; signoutall waits for a cold startmre
- 9baad745tests: browser gate waits for the reloaded document (offline reload race under CPU throttle); HL_CPU_THROTTLE knobmre
- b96796bdtests: wait for hydration before real clicks after a navigation (H2)mre
- 9722964fre-vendor Hybriel 5406d146 (hl:web batches 9+10: #72 emits while the socket is closed delivered after reconnect, browser boot linear, faster list appends; contains int 6–14 + m406)mre
- c9b196c9tests/iplimit: wait for the welcome form itself after B's first login (identities list renders before it); mission 017 reportmre
- 72e0f587ident#26: identity page with "Used in" (app, since, last use, Notif. chip, empty state); lastLogin recorded at exchange; gates + lisbeth E2E; mission 016 reportmre
- 94576fbcident#26 WIP: identity page /identity/:iid with "Used in" (app, since, last use, Notif. chip), lastLogin recorded at exchange, "Used in…" link on the identities list; apps gate 4b, e2e-usedin.mjsmre
- 349cb502tests/invites: wait for hydration on the code page before entering the code (native GET submit raced the welcome form); mission 015 reportmre
- d1bf4720tests: no hard-coded ports — every gate's ports and fixture origins come from <GATE>_PORT / _CHROME env (defaults unchanged; Bob/fixture origins follow, selector cookie name too)mre