debian-forge-composer/vendor/github.com/containers/ocicrypt
Michael Vogt 409b4f6048 go.mod: update to images@v0.117.0
This commit updates to images v0.117.0 so that the cross-distro.sh
test works again (images removed fedora-39.json in main but the
uses the previous version of images that includes fedora-39 so
there is a mismatch (we should look into if there is a way to
get github.com/osbuild/images@latest instead of main in the
cross-arch test).

It also updates all the vendor stuff that got pulled via the
new images release (which is giantonormous).

This update requires updating the Go version to 1.22.8
2025-02-19 19:19:42 +01:00
..
blockcipher go.mod: update osbuild/images to v0.74.0 2024-08-07 12:06:28 +02:00
config deps: update osbuild/images to 246b718310ea 2023-07-21 12:05:00 +02:00
crypto/pkcs11 vendor: Update osbuild/images to commit dd48a38be218 2023-09-21 16:56:54 +02:00
keywrap go.mod: update to images@v0.117.0 2025-02-19 19:19:42 +01:00
spec deps: update images to v0.18.0 2023-11-22 09:56:08 +01:00
utils go.mod: update osbuild/images to v0.74.0 2024-08-07 12:06:28 +02:00
.gitignore deps: update osbuild/images to 246b718310ea 2023-07-21 12:05:00 +02:00
.golangci.yml go.mod: update osbuild/images to v0.74.0 2024-08-07 12:06:28 +02:00
ADOPTERS.md container: add support for uploading to registries 2022-06-29 10:02:46 +02:00
CODE-OF-CONDUCT.md vendor: Update osbuild/images to commit dd48a38be218 2023-09-21 16:56:54 +02:00
encryption.go deps: update osbuild/images to 246b718310ea 2023-07-21 12:05:00 +02:00
gpg.go go.mod: update osbuild/images to v0.74.0 2024-08-07 12:06:28 +02:00
gpgvault.go deps: update osbuild/images to 246b718310ea 2023-07-21 12:05:00 +02:00
LICENSE container: add support for uploading to registries 2022-06-29 10:02:46 +02:00
MAINTAINERS container: add support for uploading to registries 2022-06-29 10:02:46 +02:00
Makefile deps: update images to v0.18.0 2023-11-22 09:56:08 +01:00
reader.go container: add support for uploading to registries 2022-06-29 10:02:46 +02:00
README.md container: add support for uploading to registries 2022-06-29 10:02:46 +02:00
SECURITY.md vendor: Update osbuild/images to commit dd48a38be218 2023-09-21 16:56:54 +02:00

OCIcrypt Library

The ocicrypt library is the OCI image spec implementation of container image encryption. More details of the spec can be seen in the OCI repository. The purpose of this library is to encode spec structures and consts in code, as well as provide a consistent implementation of image encryption across container runtimes and build tools.

Consumers of OCIcrypt:

Usage

There are various levels of usage for this library. The main consumers of these would be runtime/build tools, and a more specific use would be in the ability to extend cryptographic function.

Runtime/Build tool usage

The general exposed interface a runtime/build tool would use, would be to perform encryption or decryption of layers:

package "github.com/containers/ocicrypt"
func EncryptLayer(ec *config.EncryptConfig, encOrPlainLayerReader io.Reader, desc ocispec.Descriptor) (io.Reader, EncryptLayerFinalizer, error)
func DecryptLayer(dc *config.DecryptConfig, encLayerReader io.Reader, desc ocispec.Descriptor, unwrapOnly bool) (io.Reader, digest.Digest, error)

The settings/parameters to these functions can be specified via creation of an encryption config with the github.com/containers/ocicrypt/config package. We note that because setting of annotations and other fields of the layer descriptor is done through various means in different runtimes/build tools, it is the responsibility of the caller to still ensure that the layer descriptor follows the OCI specification (i.e. encoding, setting annotations, etc.).

Crypto Agility and Extensibility

The implementation for both symmetric and asymmetric encryption used in this library are behind 2 main interfaces, which users can extend if need be. These are in the following packages:

  • github.com/containers/ocicrypt/blockcipher - LayerBlockCipher interface for block ciphers
  • github.com/containers/ocicrypt/keywrap - KeyWrapper interface for key wrapping

We note that adding interfaces here is risky outside the OCI spec is not recommended, unless for very specialized and confined usecases. Please open an issue or PR if there is a general usecase that could be added to the OCI spec.

Keyprovider interface

As part of the keywrap interface, there is a keyprovider implementation that allows one to call out to a binary or service.

Security Issues

We consider security issues related to this library critical. Please report and security related issues by emailing maintainers in the MAINTAINERS file.

Ocicrypt Pkcs11 Support

Ocicrypt Pkcs11 support is currently experiemental. For more details, please refer to the this document.