Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
G
ghcup-hs
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Haskell
ghcup-hs
Commits
c782bc44
Verified
Commit
c782bc44
authored
5 years ago
by
Julian Ospald
Browse files
Options
Downloads
Patches
Plain Diff
Avoid unnecessary OpenSSL deps
parent
f78e7b1c
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
ghcup.cabal
+9
-5
9 additions, 5 deletions
ghcup.cabal
lib/GHCup/Download.hs
+3
-2
3 additions, 2 deletions
lib/GHCup/Download.hs
with
12 additions
and
7 deletions
ghcup.cabal
+
9
−
5
View file @
c782bc44
...
...
@@ -47,6 +47,9 @@ common attoparsec
common base
build-depends: base >=4.12 && <5
common base16-bytestring
build-depends: base16-bytestring >= 0.1.1.6
common binary
build-depends: binary >=0.8.6.0
...
...
@@ -65,6 +68,9 @@ common concurrent-output
common containers
build-depends: containers >=0.6
common cryptohash-sha256
build-depends: cryptohash-sha256 >= 0.11.101.0
common generics-sop
build-depends: generics-sop >=0.5
...
...
@@ -74,9 +80,6 @@ common haskus-utils-types
common haskus-utils-variant
build-depends: haskus-utils-variant >=3.0
common hopenssl
build-depends: hopenssl >=2.2.4
common hpath
build-depends: hpath >=0.11
...
...
@@ -223,7 +226,7 @@ library
import:
config
, base
,
HsOpenSSL
,
base16-bytestring
, aeson
, ascii-string
, async
...
...
@@ -234,10 +237,10 @@ library
, case-insensitive
, concurrent-output
, containers
, cryptohash-sha256
, generics-sop
, haskus-utils-types
, haskus-utils-variant
, hopenssl
, hpath
, hpath-directory
, hpath-filepath
...
...
@@ -301,6 +304,7 @@ library
if !flag(curl)
import:
, HsOpenSSL
, http-io-streams
, io-streams
, terminal-progress-bar
...
...
This diff is collapsed.
Click to expand it.
lib/GHCup/Download.hs
+
3
−
2
View file @
c782bc44
...
...
@@ -45,7 +45,6 @@ import GHC.IO.Exception
import
HPath
import
HPath.IO
as
HIO
import
Haskus.Utils.Variant.Excepts
import
OpenSSL.Digest
import
Optics
import
Prelude
hiding
(
abs
,
readFile
...
...
@@ -54,6 +53,8 @@ import Prelude hiding ( abs
import
System.IO.Error
import
URI.ByteString
import
qualified
Crypto.Hash.SHA256
as
SHA256
import
qualified
Data.ByteString.Base16
as
B16
import
qualified
Data.ByteString.Lazy
as
L
import
qualified
Data.CaseInsensitive
as
CI
import
qualified
Data.Map.Strict
as
M
...
...
@@ -400,7 +401,7 @@ checkDigest dli file = do
let
p'
=
toFilePath
file
lift
$
$
(
logInfo
)
[
i
|
verifying digest of: #{p'}
|]
c
<-
liftIO
$
readFile
file
let
cDigest
=
E
.
decodeUtf8
.
toHex
.
digest
(
digestByName
"sha256"
)
$
c
let
cDigest
=
E
.
decodeUtf8
.
B16
.
encode
.
SHA256
.
hashlazy
$
c
eDigest
=
view
dlHash
dli
when
((
cDigest
/=
eDigest
)
&&
verify
)
$
throwE
(
DigestError
cDigest
eDigest
)
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment