-
Notifications
You must be signed in to change notification settings - Fork 483
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
Don't encrypt empty files in new repositories #210
base: master
Are you sure you want to change the base?
Conversation
git has several problems with using smudge/clean filters on empty files (see issue #53). The easiest fix is to just not encrypt empty files. Since it was already obvious from the encrypted file length that a file was empty, skipping empty files does not decrease security. Since skipping empty files is a breaking change to the git-crypt file format, we only do this on new repositories. Specifically, we add a new critical header field to the key file called skip_empty which is set in new keys. We skip empty files if and only if this field is present. Closes: #53 Closes: #162
See comment in source code for rationale.
I'd like to give this a go in an existing repository. What process should I follow to migrate to use this new flag? I don't know how to set the flag for existing keys. |
|
Hi @hugopeixoto, did you have a chance to try this out? |
Hi, sorry, I didn't. Having to hexedit the key file and re-add collaborators kind of threw me off. I'm checking this now. Will we need to add a command to do this automatically? |
I'm having trouble replicating the original rebase issue, and my repository no longer has any empty files. I tested the migration with a new repository, though, and it seemed to work fine. Here's the transcript:
|
any progress on this show-stopping issue? |
git has several problems with using smudge/clean filters on empty files (see issue #53). The easiest fix is to just not encrypt empty files. Since it was already obvious from the encrypted file length that a file was empty, skipping empty files does not decrease security.
Since skipping empty files is a breaking change to the git-crypt file format, we only do this on new repositories. Specifically, we add a new critical header field to the key file called skip_empty which is set in new keys. We skip empty files if and only if this field is present.
Closes: #53
Closes: #162