Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Backport TUF security bugfix to 3.8 #9456

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions .github/workflows/validate.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ jobs:

- uses: actions/checkout@v2

- uses: haskell/actions/setup@v1
- uses: haskell-actions/setup@v2
id: setup-haskell
with:
ghc-version: ${{ matrix.ghc }}
Expand Down Expand Up @@ -208,10 +208,12 @@ jobs:
apt-get update
apt-get install -y ghc-${{ matrix.extra-ghc }}-dyn

- uses: haskell/actions/setup@v1
- uses: haskell-actions/setup@v2
id: setup-haskell
with:
ghc-version: ${{ matrix.ghc }}
# Make sure this bindist works in this old environment
cabal-install: 3.10.1.0

# As we are reusing the cached build dir from the previous step
# the generated artifacts are available here,
Expand Down Expand Up @@ -256,7 +258,7 @@ jobs:
steps:
- uses: actions/checkout@v2

- uses: haskell/actions/setup@v1
- uses: haskell-actions/setup@v2
id: setup-haskell
with:
ghc-version: ${{ matrix.ghc }}
Expand Down
10 changes: 6 additions & 4 deletions cabal-install/src/Distribution/Client/CmdUpdate.hs
Original file line number Diff line number Diff line change
Expand Up @@ -199,10 +199,12 @@ updateRepo verbosity _updateFlags repoCtxt (repo, indexState) = do
-- NB: always update the timestamp, even if we didn't actually
-- download anything
writeIndexTimestamp index indexState
ce <- if repoContextIgnoreExpiry repoCtxt
then Just `fmap` getCurrentTime
else return Nothing
updated <- Sec.uncheckClientErrors $ Sec.checkForUpdates repoSecure ce
-- typically we get the current time to check expiry against
-- but if the flag is set, we don't.
now' <- case repoContextIgnoreExpiry repoCtxt of
False -> Just <$> getCurrentTime
True -> pure Nothing
updated <- Sec.uncheckClientErrors $ Sec.checkForUpdates repoSecure now'
-- this resolves indexState (which could be HEAD) into a timestamp
new_ts <- currentIndexTimestamp (lessVerbose verbosity) repoCtxt repo
let rname = remoteRepoName (repoRemote repo)
Expand Down
Loading