Commit 0db7f6859fef41c1e95bcef75761054a01782d1b

Authored by Tom Rini
1 parent 6b83c38d7a

FIT: Rename FIT_DISABLE_SHA256 to FIT_ENABLE_SHA256_SUPPORT

We rename CONFIG_FIT_DISABLE_SHA256 to CONFIG_FIT_ENABLE_SHA256_SUPPORT which
is enabled by default and now a positive option.  Convert the handful of boards
that were disabling it before to save space.

Cc: Dirk Eibach <eibach@gdsys.de>
Cc: Lukasz Dalek <luk0104@gmail.com>
Signed-off-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Simon Glass <sjg@chromium.org>

Showing 16 changed files with 25 additions and 36 deletions Side-by-side Diff

... ... @@ -157,6 +157,19 @@
157 157  
158 158 if FIT
159 159  
  160 +config FIT_ENABLE_SHA256_SUPPORT
  161 + bool "Support SHA256 checksum of FIT image contents"
  162 + default y
  163 + help
  164 + Enable this to support SHA256 checksum of FIT image contents. A
  165 + SHA256 checksum is a 256-bit (32-byte) hash value used to check that
  166 + the image contents have not been corrupted. SHA256 is recommended
  167 + for use in secure applications since (as at 2016) there is no known
  168 + feasible attack that could produce a 'collision' with differing
  169 + input data. Use this for the highest security. Note that only the
  170 + SHA256 variant is supported: SHA512 and others are not currently
  171 + supported in U-Boot.
  172 +
160 173 config FIT_SIGNATURE
161 174 bool "Enable signature verification of FIT uImages"
162 175 depends on DM
... ... @@ -2973,15 +2973,6 @@
2973 2973 This define is introduced, as the legacy image format is
2974 2974 enabled per default for backward compatibility.
2975 2975  
2976   -- FIT image support:
2977   - CONFIG_FIT_DISABLE_SHA256
2978   - Supporting SHA256 hashes has quite an impact on binary size.
2979   - For constrained systems sha256 hash support can be disabled
2980   - with this option.
2981   -
2982   - TODO(sjg@chromium.org): Adjust this option to be positive,
2983   - and move it to Kconfig
2984   -
2985 2976 - Standalone program support:
2986 2977 CONFIG_STANDALONE_LOAD_ADDR
2987 2978  
configs/dlvision-10g_defconfig
... ... @@ -3,6 +3,7 @@
3 3 CONFIG_4xx=y
4 4 CONFIG_TARGET_DLVISION_10G=y
5 5 CONFIG_FIT=y
  6 +# CONFIG_FIT_ENABLE_SHA256_SUPPORT is not set
6 7 CONFIG_FIT_VERBOSE=y
7 8 CONFIG_OF_BOARD_SETUP=y
8 9 CONFIG_BOOTDELAY=5
configs/dlvision_defconfig
... ... @@ -3,6 +3,7 @@
3 3 CONFIG_4xx=y
4 4 CONFIG_TARGET_DLVISION=y
5 5 CONFIG_FIT=y
  6 +# CONFIG_FIT_ENABLE_SHA256_SUPPORT is not set
6 7 CONFIG_FIT_VERBOSE=y
7 8 CONFIG_OF_BOARD_SETUP=y
8 9 CONFIG_BOOTDELAY=5
configs/h2200_defconfig
1 1 CONFIG_ARM=y
2 2 CONFIG_TARGET_H2200=y
3 3 CONFIG_FIT=y
  4 +# CONFIG_FIT_ENABLE_SHA256_SUPPORT is not set
4 5 CONFIG_SYS_CONSOLE_IS_IN_ENV=y
5 6 # CONFIG_DISPLAY_CPUINFO is not set
6 7 # CONFIG_DISPLAY_BOARDINFO is not set
configs/io_defconfig
... ... @@ -3,6 +3,7 @@
3 3 CONFIG_4xx=y
4 4 CONFIG_TARGET_IO=y
5 5 CONFIG_FIT=y
  6 +# CONFIG_FIT_ENABLE_SHA256_SUPPORT is not set
6 7 CONFIG_FIT_VERBOSE=y
7 8 CONFIG_OF_BOARD_SETUP=y
8 9 CONFIG_BOOTDELAY=5
configs/iocon_defconfig
... ... @@ -3,6 +3,7 @@
3 3 CONFIG_4xx=y
4 4 CONFIG_TARGET_IOCON=y
5 5 CONFIG_FIT=y
  6 +# CONFIG_FIT_ENABLE_SHA256_SUPPORT is not set
6 7 CONFIG_OF_BOARD_SETUP=y
7 8 CONFIG_BOOTDELAY=5
8 9 CONFIG_SYS_CONSOLE_INFO_QUIET=y
configs/neo_defconfig
... ... @@ -3,6 +3,7 @@
3 3 CONFIG_4xx=y
4 4 CONFIG_TARGET_NEO=y
5 5 CONFIG_FIT=y
  6 +# CONFIG_FIT_ENABLE_SHA256_SUPPORT is not set
6 7 CONFIG_FIT_VERBOSE=y
7 8 CONFIG_OF_BOARD_SETUP=y
8 9 CONFIG_BOOTDELAY=5
include/configs/dlvision-10g.h
... ... @@ -31,9 +31,6 @@
31 31 #define PLLMR0_DEFAULT PLLMR0_266_133_66
32 32 #define PLLMR1_DEFAULT PLLMR1_266_133_66
33 33  
34   -/* new uImage format support */
35   -#define CONFIG_FIT_DISABLE_SHA256
36   -
37 34 #define CONFIG_ENV_IS_IN_FLASH /* use FLASH for environment vars */
38 35  
39 36 /*
include/configs/dlvision.h
... ... @@ -29,9 +29,6 @@
29 29 #define PLLMR0_DEFAULT PLLMR0_266_133_66_33
30 30 #define PLLMR1_DEFAULT PLLMR1_266_133_66_33
31 31  
32   -/* new uImage format support */
33   -#define CONFIG_FIT_DISABLE_SHA256
34   -
35 32 #define CONFIG_ENV_IS_IN_FLASH /* use FLASH for environment vars */
36 33  
37 34 /*
include/configs/h2200.h
... ... @@ -109,7 +109,6 @@
109 109  
110 110 #define CONFIG_SYS_BAUDRATE_TABLE { 9600, 38400, 115200 }
111 111  
112   -#define CONFIG_FIT_DISABLE_SHA256
113 112 #define CONFIG_SETUP_MEMORY_TAGS
114 113 #define CONFIG_CMDLINE_TAG
115 114 #define CONFIG_INITRD_TAG
include/configs/io.h
... ... @@ -31,9 +31,6 @@
31 31 #define PLLMR0_DEFAULT PLLMR0_266_133_66
32 32 #define PLLMR1_DEFAULT PLLMR1_266_133_66
33 33  
34   -/* new uImage format support */
35   -#define CONFIG_FIT_DISABLE_SHA256
36   -
37 34 #define CONFIG_ENV_IS_IN_FLASH /* use FLASH for environment vars */
38 35  
39 36 /*
include/configs/iocon.h
... ... @@ -33,9 +33,6 @@
33 33 #define PLLMR0_DEFAULT PLLMR0_266_133_66
34 34 #define PLLMR1_DEFAULT PLLMR1_266_133_66
35 35  
36   -/* new uImage format support */
37   -#define CONFIG_FIT_DISABLE_SHA256
38   -
39 36 #define CONFIG_ENV_IS_IN_FLASH /* use FLASH for environment vars */
40 37  
41 38 /*
include/configs/neo.h
... ... @@ -31,9 +31,6 @@
31 31 #define PLLMR0_DEFAULT PLLMR0_266_133_66_33
32 32 #define PLLMR1_DEFAULT PLLMR1_266_133_66_33
33 33  
34   -/* new uImage format support */
35   -#define CONFIG_FIT_DISABLE_SHA256
36   -
37 34 #define CONFIG_ENV_IS_IN_FLASH /* use FLASH for environment vars */
38 35  
39 36 /*
... ... @@ -29,6 +29,7 @@
29 29 #define IMAGE_ENABLE_FIT 1
30 30 #define IMAGE_ENABLE_OF_LIBFDT 1
31 31 #define CONFIG_FIT_VERBOSE 1 /* enable fit_format_{error,warning}() */
  32 +#define CONFIG_FIT_ENABLE_SHA256_SUPPORT
32 33  
33 34 #define IMAGE_ENABLE_IGNORE 0
34 35 #define IMAGE_INDENT_STRING ""
... ... @@ -62,9 +63,6 @@
62 63 # ifdef CONFIG_SPL_SHA1_SUPPORT
63 64 # define IMAGE_ENABLE_SHA1 1
64 65 # endif
65   -# ifdef CONFIG_SPL_SHA256_SUPPORT
66   -# define IMAGE_ENABLE_SHA256 1
67   -# endif
68 66 # else
69 67 # define CONFIG_CRC32 /* FIT images need CRC32 support */
70 68 # define CONFIG_SHA1 /* and SHA1 */
71 69  
... ... @@ -72,14 +70,8 @@
72 70 # define IMAGE_ENABLE_CRC32 1
73 71 # define IMAGE_ENABLE_MD5 1
74 72 # define IMAGE_ENABLE_SHA1 1
75   -# define IMAGE_ENABLE_SHA256 1
76 73 # endif
77 74  
78   -#ifdef CONFIG_FIT_DISABLE_SHA256
79   -#undef CONFIG_SHA256
80   -#undef IMAGE_ENABLE_SHA256
81   -#endif
82   -
83 75 #ifndef IMAGE_ENABLE_CRC32
84 76 #define IMAGE_ENABLE_CRC32 0
85 77 #endif
... ... @@ -92,7 +84,11 @@
92 84 #define IMAGE_ENABLE_SHA1 0
93 85 #endif
94 86  
95   -#ifndef IMAGE_ENABLE_SHA256
  87 +#if defined(CONFIG_FIT_ENABLE_SHA256_SUPPORT) || \
  88 + defined(CONFIG_SPL_SHA256_SUPPORT)
  89 +#define CONFIG_SHA256
  90 +#define IMAGE_ENABLE_SHA256 1
  91 +#else
96 92 #define IMAGE_ENABLE_SHA256 0
97 93 #endif
98 94  
scripts/config_whitelist.txt
... ... @@ -947,7 +947,6 @@
947 947 CONFIG_FILE
948 948 CONFIG_FIRMWARE_OFFSET
949 949 CONFIG_FIRMWARE_SIZE
950   -CONFIG_FIT_DISABLE_SHA256
951 950 CONFIG_FIXED_PHY
952 951 CONFIG_FIXED_PHY_ADDR
953 952 CONFIG_FIXED_SDHCI_ALIGNED_BUFFER