mirror of
https://github.com/espressif/openthread.git
synced 2026-08-22 18:39:50 +00:00
[key-manager] remove default master key (#5998)
When initializing, we should use randomly generated network parameters instead of default ones, to eliminate the possibility of unintentional use of default credentials.
This commit is contained in:
@@ -27,6 +27,7 @@
|
||||
# POSSIBILITY OF SUCH DAMAGE.
|
||||
#
|
||||
|
||||
import binascii
|
||||
import json
|
||||
import logging
|
||||
import os
|
||||
@@ -157,6 +158,7 @@ class TestCase(NcpSupportMixin, unittest.TestCase):
|
||||
if node.is_host:
|
||||
continue
|
||||
|
||||
self.nodes[i].set_masterkey(binascii.hexlify(config.DEFAULT_MASTER_KEY).decode())
|
||||
self.nodes[i].set_panid(params['panid'])
|
||||
self.nodes[i].set_mode(params['mode'])
|
||||
|
||||
@@ -184,6 +186,8 @@ class TestCase(NcpSupportMixin, unittest.TestCase):
|
||||
self.nodes[i].set_timeout(params['timeout'])
|
||||
|
||||
if 'active_dataset' in params:
|
||||
if 'master_key' not in params['active_dataset']:
|
||||
params['active_dataset']['master_key'] = binascii.hexlify(config.DEFAULT_MASTER_KEY).decode()
|
||||
self.nodes[i].set_active_dataset(params['active_dataset']['timestamp'],
|
||||
panid=params['active_dataset'].get('panid'),
|
||||
channel=params['active_dataset'].get('channel'),
|
||||
|
||||
Reference in New Issue
Block a user