tickets
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
- b57161e3tickets: the markup names its own rules (Style.pMessage, Style.olTickets, ...) instead of hand-written class strings that copy a stylesheet rule; the shared bodies sit in lib/looks.hl (tickets#38)mre
- f767b24dtickets: 111 needless let became plain declarations (3 in ticket.hl, ticket_list.hl, comments.hl and 108 never-reassigned, not captured loop-body ones); the 212 really reassigned lets stay (tickets#44)mre
- 16c0d3b5tickets: the modal window is phone first: the full-screen sheet is the base rule, the centred window sits in the min-width 60rem block (tickets#39)mre
- 090ee809tickets: every component's styles in its own nested Style {} block; styles.hl keeps only the theme inherit, the accent and the site-wide rules (tickets#36)mre
- d395763ftickets: ident-access gate ports 8769/8768 (8797 is taken on loreana)mre
- afb9a403tickets: an ident access key (Authorization: Bearer idt_…) works in the API (ident#27 app side): lib/ident-access.hl copied from components, read keys GET only, ident down 503; gate tests/ident-access-tickets.mjsmre
- 48c1ba79tickets: md-paste-files gate with the file manager casesmre
- f04afc43tickets: MdEditor from components 59704ce (a file manager copy still attaches, pipe rows, tickets#49)mre
- 06599fa0tickets: MdEditor from components b0f1ec2 (a clipboard with text always pastes the text, tickets#49); real Ctrl+V gatemre
- 2e1b116ftickets: re-vendor Hybriel master acaceaf3 (framework ec8d6c1d): plugins/web patch queue while a page is built, anonymous session cookies refresh; gate waits for the comment editors to draw (W174) and clicks the form editor when it stands still; security gate: main's code runs on its own binary, lazy-session cookie checksmre
- 361bc0fetickets: re-vendor Hybriel 7a684920 (WIP, not deployed); on Error exits 1 at startup; migrate passes its log by reference; gate checks follow lazy sessions and the 413 refusalmre
- 8a69999cident#28: /login/callback never signs out the session it finds; a valid code puts the user on the same sessionmre
- 337e9b21tickets#37: a comment's files are open to everyone who can read the commentmre
- 1800600ftickets: write the standby service out in full so the boot gate can read the main servicemre
- 8179d287tickets: standby service on its port plus 10 and a deploy that hands over through it without a gapmre
- 0398145ctickets: the table grid rule is marked functional for check-thememre
- 40fddc20tickets takes components e54f83a: tables get thin grey lines from the theme, desktop toolbar stays one row with the Table button, F4 check counts 11 buttonsmre
- c1b77d61tickets#35: text typed before the editor is built is taken in once by the build (the input handler no longer writes it to the field first, which doubled the first letters); the gate failure shows the surfacemre
- 32bf1873tickets#35: the gate types right after the load with the CPU slowed, no waitingmre
- 64ea9ca2tickets#35: text typed into the reply editor before the page has finished starting is kept; the gate types right after loadmre