Skip to content

Add NTS cookie master-key loading and keystore selection - #577

Closed
sofiascalzo wants to merge 1 commit into
facebook:mainfrom
sofiascalzo:export-D114729858
Closed

Add NTS cookie master-key loading and keystore selection#577
sofiascalzo wants to merge 1 commit into
facebook:mainfrom
sofiascalzo:export-D114729858

Conversation

@sofiascalzo

Copy link
Copy Markdown

Summary:
load the master key from a file and select the right keystore.

  • LoadMasterKeyFromFile reads the (Tupperware-materialized) master key
    verbatim, validates length, and fails closed on a read error or short key.
  • MasterKeyFingerprint returns a non-secret len + SHA-256[:4] identifier,
    safe to log, so KE/NTP can be confirmed to hold the same master.
  • NewKeystore selects DerivedKeystore when a master-key path is set (else the
    dev/test InMemoryKeystore), with an optional fingerprint assertion. Both
    server binaries build their keystore through it so they cannot diverge.

Reviewed By: leoleovich

Differential Revision: D114729858

Summary:
load the master key from a file and select the right keystore.

- LoadMasterKeyFromFile reads the (Tupperware-materialized) master key
  verbatim, validates length, and fails closed on a read error or short key.
- MasterKeyFingerprint returns a non-secret len + SHA-256[:4] identifier,
  safe to log, so KE/NTP can be confirmed to hold the same master.
- NewKeystore selects DerivedKeystore when a master-key path is set (else the
  dev/test InMemoryKeystore), with an optional fingerprint assertion. Both
  server binaries build their keystore through it so they cannot diverge.

Reviewed By: leoleovich

Differential Revision: D114729858
@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 Aug 6, 2026
@meta-codesync

meta-codesync Bot commented Aug 6, 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 D114729858.

@meta-codesync

meta-codesync Bot commented Aug 6, 2026

Copy link
Copy Markdown
Contributor

This pull request has been merged in c957dca.

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. Merged meta-exported

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant