Skip to content

scripts: Add incremental mode to get_auth_var_signing_certificate.py - #470

Merged
Doug Flick (Flickdm) merged 1 commit into
microsoft:mainfrom
Flickdm:support/kek_update_map/incremental_updates
Sep 9, 2026
Merged

Doug Flick (Flickdm) merged 1 commit into
microsoft:mainfrom
Flickdm:support/kek_update_map/incremental_updates

Conversation

@Flickdm

@Flickdm Doug Flick (Flickdm) commented Sep 8, 2026

Copy link
Copy Markdown
Member

Description

Modify the get_auth_var_signing_certificate.py script to support two modes for updating kek_update_map.json:

  1. Incremental Mode (default):

    • Loads existing kek_update_map.json
    • Processes only NEW .bin files not already in the map
    • Preserves existing entry order
    • Minimal diffs when adding new KEK updates
  2. Sort Mode (--sort flag):

    • Processes all .bin files
    • Sorts entries alphabetically by KEKUpdate path
    • Useful for one-time cleanup of main branch

Changes:

  • process_directory() now accepts sort_output parameter (default: False)
  • Added --sort/-s flag to CLI argument parser
  • Incremental mode loads and merges with existing map
  • Existing entries are skipped when already present (by SHA1 hash key)

Benefits:

  • Easier code review of KEK update contributions
  • Maintains alphabetical ordering expectations
  • Backward compatible (default behavior is incremental)

For details on how to complete these options and their meaning refer to CONTRIBUTING.md.

  • Impacts functionality?
  • Impacts security?
  • Breaking change?
  • Includes tests?
  • Includes documentation?

How This Was Tested

Locally with Test CAs

Integration Instructions

N/A

@SochiOgbuanya SochiOgbuanya left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You still have one failing check

Modify the get_auth_var_signing_certificate.py script to support two modes
for updating kek_update_map.json:

1. Incremental Mode (default):
   - Loads existing kek_update_map.json
   - Processes only NEW .bin files not already in the map
   - Preserves existing entry order
   - Minimal diffs when adding new KEK updates

2. Sort Mode (--sort flag):
   - Processes all .bin files
   - Sorts entries alphabetically by KEKUpdate path
   - Useful for one-time cleanup of main branch

Changes:
- process_directory() now accepts sort_output parameter (default: False)
- Added --sort/-s flag to CLI argument parser
- Incremental mode loads and merges with existing map
- Existing entries are skipped when already present (by SHA1 hash key)

Benefits:
- PR diffs now show only new entries (~10 lines instead of 138)
- Easier code review of KEK update contributions
- Maintains alphabetical ordering expectations
- Backward compatible (default behavior is incremental)

Signed-off-by: Doug Flick <dougflick@microsoft.com>
@Flickdm
Doug Flick (Flickdm) force-pushed the support/kek_update_map/incremental_updates branch from 8731091 to 8be435d Compare September 8, 2026 22:19
@Flickdm
Doug Flick (Flickdm) merged commit 2c8e94e into microsoft:main Sep 9, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants