0

I'm learnning how to use git-remote-gcrypt with multi-participants. Let's say I have two computers acting as two user/participants.

I do things like following:

Step1: Generate GPG key pairs for them respectively.
    On computer0:
    gpg --full-gen-key
    GPG key pair-0: usr0@00.com fingerprint:xxxx0000xxxx

    On computer1:
    GPG key pair-1: usr1@11.com fingerprint:yyyy1111yyyy

Step2: Exchange pub keys.
    exported user0's pub key and imported into user1's gpg trustdb,
    exported user1's pub key and imported into user0's gpg trustdb.

Step3: Create an empty repo on github.com
    get the URL git@github.com:leon/testgcrypt.git

Step4: Create an empty local repo on Computer0
    mkdir testgcrypt && cd testgcrypt && git init

Step5: Commit some contents into computer0's local repo, in order to simulate my real scenes.
    echo "content0" > content0.txt
    git add -- . && git commit -m "0.0.0 content0"

Step6: Add remote ref on computer0
    git remote add github gcrypt::git@github.com:leon/testgcrypt.git
    git config remote.github.gcrypt-participants xxxx0000xxxx yyyy1111yyyy
    git branch --set-upstream github/master master
    git push

For now, everything goes as my expecting. Now I need to clone the repo onto Computer1, in order to simulate a new coleague joint my work.

Continue as follows:

Step7: Configure Computer1
    mkdir testgcrypt && cd testgcrypt && git init
    git remote add github gcrypt::git@github.com:leon/testgcrypt.git
    git config remote.github.gcrypt-participants xxxx0000xxxx yyyy1111yyyy

Step8: Clone the repo onto Computer1
    git pull github master

At Step8, I encountered error:

gcrypt: Decrypting manifest

gpg: error getting version from 'scdaemon': No SmartCard daemon

gpg: decryption failed: No secret key

gcrypt: Failed to decrypt manifest!

I guest the reason is that Computer1 is trying to decrypt the content with its own priv-key, while the content was encrypted with Computer0's priv-key.

I'm expecting it decrypt with Computer0's pub-key.

I think that my case is a very common scenes when we use git-remote-gcrypt as a multi-participants tool.

How to let above two users can hold different key pairs, and see the modifications/commits from peers, and decrypt the contents merely with peer's pub-key?

Sorry for my ugly English! thx!

Leon
  • 1,489
  • 1
  • 12
  • 31

0 Answers0