From 84b76c20d1f2df63eb1bdafa7a403c36f13461a4 Mon Sep 17 00:00:00 2001 From: Patrick Zheng Date: Tue, 18 Jul 2023 15:28:50 +0800 Subject: [PATCH 1/2] quick fix on signer.NewFromPlugin Signed-off-by: Patrick Zheng --- signer/plugin.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/signer/plugin.go b/signer/plugin.go index 97447383..139f354e 100644 --- a/signer/plugin.go +++ b/signer/plugin.go @@ -43,7 +43,7 @@ type pluginSigner struct { // NewFromPlugin creates a notation.Signer that signs artifacts and generates // signatures by delegating the one or more operations to the named plugin, // as defined in https://github.com/notaryproject/notaryproject/blob/main/specs/plugin-extensibility.md#signing-interfaces. -func NewFromPlugin(plugin plugin.Plugin, keyID string, pluginConfig map[string]string) (notation.Signer, error) { +func NewFromPlugin(plugin plugin.SignPlugin, keyID string, pluginConfig map[string]string) (notation.Signer, error) { if plugin == nil { return nil, errors.New("nil plugin") } From 56760ac1f67816451216942617325059ab440947 Mon Sep 17 00:00:00 2001 From: Patrick Zheng Date: Tue, 18 Jul 2023 15:35:03 +0800 Subject: [PATCH 2/2] changed to use VerifyPlugin in verifier Signed-off-by: Patrick Zheng --- verifier/verifier.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/verifier/verifier.go b/verifier/verifier.go index 456a4f54..e1ff2308 100644 --- a/verifier/verifier.go +++ b/verifier/verifier.go @@ -205,7 +205,7 @@ func (v *verifier) processSignature(ctx context.Context, sigBlob []byte, envelop return err } - var installedPlugin plugin.Plugin + var installedPlugin plugin.VerifyPlugin if verificationPluginName != "" { logger.Debugf("Finding verification plugin %s", verificationPluginName) verificationPluginMinVersion, err := getVerificationPluginMinVersion(&outcome.EnvelopeContent.SignerInfo) @@ -633,7 +633,7 @@ func verifyRevocation(outcome *notation.VerificationOutcome, r revocation.Revoca return result } -func executePlugin(ctx context.Context, installedPlugin plugin.Plugin, trustPolicy *trustpolicy.TrustPolicy, capabilitiesToVerify []proto.Capability, envelopeContent *signature.EnvelopeContent, pluginConfig map[string]string) (*proto.VerifySignatureResponse, error) { +func executePlugin(ctx context.Context, installedPlugin plugin.VerifyPlugin, trustPolicy *trustpolicy.TrustPolicy, capabilitiesToVerify []proto.Capability, envelopeContent *signature.EnvelopeContent, pluginConfig map[string]string) (*proto.VerifySignatureResponse, error) { logger := log.GetLogger(ctx) // sanity check if installedPlugin == nil {