From 74f8a74ecf8284fd4182cabab797f17bb18e7032 Mon Sep 17 00:00:00 2001 From: KatolaZ Date: Sat, 15 Jul 2017 01:35:36 +0100 Subject: Added Makefile -- gofmt --- commits.go | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) (limited to 'commits.go') diff --git a/commits.go b/commits.go index 7703273..46672cf 100644 --- a/commits.go +++ b/commits.go @@ -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 { -- cgit v1.2.3