Loading boot/zephyr/Kconfig +7 Changes for boot/zephyr/Kconfig: 7 added lines, 0 removed lines. Original line number Diff line number Diff line Loading @@ -66,6 +66,13 @@ config BOOT_SIGNATURE_TYPE_RSA select BOOT_USE_MBEDTLS select MBEDTLS if BOOT_SIGNATURE_TYPE_RSA config BOOT_SIGNATURE_TYPE_RSA_LEN int "RSA signature length" range 2048 3072 default 2048 endif config BOOT_SIGNATURE_TYPE_ECDSA_P256 bool "Elliptic curve digital signatures with curve P-256" Loading boot/zephyr/include/config-rsa.h +5 Changes for boot/zephyr/include/config-rsa.h: 5 added lines, 0 removed lines. Original line number Diff line number Diff line Loading @@ -66,7 +66,12 @@ /* Save RAM by adjusting to our exact needs */ #define MBEDTLS_ECP_MAX_BITS 2048 #if (CONFIG_BOOT_SIGNATURE_TYPE_RSA_LEN == 3072) #define MBEDTLS_MPI_MAX_SIZE 384 #else #define MBEDTLS_MPI_MAX_SIZE 256 #endif #define MBEDTLS_SSL_MAX_CONTENT_LEN 1024 Loading boot/zephyr/include/mcuboot_config/mcuboot_config.h +6 Changes for boot/zephyr/include/mcuboot_config/mcuboot_config.h: 6 added lines, 0 removed lines. Original line number Diff line number Diff line Loading @@ -20,6 +20,12 @@ #ifdef CONFIG_BOOT_SIGNATURE_TYPE_RSA #define MCUBOOT_SIGN_RSA # if (CONFIG_BOOT_SIGNATURE_TYPE_RSA_LEN != 2048 && \ CONFIG_BOOT_SIGNATURE_TYPE_RSA_LEN != 3072) # error "Invalid RSA key size (must be 2048 or 3072)" # else # define MCUBOOT_SIGN_RSA_LEN CONFIG_BOOT_SIGNATURE_TYPE_RSA_LEN # endif #elif defined(CONFIG_BOOT_SIGNATURE_TYPE_ECDSA_P256) #define MCUBOOT_SIGN_EC256 #endif Loading boot/zephyr/os.c +8 −4 Changes for boot/zephyr/os.c: 8 added lines, 4 removed lines. Original line number Diff line number Diff line Loading @@ -29,11 +29,15 @@ /* * This is the heap for mbed TLS. The value needed depends on the key * size and algorithm used. For RSA-2048 signing, 6144 bytes seems to be * enough. When using RSA-2048-OAEP encryption + RSA-2048 signing, 10240 * bytes seem to be enough. * size and algorithm used. * * - RSA-2048 signing without encryption is known to work well with 6144 bytes; * - When using RSA-2048-OAEP encryption + RSA-2048 signing, or RSA-3072 * signing (no encryption) 10240 bytes seems to be enough. * * NOTE: RSA-3072 signing + RSA-2048-OAEP might require growing the size... */ #if !defined(CONFIG_BOOT_ENCRYPT_RSA) #if (CONFIG_BOOT_SIGNATURE_TYPE_RSA_LEN == 2048) && !defined(CONFIG_BOOT_ENCRYPT_RSA) #define CRYPTO_HEAP_SIZE 6144 #else #define CRYPTO_HEAP_SIZE 10240 Loading boot/zephyr/prj.conf +2 Changes for boot/zephyr/prj.conf: 2 added lines, 0 removed lines. Original line number Diff line number Diff line Loading @@ -12,6 +12,7 @@ CONFIG_BOOT_BOOTSTRAP=n ### Default to RSA CONFIG_BOOT_SIGNATURE_TYPE_RSA=y CONFIG_BOOT_SIGNATURE_TYPE_RSA_LEN=2048 CONFIG_BOOT_SIGNATURE_TYPE_ECDSA_P256=n ### The bootloader generates its own signature verification based on a Loading @@ -19,6 +20,7 @@ CONFIG_BOOT_SIGNATURE_TYPE_ECDSA_P256=n ### algorithm (CONFIG_BOOT_SIGNATURE_TYPE_). ### The PEM files below are provided as examples. CONFIG_BOOT_SIGNATURE_KEY_FILE="root-rsa-2048.pem" #CONFIG_BOOT_SIGNATURE_KEY_FILE="root-rsa-3072.pem" #CONFIG_BOOT_SIGNATURE_KEY_FILE="root-ec-p256.pem" ### mbedTLS has its own heap Loading Loading
boot/zephyr/Kconfig +7 Changes for boot/zephyr/Kconfig: 7 added lines, 0 removed lines. Original line number Diff line number Diff line Loading @@ -66,6 +66,13 @@ config BOOT_SIGNATURE_TYPE_RSA select BOOT_USE_MBEDTLS select MBEDTLS if BOOT_SIGNATURE_TYPE_RSA config BOOT_SIGNATURE_TYPE_RSA_LEN int "RSA signature length" range 2048 3072 default 2048 endif config BOOT_SIGNATURE_TYPE_ECDSA_P256 bool "Elliptic curve digital signatures with curve P-256" Loading
boot/zephyr/include/config-rsa.h +5 Changes for boot/zephyr/include/config-rsa.h: 5 added lines, 0 removed lines. Original line number Diff line number Diff line Loading @@ -66,7 +66,12 @@ /* Save RAM by adjusting to our exact needs */ #define MBEDTLS_ECP_MAX_BITS 2048 #if (CONFIG_BOOT_SIGNATURE_TYPE_RSA_LEN == 3072) #define MBEDTLS_MPI_MAX_SIZE 384 #else #define MBEDTLS_MPI_MAX_SIZE 256 #endif #define MBEDTLS_SSL_MAX_CONTENT_LEN 1024 Loading
boot/zephyr/include/mcuboot_config/mcuboot_config.h +6 Changes for boot/zephyr/include/mcuboot_config/mcuboot_config.h: 6 added lines, 0 removed lines. Original line number Diff line number Diff line Loading @@ -20,6 +20,12 @@ #ifdef CONFIG_BOOT_SIGNATURE_TYPE_RSA #define MCUBOOT_SIGN_RSA # if (CONFIG_BOOT_SIGNATURE_TYPE_RSA_LEN != 2048 && \ CONFIG_BOOT_SIGNATURE_TYPE_RSA_LEN != 3072) # error "Invalid RSA key size (must be 2048 or 3072)" # else # define MCUBOOT_SIGN_RSA_LEN CONFIG_BOOT_SIGNATURE_TYPE_RSA_LEN # endif #elif defined(CONFIG_BOOT_SIGNATURE_TYPE_ECDSA_P256) #define MCUBOOT_SIGN_EC256 #endif Loading
boot/zephyr/os.c +8 −4 Changes for boot/zephyr/os.c: 8 added lines, 4 removed lines. Original line number Diff line number Diff line Loading @@ -29,11 +29,15 @@ /* * This is the heap for mbed TLS. The value needed depends on the key * size and algorithm used. For RSA-2048 signing, 6144 bytes seems to be * enough. When using RSA-2048-OAEP encryption + RSA-2048 signing, 10240 * bytes seem to be enough. * size and algorithm used. * * - RSA-2048 signing without encryption is known to work well with 6144 bytes; * - When using RSA-2048-OAEP encryption + RSA-2048 signing, or RSA-3072 * signing (no encryption) 10240 bytes seems to be enough. * * NOTE: RSA-3072 signing + RSA-2048-OAEP might require growing the size... */ #if !defined(CONFIG_BOOT_ENCRYPT_RSA) #if (CONFIG_BOOT_SIGNATURE_TYPE_RSA_LEN == 2048) && !defined(CONFIG_BOOT_ENCRYPT_RSA) #define CRYPTO_HEAP_SIZE 6144 #else #define CRYPTO_HEAP_SIZE 10240 Loading
boot/zephyr/prj.conf +2 Changes for boot/zephyr/prj.conf: 2 added lines, 0 removed lines. Original line number Diff line number Diff line Loading @@ -12,6 +12,7 @@ CONFIG_BOOT_BOOTSTRAP=n ### Default to RSA CONFIG_BOOT_SIGNATURE_TYPE_RSA=y CONFIG_BOOT_SIGNATURE_TYPE_RSA_LEN=2048 CONFIG_BOOT_SIGNATURE_TYPE_ECDSA_P256=n ### The bootloader generates its own signature verification based on a Loading @@ -19,6 +20,7 @@ CONFIG_BOOT_SIGNATURE_TYPE_ECDSA_P256=n ### algorithm (CONFIG_BOOT_SIGNATURE_TYPE_). ### The PEM files below are provided as examples. CONFIG_BOOT_SIGNATURE_KEY_FILE="root-rsa-2048.pem" #CONFIG_BOOT_SIGNATURE_KEY_FILE="root-rsa-3072.pem" #CONFIG_BOOT_SIGNATURE_KEY_FILE="root-ec-p256.pem" ### mbedTLS has its own heap Loading