AGWA / AGWA/git-crypt

git-crypt unlock doesn't recognize my GPG key (workaround described)

Đang mở
#188 1 bình luận 4 reaction 0 người được giao Xem trên GitHub
Ngôn ngữ chính
C++
Star
9.9k
Fork
544
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

Mô tả

My workflow:

1. I generated a GPG key pair on my laptop (macOS High Sierra) and exported the private key to a second computer.
2. On the second computer (Ubuntu 18.04), I ran the following commands (git-crypt version 0.6.0 is installed on both machines):

```
git-crypt init
git-crypt add-gpg-user
```

3. I created and committed a .gitattributes file.
4. I created and committed a test file that matched the .gitattributes file.
5. I pushed the resulting branch to GitHub.
6. Returning to my laptop, I fetched and checked out the branch, then attempted to run:

```
git-crypt unlock
```

The result:

```
Error: no GPG secret key available to unlock this repository.
To unlock with a shared symmetric key instead, specify the path to the symmetric key as an argument to 'git-crypt unlock'.
```

I found the key that was generated by `git-crypt add-gpg-user` and was able to manually decrypt it with `gpg --decrypt < .git-crypt/keys/default/0/FOOBAR.gpg`, where FOOBAR.gpg is the name of the file that was generated. This gave me the symmetric key that is supposed to be automatically handled by the tool.

The following workaround is therefore possible:

```
#!/bin/sh
#
# git-crypt-unlock - Work around a bug in git-crypt.
#
# This will unlock the repo even though git-crypt can't do it. May not be
# as secure as git-crypt's correct implementation would be.

umask 077
for FILE in `find .git-crypt/keys/default -type f`; do
if gpg --decrypt < $FILE > git-crypt-symmetric-key; then
git-crypt unlock git-crypt-symmetric-key
rm -f git-crypt-symmetric-key
exit 0
fi
done
```

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Đánh giá

Issue này chưa được đánh giá.

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.