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
This commit is contained in:
Joey Hess 2023-03-27 14:34:00 -04:00
parent f4a390b2a6
commit d4cb7afeed
No known key found for this signature in database
GPG key ID: DB12DB0FF05F8F38
5 changed files with 6 additions and 6 deletions

View 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

View 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

View 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. -}

View 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

View 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