mirror of
https://salsa.debian.org/freeipa-team/freeipa.git
synced 2025-02-25 18:55:28 -06:00
py3: kem.py: user bytes with ldap values
python ldap requires bytes as values https://fedorahosted.org/freeipa/ticket/4985 Reviewed-By: Jan Cholasta <jcholast@redhat.com>
This commit is contained in:
committed by
Jan Cholasta
parent
c27a46177c
commit
8660b9e968
@@ -130,13 +130,13 @@ class KEMLdap(iSecLdap):
|
||||
service_rdn = ('cn', servicename) if servicename != 'host' else DN()
|
||||
dn = str(DN(('cn', name), service_rdn, self.keysbase))
|
||||
try:
|
||||
mods = [('objectClass', ['nsContainer',
|
||||
'ipaKeyPolicy',
|
||||
'ipaPublicKeyObject',
|
||||
'groupOfPrincipals']),
|
||||
('cn', name),
|
||||
('ipaKeyUsage', RFC5280_USAGE_MAP[usage]),
|
||||
('memberPrincipal', principal),
|
||||
mods = [('objectClass', [b'nsContainer',
|
||||
b'ipaKeyPolicy',
|
||||
b'ipaPublicKeyObject',
|
||||
b'groupOfPrincipals']),
|
||||
('cn', name.encode('utf-8')),
|
||||
('ipaKeyUsage', RFC5280_USAGE_MAP[usage].encode('utf-8')),
|
||||
('memberPrincipal', principal.encode('utf-8')),
|
||||
('ipaPublicKey', public_key)]
|
||||
conn.add_s(dn, mods)
|
||||
except Exception: # pylint: disable=broad-except
|
||||
|
Reference in New Issue
Block a user