Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

make git-crypt add-gpg-user -k default fool-proof #265

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

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.
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.

1 participant