From f2855bdb1ed90d42b995a7a3f58266185e243db9 Mon Sep 17 00:00:00 2001 From: Sefa Eyeoglu Date: Tue, 18 May 2021 13:27:16 +0200 Subject: [PATCH] fix: report invalid public key to logger --- update.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/update.go b/update.go index 8fbbe58..adea811 100644 --- a/update.go +++ b/update.go @@ -99,8 +99,9 @@ func fetchFile(file string) ([]byte, error) { func publickey() []byte { pub, err := base64.StdEncoding.DecodeString(publicKeyString) - if err != nil { - panic(err) // it's hardcoded, we should never hit this, panic if we do + if err != nil { // Should only happen when distributor ships an invalid public key + log.Fatalf("Error while reading public key: %s\nContact the distribution '%s' about this error.\n", err, distribution) + os.Exit(1) } return pub }