AGWA / git-crypt

Transparent file encryption in git
https://www.agwa.name/projects/git-crypt/
GNU General Public License v3.0
8.4k stars 476 forks source link

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

Open helmutg opened 2 years ago

helmutg commented 2 years ago

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.