Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions .github/workflows/offline-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,3 +26,10 @@ jobs:
run: python3 -m compileall -q run.py firmware_test.py transport_test.py certificate_test.py server_test.py browser_test.py websocket_tls.py simulator_test.py ci_runner.py ci tests
- name: Run offline tests
run: python3 -m unittest discover -s tests -v
- name: Set up job-local JavaScript test runtime
uses: actions/setup-node@249970729cb0ef3589644e2896645e5dc5ba9c38 # v6, Node24
with:
node-version: '24'
package-manager-cache: false
- name: Test browser programming without opening a device
run: node --test tests/installer.test.mjs
28 changes: 24 additions & 4 deletions .github/workflows/pages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,12 @@ name: Publish browser test hub
on:
push:
branches: [main]
paths: ['site/**', '.github/workflows/pages.yml', 'ci_runner.py']
paths: ['site/**', 'firmware_site.py', '.github/workflows/pages.yml', 'ci_runner.py']
workflow_dispatch:
workflow_run:
workflows: ['ESP32 test images', 'ESP8266 D1 mini prototype']
branches: [main]
types: [completed]
permissions:
contents: read
actions: read
Expand All @@ -12,7 +16,12 @@ concurrency:
cancel-in-progress: false
jobs:
pages:
if: github.repository == 'DynamicDevices/pqc-testing' && github.ref == 'refs/heads/main' && github.actor == 'ajlennon'
if: >-
github.repository == 'DynamicDevices/pqc-testing' && github.ref == 'refs/heads/main' && github.actor == 'ajlennon' &&
(github.event_name != 'workflow_run' ||
(github.event.workflow_run.head_repository.full_name == github.repository &&
github.event.workflow_run.head_branch == 'main' && github.event.workflow_run.actor.login == 'ajlennon' &&
(github.event.workflow_run.event == 'push' || github.event.workflow_run.event == 'workflow_dispatch')))
runs-on: [self-hosted, Linux, X64, dd-esl-proxmox]
timeout-minutes: 15
permissions:
Expand All @@ -31,12 +40,23 @@ jobs:
env:
GH_TOKEN: ${{ github.token }}
run: python3 ci_runner.py pages
- name: Set up job-local JavaScript test runtime
uses: actions/setup-node@249970729cb0ef3589644e2896645e5dc5ba9c38 # v6, Node24
with:
node-version: '24'
package-manager-cache: false
- name: Check the static public artifact
run: python3 -m unittest discover -s tests -p test_browser_site.py -v
run: |
python3 -m unittest discover -s tests -p 'test_*site.py' -v
node --test tests/installer.test.mjs
- name: Publish latest verified firmware packages and pinned browser runtime
env:
GH_TOKEN: ${{ github.token }}
run: python3 firmware_site.py --output build-site
- uses: actions/configure-pages@45bfe0192ca1faeb007ade9deae92b16b8254a0d # v6, Node24
- uses: actions/upload-pages-artifact@fc324d3547104276b827a68afc52ff2a11cc49c9 # v5; pinned upload-artifact v7, Node24
with:
path: site
path: build-site
- name: Deploy protected-main static files only
id: deployment
uses: actions/deploy-pages@368f82528645a54fb793d4d04e342629a3f51346 # v5.0.1, Node24
10 changes: 10 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,16 @@ not implement Zephyr TLS.
See [reproduction instructions](docs/reproduce.md) for setup, test order and
limitations.

## Program development boards from the browser

The [GitHub Pages hub](https://dynamicdevices.github.io/pqc-testing/) includes a
per-board/profile **Program latest** matrix using Web Serial. Each available
image links to its exact source revision, compiled configuration, build manifest
and CI run. A failed, pending, stale or unavailable build cannot silently fall
back to an older image. See [installer details](docs/browser-firmware.md), including
supported browsers, development-board/data-loss warnings and the unavailable
D1 mini package. A verified flash is not a hardware or PQC-TLS test pass.

## Live browser tests and public demo login

Open the [GitHub Pages test hub](https://dynamicdevices.github.io/pqc-testing/)
Expand Down
12 changes: 12 additions & 0 deletions THIRD_PARTY.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,18 @@ The MIT licence at the repository root covers Dynamic Devices' original code
and documentation. It does not relicense dependencies or their source code.
Third-party source is fetched separately and excluded from this repository.

The browser installer self-hosts integrity-pinned runtime packages:

- [esptool-js](https://github.com/espressif/esptool-js), 0.7.1, Apache-2.0.
- [@noble/hashes](https://github.com/paulmillr/noble-hashes), 2.4.0, MIT.
- esptool-js embeds [pako](https://github.com/nodeca/pako), 2.1.0, MIT/Zlib,
and [atob-lite](https://github.com/hughsk/atob-lite), 2.0.0, MIT.

Their complete upstream `LICENSE` files are published at
`vendor/esptool-js/LICENSE`, `vendor/noble/LICENSE`, `vendor/pako/LICENSE` and
`vendor/atob-lite/LICENSE.md` beside the site. Package
tarball URLs and SHA-512 digests are recorded in `firmware_site.py`.

The experiments use:

- [Zephyr](https://github.com/zephyrproject-rtos/zephyr), commit
Expand Down
77 changes: 77 additions & 0 deletions docs/browser-firmware.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
# Browser firmware installer

The GitHub Pages test hub programs development ESP boards over Web Serial.
Choose **Program latest**, then select the board's USB serial port. A data cable
and an OS-supported USB/serial driver are required. Desktop Chrome or Edge is
recommended. Safari/iOS are unsupported; other browsers need Web Serial support.
HTTPS (or localhost for a preview) is required. The browser permission chooser
cannot be automated away. Close other serial tools before programming.

## Matrix and source inspection

ESP32-DevKitC, ESP32-S3-DevKitC and ESP32-C3-DevKitM each have baseline boot and
ML-DSA-44 signature-verification profiles. These are **not TLS firmware** and
have not yet passed physical-board acceptance. A chip-family match cannot prove
the exact board model or pin layout: select the matching physical board.

Each available image links to its immutable source commit, the actual compiled
`zephyr.config`, its build manifest (including upstream revisions and SHA-256
digests), and the exact GitHub Actions run attempt. Configuration and notices are
copied from that same verified artifact, never reconstructed from current main.
Notices sit beside the image; see `LICENSE` and `THIRD_PARTY.md` in its directory.

LOLIN D1 mini hybrid HTTPS remains disabled until its target build, complete
multi-segment flash layout and wolfSSL/SDK binary-distribution and corresponding
source checks are complete. No placeholder binary is offered.

## What “latest” means

On a trusted main firmware workflow completion, Pages automatically regenerates
the matrix from that workflow's newest main run. It does not choose an older
successful run when the newest run is pending, failed or unavailable. Publisher
checks bind all required jobs to organisation runner139, group1. PR artifacts
and forks are never offered. The publisher executes no downloaded artifact code.

At a user's click, the browser fetches the catalogue without its cache, queries
GitHub for the newest main run/attempt, and checks for relevant source changes
since that build. It downloads one versioned snapshot and verifies every image's
SHA-256 before opening the serial port. After chip/security/flash-capacity checks,
it repeats the freshness checks immediately before writing. A newer build or
source revision stops programming until a fresh successful build is published.
GitHub API errors, offline operation, an incomplete source comparison and rate
limits fail closed. Anonymous GitHub API limits may require waiting before retry.

Latest is defined at the final pre-write check. A build arriving during the
write does not replace segments mid-write or trigger another flash. There is no
automatic background programming. Source comparisons accept unrelated newer main
changes (such as documentation) but refuse changed build inputs.

## Flashing and verification

The installer refuses unsupported secure-boot/encrypted boards and never changes
security settings, burns fuses or requests full-chip erase. It overwrites the
selected image sectors, which can destroy existing firmware/data in those sectors;
this is not a backup tool. Flash size/frequency/mode headers are kept unchanged.
SHA-256 verifies the published download; stub MD5 readback verifies transfer, not
publisher authenticity. Trust rests on the HTTPS site, repository and build
controls, not MD5. Runtime packages are pinned by SHA-512 and self-hosted with
their licences: esptool-js0.7.1 (Apache-2.0), @noble/hashes2.4.0 (MIT).

After programming, open **Serial console · 115200 baud** to inspect firmware
results. The bounded log lives only in this tab, with no storage or upload. Do not
print secrets. A verified flash is not a boot, signature-test or PQC-TLS pass.

## Reproduction without hardware

```sh
python3 -m unittest discover -s tests -v
node --test tests/installer.test.mjs
python3 firmware_site.py --offline --output /tmp/pqc-site-preview
python3 -m http.server 8000 --directory /tmp/pqc-site-preview
```

The offline preview downloads only integrity-pinned browser dependencies, offers
no firmware, and never opens a device. Production publication runs on the admitted
DD runner via `.github/workflows/pages.yml`; no local firmware compilation occurs.

Assisted-by: Briar
Loading