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:
parent
f4a390b2a6
commit
d4cb7afeed
5 changed files with 6 additions and 6 deletions
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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. -}
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Add table
Reference in a new issue