Skip to content
This repository has been archived by the owner on Sep 11, 2020. It is now read-only.

plumbing: object, new Commit.Verify method #653

Merged
merged 2 commits into from
Nov 24, 2017

Conversation

darkowlzz
Copy link
Contributor

This change adds Verify function to Commit object.

Verify(armoredKeyRing string) (*openpgp.Entity, error)

Provided an armored key ring, it verifies the signature of the commit.

I've tried it on my local repositories passing an armored key ring and it works as expected. But couldn't write a passing test for it because when I set a custom TreeHash and ParentHashes, the commit hash becomes 0000000000000000000000000000000000000000. Maybe I can use an existing signed commit in the fixtures, provided signing public key? Need help with the test.

Export an armored key ring:

$ gpg --armor --export [email protected]

fixes #605

@mcuadros mcuadros changed the title Verify commit plumbing: object, new Commit.Verify method Nov 22, 2017
Commit.Verify() performs PGP verification of a signed commit given an
armored keyring.
@darkowlzz
Copy link
Contributor Author

Alright, I've managed to write a working test to verify signature verification 😊

I don't think the test failures in travis and appveyor are related to my changes.

@mcuadros mcuadros merged commit 42719aa into src-d:master Nov 24, 2017
@mcuadros
Copy link
Contributor

Its failing in TravisCI after merged it: https://travis-ci.org/src-d/go-git/jobs/306660028. Can you fix this @darkowlzz, Thanks!

@darkowlzz
Copy link
Contributor Author

@mcuadros oh! sorry for that. I've submitted a fix in #656

@blacktop
Copy link

blacktop commented Nov 24, 2017

How do I use this? It isn't in the gopkg.in and when I try to use go get -u github.com/src-d/go-git/...

I get the error:

package github.com/src-d/go-git: code in directory GOPATH/src/github.com/src-d/go-git expects import "gopkg.in/src-d/go-git.v4"

@ferhatelmas
Copy link
Contributor

@blacktop See #380, please.

@blacktop
Copy link

Thank you! with the rise of go dep it seems like gopkg is falling out of favor.

ferhatelmas added a commit to ferhatelmas/go-git that referenced this pull request Nov 24, 2017
@orirawlings
Copy link
Contributor

@blacktop So far the changes have only been integrated to the master branch. Once another rc or official version is integrated to the v4 branch it will be available via go get -u gopkg.in/src-d/go-git.v4

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

I would like to request git-verify-commit support please
5 participants