@@ -299,6 +299,21 @@ if(NOT CONFIG_BOOT_SIGNATURE_KEY_FILE STREQUAL "")
299
299
endif ()
300
300
message ("MCUBoot bootloader key file: ${KEY_FILE} " )
301
301
302
+ set (mcuboot_default_signature_files
303
+ ${MCUBOOT_DIR} /root-ec-p256-pkcs8.pem
304
+ ${MCUBOOT_DIR} /root-ec-p384.pem
305
+ ${MCUBOOT_DIR} /root-ec-p384-pkcs8.pem
306
+ ${MCUBOOT_DIR} /root-ed25519.pem
307
+ ${MCUBOOT_DIR} /root-rsa-2048.pem
308
+ ${MCUBOOT_DIR} /root-rsa-3072.pem
309
+ ${MCUBOOT_DIR} /root-ec-p256.pem
310
+ )
311
+
312
+ # Emit a warning if using one of the default MCUboot key files
313
+ if (${KEY_FILE} IN_LIST mcuboot_default_signature_files )
314
+ message (WARNING "WARNING: Using default MCUboot signing key file, this file is for debug use only and is not secure!" )
315
+ endif ()
316
+
302
317
set (GENERATED_PUBKEY ${ZEPHYR_BINARY_DIR} /autogen-pubkey.c )
303
318
add_custom_command (
304
319
OUTPUT ${GENERATED_PUBKEY}
@@ -339,6 +354,20 @@ if(CONFIG_BOOT_ENCRYPTION_KEY_FILE AND NOT CONFIG_BOOT_ENCRYPTION_KEY_FILE STREQ
339
354
endif ()
340
355
message ("MCUBoot bootloader encryption key file: ${KEY_FILE} " )
341
356
357
+ # Emit a warning if using one of the default MCUboot key files
358
+ set (mcuboot_default_encryption_files
359
+ ${MCUBOOT_DIR} /enc-ec256-priv.pem
360
+ ${MCUBOOT_DIR} /enc-ec256-pub.pem
361
+ ${MCUBOOT_DIR} /enc-rsa2048-priv.pem
362
+ ${MCUBOOT_DIR} /enc-rsa2048-pub.pem
363
+ ${MCUBOOT_DIR} /enc-x25519-priv.pem
364
+ ${MCUBOOT_DIR} /enc-x25519-pub.pem
365
+ )
366
+
367
+ if (${KEY_FILE} IN_LIST mcuboot_default_encryption_files )
368
+ message (WARNING "WARNING: Using default MCUboot encryption key file, this file is for debug use only and is not secure!" )
369
+ endif ()
370
+
342
371
set (GENERATED_ENCKEY ${ZEPHYR_BINARY_DIR} /autogen-enckey.c )
343
372
add_custom_command (
344
373
OUTPUT ${GENERATED_ENCKEY}
0 commit comments