cryptManifest encrypts or decrypts the children of a top level manifest
(ctx context.Context, cs content.Store, desc ocispec.Descriptor, cc *encconfig.CryptoConfig, lf LayerFilter, cryptoOp cryptoOp)
| 364 | |
| 365 | // cryptManifest encrypts or decrypts the children of a top level manifest |
| 366 | func cryptManifest(ctx context.Context, cs content.Store, desc ocispec.Descriptor, cc *encconfig.CryptoConfig, lf LayerFilter, cryptoOp cryptoOp) (ocispec.Descriptor, bool, error) { |
| 367 | p, err := content.ReadBlob(ctx, cs, desc) |
| 368 | if err != nil { |
| 369 | return ocispec.Descriptor{}, false, err |
| 370 | } |
| 371 | var manifest ocispec.Manifest |
| 372 | if err := json.Unmarshal(p, &manifest); err != nil { |
| 373 | return ocispec.Descriptor{}, false, err |
| 374 | } |
| 375 | platform := platforms.DefaultSpec() |
| 376 | newDesc, modified, err := cryptChildren(ctx, cs, desc, cc, lf, cryptoOp, &platform) |
| 377 | if err != nil || cryptoOp == cryptoOpUnwrapOnly { |
| 378 | return ocispec.Descriptor{}, false, err |
| 379 | } |
| 380 | return newDesc, modified, nil |
| 381 | } |
| 382 | |
| 383 | // cryptManifestList encrypts or decrypts the children of a top level manifest list |
| 384 | func cryptManifestList(ctx context.Context, cs content.Store, desc ocispec.Descriptor, cc *encconfig.CryptoConfig, lf LayerFilter, cryptoOp cryptoOp) (ocispec.Descriptor, bool, error) { |
no test coverage detected
searching dependent graphs…