Chore: Use maintained crypto library (#66304)

This commit is contained in:
Andres Martinez Gotor
2023-04-12 11:18:38 +02:00
committed by GitHub
parent 24d348f804
commit 48de17945f

View File

@@ -16,14 +16,10 @@ import (
"runtime" "runtime"
"strings" "strings"
"github.com/ProtonMail/go-crypto/openpgp"
"github.com/ProtonMail/go-crypto/openpgp/clearsign"
"github.com/ProtonMail/go-crypto/openpgp/packet"
"github.com/gobwas/glob" "github.com/gobwas/glob"
// TODO: replace deprecated `golang.org/x/crypto` package https://github.com/grafana/grafana/issues/46050
// nolint:staticcheck
"golang.org/x/crypto/openpgp"
// nolint:staticcheck
"golang.org/x/crypto/openpgp/clearsign"
"github.com/grafana/grafana/pkg/plugins" "github.com/grafana/grafana/pkg/plugins"
"github.com/grafana/grafana/pkg/plugins/log" "github.com/grafana/grafana/pkg/plugins/log"
"github.com/grafana/grafana/pkg/setting" "github.com/grafana/grafana/pkg/setting"
@@ -337,7 +333,7 @@ func validateManifest(m PluginManifest, block *clearsign.Block) error {
if _, err = openpgp.CheckDetachedSignature(keyring, if _, err = openpgp.CheckDetachedSignature(keyring,
bytes.NewBuffer(block.Bytes), bytes.NewBuffer(block.Bytes),
block.ArmoredSignature.Body); err != nil { block.ArmoredSignature.Body, &packet.Config{}); err != nil {
return fmt.Errorf("%v: %w", "failed to check signature", err) return fmt.Errorf("%v: %w", "failed to check signature", err)
} }