From 1ccf34a67c82866d48f29a5b2573620513092cb1 Mon Sep 17 00:00:00 2001 From: Parnell Springmeyer Date: Fri, 1 Dec 2017 12:46:15 -0600 Subject: [PATCH 1/2] Remove response integrity check of config.json and layer This change is being made because the `Docker-Content-Digest` value sent back by docker distribution is a hash digest from the image manifest list when only the image manifest is accepted by the client. This issue on docker distribution tracks the regression: https://github.com/docker/distribution/issues/2395 Fixes #23 Issue #24 tracks reverting this change when the docker distribution issue is resolved. --- src/Network/Wreq/Docker/Image.hs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/Network/Wreq/Docker/Image.hs b/src/Network/Wreq/Docker/Image.hs index 413b352..8a68c19 100644 --- a/src/Network/Wreq/Docker/Image.hs +++ b/src/Network/Wreq/Docker/Image.hs @@ -111,7 +111,7 @@ fetchLayer = writeC <- liftIO $ getConcurrentOutputter liftIO . writeC . Text.unpack $ "Downloading layer: " <> shortRef - fetchedImageLayer <- checkResponseIntegrity' =<< Docker.Registry.fetchLayer ("sha256:" <> layerDigest) + fetchedImageLayer <- Docker.Registry.fetchLayer ("sha256:" <> layerDigest) layerPath <- writeRespBody layerOut layerDigest fetchedImageLayer liftIO . writeC $ Text.unpack ("=> wrote " <> shortRef) @@ -125,7 +125,6 @@ fetchConfig = runHocker $ ask >>= \HockerMeta{..} -> do configDigest <- fetchManifest - >>= checkResponseIntegrity' >>= getConfigDigest . view Wreq.responseBody fetchImageConfig configDigest From 5f9c4ecaeb314daa9d3154e1b4601731163349f6 Mon Sep 17 00:00:00 2001 From: Parnell Springmeyer Date: Fri, 1 Dec 2017 12:46:41 -0600 Subject: [PATCH 2/2] Add the hocker tests data files This fixes a test failure caused by the tests data dir not being included in the cabal source distribution. --- hocker.cabal | 3 +++ 1 file changed, 3 insertions(+) diff --git a/hocker.cabal b/hocker.cabal index 2645243..5568062 100644 --- a/hocker.cabal +++ b/hocker.cabal @@ -36,6 +36,9 @@ extra-source-files: README.md CHANGELOG.md +data-dir: + test/data + source-repository head type: git location: https://github.com/awakesecurity/hocker.git