From b1236707ccc0279f5f84721dbf0055f2b9370704 Mon Sep 17 00:00:00 2001 From: Georg Pfuetzenreuter Date: Tue, 6 Aug 2024 16:23:13 +0200 Subject: [PATCH] Handle commits with no signature Instead of "EOF", print a message useful to humans. Signed-off-by: Georg Pfuetzenreuter --- pistis.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/pistis.go b/pistis.go index d78ae60..9f9db53 100644 --- a/pistis.go +++ b/pistis.go @@ -171,6 +171,10 @@ func logic() { Info("Reading commit %s", hash) pgpObj, verifyErr := commit.Verify(keyring) + if verifyErr != nil && verifyErr.Error() == "EOF" { + Error("Commit is not signed.") + os.Exit(1) + } handleError("Verifying commit", verifyErr) cFp := hex.EncodeToString(pgpObj.PrimaryKey.Fingerprint[:])