Skip to content

Commit 726b506

Browse files
committed
machine init: fix tls check
Ensure we verify the TLS connection when pulling the OCI image. Fixes: CVE-2025-6032 Signed-off-by: Paul Holzinger <pholzing@redhat.com>
1 parent 7808625 commit 726b506

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

pkg/machine/ocipull/ociartifact.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -217,7 +217,7 @@ func (o *OCIArtifactDisk) getDestArtifact() (types.ImageReference, digest.Digest
217217
}
218218
fmt.Printf("Looking up Podman Machine image at %s to create VM\n", imgRef.DockerReference())
219219
sysCtx := &types.SystemContext{
220-
DockerInsecureSkipTLSVerify: types.NewOptionalBool(!o.pullOptions.TLSVerify),
220+
DockerInsecureSkipTLSVerify: o.pullOptions.SkipTLSVerify,
221221
}
222222
imgSrc, err := imgRef.NewImageSource(o.ctx, sysCtx)
223223
if err != nil {

pkg/machine/ocipull/pull.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,8 @@ import (
2121
// PullOptions includes data to alter certain knobs when pulling a source
2222
// image.
2323
type PullOptions struct {
24-
// Require HTTPS and verify certificates when accessing the registry.
25-
TLSVerify bool
24+
// Skip TLS verification when accessing the registry.
25+
SkipTLSVerify types.OptionalBool
2626
// [username[:password] to use when connecting to the registry.
2727
Credentials string
2828
// Quiet the progress bars when pushing.
@@ -46,7 +46,7 @@ func Pull(ctx context.Context, imageInput types.ImageReference, localDestPath *d
4646
}
4747

4848
sysCtx := &types.SystemContext{
49-
DockerInsecureSkipTLSVerify: types.NewOptionalBool(!options.TLSVerify),
49+
DockerInsecureSkipTLSVerify: options.SkipTLSVerify,
5050
}
5151
if options.Credentials != "" {
5252
authConf, err := parse.AuthConfig(options.Credentials)

0 commit comments

Comments
 (0)