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
|
, canUpgradeKey = Nothing
|
||||||
, fastMigrate = Nothing
|
, fastMigrate = Nothing
|
||||||
, isStableKey = const isstable
|
, isStableKey = const isstable
|
||||||
, isCryptographicallySecure = const iscryptographicallysecure
|
, isCryptographicallySecure = iscryptographicallysecure
|
||||||
}
|
}
|
||||||
makeBackend' ebname hasext (Left _) = return $ unavailBackend ebname hasext
|
makeBackend' ebname hasext (Left _) = return $ unavailBackend ebname hasext
|
||||||
|
|
||||||
|
@ -86,7 +86,7 @@ unavailBackend (ExternalBackendName bname) hasext =
|
||||||
, canUpgradeKey = Nothing
|
, canUpgradeKey = Nothing
|
||||||
, fastMigrate = Nothing
|
, fastMigrate = Nothing
|
||||||
, isStableKey = const False
|
, isStableKey = const False
|
||||||
, isCryptographicallySecure = const False
|
, isCryptographicallySecure = False
|
||||||
}
|
}
|
||||||
|
|
||||||
genKeyExternal :: ExternalBackendName -> HasExt -> KeySource -> MeterUpdate -> Annex Key
|
genKeyExternal :: ExternalBackendName -> HasExt -> KeySource -> MeterUpdate -> Annex Key
|
||||||
|
|
|
@ -80,7 +80,7 @@ genBackend hash = Backend
|
||||||
, canUpgradeKey = Just needsUpgrade
|
, canUpgradeKey = Just needsUpgrade
|
||||||
, fastMigrate = Just trivialMigrate
|
, fastMigrate = Just trivialMigrate
|
||||||
, isStableKey = const True
|
, isStableKey = const True
|
||||||
, isCryptographicallySecure = const (cryptographicallySecure hash)
|
, isCryptographicallySecure = cryptographicallySecure hash
|
||||||
}
|
}
|
||||||
|
|
||||||
genBackendE :: Hash -> Backend
|
genBackendE :: Hash -> Backend
|
||||||
|
|
|
@ -29,7 +29,7 @@ backend = Backend
|
||||||
-- The content of an url can change at any time, so URL keys are
|
-- The content of an url can change at any time, so URL keys are
|
||||||
-- not stable.
|
-- not stable.
|
||||||
, isStableKey = const False
|
, isStableKey = const False
|
||||||
, isCryptographicallySecure = const False
|
, isCryptographicallySecure = False
|
||||||
}
|
}
|
||||||
|
|
||||||
{- Every unique url has a corresponding key. -}
|
{- Every unique url has a corresponding key. -}
|
||||||
|
|
|
@ -32,7 +32,7 @@ backend = Backend
|
||||||
, canUpgradeKey = Just needsUpgrade
|
, canUpgradeKey = Just needsUpgrade
|
||||||
, fastMigrate = Just removeProblemChars
|
, fastMigrate = Just removeProblemChars
|
||||||
, isStableKey = const True
|
, isStableKey = const True
|
||||||
, isCryptographicallySecure = const False
|
, isCryptographicallySecure = False
|
||||||
}
|
}
|
||||||
|
|
||||||
{- The key includes the file size, modification time, and the
|
{- The key includes the file size, modification time, and the
|
||||||
|
|
|
@ -34,7 +34,7 @@ data BackendA a = Backend
|
||||||
-- same data.
|
-- same data.
|
||||||
, isStableKey :: Key -> Bool
|
, isStableKey :: Key -> Bool
|
||||||
-- Checks if a key is verified using a cryptographically secure hash.
|
-- Checks if a key is verified using a cryptographically secure hash.
|
||||||
, isCryptographicallySecure :: Key -> Bool
|
, isCryptographicallySecure :: Bool
|
||||||
}
|
}
|
||||||
|
|
||||||
instance Show (BackendA a) where
|
instance Show (BackendA a) where
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue