resign zone if keys change
This commit is contained in:
parent
01d8ab0cfd
commit
d6c8ddb955
|
@ -136,7 +136,6 @@ signedPrimary recurrance hosts domain soa rs = RevertableProperty setup cleanup
|
||||||
-- TODO put signed zone file in named.conf.
|
-- TODO put signed zone file in named.conf.
|
||||||
-- TODO enable dnssec options.
|
-- TODO enable dnssec options.
|
||||||
-- dnssec-enable yes; dnssec-validation yes; dnssec-lookaside auto;
|
-- dnssec-enable yes; dnssec-validation yes; dnssec-lookaside auto;
|
||||||
-- TODO if keys change, resign zone file.
|
|
||||||
-- TODO write to entirely different files than does primary,
|
-- TODO write to entirely different files than does primary,
|
||||||
-- so that primary can be reverted and signedPrimary enabled,
|
-- so that primary can be reverted and signedPrimary enabled,
|
||||||
-- or vice-versa, without conflicts.
|
-- or vice-versa, without conflicts.
|
||||||
|
|
|
@ -53,14 +53,17 @@ zoneSigned domain zonefile = RevertableProperty setup cleanup
|
||||||
dssetfile = dir </> "-" ++ domain ++ "."
|
dssetfile = dir </> "-" ++ domain ++ "."
|
||||||
dir = takeDirectory zonefile
|
dir = takeDirectory zonefile
|
||||||
|
|
||||||
-- Need to update the signed zone if the zone file
|
-- Need to update the signed zone file if the zone file or
|
||||||
-- has a newer timestamp.
|
-- any of the keys have a newer timestamp.
|
||||||
needupdate = do
|
needupdate = do
|
||||||
v <- catchMaybeIO $ getModificationTime signedzonefile
|
v <- catchMaybeIO $ getModificationTime signedzonefile
|
||||||
case v of
|
case v of
|
||||||
Nothing -> return True
|
Nothing -> return True
|
||||||
Just t1 -> do
|
Just t1 -> anyM (newerthan t1) $
|
||||||
t2 <- getModificationTime zonefile
|
zonefile : map (keyFn domain) [minBound..maxBound]
|
||||||
|
|
||||||
|
newerthan t1 f = do
|
||||||
|
t2 <- getModificationTime f
|
||||||
return (t2 >= t1)
|
return (t2 >= t1)
|
||||||
|
|
||||||
forceZoneSigned :: Domain -> FilePath -> Property
|
forceZoneSigned :: Domain -> FilePath -> Property
|
||||||
|
|
|
@ -104,4 +104,4 @@ data DnsSecKey
|
||||||
| PrivZSK -- ^ DNSSEC Zone Signing Key (private)
|
| PrivZSK -- ^ DNSSEC Zone Signing Key (private)
|
||||||
| PubKSK -- ^ DNSSEC Key Signing Key (public)
|
| PubKSK -- ^ DNSSEC Key Signing Key (public)
|
||||||
| PrivKSK -- ^ DNSSEC Key Signing Key (private)
|
| PrivKSK -- ^ DNSSEC Key Signing Key (private)
|
||||||
deriving (Read, Show, Ord, Eq)
|
deriving (Read, Show, Ord, Eq, Bounded, Enum)
|
||||||
|
|
Loading…
Reference in New Issue