| 1 |
// Copyright The Notary Project Authors. |
| 2 |
// Licensed under the Apache License, Version 2.0 (the "License"); |
| 3 |
// you may not use this file except in compliance with the License. |
| 4 |
// You may obtain a copy of the License at |
| 5 |
// |
| 6 |
// http://www.apache.org/licenses/LICENSE-2.0 |
| 7 |
// |
| 8 |
// Unless required by applicable law or agreed to in writing, software |
| 9 |
// distributed under the License is distributed on an "AS IS" BASIS, |
| 10 |
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 11 |
// See the License for the specific language governing permissions and |
| 12 |
// limitations under the License. |
| 13 |
|
| 14 |
package signer |
| 15 |
|
| 16 |
import ( |
| 17 |
"context" |
| 18 |
"crypto" |
| 19 |
"crypto/x509" |
| 20 |
"encoding/json" |
| 21 |
"errors" |
| 22 |
"fmt" |
| 23 |
"reflect" |
| 24 |
"strings" |
| 25 |
"testing" |
| 26 |
"time" |
| 27 |
|
| 28 |
"github.com/notaryproject/notation-core-go/signature" |
| 29 |
_ "github.com/notaryproject/notation-core-go/signature/cose" |
| 30 |
_ "github.com/notaryproject/notation-core-go/signature/jws" |
| 31 |
"github.com/notaryproject/notation-go" |
| 32 |
"github.com/notaryproject/notation-go/internal/envelope" |
| 33 |
"github.com/notaryproject/notation-go/plugin" |
| 34 |
"github.com/notaryproject/notation-go/plugin/proto" |
| 35 |
ocispec "github.com/opencontainers/image-spec/specs-go/v1" |
| 36 |
) |
| 37 |
|
| 38 |
var ( |
| 39 |
validMetadata = proto.GetMetadataResponse{ |
| 40 |
Name: "testPlugin", |
| 41 |
Description: "plugin for test", |
| 42 |
Version: "1.0", URL: "test.com", |
| 43 |
SupportedContractVersions: []string{proto.ContractVersion}, |
| 44 |
Capabilities: []proto.Capability{proto.CapabilitySignatureGenerator}, |
| 45 |
} |
| 46 |
validSignDescriptor, validSignOpts = generateSigningContent() |
| 47 |
invalidSignatureEnvelope = []byte("invalid") |
| 48 |
) |
| 49 |
|
| 50 |
var ( |
| 51 |
defaultKeyCert *keyCertPair |
| 52 |
defaultKeySpec signature.KeySpec |
| 53 |
) |
| 54 |
|
| 55 |
func init() { |
| 56 |
keyCertPairCollections = setUpKeyCertPairCollections() |
| 57 |
defaultKeyCert = keyCertPairCollections[0] |
| 58 |
defaultKeySpec, _ = signature.ExtractKeySpec(defaultKeyCert.certs[0]) |
| 59 |
} |
| 60 |
|
| 61 |
type mockPlugin struct { |
| 62 |
failEnvelope bool |
| 63 |
wantEnvelope bool |
| 64 |
invalidSig bool |
| 65 |
invalidCertChain bool |
| 66 |
invalidDescriptor bool |
| 67 |
annotations map[string]string |
| 68 |
key crypto.PrivateKey |
| 69 |
certs []*x509.Certificate |
| 70 |
keySpec signature.KeySpec |
| 71 |
} |
| 72 |
|
| 73 |
func newMockPlugin(key crypto.PrivateKey, certs []*x509.Certificate, keySpec signature.KeySpec) *mockPlugin { |
| 74 |
return &mockPlugin{ |
| 75 |
key: key, |
| 76 |
certs: certs, |
| 77 |
keySpec: keySpec, |
| 78 |
} |
| 79 |
} |
| 80 |
|
| 81 |
func (p *mockPlugin) GetMetadata(ctx context.Context, req *proto.GetMetadataRequest) (*proto.GetMetadataResponse, error) { |
| 82 |
if p.wantEnvelope { |
| 83 |
return &proto.GetMetadataResponse{ |
| 84 |
Name: "testPlugin", |
| 85 |
Version: "1.0", |
| 86 |
SupportedContractVersions: []string{proto.ContractVersion}, |
| 87 |
Capabilities: []proto.Capability{proto.CapabilityEnvelopeGenerator}, |
| 88 |
}, nil |
| 89 |
} |
| 90 |
return &proto.GetMetadataResponse{ |
| 91 |
Name: "testPlugin", |
| 92 |
Version: "1.0", |
| 93 |
SupportedContractVersions: []string{proto.ContractVersion}, |
| 94 |
Capabilities: []proto.Capability{proto.CapabilitySignatureGenerator}, |
| 95 |
}, nil |
| 96 |
} |
| 97 |
|
| 98 |
// DescribeKey returns the KeySpec of a key. |
| 99 |
func (p *mockPlugin) DescribeKey(ctx context.Context, req *proto.DescribeKeyRequest) (*proto.DescribeKeyResponse, error) { |
| 100 |
ks, _ := proto.EncodeKeySpec(p.keySpec) |
| 101 |
return &proto.DescribeKeyResponse{ |
| 102 |
KeySpec: ks, |
| 103 |
}, nil |
| 104 |
} |
| 105 |
|
| 106 |
// GenerateSignature generates the raw signature based on the request. |
| 107 |
func (p *mockPlugin) GenerateSignature(ctx context.Context, req *proto.GenerateSignatureRequest) (*proto.GenerateSignatureResponse, error) { |
| 108 |
sig, err := localSign(req.Payload, p.keySpec.SignatureAlgorithm().Hash(), p.key) |
| 109 |
var certChain [][]byte |
| 110 |
for _, cert := range p.certs { |
| 111 |
certChain = append(certChain, cert.Raw) |
| 112 |
} |
| 113 |
sigAlg, _ := proto.EncodeSigningAlgorithm(p.keySpec.SignatureAlgorithm()) |
| 114 |
if p.invalidSig { |
| 115 |
return &proto.GenerateSignatureResponse{ |
| 116 |
KeyID: req.KeyID, |
| 117 |
Signature: invalidSignatureEnvelope, |
| 118 |
SigningAlgorithm: sigAlg, |
| 119 |
CertificateChain: certChain, |
| 120 |
}, err |
| 121 |
} |
| 122 |
if p.invalidCertChain { |
| 123 |
return &proto.GenerateSignatureResponse{ |
| 124 |
KeyID: req.KeyID, |
| 125 |
Signature: sig, |
| 126 |
CertificateChain: [][]byte{{}, {}}, |
| 127 |
}, err |
| 128 |
} |
| 129 |
|
| 130 |
return &proto.GenerateSignatureResponse{ |
| 131 |
KeyID: req.KeyID, |
| 132 |
Signature: sig, |
| 133 |
CertificateChain: certChain, |
| 134 |
}, nil |
| 135 |
} |
| 136 |
|
| 137 |
// GenerateEnvelope generates the Envelope with signature based on the request. |
| 138 |
func (p *mockPlugin) GenerateEnvelope(ctx context.Context, req *proto.GenerateEnvelopeRequest) (*proto.GenerateEnvelopeResponse, error) { |
| 139 |
internalPluginSigner := PluginSigner{ |
| 140 |
plugin: newMockPlugin(p.key, p.certs, p.keySpec), |
| 141 |
} |
| 142 |
|
| 143 |
if p.failEnvelope { |
| 144 |
return nil, errors.New("failed GenerateEnvelope") |
| 145 |
} |
| 146 |
if p.invalidDescriptor { |
| 147 |
var payload map[string]interface{} |
| 148 |
if err := json.Unmarshal(req.Payload, &payload); err != nil { |
| 149 |
return nil, err |
| 150 |
} |
| 151 |
payload["additional_field"] = "some_string" |
| 152 |
|
| 153 |
updatedPayload, err := json.Marshal(payload) |
| 154 |
if err != nil { |
| 155 |
return nil, err |
| 156 |
} |
| 157 |
|
| 158 |
primitivePluginSigner := &pluginPrimitiveSigner{ |
| 159 |
ctx: ctx, |
| 160 |
plugin: internalPluginSigner.plugin, |
| 161 |
keyID: internalPluginSigner.keyID, |
| 162 |
pluginConfig: req.PluginConfig, |
| 163 |
keySpec: p.keySpec, |
| 164 |
} |
| 165 |
|
| 166 |
signReq := &signature.SignRequest{ |
| 167 |
Payload: signature.Payload{ |
| 168 |
ContentType: envelope.MediaTypePayloadV1, |
| 169 |
Content: updatedPayload, |
| 170 |
}, |
| 171 |
Signer: primitivePluginSigner, |
| 172 |
SigningTime: time.Now(), |
| 173 |
ExtendedSignedAttributes: nil, |
| 174 |
SigningScheme: signature.SigningSchemeX509, |
| 175 |
SigningAgent: "testing agent", |
| 176 |
} |
| 177 |
|
| 178 |
sigEnv, err := signature.NewEnvelope(req.SignatureEnvelopeType) |
| 179 |
if err != nil { |
| 180 |
return nil, err |
| 181 |
} |
| 182 |
|
| 183 |
sig, err := sigEnv.Sign(signReq) |
| 184 |
return &proto.GenerateEnvelopeResponse{ |
| 185 |
SignatureEnvelope: sig, |
| 186 |
SignatureEnvelopeType: req.SignatureEnvelopeType, |
| 187 |
}, err |
| 188 |
} |
| 189 |
if p.wantEnvelope { |
| 190 |
var payload envelope.Payload |
| 191 |
if err := json.Unmarshal(req.Payload, &payload); err != nil { |
| 192 |
return nil, err |
| 193 |
} |
| 194 |
validSignOpts.SignatureMediaType = req.SignatureEnvelopeType |
| 195 |
data, _, err := internalPluginSigner.Sign(ctx, payload.TargetArtifact, validSignOpts) |
| 196 |
if err != nil { |
| 197 |
return nil, err |
| 198 |
} |
| 199 |
return &proto.GenerateEnvelopeResponse{ |
| 200 |
SignatureEnvelope: data, |
| 201 |
SignatureEnvelopeType: req.SignatureEnvelopeType, |
| 202 |
Annotations: p.annotations, |
| 203 |
}, nil |
| 204 |
} |
| 205 |
return &proto.GenerateEnvelopeResponse{}, nil |
| 206 |
} |
| 207 |
|
| 208 |
func TestNewFromPluginFailed(t *testing.T) { |
| 209 |
tests := map[string]struct { |
| 210 |
pl plugin.SignPlugin |
| 211 |
keyID string |
| 212 |
errMsg string |
| 213 |
}{ |
| 214 |
"Invalid KeyID": { |
| 215 |
pl: &plugin.CLIPlugin{}, |
| 216 |
keyID: "", |
| 217 |
errMsg: "keyID not specified", |
| 218 |
}, |
| 219 |
"nilPlugin": { |
| 220 |
pl: nil, |
| 221 |
keyID: "someKeyId", |
| 222 |
errMsg: "nil plugin", |
| 223 |
}, |
| 224 |
} |
| 225 |
for name, tc := range tests { |
| 226 |
t.Run(name, func(t *testing.T) { |
| 227 |
_, err := NewFromPlugin(tc.pl, tc.keyID, make(map[string]string)) |
| 228 |
if err == nil || err.Error() != tc.errMsg { |
| 229 |
t.Fatalf("TestNewFromPluginFailed expects error %q, got %q", tc.errMsg, err.Error()) |
| 230 |
} |
| 231 |
}) |
| 232 |
} |
| 233 |
} |
| 234 |
|
| 235 |
func TestSigner_Sign_EnvelopeNotSupported(t *testing.T) { |
| 236 |
signer := PluginSigner{ |
| 237 |
plugin: newMockPlugin(nil, nil, signature.KeySpec{Type: signature.KeyTypeRSA, Size: 2048}), |
| 238 |
} |
| 239 |
opts := notation.SignerSignOptions{SignatureMediaType: "unsupported"} |
| 240 |
testSignerError(t, signer, fmt.Sprintf("signature envelope format with media type %q is not supported", opts.SignatureMediaType), opts) |
| 241 |
} |
| 242 |
|
| 243 |
func TestSigner_Sign_DescribeKeyIDMismatch(t *testing.T) { |
| 244 |
respKeyId := "" |
| 245 |
for _, envelopeType := range signature.RegisteredEnvelopeTypes() { |
| 246 |
t.Run(fmt.Sprintf("envelopeType=%v", envelopeType), func(t *testing.T) { |
| 247 |
signer := PluginSigner{ |
| 248 |
plugin: newMockPlugin(nil, nil, signature.KeySpec{}), |
| 249 |
keyID: "1", |
| 250 |
} |
| 251 |
testSignerError(t, signer, fmt.Sprintf("keyID in describeKey response %q does not match request %q", respKeyId, signer.keyID), notation.SignerSignOptions{SignatureMediaType: envelopeType}) |
| 252 |
}) |
| 253 |
} |
| 254 |
} |
| 255 |
|
| 256 |
func TestSigner_Sign_ExpiryInValid(t *testing.T) { |
| 257 |
for _, envelopeType := range signature.RegisteredEnvelopeTypes() { |
| 258 |
t.Run(fmt.Sprintf("envelopeType=%v", envelopeType), func(t *testing.T) { |
| 259 |
ks, _ := signature.ExtractKeySpec(keyCertPairCollections[0].certs[0]) |
| 260 |
signer := PluginSigner{ |
| 261 |
plugin: newMockPlugin(keyCertPairCollections[0].key, keyCertPairCollections[0].certs, ks), |
| 262 |
} |
| 263 |
_, _, err := signer.Sign(context.Background(), ocispec.Descriptor{}, notation.SignerSignOptions{ExpiryDuration: -24 * time.Hour, SignatureMediaType: envelopeType}) |
| 264 |
wantEr := "expiry cannot be equal or before the signing time" |
| 265 |
if err == nil || !strings.Contains(err.Error(), wantEr) { |
| 266 |
t.Errorf("Signer.Sign() error = %v, wantErr %v", err, wantEr) |
| 267 |
} |
| 268 |
}) |
| 269 |
} |
| 270 |
} |
| 271 |
|
| 272 |
func TestSigner_Sign_InvalidCertChain(t *testing.T) { |
| 273 |
for _, envelopeType := range signature.RegisteredEnvelopeTypes() { |
| 274 |
t.Run(fmt.Sprintf("envelopeType=%v", envelopeType), func(t *testing.T) { |
| 275 |
mockPlugin := newMockPlugin(defaultKeyCert.key, defaultKeyCert.certs, defaultKeySpec) |
| 276 |
mockPlugin.invalidCertChain = true |
| 277 |
signer := PluginSigner{ |
| 278 |
plugin: mockPlugin, |
| 279 |
} |
| 280 |
testSignerError(t, signer, "x509: malformed certificate", notation.SignerSignOptions{SignatureMediaType: envelopeType}) |
| 281 |
}) |
| 282 |
} |
| 283 |
} |
| 284 |
|
| 285 |
func TestSigner_Sign_InvalidDescriptor(t *testing.T) { |
| 286 |
for _, envelopeType := range signature.RegisteredEnvelopeTypes() { |
| 287 |
t.Run(fmt.Sprintf("envelopeType=%v", envelopeType), func(t *testing.T) { |
| 288 |
mockPlugin := newMockPlugin(defaultKeyCert.key, defaultKeyCert.certs, defaultKeySpec) |
| 289 |
mockPlugin.wantEnvelope = true |
| 290 |
mockPlugin.invalidDescriptor = true |
| 291 |
signer := PluginSigner{ |
| 292 |
plugin: mockPlugin, |
| 293 |
} |
| 294 |
testSignerError(t, signer, "during signing, following unknown attributes were added to subject descriptor: [\"additional_field\"]", notation.SignerSignOptions{SignatureMediaType: envelopeType}) |
| 295 |
}) |
| 296 |
} |
| 297 |
} |
| 298 |
|
| 299 |
func TestPluginSigner_Sign_SignatureVerifyError(t *testing.T) { |
| 300 |
for _, envelopeType := range signature.RegisteredEnvelopeTypes() { |
| 301 |
t.Run(fmt.Sprintf("envelopeType=%v", envelopeType), func(t *testing.T) { |
| 302 |
mockPlugin := newMockPlugin(defaultKeyCert.key, defaultKeyCert.certs, defaultKeySpec) |
| 303 |
mockPlugin.invalidSig = true |
| 304 |
signer := PluginSigner{ |
| 305 |
plugin: mockPlugin, |
| 306 |
} |
| 307 |
testSignerError(t, signer, "signature is invalid", notation.SignerSignOptions{SignatureMediaType: envelopeType}) |
| 308 |
}) |
| 309 |
} |
| 310 |
} |
| 311 |
|
| 312 |
func TestPluginSigner_Sign_Valid(t *testing.T) { |
| 313 |
for _, envelopeType := range signature.RegisteredEnvelopeTypes() { |
| 314 |
for _, keyCert := range keyCertPairCollections { |
| 315 |
t.Run(fmt.Sprintf("external plugin,envelopeType=%v_keySpec=%v", envelopeType, keyCert.keySpecName), func(t *testing.T) { |
| 316 |
keySpec, _ := proto.DecodeKeySpec(proto.KeySpec(keyCert.keySpecName)) |
| 317 |
pluginSigner := PluginSigner{ |
| 318 |
plugin: newMockPlugin(keyCert.key, keyCert.certs, keySpec), |
| 319 |
} |
| 320 |
validSignOpts.SignatureMediaType = envelopeType |
| 321 |
data, signerInfo, err := pluginSigner.Sign(context.Background(), validSignDescriptor, validSignOpts) |
| 322 |
basicSignTest(t, &pluginSigner, envelopeType, data, signerInfo, err) |
| 323 |
}) |
| 324 |
} |
| 325 |
} |
| 326 |
} |
| 327 |
|
| 328 |
func TestPluginSigner_SignEnvelope_RunFailed(t *testing.T) { |
| 329 |
for _, envelopeType := range signature.RegisteredEnvelopeTypes() { |
| 330 |
t.Run(fmt.Sprintf("envelopeType=%v", envelopeType), func(t *testing.T) { |
| 331 |
p := &mockPlugin{ |
| 332 |
wantEnvelope: true, |
| 333 |
failEnvelope: true, |
| 334 |
} |
| 335 |
signer := PluginSigner{ |
| 336 |
plugin: p, |
| 337 |
} |
| 338 |
testSignerError(t, signer, "failed GenerateEnvelope", notation.SignerSignOptions{SignatureMediaType: envelopeType}) |
| 339 |
}) |
| 340 |
} |
| 341 |
} |
| 342 |
|
| 343 |
func TestPluginSigner_SignEnvelope_Valid(t *testing.T) { |
| 344 |
for _, envelopeType := range signature.RegisteredEnvelopeTypes() { |
| 345 |
for _, keyCert := range keyCertPairCollections { |
| 346 |
t.Run(fmt.Sprintf("envelopeType=%v, keySpec: %v", envelopeType, keyCert.keySpecName), func(t *testing.T) { |
| 347 |
keySpec, _ := proto.DecodeKeySpec(proto.KeySpec(keyCert.keySpecName)) |
| 348 |
mockPlugin := newMockPlugin(keyCert.key, keyCert.certs, keySpec) |
| 349 |
mockPlugin.wantEnvelope = true |
| 350 |
pluginSigner := PluginSigner{ |
| 351 |
plugin: mockPlugin, |
| 352 |
} |
| 353 |
validSignOpts.SignatureMediaType = envelopeType |
| 354 |
data, signerInfo, err := pluginSigner.Sign(context.Background(), validSignDescriptor, validSignOpts) |
| 355 |
basicSignTest(t, &pluginSigner, envelopeType, data, signerInfo, err) |
| 356 |
}) |
| 357 |
} |
| 358 |
} |
| 359 |
} |
| 360 |
|
| 361 |
func TestPluginSigner_SignWithAnnotations_Valid(t *testing.T) { |
| 362 |
for _, envelopeType := range signature.RegisteredEnvelopeTypes() { |
| 363 |
for _, keyCert := range keyCertPairCollections { |
| 364 |
t.Run(fmt.Sprintf("external plugin,envelopeType=%v_keySpec=%v", envelopeType, keyCert.keySpecName), func(t *testing.T) { |
| 365 |
keySpec, _ := proto.DecodeKeySpec(proto.KeySpec(keyCert.keySpecName)) |
| 366 |
annts := map[string]string{"key": "value"} |
| 367 |
pluginSigner := PluginSigner{ |
| 368 |
plugin: &mockPlugin{ |
| 369 |
key: keyCert.key, |
| 370 |
certs: keyCert.certs, |
| 371 |
keySpec: keySpec, |
| 372 |
annotations: map[string]string{"key": "value"}, |
| 373 |
wantEnvelope: true, |
| 374 |
}, |
| 375 |
} |
| 376 |
validSignOpts.SignatureMediaType = envelopeType |
| 377 |
data, signerInfo, err := pluginSigner.Sign(context.Background(), validSignDescriptor, validSignOpts) |
| 378 |
basicSignTest(t, &pluginSigner, envelopeType, data, signerInfo, err) |
| 379 |
if !reflect.DeepEqual(pluginSigner.PluginAnnotations(), annts) { |
| 380 |
fmt.Println(pluginSigner.PluginAnnotations()) |
| 381 |
t.Errorf("mismatch in annotations returned from PluginAnnotations()") |
| 382 |
} |
| 383 |
}) |
| 384 |
} |
| 385 |
} |
| 386 |
} |
| 387 |
|
| 388 |
func testSignerError(t *testing.T, signer PluginSigner, wantEr string, opts notation.SignerSignOptions) { |
| 389 |
t.Helper() |
| 390 |
_, _, err := signer.Sign(context.Background(), ocispec.Descriptor{}, opts) |
| 391 |
if err == nil || !strings.Contains(err.Error(), wantEr) { |
| 392 |
t.Errorf("Signer.Sign() error = %v, wantErr %v", err, wantEr) |
| 393 |
} |
| 394 |
} |
| 395 |
|
| 396 |
func basicSignTest(t *testing.T, ps *PluginSigner, envelopeType string, data []byte, signerInfo *signature.SignerInfo, err error) { |
| 397 |
if err != nil { |
| 398 |
t.Fatalf("Signer.Sign() error = %v, wantErr nil", err) |
| 399 |
} |
| 400 |
env, err := signature.ParseEnvelope(envelopeType, data) |
| 401 |
if err != nil { |
| 402 |
t.Fatal(err) |
| 403 |
} |
| 404 |
envContent, err := env.Verify() |
| 405 |
if err != nil { |
| 406 |
t.Fatal(err) |
| 407 |
} |
| 408 |
|
| 409 |
if err := envelope.ValidatePayloadContentType(&envContent.Payload); err != nil { |
| 410 |
t.Fatalf("verification failed. error = %v", err) |
| 411 |
} |
| 412 |
|
| 413 |
payload := envContent.Payload |
| 414 |
if payload.ContentType != envelope.MediaTypePayloadV1 { |
| 415 |
t.Fatalf("Signer.Sign() Payload content type changed, expect: %v, got: %v", payload.ContentType, envelope.MediaTypePayloadV1) |
| 416 |
} |
| 417 |
var gotPayload envelope.Payload |
| 418 |
if err := json.Unmarshal(payload.Content, &gotPayload); err != nil { |
| 419 |
t.Fatalf("Signer.Sign() Unmarshal payload failed: %v", err) |
| 420 |
} |
| 421 |
expectedPayload := envelope.Payload{ |
| 422 |
TargetArtifact: validSignDescriptor, |
| 423 |
} |
| 424 |
if !reflect.DeepEqual(expectedPayload, gotPayload) { |
| 425 |
t.Fatalf("Signer.Sign() descriptor subject changed, expect: %+v, got: %+v", expectedPayload, payload) |
| 426 |
} |
| 427 |
if signerInfo.SignedAttributes.SigningScheme != signature.SigningSchemeX509 { |
| 428 |
t.Fatalf("Signer.Sign() signing scheme changed, expect: %+v, got: %+v", signerInfo.SignedAttributes.SigningScheme, signature.SigningSchemeX509) |
| 429 |
} |
| 430 |
mockPlugin := ps.plugin.(*mockPlugin) |
| 431 |
if mockPlugin.keySpec.SignatureAlgorithm() != signerInfo.SignatureAlgorithm { |
| 432 |
t.Fatalf("Signer.Sign() signing algorithm changed") |
| 433 |
} |
| 434 |
if validSignOpts.ExpiryDuration != signerInfo.SignedAttributes.Expiry.Sub(signerInfo.SignedAttributes.SigningTime) { |
| 435 |
t.Fatalf("Signer.Sign() expiry duration changed") |
| 436 |
} |
| 437 |
if !reflect.DeepEqual(mockPlugin.certs, signerInfo.CertificateChain) { |
| 438 |
t.Fatalf(" Signer.Sign() cert chain changed") |
| 439 |
} |
| 440 |
basicVerification(t, data, envelopeType, mockPlugin.certs[len(mockPlugin.certs)-1], &validMetadata) |
| 441 |
} |