fix(gpg): remove --pinentry-mode loopback from key import#400
Merged
Conversation
loopback mode corrupts the at-rest storage of passphrase-less cv25519 secret keys under GnuPG 2.4.x: the keygrip is listed as present but unusable for pkdecrypt, so pillar decryption fails at render time with "Bad secret key" while the master still starts cleanly. loopback does not bypass gpg-agent and is pointless for passphrase-less keys; --batch --no-tty already covers the non-interactive CI case.
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.
Summary
Removes
--pinentry-mode loopbackfrom the GPG key import in_setup_gpgkeys.This flag leaves the imported secret key in a state where it is listed as present but cannot actually be used for decryption, causing pillar GPG decryption to fail.
The bug
After import,
--list-secret-keysshows the key as present, but decrypting a pillar fails:The container starts up healthy, so the problem only surfaces when a pillar is rendered.
Fix
--pinentry-mode loopbackonly reroutes passphrase prompts to the caller; it does not bypass gpg-agent. Since this image requires passphrase-less keys, no passphrase is ever supplied, so the flag adds nothing and breaks the import.--batch --no-ttyalready keeps the import non-interactive.