From b1b31257b41016b57cfac95ccdb46dc537bff886 Mon Sep 17 00:00:00 2001 From: Daniel Date: Mon, 22 Aug 2022 23:28:16 +0200 Subject: [PATCH] Enable signature checking in beta and staging release channels --- updates/helper/signing.go | 10 ++++++++++ updates/main.go | 1 + 2 files changed, 11 insertions(+) diff --git a/updates/helper/signing.go b/updates/helper/signing.go index 78ccab47..0bd19224 100644 --- a/updates/helper/signing.go +++ b/updates/helper/signing.go @@ -28,6 +28,16 @@ var ( BinarySigningTrustStore = jess.NewMemTrustStore() ) +// GetVerificationConfig returns the verification options based on the release channel. +func GetVerificationConfig(releaseChannel string) map[string]*updater.VerificationOptions { + switch releaseChannel { + case ReleaseChannelBeta, ReleaseChannelStaging: + return VerificationConfig + default: + return nil + } +} + func init() { for _, signingKey := range BinarySigningKeys { rcpt, err := jess.RecipientFromTextFormat(signingKey) diff --git a/updates/main.go b/updates/main.go index 87b63b93..6977ca16 100644 --- a/updates/main.go +++ b/updates/main.go @@ -111,6 +111,7 @@ func start() error { UserAgent: UserAgent, MandatoryUpdates: helper.MandatoryUpdates(), AutoUnpack: helper.AutoUnpackUpdates(), + Verification: helper.GetVerificationConfig(initialReleaseChannel), DevMode: devMode(), Online: true, }