Skip to content

Conversation

helmutg
Copy link

@helmutg helmutg commented Nov 20, 2022

Unlike most other keys, the default key is encoded using the name default in the file system, but inside the key name is empty. If one actually stores the key name default inside, the key is rejected by validate_key_name.

If one does git-crypt add-gpg-user without -k, the default key is being used leaving the key name empty and things work. If one specifies -k default however, it actually stores the invalid key name default. The resulting key file is always rejected by validate_key_name.

This commit changes the behaviour of -k default to behave as if no -k were given.

It is not entirely clear to me whether this change would have prevented #230.

Unlike most other keys, the default key is encoded using the name
`default` in the file system, but inside the key name is empty. If one
actually stores the key name `default` inside, the key is rejected by
`validate_key_name`.

If one does `git-crypt add-gpg-user` without `-k`, the default key is
being used leaving the key name empty and things work. If one specifies
`-k default` however, it actually stores the invalid key name `default`.
The resulting key file is always rejected by `validate_key_name`.

This commit changes the behaviour of `-k default` to behave as if no
`-k` were given.
@AGWA AGWA added this to the 0.9.0 milestone Sep 24, 2025
@AGWA AGWA added the defect label Sep 24, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants