mirror of
https://github.com/espressif/esp-matter.git
synced 2026-04-27 19:13:13 +00:00
mfg_tool: Remove unique_id to avoid misunderstanding with rotating_device_id_unique_id
This commit is contained in:
@@ -118,16 +118,16 @@ Below commands uses the test PAI signing certificate and key, test certificate d
|
||||
--dac-key DAC_key.pem --dac-cert DAC_cert.pem
|
||||
```
|
||||
|
||||
### Generate factory partitions using existing Passcode, Discriminator, and unique ID [Optional arguments : `--passcode`, `--discriminator`, and `--unique-id`]
|
||||
### Generate factory partitions using existing Passcode, Discriminator, and rotating device ID [Optional arguments : `--passcode`, `--discriminator`, and `--rd-id-uid`]
|
||||
```
|
||||
./mfg_tool.py -cn "My bulb" -v 0xFFF2 -p 0x8001 --pai \
|
||||
-k path/to/esp-matter/connectedhomeip/connectedhomeip/credentials/test/attestation/Chip-Test-PAI-FFF2-8001-Key.pem \
|
||||
-c path/to/esp-matter/connectedhomeip/connectedhomeip/credentials/test/attestation/Chip-Test-PAI-FFF2-8001-Cert.pem \
|
||||
-cd path/to/esp-matter/connectedhomeip/connectedhomeip/credentials/test/certification-declaration/Chip-Test-CD-FFF2-8001.der \
|
||||
--passcode 20202021 --discriminator 3840 --unique-id d2f351f57bb9387445a5f92a601d1c14
|
||||
--passcode 20202021 --discriminator 3840 --enable-rotating-device-id --rd-id-uid d2f351f57bb9387445a5f92a601d1c14
|
||||
```
|
||||
|
||||
* NOTE: Script generates only one factory partition if **DAC or Discriminator or Passcode or Unique-ID** is specified.
|
||||
* NOTE: Script generates only one factory partition if **DAC or Discriminator or Passcode or Rotating-Device-ID** is specified.
|
||||
|
||||
### Generate factory partitions with extra NVS key-values specified using csv and mcsv file [Optional arguments : `--csv` and `--mcsv`]
|
||||
```
|
||||
|
||||
@@ -70,13 +70,6 @@ CHIP_NVS_MAP = {
|
||||
'encoding': 'binary',
|
||||
'value': None,
|
||||
},
|
||||
},
|
||||
'chip-config': {
|
||||
'unique-id': {
|
||||
'type': 'data',
|
||||
'encoding': 'string',
|
||||
'value': None,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -337,10 +337,6 @@ def write_per_device_unique_data(args):
|
||||
chip_factory_update('pai-cert', os.path.abspath(PAI['cert_der']))
|
||||
chip_factory_update('cert-dclrn', os.path.abspath(args.cert_dclrn))
|
||||
|
||||
# If unique id is not passed, then generate one
|
||||
if (args.unique_id is None):
|
||||
chip_config_update('unique-id', binascii.b2a_hex(os.urandom(int(MAX_UNIQUE_ID_LEN / 2))).decode('utf-8'))
|
||||
|
||||
# If serial number is not passed, then generate one
|
||||
if (args.serial_num is None):
|
||||
chip_factory_append('serial-num', 'data', 'string', binascii.b2a_hex(os.urandom(SERIAL_NUMBER_LEN)).decode('utf-8'))
|
||||
@@ -506,7 +502,6 @@ def get_args():
|
||||
g_basic = parser.add_argument_group('Few more Basic clusters options')
|
||||
g_basic.add_argument('--product-label', type=str, required=False, help='Product label')
|
||||
g_basic.add_argument('--product-url', type=str, required=False, help='Product URL')
|
||||
g_basic.add_argument('--unique-id', type=str, required=False, help='Unique identifier in Basic cluster')
|
||||
|
||||
g_extra_info = parser.add_argument_group('Extra information options using csv files')
|
||||
g_extra_info.add_argument('--csv', type=str, help='CSV file containing the partition schema for extra options. \
|
||||
@@ -568,8 +563,6 @@ def add_optional_KVs(args):
|
||||
chip_factory_append('product-label', 'data', 'string', args.product_label)
|
||||
if args.product_url is not None:
|
||||
chip_factory_append('product-url', 'data', 'string', args.product_url)
|
||||
if args.unique_id is not None:
|
||||
chip_config_update('unique-id', args.unique_id)
|
||||
|
||||
|
||||
def main():
|
||||
|
||||
@@ -28,7 +28,6 @@ import cryptography.hazmat.backends
|
||||
import cryptography.x509
|
||||
|
||||
|
||||
MAX_UNIQUE_ID_LEN = 32
|
||||
ROTATING_DEVICE_ID_UNIQUE_ID_LEN_BITS = 128
|
||||
SERIAL_NUMBER_LEN = 16
|
||||
|
||||
@@ -165,7 +164,6 @@ def validate_attestation_info(args):
|
||||
def validate_basic_cluster_info(args):
|
||||
check_str_range(args.product_label, 1, 64, 'Product Label')
|
||||
check_str_range(args.product_url, 1, 256, 'Product URL')
|
||||
check_str_range(args.unique_id, 1, MAX_UNIQUE_ID_LEN, 'Unique id')
|
||||
|
||||
|
||||
# Validates the input arguments, this calls the above functions
|
||||
@@ -189,16 +187,15 @@ def validate_args(args):
|
||||
validate_attestation_info(args)
|
||||
validate_basic_cluster_info(args)
|
||||
|
||||
# If unique_id/discriminator/passcode/DAC/serial_number is present
|
||||
# If discriminator/passcode/DAC/serial_number/rotating_device_id is present
|
||||
# then we are restricting the number of partitions to 1
|
||||
if (args.discriminator is not None
|
||||
or args.passcode is not None
|
||||
or args.unique_id is not None
|
||||
or args.dac_key is not None
|
||||
or args.serial_num is not None
|
||||
or args.rd_id_uid is not None):
|
||||
if args.count > 1:
|
||||
logging.error('Number of partitions should be 1 when unique_id or discriminator or passcode or DAC or serial number or rotating device id is present')
|
||||
logging.error('Number of partitions should be 1 when discriminator or passcode or DAC or serial number or rotating device id is present')
|
||||
sys.exit(1)
|
||||
|
||||
logging.info('Number of manufacturing NVS images to generate: {}'.format(args.count))
|
||||
|
||||
Reference in New Issue
Block a user