@browsercore/tls 0.4.21 → 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.
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,28 +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) |
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 |
67
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) |
68
- | `TlsProfile` | interface | Named, reusable ClientHello config |
69
- | `resolveProfile()` | function | Look up a profile by name and fill in serverName |
70
104
  | `TlsError` | class | Base typed error |
71
105
  | `TlsHandshakeError` | class | Handshake failure at a specific phase |
72
106
  | `TlsCertificateError` | class | Certificate validation failure with a typed `reason` (extends `TlsHandshakeError`, phase `"certificate"`) |
73
- | `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` |
74
110
  | `TlsDecryptError` | class | Record decryption / auth failure |
75
111
  | `TlsAlertError` | class | TLS alert with level + description |
76
112
  | `Certificate` | interface | Parsed X.509 certificate (validation-relevant fields; the canonical contract type) |
77
- | `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`) |
78
- | `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) |
79
- | `TrustAnchor` | type alias | A parsed certificate trusted a priori (= `ParsedCertificate`; breaking change in 0.4.19: was `{ subjectPublicKeyInfo, subject }`) |
80
- | `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 |
81
117
  | `buildCertificatePath()` / `parseCertificateDetails()` | functions | The pure RFC 5280 §6.1 path builder; the full internal parse behind `parseCertificate` |
82
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) |
83
124
  | `Clock` | interface (re-export) | Canonical time source from `@browsercore/contracts`, injected via `TlsOptions.clock` |
84
125
  | `systemClock` | const | Default `Clock` over the plain JS globals (`Date.now`, `performance.now`, `setTimeout`) |
85
126
 
@@ -104,10 +145,6 @@ matters), ECDSA with SHA-256/384/512 (`ecdsa_secp256r1_sha256`,
104
145
  the conventional pairing; verification uses the issuer's actual key), and
105
146
  Ed25519 (parameters absent).
106
147
 
107
- This is a breaking rename in 0.4.19: `Certificate.signatureScheme: SignatureScheme`
108
- (a scalar that threw at parse time for every OID outside four hardcoded
109
- entries) is replaced by `Certificate.signatureAlgorithm` above.
110
-
111
148
  ### Rejection policy
112
149
 
113
150
  `validateCertificateChain` enforces signature-algorithm policy in EVERY mode —
@@ -305,9 +342,13 @@ Exactly what is checked, and when:
305
342
  (`kMaxChecks = 1048576`). Violations fail with
306
343
  `name-constraint-violation`, naming the constrained certificate (wire
307
344
  index + issuer DN), the constraint holder, the offending name and whether
308
- 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).
309
350
 
310
- 10. **Malformed NON-critical extension values are rejected (Part B parity)** —
351
+ 10. **Malformed NON-critical extension values are rejected** —
311
352
  BoringSSL's ParsedCertificate::Create parses the VALUE of basic
312
353
  Constraints, keyUsage, extendedKeyUsage, subjectAltName, nameConstraints,
313
354
  authorityInfoAccess, certificatePolicies, policyConstraints,
@@ -341,8 +382,7 @@ re-running the handshake. A malformed extension VALUE at PARSE time throws a
341
382
  `TlsMalformedExtensionError` (a `TlsHandshakeError` subclass with phase
342
383
  "certificate" carrying the `extensionOid`).
343
384
 
344
- Explicit limitations — current scope, tracked as separate follow-up subsets
345
- (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
346
386
  CRL, no OCSP — neither stapled nor fetched); no AIA fetching; no policy
347
387
  constraints / policy mappings / certificate-policies ENFORCEMENT (the
348
388
  critical-acceptance of those OIDs mirrors BoringSSL's parseability bar and the
@@ -370,11 +410,9 @@ inner/outer AlgorithmIdentifier equality of RFC 5280 §4.1.2.2 is not enforced
370
410
 
371
411
  `@browsercore/contracts` provides the `EventProvider` interface the connection
372
412
  composes (dependency injection, no `node:events` import), the canonical
373
- `Clock` (see [Time](#time--the-canonical-clock)), and the `TlsHandshakeEngine`
413
+ `Clock` (see [Time](#time-the-canonical-clock)), and the `TlsHandshakeEngine`
374
414
  contract tls satisfies (see
375
- [TlsHandshakeEngine conformance](#tlshandshakeengine-conformance-contracts-026)).
376
- Shared build, lint, and test config comes from `@browsercore/dev` (see
377
- [Development](#development)).
415
+ [TlsHandshakeEngine conformance](#tlshandshakeengine-conformance)).
378
416
 
379
417
  ## Architecture
380
418
 
@@ -398,53 +436,61 @@ connection.
398
436
  | `src/connection/handshake-driver.ts` | Handshake choreography (what to send, what to read, when to derive) |
399
437
  | `src/connection/record-layer.ts` | TLS 1.3 inner-content-type wrapping, nonce XOR, record framing |
400
438
  | `src/connection/key-exchange.ts` | (EC)DHE shared secret, transcript hash, server Finished verification, CertificateVerify verification |
401
- | `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 |
402
440
  | `src/handshake/hello-retry-request.ts` | HelloRetryRequest detection (RFC 8446 §4.1.3 sentinel) and cookie handling |
403
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 |
404
444
 
405
445
  Errors all carry a `kind` discriminator so callers can narrow and inspect
406
446
  without leaking backend specifics (`TlsHandshakeError(phase)`,
407
447
  `TlsDecryptError`, `TlsAlertError(level, description)`).
408
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
+
409
460
  ## Time: the canonical Clock
410
461
 
411
- Since 0.4.17 this package has **no local Clock type**. `TlsOptions.clock`
412
- accepts the canonical `Clock` from `@browsercore/contracts` (`src/time.ts`,
413
- 0.2.6), the single time contract the entire stack migrates onto (five
414
- package-local sibling clocks existed before; tls's `{ now; sleep }` shape was
415
- 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
416
465
  contract (`now` / `monotonic` / `sleep` / `setTimeout` / `clearTimeout`) over
417
466
  the plain JS globals, so the same object can serve as the whole stack's
418
467
  `Platform.time` without a second adapter.
419
468
 
420
- tls itself only calls `now` and `sleep` today:
469
+ tls itself calls `now` and `sleep`:
421
470
 
422
471
  - handshake timeout: `withTimeout` races the handshake against `clock.sleep`
423
472
  - certificate `notBefore`/`notAfter` validation via `now()` (epoch seconds)
424
473
  - NewSessionTicket timestamps and connection-id generation via `now()`
425
474
 
426
- `monotonic()` is available on the same seam for future deadline hardening:
427
- timeout code can migrate from a single `sleep(ms)` race to monotonic deadline
428
- math (immune to wall-clock jumps) with no signature change at call sites (noted
429
- 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:
430
478
  `now()` is wall time (epoch ms, can jump); `monotonic()` is elapsed-time ms
431
479
  and never goes backwards, so never compare the two.
432
480
 
433
- ## TlsHandshakeEngine conformance (contracts 0.2.6)
481
+ ## TlsHandshakeEngine conformance
434
482
 
435
483
  `@browsercore/tls` is formally **an implementation of the contracts handshake
436
484
  engine**: `runHandshake`, `generateKeyShares`, and `cipherSuiteToAead`, wired
437
485
  from the public barrel, satisfy `TlsHandshakeEngine`
438
- (`@browsercore/contracts` `src/tls-engine.ts`, 0.2.6) with zero adaptation;
439
- the contract's signatures were lifted verbatim from this package.
486
+ (`@browsercore/contracts` `src/tls-engine.ts`) with zero adaptation.
440
487
 
441
- The proof is type-level and checked in
488
+ Conformance is type-level, checked in
442
489
  `tests/tls-engine-conformance.test.ts`: the real functions are assigned to a
443
490
  `TlsHandshakeEngine`-typed object (plus a negative `@ts-expect-error` control),
444
- compiled under the repo's strict compiler options. This is the foundation for
445
- the next batch: `@browsercore/quic` stops importing `@browsercore/tls`
446
- directly and receives the engine via injection, exactly like crypto/transport
447
- (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.
448
494
 
449
495
  ## Session resumption offer (wire level)
450
496
 
@@ -481,44 +527,30 @@ non-resuming build.
481
527
 
482
528
  ## Not implemented
483
529
 
484
- - Session resumption from `connectTls` — no connection offers a PSK. The
485
- connection does receive and store tickets: NewSessionTicket post-handshake
486
- messages are parsed, the resumption PSK is derived and kept in a
487
- per-connection `SessionCache`, and `getResumptionTicket(serverName)` hands
488
- the stored ticket to the caller. What the client does not do is offer one:
489
- the handshake driver never consults the store, so every ClientHello it
490
- emits is a fresh full handshake — no `pre_shared_key`, no PSK-aware key
491
- schedule, no resumed state machine. Tickets received today reach the wire
492
- only when a caller feeds one back into `buildClientHello`'s `psk` argument
493
- (tracked in #91).
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)
494
533
  - Mutual TLS (client certificate)
495
- - 0-RTT early data (never offered; `max_early_data_size` from a ticket is stored informationally only)
496
- - Certificate compression
497
- - 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)
498
535
 
499
536
  ## Development
500
537
 
501
- This repo shares tooling with the `@browsercore/*` family via
502
- [`@browsercore/dev`](https://www.npmjs.com/package/@browsercore/dev). That package
503
- is the single source of truth for:
504
-
505
- - `tsconfig` strict flags: `tsconfig.json` extends `@browsercore/dev/tsconfig.base.json`
506
- - `vitest` config: `vitest.config.ts` imports `definePackageConfig` from `@browsercore/dev/vitest`
507
- - `oxlint` config: `oxlint.config.ts` imports the base ruleset from `@browsercore/dev/oxlint`
508
- - `coverage-md` bin: shipped via `@browsercore/dev`'s `bin/`, used as `npx coverage-md`
538
+ This repo owns its tooling configs directly:
509
539
 
510
- `@browsercore/dev` is declared in `devDependencies` as `"file:../dev"` for local
511
- development (the monorepo layout). When installing from npm, consumers resolve the
512
- 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)
513
546
 
514
547
  ### Scripts
515
548
 
516
549
  ```sh
517
- npm run typecheck # tsc --noEmit (strict mode, noUncheckedIndexedAccess + exactOptionalPropertyTypes)
550
+ npm run typecheck # tsc --noEmit for src (tsconfig.json) and tests (tsconfig.test.json)
518
551
  npm run lint # oxlint --type-aware src/ (tests excluded)
519
- npm test # vitest run (in-process fixture server, no real network)
520
- npm run build # tsc -p tsconfig.build.json → dist/
521
- 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/
522
554
  ```
523
555
 
524
556
  Run a single test file:
@@ -530,19 +562,17 @@ npx vitest run tests/handshake.test.ts
530
562
  Run tests by name pattern:
531
563
 
532
564
  ```sh
533
- npx vitest run -t "rejects a non-browser User-Agent"
565
+ npx vitest run -t "skips groups the crypto backend cannot generate"
534
566
  ```
535
567
 
536
568
  ### Lint config
537
569
 
538
- Linting is type-aware oxlint via `oxlint.config.ts`. The file extends the shared
539
- `@browsercore/dev/oxlint` base (which enables the `typescript`, `unicorn`, `import`,
540
- `promise`, and `node` plugins with `correctness`/`suspicious`/`pedantic` as errors).
541
- 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.
542
573
 
543
- Private fields use the native TypeScript `private` keyword. The legacy
544
- `_`-prefixed naming convention has been fully migrated away, so no
545
- `no-underscore-dangle` allowlist is required.
574
+ Private fields use the native TypeScript `private` keyword; the `_` prefix
575
+ survives only on intentionally-unused parameters.
546
576
 
547
577
  Requires **Node >= 26**. ESM only (`"type": "module"`).
548
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,WAAW,EAAE,cAAc,EAAE,MAAM,EAAE,MAAM,wBAAwB,CAAC;AAClF,OAAO,EAAqB,KAAK,UAAU,EAAE,KAAK,cAAc,IAAI,YAAY,EAAE,MAAM,cAAc,CAAC;AAEvG,OAAO,EAUH,KAAK,WAAW,EACnB,MAAM,2BAA2B,CAAC;AAOnC,OAAO,KAAK,EACR,aAAa,EACb,yBAAyB,EACzB,WAAW,EACX,iBAAiB,EACjB,OAAO,EACP,cAAc,EACjB,MAAM,aAAa,CAAC;AAKrB,OAAO,EASH,KAAK,kBAAkB,EAC1B,MAAM,yBAAyB,CAAC;AAQjC;;;GAGG;AACH,MAAM,WAAW,gBAAgB;IAC7B,QAAQ,CAAC,SAAS,EAAE,SAAS,CAAC;IAC9B,8EAA8E;IAC9E,MAAM,EAAE,cAAc,CAAC;IACvB;;;;OAIG;IACH,WAAW,EAAE,kBAAkB,GAAG,SAAS,CAAC;IAC5C,qEAAqE;IACrE,UAAU,EAAE,UAAU,CAAC;IACvB,8DAA8D;IAC9D,QAAQ,CAAC,UAAU,EAAE,UAAU,EAAE,CAAC;IAClC,8EAA8E;I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sDAAsD;IACtD,WAAW,EAAE,MAAM,CAAC;IACpB,WAAW,EAAE,MAAM,CAAC;IACpB,kFAAkF;IAClF,cAAc,EAAE,OAAO,CAAC;IACxB,kEAAkE;IAClE,YAAY,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAClC;;;;;;;;;;;;;OAaG;IACH,4BAA4B,CAAC,EAAE,aAAa,GAAG,SAAS,CAAC;IACzD;;;;;OAKG;IACH,eAAe,CAAC,EAAE,WAAW,GAAG,SAAS,CAAC;IAC1C;;;;OAIG;IACH,YAAY,EAAE,YAAY,CAAC;IAC3B;;;;OAIG;IACH,OAAO,EAAE,CAAC,CAAC,GAAG,EAAE,MAAM,KAAK,IAAI,CAAC,GAAG,SAAS,CAAC;IAC7C;;;;;OAKG;IACH,SAAS,CAAC,KAAK,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,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,gBAAgB,EAChB,iBAAiB,EACjB,aAAa,EACb,mBAAmB,EACnB,gCAAgC,EAChC,uBAAuB,GAG1B,MAAM,2BAA2B,CAAC;AACnC,OAAO,EACH,wBAAwB,EACxB,6BAA6B,EAC7B,oBAAoB,EACpB,OAAO,GACV,MAAM,0BAA0B,CAAC;AASlC,+EAA+E;AAC/E,8EAA8E;AAC9E,gFAAgF;AAChF,OAAO,EAAE,mBAAmB,EAAE,cAAc,EAAE,oBAAoB,EAAE,MAAM,mBAAmB,CAAC;AAC9F,OAAO,EACH,0BAA0B,EAC1B,gCAAgC,EAChC,6BAA6B,EAC7B,sBAAsB,EACtB,wBAAwB,EACxB,uBAAuB,EACvB,2BAA2B,EAC3B,2CAA2C,GAE9C,MAAM,yBAAyB,CAAC;AACjC,OAAO,EACH,eAAe,EACf,aAAa,EACb,oBAAoB,EACpB,WAAW,GACd,MAAM,mBAAmB,CAAC;AAyE3B,4EAA4E;AAC5E,SAAS,gBAAgB,CAAC,GAAqB;IAC3C,GAAG,CAAC,IAAI,GAAG,iBAAiB,CAAC,GAAG,CAAC,WAAW,CAAC,CAAC;I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AC,IAAI,EAAE,kBAAkB,EAAE,GAAG,CAAC,IAAI,EAAE,GAAG,CAAC,qBAAqB,EAAE,GAAG,CAAC,MAAM,CAAC,CAAC;IACxG,gBAAgB,CAAC,KAAK,EAAE,aAAa,CAAC,QAAQ,CAAC,CAAC;IAChD,GAAG,CAAC,UAAU,CAAC,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;IACnC,GAAG,CAAC,OAAO,EAAE,CAAC,kDAAkD,CAAC,CAAC;AACtE,CAAC"}
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,gBAAgB,EAChB,iBAAiB,EACjB,aAAa,EACb,mBAAmB,EACnB,gCAAgC,EAChC,uBAAuB,GAG1B,MAAM,2BAA2B,CAAC;AACnC,OAAO,EACH,wBAAwB,EACxB,6BAA6B,EAC7B,oBAAoB,EACpB,OAAO,GACV,MAAM,0BAA0B,CAAC;AASlC,+EAA+E;AAC/E,8EAA8E;AAC9E,gFAAgF;AAChF,OAAO,EAAE,mBAAmB,EAAE,cAAc,EAAE,oBAAoB,EAAE,MAAM,mBAAmB,CAAC;AAC9F,OAAO,EACH,0BAA0B,EAC1B,qCAAqC,EACrC,mCAAmC,EACnC,gCAAgC,EAChC,kDAAkD,EAClD,6BAA6B,EAC7B,sBAAsB,EACtB,8BAA8B,EAC9B,wBAAwB,EACxB,uBAAuB,EACvB,2BAA2B,EAC3B,2CAA2C,GAG9C,MAAM,yBAAyB,CAAC;AACjC,OAAO,EACH,eAAe,EACf,aAAa,EACb,oBAAoB,EACpB,WAAW,GACd,MAAM,mBAAmB,CAAC;AAwF3B,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