From d4cb7afeed810ac58c73b4f18ef124fc206be7c4 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Mon, 27 Mar 2023 14:34:00 -0400 Subject: [PATCH] remove unused Key parameter from isCryptographicallySecure This will allow using isCryptographicallySecure on a Backend, before a Key has been generated. Sponsored-by: Lawrence Brogan on Patreon --- Backend/External.hs | 4 ++-- Backend/Hash.hs | 2 +- Backend/URL.hs | 2 +- Backend/WORM.hs | 2 +- Types/Backend.hs | 2 +- 5 files changed, 6 insertions(+), 6 deletions(-) diff --git a/Backend/External.hs b/Backend/External.hs index 5ee7150c72..4e161cb17e 100644 --- a/Backend/External.hs +++ b/Backend/External.hs @@ -72,7 +72,7 @@ makeBackend' ebname@(ExternalBackendName bname) hasext (Right p) = do , canUpgradeKey = Nothing , fastMigrate = Nothing , isStableKey = const isstable - , isCryptographicallySecure = const iscryptographicallysecure + , isCryptographicallySecure = iscryptographicallysecure } makeBackend' ebname hasext (Left _) = return $ unavailBackend ebname hasext @@ -86,7 +86,7 @@ unavailBackend (ExternalBackendName bname) hasext = , canUpgradeKey = Nothing , fastMigrate = Nothing , isStableKey = const False - , isCryptographicallySecure = const False + , isCryptographicallySecure = False } genKeyExternal :: ExternalBackendName -> HasExt -> KeySource -> MeterUpdate -> Annex Key diff --git a/Backend/Hash.hs b/Backend/Hash.hs index 314b2676e2..6166d04e07 100644 --- a/Backend/Hash.hs +++ b/Backend/Hash.hs @@ -80,7 +80,7 @@ genBackend hash = Backend , canUpgradeKey = Just needsUpgrade , fastMigrate = Just trivialMigrate , isStableKey = const True - , isCryptographicallySecure = const (cryptographicallySecure hash) + , isCryptographicallySecure = cryptographicallySecure hash } genBackendE :: Hash -> Backend diff --git a/Backend/URL.hs b/Backend/URL.hs index 0468cbbe36..4df8979fb2 100644 --- a/Backend/URL.hs +++ b/Backend/URL.hs @@ -29,7 +29,7 @@ backend = Backend -- The content of an url can change at any time, so URL keys are -- not stable. , isStableKey = const False - , isCryptographicallySecure = const False + , isCryptographicallySecure = False } {- Every unique url has a corresponding key. -} diff --git a/Backend/WORM.hs b/Backend/WORM.hs index 771a490e48..9d4fa01d49 100644 --- a/Backend/WORM.hs +++ b/Backend/WORM.hs @@ -32,7 +32,7 @@ backend = Backend , canUpgradeKey = Just needsUpgrade , fastMigrate = Just removeProblemChars , isStableKey = const True - , isCryptographicallySecure = const False + , isCryptographicallySecure = False } {- The key includes the file size, modification time, and the diff --git a/Types/Backend.hs b/Types/Backend.hs index 46fbea912a..e244bbe4d1 100644 --- a/Types/Backend.hs +++ b/Types/Backend.hs @@ -34,7 +34,7 @@ data BackendA a = Backend -- same data. , isStableKey :: Key -> Bool -- Checks if a key is verified using a cryptographically secure hash. - , isCryptographicallySecure :: Key -> Bool + , isCryptographicallySecure :: Bool } instance Show (BackendA a) where -- 2.30.2