-
Notifications
You must be signed in to change notification settings - Fork 105
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
Unable to encrypt .pem file? #131
Comments
Hi, the only way I have been able to reproduce this problem with a PEM file of my own is to make repository changes in a subtly wrong order: by staging the pem file first and only updating the .gitattributes file afterwards. Could this be what is going wrong for you? If have confirmed that if I change the .gitattributes file before # Copy a pem file into repo
cp ~/.ssh/example.pem .
# Configure transcrypt "crypt" attributes to encrypt pem files
# This MUST be done before you stage the pem file
echo '*.pem filter=crypt diff=crypt merge=crypt' >> .gitattributes
# Stage pem file and config changes
git add .gitattributes example.pem
# Check raw contents of staged pem file, should start with "U2FsdGVk"
git show :example.pem
# Commit works as expected
git commit -m "Add encrypted pem file" |
Hi Jmurty. Thanks for trying to reproduce this. No, I had updated the .gitattributes before I staged the pem file. I have tested the sequence as you described. And pem file did encrypt correctly. So at least that confirms that .pem files are encryptable by transcrypt. I suppose the other thing to note is that the .pem files I was trying to encrypt are actually mounted onto the filesystem from a docker container. I hadn't had an issue encrypting other files that were inside a docker container, mounted on the host. So I didn't think this was an issue. But maybe something strange is happening that way. |
I am seeing the same issue on my system. Environment info: Steps to produce issue:
The final command returns the following message:
Running the two suggested commands and attempting to commit again returned the same message. Running Running This was also attempted with version 2.2.0-pre and 2.0.0, which did not solve the problem. |
Having the same issue with @Ernaldis ! |
Hi @Ernaldis and @yambottle can you check which version of OpenSSL you are using with I suspect the issue is due to an incompatible (with transcrypt) change in how the new OpenSSL version 3 encrypts files, as discussed in #133 If you are using OpenSSL 3+ can you try the |
Hi @jmurty, thank you for getting back to us.
After checking out the Initially, the same error occurred, but removing transcrypt from the repo with |
Thanks for confirming this fix, we'll include the fix along with a bunch of other improvements in the upcoming 2.2.0 release |
Hi, I've been trying to encrypt a certificate with transcrypt.
Let's say I have a certificate file in my git repo at
<repo>/cert.pem
If I add the file to transcrypt via gitattributes, when I try to commit the file I get the warning
Using #120
git rm --cached cert.pem
doesn't fix the problem.I guess transcrypt must think that the certificate file is already encrypted? As it seems to be hitting these lines of code:
transcrypt/transcrypt
Lines 224 to 226 in fdf81c5
But the certificate file isn't encrypted. I'm wondering can transcrypt encrypt certificate files?
Thanks
The text was updated successfully, but these errors were encountered: