Avoid unnecessary OpenSSL deps
This commit is contained in:
parent
f78e7b1cbc
commit
c782bc44de
14
ghcup.cabal
14
ghcup.cabal
@ -47,6 +47,9 @@ common attoparsec
|
|||||||
common base
|
common base
|
||||||
build-depends: base >=4.12 && <5
|
build-depends: base >=4.12 && <5
|
||||||
|
|
||||||
|
common base16-bytestring
|
||||||
|
build-depends: base16-bytestring >= 0.1.1.6
|
||||||
|
|
||||||
common binary
|
common binary
|
||||||
build-depends: binary >=0.8.6.0
|
build-depends: binary >=0.8.6.0
|
||||||
|
|
||||||
@ -65,6 +68,9 @@ common concurrent-output
|
|||||||
common containers
|
common containers
|
||||||
build-depends: containers >=0.6
|
build-depends: containers >=0.6
|
||||||
|
|
||||||
|
common cryptohash-sha256
|
||||||
|
build-depends: cryptohash-sha256 >= 0.11.101.0
|
||||||
|
|
||||||
common generics-sop
|
common generics-sop
|
||||||
build-depends: generics-sop >=0.5
|
build-depends: generics-sop >=0.5
|
||||||
|
|
||||||
@ -74,9 +80,6 @@ common haskus-utils-types
|
|||||||
common haskus-utils-variant
|
common haskus-utils-variant
|
||||||
build-depends: haskus-utils-variant >=3.0
|
build-depends: haskus-utils-variant >=3.0
|
||||||
|
|
||||||
common hopenssl
|
|
||||||
build-depends: hopenssl >=2.2.4
|
|
||||||
|
|
||||||
common hpath
|
common hpath
|
||||||
build-depends: hpath >=0.11
|
build-depends: hpath >=0.11
|
||||||
|
|
||||||
@ -223,7 +226,7 @@ library
|
|||||||
import:
|
import:
|
||||||
config
|
config
|
||||||
, base
|
, base
|
||||||
, HsOpenSSL
|
, base16-bytestring
|
||||||
, aeson
|
, aeson
|
||||||
, ascii-string
|
, ascii-string
|
||||||
, async
|
, async
|
||||||
@ -234,10 +237,10 @@ library
|
|||||||
, case-insensitive
|
, case-insensitive
|
||||||
, concurrent-output
|
, concurrent-output
|
||||||
, containers
|
, containers
|
||||||
|
, cryptohash-sha256
|
||||||
, generics-sop
|
, generics-sop
|
||||||
, haskus-utils-types
|
, haskus-utils-types
|
||||||
, haskus-utils-variant
|
, haskus-utils-variant
|
||||||
, hopenssl
|
|
||||||
, hpath
|
, hpath
|
||||||
, hpath-directory
|
, hpath-directory
|
||||||
, hpath-filepath
|
, hpath-filepath
|
||||||
@ -301,6 +304,7 @@ library
|
|||||||
|
|
||||||
if !flag(curl)
|
if !flag(curl)
|
||||||
import:
|
import:
|
||||||
|
, HsOpenSSL
|
||||||
, http-io-streams
|
, http-io-streams
|
||||||
, io-streams
|
, io-streams
|
||||||
, terminal-progress-bar
|
, terminal-progress-bar
|
||||||
|
@ -45,7 +45,6 @@ import GHC.IO.Exception
|
|||||||
import HPath
|
import HPath
|
||||||
import HPath.IO as HIO
|
import HPath.IO as HIO
|
||||||
import Haskus.Utils.Variant.Excepts
|
import Haskus.Utils.Variant.Excepts
|
||||||
import OpenSSL.Digest
|
|
||||||
import Optics
|
import Optics
|
||||||
import Prelude hiding ( abs
|
import Prelude hiding ( abs
|
||||||
, readFile
|
, readFile
|
||||||
@ -54,6 +53,8 @@ import Prelude hiding ( abs
|
|||||||
import System.IO.Error
|
import System.IO.Error
|
||||||
import URI.ByteString
|
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.ByteString.Lazy as L
|
||||||
import qualified Data.CaseInsensitive as CI
|
import qualified Data.CaseInsensitive as CI
|
||||||
import qualified Data.Map.Strict as M
|
import qualified Data.Map.Strict as M
|
||||||
@ -400,7 +401,7 @@ checkDigest dli file = do
|
|||||||
let p' = toFilePath file
|
let p' = toFilePath file
|
||||||
lift $ $(logInfo) [i|verifying digest of: #{p'}|]
|
lift $ $(logInfo) [i|verifying digest of: #{p'}|]
|
||||||
c <- liftIO $ readFile file
|
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
|
eDigest = view dlHash dli
|
||||||
when ((cDigest /= eDigest) && verify) $ throwE (DigestError cDigest eDigest)
|
when ((cDigest /= eDigest) && verify) $ throwE (DigestError cDigest eDigest)
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user