@browsercore/tls 0.4.20 → 0.4.22

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (43) hide show
  1. package/README.md +151 -77
  2. package/dist/connection/handshake-driver.d.ts +16 -1
  3. package/dist/connection/handshake-driver.d.ts.map +1 -1
  4. package/dist/connection/handshake-driver.js +60 -4
  5. package/dist/connection/handshake-driver.js.map +1 -1
  6. package/dist/connection/handshake-messages.d.ts +128 -0
  7. package/dist/connection/handshake-messages.d.ts.map +1 -1
  8. package/dist/connection/handshake-messages.js +196 -0
  9. package/dist/connection/handshake-messages.js.map +1 -1
  10. package/dist/errors.d.ts +17 -1
  11. package/dist/errors.d.ts.map +1 -1
  12. package/dist/errors.js +19 -1
  13. package/dist/errors.js.map +1 -1
  14. package/dist/handshake/client-hello.d.ts +16 -2
  15. package/dist/handshake/client-hello.d.ts.map +1 -1
  16. package/dist/handshake/client-hello.js +38 -5
  17. package/dist/handshake/client-hello.js.map +1 -1
  18. package/dist/handshake/handshake.d.ts +1 -1
  19. package/dist/handshake/handshake.d.ts.map +1 -1
  20. package/dist/handshake/handshake.js.map +1 -1
  21. package/dist/index.d.ts +2 -2
  22. package/dist/index.d.ts.map +1 -1
  23. package/dist/index.js +1 -1
  24. package/dist/index.js.map +1 -1
  25. package/dist/session/binder.d.ts +76 -0
  26. package/dist/session/binder.d.ts.map +1 -0
  27. package/dist/session/binder.js +107 -0
  28. package/dist/session/binder.js.map +1 -0
  29. package/dist/session/psk-extension.d.ts +49 -0
  30. package/dist/session/psk-extension.d.ts.map +1 -0
  31. package/dist/session/psk-extension.js +96 -0
  32. package/dist/session/psk-extension.js.map +1 -0
  33. package/dist/session/psk-offer.d.ts +52 -0
  34. package/dist/session/psk-offer.d.ts.map +1 -0
  35. package/dist/session/psk-offer.js +62 -0
  36. package/dist/session/psk-offer.js.map +1 -0
  37. package/dist/tls.d.ts +15 -1
  38. package/dist/tls.d.ts.map +1 -1
  39. package/dist/tls.js +17 -1
  40. package/dist/tls.js.map +1 -1
  41. package/dist/types.d.ts +28 -1
  42. package/dist/types.d.ts.map +1 -1
  43. package/package.json +2 -2
package/README.md CHANGED
@@ -7,7 +7,7 @@ A TLS 1.3-only client implemented entirely in TypeScript (RFC 8446). There is
7
7
  no TLS 1.2 fallback: a profile that cannot negotiate TLS 1.3 is rejected up
8
8
  front with a typed `TlsHandshakeError`, and a server that answers with a
9
9
  TLS 1.2 cipher suite or a downgrade sentinel aborts the handshake with the
10
- same typed error.
10
+ same typed error. TLS 1.2 support is tracked in #59.
11
11
 
12
12
  ## Responsibility
13
13
 
@@ -28,27 +28,62 @@ is `@browsercore/crypto`'s job, which keeps the crypto backend replaceable.
28
28
  ## Public API
29
29
 
30
30
  ```ts
31
- import { EventEmitter } from "node:events";
32
31
  import { connect } from "@browsercore/transport";
33
- import { connectTls, resolveProfile, TlsHandshakeError } from "@browsercore/tls";
32
+ import { connectTls, TLS_1_3, type ClientHelloConfig, type CryptoProvider } from "@browsercore/tls";
33
+ import type { DnsResolver, EventProvider, Net } from "@browsercore/contracts";
34
+
35
+ // Injected by the composition root (browsersmith assembles the Platform):
36
+ // the TCP + DNS adapters and the EventProvider backend. `crypto` and
37
+ // `events` are REQUIRED injections with no fallback — the composition root
38
+ // also supplies the Node-backed CryptoProvider.
39
+ declare const platform: {
40
+ network: { tcp: Net; dns: DnsResolver };
41
+ events: EventProvider;
42
+ };
43
+ declare const crypto: CryptoProvider;
44
+
45
+ const transport = await connect({
46
+ host: "example.com",
47
+ port: 443,
48
+ net: platform.network.tcp,
49
+ dns: platform.network.dns,
50
+ events: platform.events,
51
+ });
34
52
 
35
- const transport = await connect({ host: "example.com", port: 443 });
53
+ // A browser profile translated into a ClientHelloConfig — cipher suites,
54
+ // extension order, key shares, signature algorithms.
55
+ const profile: ClientHelloConfig = {
56
+ cipherSuites: [
57
+ "TLS_AES_128_GCM_SHA256",
58
+ "TLS_AES_256_GCM_SHA384",
59
+ "TLS_CHACHA20_POLY1305_SHA256",
60
+ ],
61
+ extensionOrder: [0, 10, 11, 13, 16, 23, 27, 35, 43, 45, 5, 51, 65281],
62
+ keyShareGroups: ["X25519MLKEM768", "x25519"],
63
+ signatureAlgorithms: [
64
+ "ecdsa_secp256r1_sha256",
65
+ "rsa_pss_rsae_sha256",
66
+ "rsa_pss_rsae_sha384",
67
+ "rsa_pss_rsae_sha512",
68
+ "ed25519",
69
+ ],
70
+ supportedVersions: [TLS_1_3],
71
+ serverName: "example.com",
72
+ grease: true,
73
+ };
36
74
 
37
- // `events` is required: an injected EventProvider backend that decouples the
38
- // connection from node:events. Any runtime adapter satisfying the EventProvider
39
- // interface works (here a thin wrapper over Node's EventEmitter).
40
- const events = new EventEmitter();
41
75
  const tls = await connectTls({
42
76
  transport,
43
77
  serverName: "example.com",
44
- profile: resolveProfile("modern-tls13", "example.com"),
78
+ profile,
45
79
  alpnProtocols: ["h2", "http/1.1"],
46
80
  handshakeTimeoutMs: 10_000,
47
- events,
81
+ crypto,
82
+ events: platform.events,
48
83
  });
49
84
 
50
- const response = await tls.read();
51
85
  await tls.write(new TextEncoder().encode("GET / HTTP/1.1\r\n"));
86
+ const response = await tls.read();
52
87
  await tls.close();
53
88
  ```
54
89
 
@@ -58,27 +93,34 @@ await tls.close();
58
93
  | --- | --- | --- |
59
94
  | `TlsConnection` | interface | Public contract higher layers depend on |
60
95
  | `connectTls()` | function | Perform the TLS handshake over a transport |
96
+ | `TlsOptions` | interface | Options for `connectTls`: `transport`, `serverName`, `profile`, `crypto` (required), `events` (required), optional `alpnProtocols`, `handshakeTimeoutMs` (default 10 000), `trustAnchors`, `clock`, `compression`, `onDebug` |
61
97
  | `TlsConnectionImpl` | class | Concrete connection (thin coordinator over `./connection/` modules) |
62
98
  | `TlsState` | discriminated union | `connecting \| handshaking \| open \| closed` |
63
99
  | `CloseReason` | discriminated union | Why a TLS connection closed |
64
100
  | `ProtocolVersion` | discriminated union | `TLS 1.2` / `TLS 1.3` with wire codes |
65
- | `CipherSuite` | string-literal union | Negotiated AEAD + hash |
66
- | `ClientHelloConfig` | interface | ClientHello configuration (placeholder for @browsercore/profiles) |
67
- | `TlsProfile` | interface | Named, reusable ClientHello config |
68
- | `resolveProfile()` | function | Look up a profile by name and fill in serverName |
101
+ | `CipherSuite` | string-literal union | Offered + negotiated cipher suites (AEAD + hash); TLS 1.3 negotiates one of the four AEAD suites |
102
+ | `ClientHelloConfig` | interface | ClientHello configuration — browser profiles (e.g. from `@browsercore/profiles`) translate into this shape |
103
+ | `PskIdentity` | interface | Wire-ready PSK identity consumed by `buildClientHello`'s optional `psk` parameter: verbatim ticket bytes, `obfuscatedTicketAge` (u32), the resumption PSK (binder input, never on the wire), and the TICKET suite's hash (sizes the binder). Emitted as the `pre_shared_key` extension — always the LAST ClientHello extension, after the trailing GREASE (RFC 8446 §4.2.11) |
69
104
  | `TlsError` | class | Base typed error |
70
105
  | `TlsHandshakeError` | class | Handshake failure at a specific phase |
71
106
  | `TlsCertificateError` | class | Certificate validation failure with a typed `reason` (extends `TlsHandshakeError`, phase `"certificate"`) |
72
- | `CertificateFailureReason` | string-literal union | Why certificate validation failed: `no-anchors`, `no-issuer`, `bad-signature`, `expired`, `not-yet-valid`, `not-a-ca`, `missing-key-cert-sign`, `path-too-long`, `unsupported-critical-extension`, `missing-server-auth-eku` |
107
+ | `TlsMalformedExtensionError` | class | A known extension whose VALUE is structurally malformed; carries `extensionOid` (extends `TlsHandshakeError`, phase `"certificate"`) |
108
+ | `ensureTlsError()` | function | Narrow a caught error to a typed `TlsError`, wrapping foreign errors |
109
+ | `CertificateFailureReason` | string-literal union | Why certificate validation failed: `no-anchors`, `no-issuer`, `bad-signature`, `expired`, `not-yet-valid`, `not-a-ca`, `missing-key-cert-sign`, `path-too-long`, `unsupported-critical-extension`, `missing-server-auth-eku`, `name-constraint-violation` |
73
110
  | `TlsDecryptError` | class | Record decryption / auth failure |
74
111
  | `TlsAlertError` | class | TLS alert with level + description |
75
112
  | `Certificate` | interface | Parsed X.509 certificate (validation-relevant fields; the canonical contract type) |
76
- | `ParsedCertificate` | interface | tls-internal superset of `Certificate` carrying the subject/issuer DN byte spans, keyUsage presence + keyCertSign bit, `pathLenConstraint`, the ordered extension inventory (`extensions`: `{ oid, critical, value }` per RFC 5280 §4.1.2.9), and the parsed extendedKeyUsage OID list (`extendedKeyUsagePresent` + `extendedKeyUsage`) |
77
- | `CertificateChain` | interface | The server-sent list: `leaf` first, `intermediates` = every following entry in wire order (breaking change in 0.4.19: the forced `root` field is gone) |
78
- | `TrustAnchor` | type alias | A parsed certificate trusted a priori (= `ParsedCertificate`; breaking change in 0.4.19: was `{ subjectPublicKeyInfo, subject }`) |
79
- | `CertificatePath` | discriminated union | `buildCertificatePath` result: `anchored` (path + anchor) or `unanchored` — `reason` is one of `no-issuer`, `bad-signature`, `expired`, `not-yet-valid`, `not-a-ca`, `missing-key-cert-sign`, `path-too-long`, `unsupported-critical-extension`, `missing-server-auth-eku` (every certificate failure reason except `no-anchors`, which `verifyChain` raises before building), plus the fully rendered `message` and the certificate the failure names |
113
+ | `ParsedCertificate` | interface | tls-internal superset of `Certificate` carrying the subject/issuer DN byte spans (plus the RDNSequence value spans for DN matching), keyUsage presence + keyCertSign bit, `pathLenConstraint`, the ordered extension inventory (`extensions`: `{ oid, critical, value }` per RFC 5280 §4.1.2.9), the parsed extendedKeyUsage OID list (`extendedKeyUsagePresent` + `extendedKeyUsage`), the parsed SAN (`sanNames`) and nameConstraints (`nameConstraints`) |
114
+ | `CertificateChain` | interface | The server-sent list: `leaf` first, `intermediates` = every following entry in wire order — there is no `root` field |
115
+ | `TrustAnchor` | type alias | A parsed certificate trusted a priori (= `ParsedCertificate`) |
116
+ | `CertificatePath` | discriminated union | `buildCertificatePath` result: `anchored` (path + anchor) or `unanchored` — `reason` is every `CertificateFailureReason` except `no-anchors` (which `verifyChain` raises before building), plus the fully rendered `message` and the certificate the failure names |
80
117
  | `buildCertificatePath()` / `parseCertificateDetails()` | functions | The pure RFC 5280 §6.1 path builder; the full internal parse behind `parseCertificate` |
81
118
  | `CertificateSignatureAlgorithm` | discriminated union | The certificate's signature algorithm: `supported` (with TLS scheme) or `rejected` (with reason + OID) |
119
+ | `SessionCache` | class | In-memory store of parsed NewSessionTickets keyed by server name |
120
+ | `ResumptionTicket` | interface | A parsed NewSessionTicket plus its derived resumption PSK (returned by `TlsConnection.getResumptionTicket`) |
121
+ | `runHandshake()` / `HandshakeContext` | function + interface | The engine SPI `TlsHandshakeEngine` consumers drive directly: the driver mutates the context's state and returns the application secrets |
122
+ | `generateKeyShares()` | function | Key shares for the requested groups (delegates to `CryptoProvider`; unsupported groups are skipped) |
123
+ | `hkdfExpandLabel()` / `deriveHandshakeSecrets()` / `deriveHandshakeTrafficSecrets()` / `deriveApplicationSecrets()` | functions | TLS 1.3 key schedule primitives (RFC 8446 §7.1) |
82
124
  | `Clock` | interface (re-export) | Canonical time source from `@browsercore/contracts`, injected via `TlsOptions.clock` |
83
125
  | `systemClock` | const | Default `Clock` over the plain JS globals (`Date.now`, `performance.now`, `setTimeout`) |
84
126
 
@@ -103,10 +145,6 @@ matters), ECDSA with SHA-256/384/512 (`ecdsa_secp256r1_sha256`,
103
145
  the conventional pairing; verification uses the issuer's actual key), and
104
146
  Ed25519 (parameters absent).
105
147
 
106
- This is a breaking rename in 0.4.19: `Certificate.signatureScheme: SignatureScheme`
107
- (a scalar that threw at parse time for every OID outside four hardcoded
108
- entries) is replaced by `Certificate.signatureAlgorithm` above.
109
-
110
148
  ### Rejection policy
111
149
 
112
150
  `validateCertificateChain` enforces signature-algorithm policy in EVERY mode —
@@ -304,9 +342,13 @@ Exactly what is checked, and when:
304
342
  (`kMaxChecks = 1048576`). Violations fail with
305
343
  `name-constraint-violation`, naming the constrained certificate (wire
306
344
  index + issuer DN), the constraint holder, the offending name and whether
307
- it matched an excludedSubtrees entry or no permittedSubtrees entry.
345
+ it matched an excludedSubtrees entry or no permittedSubtrees entry. The
346
+ thrown error's `details.nameConstraint` carries the discriminated outcome:
347
+ `excluded` (matched an excludedSubtrees entry), `not-permitted` (matched
348
+ no permittedSubtrees entry), `unsupported-name-form`,
349
+ `subject-email-unreadable`, or `too-many-checks` (the DoS guard).
308
350
 
309
- 10. **Malformed NON-critical extension values are rejected (Part B parity)** —
351
+ 10. **Malformed NON-critical extension values are rejected** —
310
352
  BoringSSL's ParsedCertificate::Create parses the VALUE of basic
311
353
  Constraints, keyUsage, extendedKeyUsage, subjectAltName, nameConstraints,
312
354
  authorityInfoAccess, certificatePolicies, policyConstraints,
@@ -340,8 +382,7 @@ re-running the handshake. A malformed extension VALUE at PARSE time throws a
340
382
  `TlsMalformedExtensionError` (a `TlsHandshakeError` subclass with phase
341
383
  "certificate" carrying the `extensionOid`).
342
384
 
343
- Explicit limitations — current scope, tracked as separate follow-up subsets
344
- (not permanent design decisions): no revocation checking of any kind (no
385
+ Explicit limitations of the current implementation: no revocation checking of any kind (no
345
386
  CRL, no OCSP — neither stapled nor fetched); no AIA fetching; no policy
346
387
  constraints / policy mappings / certificate-policies ENFORCEMENT (the
347
388
  critical-acceptance of those OIDs mirrors BoringSSL's parseability bar and the
@@ -369,11 +410,9 @@ inner/outer AlgorithmIdentifier equality of RFC 5280 §4.1.2.2 is not enforced
369
410
 
370
411
  `@browsercore/contracts` provides the `EventProvider` interface the connection
371
412
  composes (dependency injection, no `node:events` import), the canonical
372
- `Clock` (see [Time](#time--the-canonical-clock)), and the `TlsHandshakeEngine`
413
+ `Clock` (see [Time](#time-the-canonical-clock)), and the `TlsHandshakeEngine`
373
414
  contract tls satisfies (see
374
- [TlsHandshakeEngine conformance](#tlshandshakeengine-conformance-contracts-026)).
375
- Shared build, lint, and test config comes from `@browsercore/dev` (see
376
- [Development](#development)).
415
+ [TlsHandshakeEngine conformance](#tlshandshakeengine-conformance)).
377
416
 
378
417
  ## Architecture
379
418
 
@@ -397,84 +436,121 @@ connection.
397
436
  | `src/connection/handshake-driver.ts` | Handshake choreography (what to send, what to read, when to derive) |
398
437
  | `src/connection/record-layer.ts` | TLS 1.3 inner-content-type wrapping, nonce XOR, record framing |
399
438
  | `src/connection/key-exchange.ts` | (EC)DHE shared secret, transcript hash, server Finished verification, CertificateVerify verification |
400
- | `src/connection/handshake-messages.ts` | EncryptedExtensions/Certificate/Finished parsing, client Finished builder |
439
+ | `src/connection/handshake-messages.ts` | EncryptedExtensions/Certificate/Finished parsing, client Finished builder, client application_settings (ALPS) builder |
401
440
  | `src/handshake/hello-retry-request.ts` | HelloRetryRequest detection (RFC 8446 §4.1.3 sentinel) and cookie handling |
402
441
  | `src/connection/lifecycle.ts` | Timeouts (with phase-attributed errors), alerts, state transitions, post-handshake record dispatch |
442
+ | `src/session/session-cache.ts` | NewSessionTicket parsing, resumption-PSK derivation, per-server ticket store |
443
+ | `src/iana/` | Wire-code tables for cipher suites, named groups, signature schemes, and versions |
403
444
 
404
445
  Errors all carry a `kind` discriminator so callers can narrow and inspect
405
446
  without leaking backend specifics (`TlsHandshakeError(phase)`,
406
447
  `TlsDecryptError`, `TlsAlertError(level, description)`).
407
448
 
449
+ ## Handshake flow
450
+
451
+ When the server acknowledges `application_settings` (ALPS) in
452
+ EncryptedExtensions, the client sends its application_settings message — an
453
+ EncryptedExtensions message carrying the offered codepoint with empty HTTP/2
454
+ settings, byte-identical to Chrome — as the first message of its second flight,
455
+ before Finished; servers that do not acknowledge it get the two-record flight
456
+ unchanged. An ack without a ClientHello offer (or an ack in both codepoints)
457
+ aborts with fatal `unsupported_extension`, and an ack without a matching h2
458
+ ALPN aborts with fatal `illegal_parameter`.
459
+
408
460
  ## Time: the canonical Clock
409
461
 
410
- Since 0.4.17 this package has **no local Clock type**. `TlsOptions.clock`
411
- accepts the canonical `Clock` from `@browsercore/contracts` (`src/time.ts`,
412
- 0.2.6), the single time contract the entire stack migrates onto (five
413
- package-local sibling clocks existed before; tls's `{ now; sleep }` shape was
414
- one of them and is deleted). The default `systemClock` implements the FULL
462
+ `TlsOptions.clock` accepts the canonical `Clock` from `@browsercore/contracts`
463
+ (`src/time.ts`) — the single time contract for the entire stack. The default
464
+ `systemClock` implements the FULL
415
465
  contract (`now` / `monotonic` / `sleep` / `setTimeout` / `clearTimeout`) over
416
466
  the plain JS globals, so the same object can serve as the whole stack's
417
467
  `Platform.time` without a second adapter.
418
468
 
419
- tls itself only calls `now` and `sleep` today:
469
+ tls itself calls `now` and `sleep`:
420
470
 
421
471
  - handshake timeout: `withTimeout` races the handshake against `clock.sleep`
422
472
  - certificate `notBefore`/`notAfter` validation via `now()` (epoch seconds)
423
473
  - NewSessionTicket timestamps and connection-id generation via `now()`
424
474
 
425
- `monotonic()` is available on the same seam for future deadline hardening:
426
- timeout code can migrate from a single `sleep(ms)` race to monotonic deadline
427
- math (immune to wall-clock jumps) with no signature change at call sites (noted
428
- where the timeout is computed, `src/connection/lifecycle.ts`). Unit contract:
475
+ `monotonic()` is available on the same seam for deadline math immune to
476
+ wall-clock jumps; the handshake timeout is computed from a single `sleep(ms)`
477
+ race (`src/connection/lifecycle.ts`). Unit contract:
429
478
  `now()` is wall time (epoch ms, can jump); `monotonic()` is elapsed-time ms
430
479
  and never goes backwards, so never compare the two.
431
480
 
432
- ## TlsHandshakeEngine conformance (contracts 0.2.6)
481
+ ## TlsHandshakeEngine conformance
433
482
 
434
483
  `@browsercore/tls` is formally **an implementation of the contracts handshake
435
484
  engine**: `runHandshake`, `generateKeyShares`, and `cipherSuiteToAead`, wired
436
485
  from the public barrel, satisfy `TlsHandshakeEngine`
437
- (`@browsercore/contracts` `src/tls-engine.ts`, 0.2.6) with zero adaptation;
438
- the contract's signatures were lifted verbatim from this package.
486
+ (`@browsercore/contracts` `src/tls-engine.ts`) with zero adaptation.
439
487
 
440
- The proof is type-level and checked in
488
+ Conformance is type-level, checked in
441
489
  `tests/tls-engine-conformance.test.ts`: the real functions are assigned to a
442
490
  `TlsHandshakeEngine`-typed object (plus a negative `@ts-expect-error` control),
443
- compiled under the repo's strict compiler options. This is the foundation for
444
- the next batch: `@browsercore/quic` stops importing `@browsercore/tls`
445
- directly and receives the engine via injection, exactly like crypto/transport
446
- (no-hard-wires invariant).
491
+ compiled under the repo's strict compiler options. `@browsercore/quic` consumes
492
+ this interface: the engine is injected via its options (`handshakeEngine`),
493
+ with a deprecated dynamic-import default loader for back-compat.
494
+
495
+ ## Session resumption offer (wire level)
496
+
497
+ `buildClientHello` takes an optional `psk` argument (`PskIdentity`) that turns
498
+ the ClientHello into a TLS 1.3 resumption offer (RFC 8446 §4.2.11). The caller
499
+ supplies the identity: the ticket bytes verbatim, the ticket's resumption PSK
500
+ (the binder input — it never crosses the wire), the hash of the TICKET's
501
+ cipher suite (it sizes the binder), and the `obfuscatedTicketAge` u32. The
502
+ `src/session/` helpers (package-internal) cover the rest of the caller's job:
503
+ `mayOfferTicket` gates the offer on the ticket's suite being among the offered
504
+ suites, `obfuscatedTicketAge` computes the u32 age
505
+ (`(nowMs − receivedAt + ticketAgeAdd) mod 2^32`), and `buildPskIdentity`
506
+ converts a stored ticket into the wire-ready identity.
507
+
508
+ On the wire, a PSK-offering ClientHello carries:
509
+
510
+ - `psk_key_exchange_modes` with the single `psk_dhe_ke` value;
511
+ - `pre_shared_key` as the last extension — after the trailing GREASE and the
512
+ padding extension — with ONE identity (`ticket<16>` +
513
+ `obfuscated_ticket_age` u32) and ONE zero-placeholder binder sized by the
514
+ ticket hash. The padding probe counts the PSK bytes, and servers reject a
515
+ `pre_shared_key` that is not last with `illegal_parameter`.
516
+ - the placeholder binder is then computed (`computePskBinder`,
517
+ RFC 8446 §4.2.11.2) as `HMAC(finished_key, Hash(transcript ‖ truncated
518
+ ClientHello))`, keyed through `HKDF-Extract(0, psk)` → `"res binder"` →
519
+ `"finished"`, and patched over the last `Hash.length` bytes of the message
520
+ (`truncateClientHelloForBinder` + `patchPskBinder`).
521
+
522
+ Invalid inputs fail with the typed `TlsPskError`: a ticket outside the u16
523
+ identity range, a binder longer than the ClientHello, or a ClientHello
524
+ shorter than the binder tail. Without the `psk` argument no `pre_shared_key`
525
+ extension is emitted and the ClientHello is byte-identical to the
526
+ non-resuming build.
447
527
 
448
528
  ## Not implemented
449
529
 
450
- - NewSessionTicket / session resumption / PSK / 0-RTT
530
+ - Session resumption / PSK / 0-RTT — NewSessionTickets are parsed and cached
531
+ (`TlsConnection.getResumptionTicket()`), but the PSK is never offered in a
532
+ subsequent ClientHello (tracked in #91)
451
533
  - Mutual TLS (client certificate)
452
- - Certificate compression
453
- - Key-share groups beyond X25519, secp256r1, secp384r1, and the X25519MLKEM768 hybrid (secp521r1 / x448 / FFDHE fail with a typed error — the crypto backend does not expose them)
534
+ - Key-share groups beyond X25519, secp256r1, secp384r1, X25519MLKEM768, Secp256r1MLKEM768 and Secp384r1MLKEM1024: groups without a crypto backend (secp521r1, x448, FFDHE) are skipped — supported_groups keeps the full profile list — and only a profile whose key-share groups are ALL unsupported fails the handshake with a typed error. X25519Kyber768 sends a classical-only X25519 share under the hybrid group id (strict peers may reject it)
454
535
 
455
536
  ## Development
456
537
 
457
- This repo shares tooling with the `@browsercore/*` family via
458
- [`@browsercore/dev`](https://www.npmjs.com/package/@browsercore/dev). That package
459
- is the single source of truth for:
460
-
461
- - `tsconfig` strict flags: `tsconfig.json` extends `@browsercore/dev/tsconfig.base.json`
462
- - `vitest` config: `vitest.config.ts` imports `definePackageConfig` from `@browsercore/dev/vitest`
463
- - `oxlint` config: `oxlint.config.ts` imports the base ruleset from `@browsercore/dev/oxlint`
464
- - `coverage-md` bin: shipped via `@browsercore/dev`'s `bin/`, used as `npx coverage-md`
538
+ This repo owns its tooling configs directly:
465
539
 
466
- `@browsercore/dev` is declared in `devDependencies` as `"file:../dev"` for local
467
- development (the monorepo layout). When installing from npm, consumers resolve the
468
- published version.
540
+ - `tsconfig.json` sets the strict compiler flags (`strict`,
541
+ `noUncheckedIndexedAccess`, `exactOptionalPropertyTypes`, and more) — no
542
+ shared base config; `tsconfig.test.json` mirrors them for `tests/`
543
+ - `vitest.config.ts` configures vitest with v8 coverage (thresholds: 94%
544
+ statements / 92% branches / 94% functions / 94% lines)
545
+ - `oxlint.config.ts` holds the lint ruleset (type-aware oxlint)
469
546
 
470
547
  ### Scripts
471
548
 
472
549
  ```sh
473
- npm run typecheck # tsc --noEmit (strict mode, noUncheckedIndexedAccess + exactOptionalPropertyTypes)
550
+ npm run typecheck # tsc --noEmit for src (tsconfig.json) and tests (tsconfig.test.json)
474
551
  npm run lint # oxlint --type-aware src/ (tests excluded)
475
- npm test # vitest run (in-process fixture server, no real network)
476
- npm run build # tsc -p tsconfig.build.json → dist/
477
- npx coverage-md # write COVERAGE.md + coverage/badge.json from coverage-summary.json
552
+ npm test # vitest run — in-process fixture server; live tests run only with RUN_LIVE_TESTS=1
553
+ npm run build # tsc -p tsconfig.json → dist/
478
554
  ```
479
555
 
480
556
  Run a single test file:
@@ -486,19 +562,17 @@ npx vitest run tests/handshake.test.ts
486
562
  Run tests by name pattern:
487
563
 
488
564
  ```sh
489
- npx vitest run -t "rejects a non-browser User-Agent"
565
+ npx vitest run -t "skips groups the crypto backend cannot generate"
490
566
  ```
491
567
 
492
568
  ### Lint config
493
569
 
494
- Linting is type-aware oxlint via `oxlint.config.ts`. The file extends the shared
495
- `@browsercore/dev/oxlint` base (which enables the `typescript`, `unicorn`, `import`,
496
- `promise`, and `node` plugins with `correctness`/`suspicious`/`pedantic` as errors).
497
- The old `.oxlintrc.json` has been removed.
570
+ Linting is type-aware oxlint via `oxlint.config.ts`. It enables the
571
+ `typescript`, `unicorn`, `import`, `promise`, and `node` plugins with
572
+ `correctness`/`suspicious`/`pedantic` as errors and style rules off.
498
573
 
499
- Private fields use the native TypeScript `private` keyword. The legacy
500
- `_`-prefixed naming convention has been fully migrated away, so no
501
- `no-underscore-dangle` allowlist is required.
574
+ Private fields use the native TypeScript `private` keyword; the `_` prefix
575
+ survives only on intentionally-unused parameters.
502
576
 
503
577
  Requires **Node >= 26**. ESM only (`"type": "module"`).
504
578
 
@@ -17,7 +17,7 @@ import type { Certificate, CryptoProvider, HashId } from "@browsercore/contracts
17
17
  import { type AlertLevel, type HandshakePhase as TimeoutPhase } from "../errors.js";
18
18
  import { type ServerHello } from "../handshake/handshake.js";
19
19
  import type { AeadAlgorithm, ApplicationTrafficSecrets, CipherSuite, ClientHelloConfig, KeyPair, TrafficSecrets } from "../types.js";
20
- import { type BrotliDecompressor } from "./handshake-messages.js";
20
+ import { type AlpsCodepoint, type BrotliDecompressor } from "./handshake-messages.js";
21
21
  /**
22
22
  * The slice of connection state the handshake driver reads and mutates.
23
23
  * The connection implements this; the driver never reaches past these fields.
@@ -61,6 +61,21 @@ export interface HandshakeContext {
61
61
  hsTrafficReady: boolean;
62
62
  /** Set when the server negotiates ALPN in EncryptedExtensions. */
63
63
  alpnProtocol?: string | undefined;
64
+ /**
65
+ * Mutable: the application_settings codepoint the CLIENT must send (its own
66
+ * OFFERED codepoint, 17613 new / 17513 old), set during the server-flight
67
+ * consumption once the server's ALPS ack passes the BoringSSL validation
68
+ * gates (an unsolicited or double ack aborts with unsupported_extension
69
+ * (110), an ack without a matching h2 ALPN with illegal_parameter (47) —
70
+ * handshake-messages.ts validateApplicationSettingsAck). Undefined → ALPS
71
+ * not negotiated → the client sends NO application_settings message. Set →
72
+ * the driver MUST emit the client's application_settings message as the
73
+ * first message of the client's second flight (before the client
74
+ * Finished): strict ALPS servers — Google Front Ends for google.com /
75
+ * youtube.com / http2.golang.org — abort the connection with a fatal
76
+ * unexpected_message (10) alert otherwise.
77
+ */
78
+ applicationSettingsCodepoint?: AlpsCodepoint | undefined;
64
79
  /**
65
80
  * Set to the validated leaf once the Certificate message is consumed.
66
81
  * Typed as THE canonical contract `Certificate` (contracts 0.2.8 carries
@@ -1 +1 @@
1
- {"version":3,"file":"handshake-driver.d.ts","sourceRoot":"","sources":["../../src/connection/handshake-driver.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AACxD,OAAO,KAAK,EAAE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GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;CACpE;AAQD;;;;;;GAMG;AACH,wBAAsB,YAAY,CAC9B,GAAG,EAAE,gBAAgB,EACrB,OAAO,EAAE,iBAAiB,EAC1B,UAAU,EAAE,MAAM,EAClB,YAAY,EAAE,SAAS,UAAU,EAAE,EACnC,iBAAiB,EAAE,CAAC,MAAM,EAAE,SAAS,MAAM,EAAE,KAAK,OAAO,CAAC,OAAO,EAAE,CAAC,EACpE,GAAG,EAAE,MAAM,GACZ,OAAO,CAAC,yBAAyB,CAAC,CAkPpC"}
@@ -20,7 +20,7 @@ import { deriveApplicationSecrets, deriveHandshakeTrafficSecrets, deriveTrafficS
20
20
  // dependency cycle: index.ts re-exports this module, so reaching back through
21
21
  // it would close the loop. The submodules are the real owners of these helpers.
22
22
  import { computeSharedSecret, transcriptHash, verifyServerFinished } from "./key-exchange.js";
23
- import { buildClientFinishedMessage, parseAlpnFromEncryptedExtensions, readEncryptedHandshakeMessage, splitHandshakeMessages, validateCertificateChain, verifyCertificateVerify, expandCompressedCertificate, parseCertCompressionFromEncryptedExtensions, } from "./handshake-messages.js";
23
+ import { buildClientFinishedMessage, buildClientApplicationSettingsMessage, offeredApplicationSettingsCodepoint, parseAlpnFromEncryptedExtensions, parseApplicationSettingsAckFromEncryptedExtensions, readEncryptedHandshakeMessage, splitHandshakeMessages, validateApplicationSettingsAck, validateCertificateChain, verifyCertificateVerify, expandCompressedCertificate, parseCertCompressionFromEncryptedExtensions, } from "./handshake-messages.js";
24
24
  import { readHeaderBytes, readRawRecord, writeEncryptedRecord, writeRecord, } from "./record-layer.js";
25
25
  /** Apply the result of {@link parseServerHello} to the context's fields. */
26
26
  function applyNegotiation(ctx) {
@@ -181,7 +181,7 @@ export async function runHandshake(ctx, profile, serverName, trustAnchors, gener
181
181
  ctx.serverHsTraffic = deriveTrafficSecrets(serverTrafficSecret, ctx.cipherSuite, ctx.hash, ctx.crypto);
182
182
  ctx.hsTrafficReady = true;
183
183
  // 6. Consume the server's encrypted flight.
184
- await consumeServerFlight(ctx, serverName, trustAnchors, now);
184
+ await consumeServerFlight(ctx, profile, serverName, trustAnchors, now);
185
185
  // 7. Derive application traffic secrets from the full transcript.
186
186
  ctx.currentPhase = "client_finished";
187
187
  ctx.onDebug?.("phase: client_finished — deriving application traffic secrets");
@@ -190,6 +190,29 @@ export async function runHandshake(ctx, profile, serverName, trustAnchors, gener
190
190
  ctx.clientAppSecret = applicationSecrets.clientSecret;
191
191
  ctx.serverAppSecret = applicationSecrets.serverSecret;
192
192
  ctx.onDebug?.("phase: client_finished — application traffic secrets derived");
193
+ // 7.5. ALPS (draft-ietf-tls-alps): when the server acked the
194
+ // application_settings extension in its EncryptedExtensions, the client
195
+ // MUST send its application_settings message as the FIRST message of the
196
+ // second flight — before the client Finished, under the same client
197
+ // handshake traffic key. The message reuses the EncryptedExtensions
198
+ // handshake type on the wire and carries the client's OWN OFFERED codepoint
199
+ // (the codepoint the ClientHello sent — BoringSSL reads
200
+ // hs->config->alps_use_new_codepoint here, ssl/tls13_client.cc:873-876, not
201
+ // the acked one) with the protocol's settings; Chromium enables ALPS for h2
202
+ // with EMPTY settings (net/http/http_network_session.cc
203
+ // application_settings_[kProtoHTTP2] = {}), and BoringSSL servers
204
+ // (tls13_server.cc do_read_client_encrypted_extensions) require only the
205
+ // extension's presence — its absence makes strict servers (Google Front
206
+ // Ends) abort with fatal unexpected_message (10).
207
+ // The message is part of the handshake transcript: the client Finished
208
+ // verify_data below covers it (and so does the server's verification).
209
+ if (ctx.applicationSettingsCodepoint !== undefined) {
210
+ ctx.onDebug?.(`phase: client_application_settings — sending application_settings (codepoint ${ctx.applicationSettingsCodepoint}) before Finished`);
211
+ const applicationSettingsMessage = buildClientApplicationSettingsMessage(ctx.applicationSettingsCodepoint, new Uint8Array(0));
212
+ ctx.transcript.push(applicationSettingsMessage);
213
+ await writeEncryptedRecord(ctx.transport, ctx.aead, ctx.clientHsTraffic, ContentType.HANDSHAKE, applicationSettingsMessage, ctx.clientHsSeq, ctx.crypto, ctx.onDebug);
214
+ ctx.clientHsSeq++;
215
+ }
193
216
  // 8. Send the client Finished under the client handshake traffic key.
194
217
  ctx.onDebug?.("phase: client_finished — building and sending client Finished");
195
218
  const finishedMessage = buildClientFinishedMessage(ctx.hash, ctx.clientHsTrafficSecret, ctx.transcript, ctx.crypto);
@@ -216,7 +239,7 @@ export async function runHandshake(ctx, profile, serverName, trustAnchors, gener
216
239
  * simple case) or packs the entire flight into a single record (the common case
217
240
  * for real TLS 1.3 servers like Cloudflare, nginx, and OpenSSL).
218
241
  */
219
- async function consumeServerFlight(ctx, serverName, trustAnchors, now) {
242
+ async function consumeServerFlight(ctx, profile, serverName, trustAnchors, now) {
220
243
  let phase = recordServerHello({ phase: "client_hello_sent" }, ctx.serverHello);
221
244
  // Messages parsed from the current record but not yet consumed. The AEAD
222
245
  // sequence number advances once per RECORD (not per message), because all
@@ -268,7 +291,40 @@ async function consumeServerFlight(ctx, serverName, trustAnchors, now) {
268
291
  ctx.alpnProtocol = alpn;
269
292
  }
270
293
  const certCompression = parseCertCompressionFromEncryptedExtensions(message.body);
271
- ctx.onDebug?.(`consumeServerFlight: EncryptedExtensions consumed (alpn=${alpn ?? "none"}, certCompression=${certCompression === undefined ? "none" : `0x${certCompression.toString(16)}`})`);
294
+ // ALPS ack (draft-ietf-tls-alps): when the server echoes an
295
+ // application_settings extension here, it obligates the client to send its
296
+ // own application_settings message in the second flight (runHandshake step
297
+ // 7.5). The ack is validated with BoringSSL's serverhello gates FIRST
298
+ // (ssl/extensions.cc, pin 0a0009998fa180695f3e2071805dc03c9a5f3124):
299
+ //
300
+ // - an ack with no ClientHello offer, or an ack in BOTH codepoints (one of
301
+ // the two was never sent by a BoringSSL client, so it is always
302
+ // unsolicited) is fatal unsupported_extension (110) — the
303
+ // `hs->extensions.sent` check in ssl_scan_serverhello_tlsext
304
+ // (ssl/extensions.cc:4153-4158, bits set only when bytes were written,
305
+ // ssl/extensions.cc:3920-3923);
306
+ // - an ack with no ALPN, or with a protocol outside the ClientHello's
307
+ // application_settings list ("h2"), is fatal illegal_parameter (47) —
308
+ // ssl_check_serverhello_tlsext (ssl/extensions.cc:4219-4234,
309
+ // SSL_R_NEGOTIATED_ALPS_WITHOUT_ALPN / SSL_R_INVALID_ALPN_PROTOCOL);
310
+ // - a single ack in EITHER codepoint is accepted (a 17513 ack works on a
311
+ // 17613-offering client), but the client SENDS its own offered codepoint,
312
+ // never the acked one (ssl/tls13_client.cc:873-876,
313
+ // do_send_client_encrypted_extensions reads alps_use_new_codepoint).
314
+ //
315
+ // On any violation the typed error names the alert, so the connection's
316
+ // teardown sends the matching fatal alert (errors.ts AlertDescription).
317
+ const ackedAlpsCodepoints = parseApplicationSettingsAckFromEncryptedExtensions(message.body);
318
+ if (ackedAlpsCodepoints.length > 0) {
319
+ ctx.applicationSettingsCodepoint = validateApplicationSettingsAck({
320
+ ackedCodepoints: ackedAlpsCodepoints,
321
+ offeredCodepoint: offeredApplicationSettingsCodepoint(profile.extensionOrder, profile.alpnProtocols),
322
+ negotiatedAlpn: alpn,
323
+ });
324
+ }
325
+ ctx.onDebug?.(`consumeServerFlight: EncryptedExtensions consumed (alpn=${alpn ?? "none"}, ` +
326
+ `alps=${ctx.applicationSettingsCodepoint ?? "none"}, ` +
327
+ `certCompression=${certCompression === undefined ? "none" : `0x${certCompression.toString(16)}`})`);
272
328
  // Certificate.
273
329
  ctx.currentPhase = "certificate";
274
330
  ctx.onDebug?.("consumeServerFlight: expecting Certificate");
@@ -1 +1 @@
1
- {"version":3,"file":"handshake-driver.js","sourceRoot":"","sources":["../../src/connection/handshake-driver.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAIH,OAAO,EAAE,iBAAiB,EAAwD,MAAM,cAAc,CAAC;AACvG,OAAO,EAAE,2BAA2B,EAAE,WAAW,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AAClG,OAAO,EACH,gBAAgB,EAChB,gBAAgB,EAChB,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