2
0
mirror of https://github.com/xcat2/confluent.git synced 2024-11-22 17:43:14 +00:00

Refresh chained SMM discovery for SMMv2

Additionally, amend overall
discovery to force chain validation
rather than theoretically
accepting a low mac count match.
This commit is contained in:
Jarrod Johnson 2020-10-02 11:45:50 -04:00
parent ef901f64af
commit 587197e934
2 changed files with 15 additions and 6 deletions

View File

@ -772,12 +772,14 @@ def get_chained_smm_name(nodename, cfg, handler, nl=None, checkswitch=True):
'extend a single enclosure')
cd = cfg.get_node_attributes(nodename, ['hardwaremanagement.manager',
'pubkeys.tls_hardwaremanager'])
smmaddr = cd[nodename]['hardwaremanagement.manager']['value']
pkey = cd[nodename].get('pubkeys.tls_hardwaremanager', {}).get(
'value', None)
if not pkey:
# We cannot continue through a break in the chain
return None, False
smmaddr = cd.get(nodename, {}).get('hardwaremanagement.manager', {}.get('value', None)
if not smmaddr:
return None, False
if pkey:
cv = util.TLSCertVerifier(
cfg, nodename, 'pubkeys.tls_hardwaremanager').verify_cert
@ -855,6 +857,14 @@ def get_nodename(cfg, handler, info):
# while this started by switch, it was disambiguated
info['verified'] = v
return newnodename, None
else:
errorstr = 'Attempt to discover SMM in chain but '
'unable to follow chain to the specific '
'SMM, it may be waiting on an upstream '
'SMM, 'chain starts with {0}'.format(
nodename)
log.log({'error': errorstr})
return None, None
if (nodename and
not handler.discoverable_by_switch(macinfo['maccount'])):
if handler.devname == 'SMM':

View File

@ -148,11 +148,10 @@ def get_fingerprint(switch, port, configmanager, portmatch):
def _extract_extended_desc(info, source, integritychecked):
source = str(source)
info['verified'] = bool(integritychecked)
if source.startswith('Lenovo SMM;'):
info['peerdescription'] = 'Lenovo SMM'
if ';S2=' in source:
info['peersha256fingerprint'] = source.replace('Lenovo SMM;S2=',
'')
if source.startswith('Lenovo ') and ';S2=' in source:
desc, fprint = source.split(';S2=', 1)
info['peerdescription'] = desc
info['peersha256fingerprint'] = fprint
else:
info['peerdescription'] = source