remove unused Key parameter from isCryptographicallySecure
authorJoey Hess <joeyh@joeyh.name>
Mon, 27 Mar 2023 18:34:00 +0000 (14:34 -0400)
committerJoey Hess <joeyh@joeyh.name>
Mon, 27 Mar 2023 18:34:00 +0000 (14:34 -0400)
This will allow using isCryptographicallySecure on a Backend, before a
Key has been generated.

Sponsored-by: Lawrence Brogan on Patreon
Backend/External.hs
Backend/Hash.hs
Backend/URL.hs
Backend/WORM.hs
Types/Backend.hs

index 5ee7150c7200ee45d8c83f5000441e9a01900a40..4e161cb17ef449764f3092dd9fe34b4afc43015d 100644 (file)
@@ -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
index 314b2676e2d1be423eb3dcb03bc08af873a07a7b..6166d04e07eab2ce2a84ec14a1bb811b44dd238e 100644 (file)
@@ -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
index 0468cbbe3694c1f88b79e97f4d4cd0bc7b3f54b2..4df8979fb229a220a127c54c885922dee90c91d0 100644 (file)
@@ -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. -}
index 771a490e48376ffe8ca97e1b3e3e8b75aa681cc8..9d4fa01d49983651cd0ec0f0fe396c5bbe1190b5 100644 (file)
@@ -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
index 46fbea912af397c7d8ea7d75b900353accaf28bf..e244bbe4d10f1ef181ece73f26929f175ce9bd67 100644 (file)
@@ -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