2
0
mirror of https://github.com/xcat2/confluent.git synced 2025-01-07 12:06:00 +00:00

Treat empty string same as undefined

If an administrator clears the cert fingerprint, they will
likely set it to ''.  In such a case, go down the 'no fingerprint'
path rather than reject it.
This commit is contained in:
Jarrod Johnson 2017-07-20 10:20:22 -04:00
parent 60756d9b41
commit ba9ea1acd8

View File

@ -121,8 +121,9 @@ class TLSCertVerifier(object):
fingerprint = get_fingerprint(certificate)
storedprint = self.cfm.get_node_attributes(self.node, (self.fieldname,)
)
if self.fieldname not in storedprint[self.node]: # no stored value, check
# policy for next action
if (self.fieldname not in storedprint[self.node] or
storedprint[self.node][self.fieldname]['value'] == ''):
# no stored value, check policy for next action
newpolicy = self.cfm.get_node_attributes(self.node,
('pubkeys.addpolicy',))
if ('pubkeys.addpolicy' in newpolicy[self.node] and