mirror of
https://salsa.debian.org/freeipa-team/freeipa.git
synced 2025-02-25 18:55:28 -06:00
DNSSEC: Make sure that current key state in LDAP matches key state in BIND
We have to explicitly specify "none" value to prevent dnssec-keyfromlabel utility from using current time for keys without "publish" and "activate" timestamps. Previously this lead to situation where key was in (intermediate) state "generated" in OpenDNSSEC but BIND started to use this key for signing. https://fedorahosted.org/freeipa/ticket/5348 Reviewed-By: Martin Basti <mbasti@redhat.com>
This commit is contained in:
parent
9ff1c0ac29
commit
21e6cc6863
@ -55,6 +55,8 @@ class BINDMgr(object):
|
||||
return dt.strftime(time_bindfmt)
|
||||
|
||||
def dates2params(self, ldap_attrs):
|
||||
"""Convert LDAP timestamps to list of parameters suitable
|
||||
for dnssec-keyfromlabel utility"""
|
||||
attr2param = {'idnsseckeypublish': '-P',
|
||||
'idnsseckeyactivate': '-A',
|
||||
'idnsseckeyinactive': '-I',
|
||||
@ -62,10 +64,12 @@ class BINDMgr(object):
|
||||
|
||||
params = []
|
||||
for attr, param in attr2param.items():
|
||||
if attr in ldap_attrs:
|
||||
params.append(param)
|
||||
if attr in ldap_attrs:
|
||||
assert len(ldap_attrs[attr]) == 1, 'Timestamp %s is expected to be single-valued' % attr
|
||||
params.append(self.time_ldap2bindfmt(ldap_attrs[attr][0]))
|
||||
else:
|
||||
params.append('none')
|
||||
|
||||
return params
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user