Update for c/image's update of github.com/gobuffalo/pop

> go get github.com/containers/image/v5@main
> go mod tidy -go=1.16 && go mod tidy -go=1.17
> make vendor

The (go mod tidy) pair is necessary to keep c/image CI working.

Signed-off-by: Miloslav Trmač <mitr@redhat.com>
This commit is contained in:
Miloslav Trmač
2022-08-23 20:47:59 +02:00
parent a81460437a
commit 4b9ffac0cc
151 changed files with 4206 additions and 6092 deletions

View File

@@ -27,10 +27,8 @@ import (
// PassFunc is a type of function that takes a boolean (representing whether confirmation is desired) and returns the password as read, along with an error if one occurred
type PassFunc func(bool) ([]byte, error)
var (
// Read is for fuzzing
Read = readPasswordFn
)
// Read is for fuzzing
var Read = readPasswordFn
// readPasswordFn reads the password from the following sources, in order of preference:
//

View File

@@ -52,7 +52,13 @@ func UnmarshalPEMToPublicKey(pemBytes []byte) (crypto.PublicKey, error) {
if derBytes == nil {
return nil, errors.New("PEM decoding failed")
}
return x509.ParsePKIXPublicKey(derBytes.Bytes)
switch derBytes.Type {
case string(PublicKeyPEMType):
return x509.ParsePKIXPublicKey(derBytes.Bytes)
default:
return nil, fmt.Errorf("unknown Public key PEM file type: %v. Are you passing the correct public key?",
derBytes.Type)
}
}
// MarshalPublicKeyToDER converts a crypto.PublicKey into a PKIX, ASN.1 DER byte slice

View File

@@ -154,7 +154,7 @@ func LoadED25519SignerVerifier(priv ed25519.PrivateKey) (*ED25519SignerVerifier,
}
pub, ok := priv.Public().(ed25519.PublicKey)
if !ok {
return nil, fmt.Errorf("given key is not ed25519.PublicKey: %w", err)
return nil, fmt.Errorf("given key is not ed25519.PublicKey")
}
verifier, err := LoadED25519Verifier(pub)
if err != nil {

View File

@@ -26,7 +26,7 @@ import (
const CosignSignatureType = "cosign container image signature"
// SimpleContainerImage describes the structure of a basic container image signature payload, as defined at:
// https://github.com/containers/image/blob/master/docs/containers-signature.5.md#json-data-format
// https://github.com/containers/image/blob/master/docs/containers-signature.5.md#json-data-format
type SimpleContainerImage struct {
Critical Critical `json:"critical"` // Critical data critical to correctly evaluating the validity of the signature
Optional map[string]interface{} `json:"optional"` // Optional optional metadata about the image