From 85241523912eabf5e0ee1e372afa5c1e4559f7d9 Mon Sep 17 00:00:00 2001 From: Giuseppe Scrivano Date: Tue, 9 Jan 2024 10:04:42 +0100 Subject: [PATCH] storage: validate images converted to zstd:chunked Signed-off-by: Giuseppe Scrivano --- go.mod | 2 +- go.sum | 4 ++-- storage/storage_dest.go | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/go.mod b/go.mod index 9f661df75..244167057 100644 --- a/go.mod +++ b/go.mod @@ -7,7 +7,7 @@ require ( github.com/BurntSushi/toml v1.3.2 github.com/containers/libtrust v0.0.0-20230121012942-c1716e8a8d01 github.com/containers/ocicrypt v1.1.9 - github.com/containers/storage v1.51.1-0.20240102120156-ef81e9b09aad + github.com/containers/storage v1.51.1-0.20240108210900-5279cccb7208 github.com/cyberphone/json-canonicalization v0.0.0-20231217050601-ba74d44ecf5f github.com/distribution/reference v0.5.0 github.com/docker/cli v24.0.7+incompatible diff --git a/go.sum b/go.sum index 0d6045ee7..a57185018 100644 --- a/go.sum +++ b/go.sum @@ -51,8 +51,8 @@ github.com/containers/libtrust v0.0.0-20230121012942-c1716e8a8d01 h1:Qzk5C6cYgle github.com/containers/libtrust v0.0.0-20230121012942-c1716e8a8d01/go.mod h1:9rfv8iPl1ZP7aqh9YA68wnZv2NUDbXdcdPHVz0pFbPY= github.com/containers/ocicrypt v1.1.9 h1:2Csfba4jse85Raxk5HIyEk8OwZNjRvfkhEGijOjIdEM= github.com/containers/ocicrypt v1.1.9/go.mod h1:dTKx1918d8TDkxXvarscpNVY+lyPakPNFN4jwA9GBys= -github.com/containers/storage v1.51.1-0.20240102120156-ef81e9b09aad h1:N82/fTsdDj3C9rsCvY4E8EwpJa9YKi9aHTQBk/JoeJU= -github.com/containers/storage v1.51.1-0.20240102120156-ef81e9b09aad/go.mod h1:b/OcxiGpF0t+21LUK800D6fjSWNF2211o8V6Uc0NIvg= +github.com/containers/storage v1.51.1-0.20240108210900-5279cccb7208 h1:6mna1GBBpFmS2Q/2hvQ9TFBuoRsN8ZD+wJUgZOX7O48= +github.com/containers/storage v1.51.1-0.20240108210900-5279cccb7208/go.mod h1:PE+L330tisEjQrAVkfAlW8ECvqzc/jusrxJzu9TEi2w= github.com/coreos/go-oidc/v3 v3.9.0 h1:0J/ogVOd4y8P0f0xUh8l9t07xRP/d8tccvjHl2dcsSo= github.com/coreos/go-oidc/v3 v3.9.0/go.mod h1:rTKz2PYwftcrtoCzV5g5kvfJoWcm0Mk8AF8y1iAQro4= github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= diff --git a/storage/storage_dest.go b/storage/storage_dest.go index bbbff6cf9..b2bc26fbf 100644 --- a/storage/storage_dest.go +++ b/storage/storage_dest.go @@ -276,7 +276,7 @@ func (s *storageImageDestination) PutBlobPartial(ctx context.Context, chunkAcces blobInfo: srcInfo, } - differ, err := chunked.GetDiffer(ctx, s.imageRef.transport.store, srcInfo.Size, srcInfo.Annotations, &fetcher) + differ, err := chunked.GetDiffer(ctx, s.imageRef.transport.store, srcInfo.Digest, srcInfo.Size, srcInfo.Annotations, &fetcher) if err != nil { return private.UploadedBlob{}, err }