Allow null passphrase for MASTER logins
New config options for this in GLOBAL config section If pashphrase is null and this option is set, login will always succeed
This commit is contained in:
parent
f300e61192
commit
f8bd5b00df
@ -122,7 +122,9 @@ def build_config(_config_file):
|
||||
'SUB_ACL': config.get(section, 'SUB_ACL'),
|
||||
'TG1_ACL': config.get(section, 'TGID_TS1_ACL'),
|
||||
'TG2_ACL': config.get(section, 'TGID_TS2_ACL'),
|
||||
'GEN_STAT_BRIDGES': config.getboolean(section, 'GEN_STAT_BRIDGES')
|
||||
'GEN_STAT_BRIDGES': config.getboolean(section, 'GEN_STAT_BRIDGES'),
|
||||
'ALLOW_NULL_PASSPHRASE': config.getboolean(section, 'ALLOW_NULL_PASSPHRASE')
|
||||
|
||||
})
|
||||
|
||||
elif section == 'REPORTS':
|
||||
|
@ -465,6 +465,11 @@ class HBSYSTEM(DatagramProtocol):
|
||||
self._peer_sema.release()
|
||||
_sent_hash = _data[8:]
|
||||
_salt_str = bytes_4(_this_peer['SALT'])
|
||||
if self._CONFIG['GLOBAL']['ALLOW_NULL_PASSPHRASE'] and len(self._config['PASSPHRASE']) == 0:
|
||||
_this_peer['CONNECTION'] = 'WAITING_CONFIG'
|
||||
self.send_peer(_peer_id, b''.join([RPTACK, _peer_id]))
|
||||
logger.info('(%s) Peer %s has completed the login exchange successfully', self._system, _this_peer['RADIO_ID'])
|
||||
else:
|
||||
_calc_hash = bhex(sha256(_salt_str+self._config['PASSPHRASE']).hexdigest())
|
||||
if _sent_hash == _calc_hash:
|
||||
_this_peer['CONNECTION'] = 'WAITING_CONFIG'
|
||||
|
Loading…
Reference in New Issue
Block a user