git-crypt: This repository contains a malformed key file. It may be corrupted.
- Lingua principale
- C++
- Stelle
- 9.9k
- Fork
- 544
- Metriche di merge delle PR
- Nessuna PR unita negli ultimi 30g
Descrizione
Trying to add a new `git-crypt` collaborator as follows.
Following steps run on a `MacOS` Big Sur with
```
▶ gpg --version
gpg (GnuPG) 2.3.3
libgcrypt 1.9.4
Copyright (C) 2021 Free Software Foundation, Inc.
License GNU GPL-3.0-or-later
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
Home: /Users/pantelis/.gnupg
Supported algorithms:
Pubkey: RSA, ELG, DSA, ECDH, ECDSA, EDDSA
Cipher: IDEA, 3DES, CAST5, BLOWFISH, AES, AES192, AES256, TWOFISH,
CAMELLIA128, CAMELLIA192, CAMELLIA256
AEAD: EAX, OCB
Hash: SHA1, RIPEMD160, SHA256, SHA384, SHA512, SHA224
Compression: Uncompressed, ZIP, ZLIB, BZIP2
```
__1__ Create the key for a specific user id
```
gpg --full-generate-key -u foo@bar.com
```
Provided rest of the details interactively. `RSA` key was selected
__2__
I switch to the working tree of my GH repo containing encrypted files. I am a `git-crypt` collaborator so I am able to add the new user
```
git-crypt add-gpg-user --trusted foo@bar.com
```
__3__
Run a GH PR with the above change, where GH does recognise that a new `git-crypt` collaborator was added, since I see the following message automatically being created in the PR
```
New collaborators:
AF23912 Foo Bar
```
__4__
I export locally the new user's private key
```
gpg --export-secret-keys foo@bar.com > private.key
```
__5__
I `scp` this private key to another machine running `Debian 9` and
```
$ gpg --version
gpg (GnuPG) 2.1.18
libgcrypt 1.7.6-beta
Copyright (C) 2017 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
Home: /home/pantelis/.gnupg
Supported algorithms:
Pubkey: RSA, ELG, DSA, ECDH, ECDSA, EDDSA
Cipher: IDEA, 3DES, CAST5, BLOWFISH, AES, AES192, AES256, TWOFISH,
CAMELLIA128, CAMELLIA192, CAMELLIA256
Hash: SHA1, RIPEMD160, SHA256, SHA384, SHA512, SHA224
Compression: Uncompressed, ZIP, ZLIB, BZIP2
```
so next steps are executed running the above `gpg` version
__6__
I import the key that was copied during step __5__
```
$ gpg --import private.key
gpg: key XXXXXXXX: public key "Foo Bar " imported
gpg: key XXXXXXXX: secret key imported
gpg: Total number processed: 1
gpg: imported: 1
gpg: secret keys read: 1
gpg: secret keys imported: 1
```
__7__
I clone the repo (I have an `ssh` private key for this job
```
$ git clone git@github.com/MyUsername/MyRepo
```
__8__
I cd into the new dir and try to perform a decryption
```
$ cd MyRepo
$ git-crypt unlock
git-crypt: This repository contains a malformed key file. It may be corrupted.
```
Guida per i contributori
Apri la guida per i contributori
Valutazione
Questa issue non è ancora stata valutata.