fix: report invalid public key to logger

pull/129/head
Sefa Eyeoglu 3 years ago
parent 5ea2e80f61
commit f2855bdb1e

@ -99,8 +99,9 @@ func fetchFile(file string) ([]byte, error) {
func publickey() []byte { func publickey() []byte {
pub, err := base64.StdEncoding.DecodeString(publicKeyString) pub, err := base64.StdEncoding.DecodeString(publicKeyString)
if err != nil { if err != nil { // Should only happen when distributor ships an invalid public key
panic(err) // it's hardcoded, we should never hit this, panic if we do log.Fatalf("Error while reading public key: %s\nContact the distribution '%s' about this error.\n", err, distribution)
os.Exit(1)
} }
return pub return pub
} }

Loading…
Cancel
Save