Skip to contentSkip to conversation

env: Remove CONFIG_ENV_AES support

PATCH In review Tom Rini 1 participant 2 messages Nov 14, 2017 – Nov 21, 2017

lore
Share & tools
lore

Tom Rini

author
#0 lore raw

PATCH 1/1 env: Remove CONFIG_ENV_AES support

This support has been deprecated since v2017.09 due to security issues. We now remove this support.

---
 env/Kconfig             |  8 -----
 env/common.c            | 61 --------------------------------------
 include/environment.h   | 12 +-------
 tools/env/Makefile      |  2 +-
 tools/env/aes.c         |  1 -
 tools/env/fw_env.c      | 79 -------------------------------------------------
 tools/env/fw_env.h      |  5 ----
 tools/env/fw_env_main.c | 14 ---------
 8 files changed, 2 insertions(+), 180 deletions(-)
 delete mode 100644 tools/env/aes.c
env/Kconfig +0 -8
index 8c9d800f485f..2477bf85309b 100644
@@ -360,14 +360,6 @@ config ENV_IS_IN_UBI
 
 endchoice
 
-config ENV_AES
-	bool "AES-128 encryption for stored environment (DEPRECATED)"
-	help
-	  Enable this to have the on-device stored environment be encrypted
-	  with AES-128.  The implementation here however has security
-	  complications and is not recommended for use.  Please see
-	  CVE-2017-3225 and CVE-2017-3226 for more details.
-
 config ENV_FAT_INTERFACE
 	string "Name of the block device for the environment"
 	depends on ENV_IS_IN_FAT
env/common.c +0 -61

91 lines not on this page · raw message

include/environment.h +1 -11
index 7b9821638960..d29f82cb5d6f 100644
@@ -143,12 +143,7 @@ extern unsigned long nand_env_oob_offset;
 # define ENV_HEADER_SIZE	(sizeof(uint32_t))
 #endif
 
-#ifdef CONFIG_ENV_AES
-/* Make sure the payload is multiple of AES block size */
-#define ENV_SIZE ((CONFIG_ENV_SIZE - ENV_HEADER_SIZE) & ~(16 - 1))
-#else
 #define ENV_SIZE (CONFIG_ENV_SIZE - ENV_HEADER_SIZE)
-#endif
 
 typedef struct environment_s {
 	uint32_t	crc;		/* CRC32 over data bytes	*/
@@ -156,12 +151,7 @@ typedef struct environment_s {
 	unsigned char	flags;		/* active/obsolete flags	*/
 #endif
 	unsigned char	data[ENV_SIZE]; /* Environment data		*/
-} env_t
-#ifdef CONFIG_ENV_AES
-/* Make sure the env is aligned to block size. */
-__attribute__((aligned(16)))
-#endif
-;
+} env_t;
 
 #ifdef ENV_IS_EMBEDDED
 extern env_t environment;
tools/env/Makefile +1 -1
index 95b28c0b3a3c..95a03c98e75a 100644
@@ -25,7 +25,7 @@ hostprogs-y := fw_printenv
 
 lib-y += fw_env.o \
 	crc32.o ctype.o linux_string.o \
-	env_attr.o env_flags.o aes.o
+	env_attr.o env_flags.o
 
 fw_printenv-objs := fw_env_main.o $(lib-y)
 
tools/env/aes.c deleted +0 -1
deleted file mode 100644
index 9e42679e3434..000000000000
@@ -1 +0,0 @@
-#include "../../lib/aes.c"
tools/env/fw_env.c +0 -79

121 lines not on this page · raw message

tools/env/fw_env.h +0 -5
index 2d37eb505309..b86ca78ba274 100644
@@ -6,7 +6,6 @@
  */
 
 #include <stdint.h>
-#include <uboot_aes.h>
 
 /*
  * Programs using the library must check which API is available,
@@ -19,13 +18,9 @@ struct env_opts {
 #ifdef CONFIG_FILE
 	char *config_file;
 #endif
-	int aes_flag; /* Is AES encryption used? */
-	uint8_t aes_key[AES_KEY_LENGTH];
 	char *lockname;
 };
 
-int parse_aes_key(char *key, uint8_t *bin_key);
-
 /**
  * fw_printenv() - print one or several environment variables
  *
tools/env/fw_env_main.c +0 -14
index 0b9063742cec..6fdf41c87604 100644
@@ -43,7 +43,6 @@
 static int do_printenv;
 
 static struct option long_options[] = {
-	{"aes", required_argument, NULL, 'a'},
 	{"config", required_argument, NULL, 'c'},
 	{"help", no_argument, NULL, 'h'},
 	{"script", required_argument, NULL, 's'},
@@ -70,9 +69,6 @@ void usage_printenv(void)
 		"\n"
 		" -h, --help           print this help.\n"
 		" -v, --version        display version\n"
-#ifdef CONFIG_ENV_AES
-		" -a, --aes            aes key to access environment\n"
-#endif
 #ifdef CONFIG_FILE
 		" -c, --config         configuration file, default:" CONFIG_FILE "\n"
 #endif
@@ -89,9 +85,6 @@ void usage_env_set(void)
 		"\n"
 		" -h, --help           print this help.\n"
 		" -v, --version        display version\n"
-#ifdef CONFIG_ENV_AES
-		" -a, --aes            aes key to access environment\n"
-#endif
 #ifdef CONFIG_FILE
 		" -c, --config         configuration file, default:" CONFIG_FILE "\n"
 #endif
@@ -130,13 +123,6 @@ static void parse_common_args(int argc, char *argv[])
 	while ((c = getopt_long(argc, argv, ":a:c:l:h:v", long_options, NULL)) !=
 	       EOF) {
 		switch (c) {
-		case 'a':
-			if (parse_aes_key(optarg, env_opts.aes_key)) {
-				fprintf(stderr, "AES key parse error\n");
-				exit(EXIT_FAILURE);
-			}
-			env_opts.aes_flag = 1;
-			break;
 #ifdef CONFIG_FILE
 		case 'c':
 			env_opts.config_file = optarg;
Signature · 1 line
2.7.4
author
#1 lore raw
Quoted 4 lines · Tom Rini

This support has been deprecated since v2017.09 due to security issues. We now remove this support.

Applied to u-boot/master, thanks!

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: not available
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20171121/bcb6bff0/attachment.sig>