Commit b9d71f5c by Will Browne Committed by GitHub

Plugins: Fix descendent frontend plugin signature validation (#28638)

* move plugin root check to earlier in validation process

* remove comment

* only check root if necessary
parent 2be217e0
...@@ -373,12 +373,6 @@ func (scanner *PluginScanner) IsBackendOnlyPlugin(pluginType string) bool { ...@@ -373,12 +373,6 @@ func (scanner *PluginScanner) IsBackendOnlyPlugin(pluginType string) bool {
// validateSignature validates a plugin's signature. // validateSignature validates a plugin's signature.
func (s *PluginScanner) validateSignature(plugin *PluginBase) *PluginError { func (s *PluginScanner) validateSignature(plugin *PluginBase) *PluginError {
// For the time being, we choose to only require back-end plugins to be signed
// NOTE: the state is calculated again when setting metadata on the object
if !plugin.Backend || !s.requireSigned {
return nil
}
if plugin.Signature == PluginSignatureValid { if plugin.Signature == PluginSignatureValid {
s.log.Debug("Plugin has valid signature", "id", plugin.Id) s.log.Debug("Plugin has valid signature", "id", plugin.Id)
return nil return nil
...@@ -403,6 +397,12 @@ func (s *PluginScanner) validateSignature(plugin *PluginBase) *PluginError { ...@@ -403,6 +397,12 @@ func (s *PluginScanner) validateSignature(plugin *PluginBase) *PluginError {
"state", plugin.Signature) "state", plugin.Signature)
} }
// For the time being, we choose to only require back-end plugins to be signed
// NOTE: the state is calculated again when setting metadata on the object
if !plugin.Backend || !s.requireSigned {
return nil
}
switch plugin.Signature { switch plugin.Signature {
case PluginSignatureUnsigned: case PluginSignatureUnsigned:
allowUnsigned := false allowUnsigned := false
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment