AGWA / AGWA/git-crypt

git-crypt: This repository contains a malformed key file. It may be corrupted.

Abierto
#230 4 comentarios 0 reacciones 0 asignados Ver en GitHub
Lenguaje dominante
C++
Estrellas
9.9k
Forks
544
Métricas de merge de PR
Sin PR fusionados en 30 d

Descripción

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.
```

Guía de contribución

Abrir la guía de contribución

Evaluación

Este issue todavía no se ha evaluado.

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.