Skip to content

Commit

Permalink
Backport TUF security bugfix to 3.6
Browse files Browse the repository at this point in the history
cherry-picks dcfdc9c
  • Loading branch information
andreabedini committed Nov 16, 2023
1 parent 8fd619e commit 0f207d6
Showing 1 changed file with 6 additions and 4 deletions.
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 @@ -197,10 +197,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

let rname = remoteRepoName (repoRemote repo)

Expand Down

0 comments on commit 0f207d6

Please sign in to comment.