Conversation
This commit fixes the semantics of the `HSMs` and `ActiveHSMs`, now `ConfiguredHSMs` fields. Before, the `HSMs` field contained all HSMs "present" at the KMS server (configured ones and ones with an on-disk entry), and the `ActiveHSMs` field contain only the configured HSMs for which an on-disk entry exists. The problem with such an approach is that you cannot distinguish between HSMs that are configured but don't have an on-disk entry (because it got deleted) and HSMs that have an on-disk entry but are not configured. Both would appear in the list of `HSMs` but not in the list of `ActiveHSMs`. This commit fixes this. Now, the `HSMs` list contains only HSMs with an on-disk entry and the `ConfiguredHSMs` list contains only HSMs for which a configuration is currently present. The list of all HSMs (what the `HSMs` field used to be) is simply the union of `HSMs` and `ConfiguedHSMs`. Configured HSMs without an on-disk entry appear in `ConfiguredHSMs` but not in `HSMs` and HSMs without a configuration but a (stale or fallback) on-disk entry appear in `HSMs` but not in `ConfiguredHSMs`. This semantic change can be made since support for multiple HSMs is not released yet. Signed-off-by: Andreas Auernhammer <github@aead.dev>
toastsandwich
approved these changes
May 27, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This commit fixes the semantics of the
HSMsandActiveHSMs, nowConfiguredHSMsfields.Before, the
HSMsfield contained all HSMs "present" at the KMS server (configured ones and ones with an on-disk entry), and theActiveHSMsfield contain only the configured HSMs for which an on-disk entry exists.The problem with such an approach is that you cannot distinguish between HSMs that are configured but don't have an on-disk entry (because it got deleted) and HSMs that have an on-disk entry but are not configured. Both would appear in the list of
HSMsbut not in the list ofActiveHSMs.This commit fixes this. Now, the
HSMslist contains only HSMs with an on-disk entry and theConfiguredHSMslist contains only HSMs for which a configuration is currently present.The list of all HSMs (what the
HSMsfield used to be) is simply the union ofHSMsandConfiguedHSMs. Configured HSMs without an on-disk entry appear inConfiguredHSMsbut not inHSMsand HSMs without a configuration but a (stale or fallback) on-disk entry appear inHSMsbut not inConfiguredHSMs.This semantic change can be made since support for multiple HSMs is not released yet.