initremote: Prevent enabling encryption with exporttree=yes/importtree=yes
I do think this was a reversion, but I have not tracked back to what version. While involving the remote config, it's not the same class of problems that I kept having to chase down for a while after the remote config parser reworking.
This commit is contained in:
parent
74c1e0660b
commit
6c890d62f6
4 changed files with 14 additions and 2 deletions
|
@ -20,6 +20,7 @@ module Remote.Helper.Encryptable (
|
|||
cipherKey,
|
||||
extractCipher,
|
||||
isEncrypted,
|
||||
encryptionIsEnabled,
|
||||
describeEncryption,
|
||||
encryptionField,
|
||||
highRandomQualityField
|
||||
|
@ -282,6 +283,14 @@ extractCipher c = case (getRemoteConfigValue cipherField c,
|
|||
isEncrypted :: ParsedRemoteConfig -> Bool
|
||||
isEncrypted = isJust . extractCipher
|
||||
|
||||
-- Check if encryption is enabled. This can be done before encryption
|
||||
-- is fully set up yet, so the cipher might not be present yet.
|
||||
encryptionIsEnabled :: ParsedRemoteConfig -> Bool
|
||||
encryptionIsEnabled c = case getRemoteConfigValue encryptionField c of
|
||||
Nothing -> False
|
||||
Just NoneEncryption -> False
|
||||
Just _ -> True
|
||||
|
||||
describeEncryption :: ParsedRemoteConfig -> String
|
||||
describeEncryption c = case extractCipher c of
|
||||
Nothing -> "none"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue