diff options
author | KatolaZ <katolaz@freaknet.org> | 2017-07-15 01:35:36 +0100 |
---|---|---|
committer | KatolaZ <katolaz@freaknet.org> | 2017-07-15 01:35:36 +0100 |
commit | 74f8a74ecf8284fd4182cabab797f17bb18e7032 (patch) | |
tree | fccf6ded5d4a894b5863039b99ce977023bd0f79 /commits.go | |
parent | 726b399e4747032a3d052339cd62c57ae5b6767c (diff) |
Added Makefile -- gofmt
Diffstat (limited to 'commits.go')
-rw-r--r-- | commits.go | 17 |
1 files changed, 8 insertions, 9 deletions
@@ -6,7 +6,7 @@ import ( "golang.org/x/crypto/openpgp" "os" "strings" -// "log" + // "log" ) func CommitToString(commit *git.Commit) string { @@ -24,16 +24,16 @@ func CommitToString(commit *git.Commit) string { // FIXME: RETURN THE ENTITY PROVIDED BY THE CHECK, OR nil func check_signature(commit *git.Commit, keys []*openpgp.KeyRing) (signature, signed string, err error) { - + signature, signed, err = commit.ExtractSignature() if err == nil { for _, keyring := range keys { - + _, err_sig := openpgp.CheckArmoredDetachedSignature(*keyring, strings.NewReader(signed), - strings.NewReader(signature)) - + strings.NewReader(signature)) + if err_sig == nil { fmt.Printf("Good signature \n") return signature, signed, nil @@ -41,11 +41,10 @@ func check_signature(commit *git.Commit, keys []*openpgp.KeyRing) (signature, si err = err_sig } } - + return "", "", err } - // traverse all the commits between two references, looking for scorsh // commands // fixme: we don't have just one keyring here.... @@ -91,12 +90,12 @@ func walk_commits(msg SCORSHmsg, w *SCORSHworker) error { // We should look for scorsh-tags, and if the commit has any, // check if it can be verified by any of the keyrings associated // with the scorsh-tag - + //signature, signed, err := check_signature(commit, &keyring) //_, _, err := check_signature(commit, w.keys) //if err != nil { // log.Printf("%s\n", SCORSHerr(SCORSH_ERR_SIGNATURE)) - // + // //} cur_commit = commit.Parent(0) } else { |