Skip to content

add smoke-test client and standalone KE server for chrony interop#557

Open
sofiascalzo wants to merge 1 commit into
facebook:mainfrom
sofiascalzo:export-D111491705
Open

add smoke-test client and standalone KE server for chrony interop#557
sofiascalzo wants to merge 1 commit into
facebook:mainfrom
sofiascalzo:export-D111491705

Conversation

@sofiascalzo

Copy link
Copy Markdown

Summary:
Adds two dev/test binaries under time/ntp/ntske/cmd/ to exercise the NTS-KE server end-to-end.
ntsketest is a smoke-test client: it dials the KE server over TLS 1.3 with ALPN ntske/1, sends a NextProtocol=NTPv4 + AEAD [30, 17] + RecordCompliant128GCMExport request, parses the response, and prints [ke] PASS: next-proto=NTPv4 aead=<id> cookies=<n>. Flags: --addr, --ca (trust a self-signed dev cert), --skip-ntp (stop after the KE handshake, since the NTPv4 phase is not implemented yet), and --timeout. It mirrors the server's unexported record reader because the ntske package exposes no reader-based helper, and re-uses the exported MarshalRecords/Parse and record constructors.

ntskeserver is a thin standalone server: it loads a cert/key with tls.LoadX509KeyPair, builds an InMemoryKeystore, and runs ntske.Server.ListenAndServe until SIGINT/SIGTERM. It is the counterpart the ntsketest client and chronyd connect to for local interop testing.

Reviewed By: leoleovich

Differential Revision: D111491705

Summary:
Adds two dev/test binaries under `time/ntp/ntske/cmd/` to exercise the NTS-KE server end-to-end.
`ntsketest` is a smoke-test client: it dials the KE server over TLS 1.3 with ALPN `ntske/1`, sends a NextProtocol=NTPv4 + AEAD `[30, 17]` + `RecordCompliant128GCMExport` request, parses the response, and prints `[ke] PASS: next-proto=NTPv4 aead=<id> cookies=<n>`. Flags: `--addr`, `--ca` (trust a self-signed dev cert), `--skip-ntp` (stop after the KE handshake, since the NTPv4 phase is not implemented yet), and `--timeout`. It mirrors the server's unexported record reader because the `ntske` package exposes no reader-based helper, and re-uses the exported `MarshalRecords`/`Parse` and record constructors.

`ntskeserver` is a thin standalone server: it loads a cert/key with `tls.LoadX509KeyPair`, builds an `InMemoryKeystore`, and runs `ntske.Server.ListenAndServe` until SIGINT/SIGTERM. It is the counterpart the `ntsketest` client and `chronyd` connect to for local interop testing.

Reviewed By: leoleovich

Differential Revision: D111491705
@meta-cla meta-cla Bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Jul 17, 2026
@meta-codesync

meta-codesync Bot commented Jul 17, 2026

Copy link
Copy Markdown
Contributor

@sofiascalzo has exported this pull request. If you are a Meta employee, you can view the originating Diff in D111491705.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. meta-exported

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant