diff options
author | Tom Rini <trini@konsulko.com> | 2019-10-16 18:10:31 -0400 |
---|---|---|
committer | Tom Rini <trini@konsulko.com> | 2019-10-16 18:10:31 -0400 |
commit | c83b1bb923421e95e499b22b010d2f9f463c1226 (patch) | |
tree | 48860f46e83dc30d9a77fac61c979fb3625588d7 /cmd | |
parent | d2a93a88631929169d3ef1c537430330404f96f7 (diff) | |
parent | d11ef4d54cab0e740efbceb9c6b5697a41770eea (diff) | |
download | u-boot-c83b1bb923421e95e499b22b010d2f9f463c1226.zip u-boot-c83b1bb923421e95e499b22b010d2f9f463c1226.tar.gz u-boot-c83b1bb923421e95e499b22b010d2f9f463c1226.tar.bz2 |
Merge tag 'dm-pull-15oct19' of https://gitlab.denx.de/u-boot/custodians/u-boot-dm
binman enhancements:
- Dropping some test Elf files and building them from source instead
- Refactoring of x86 16-bit entries
- Support for SPL symbols within sections
- Handle the 'notes' sections and hidden symbols in recent binutils
- Improved error reporting with a tool fails
libfdt and documentation fixes
vboot required-key test
driver model power-domain controls
patman Message-Id enhancement
Diffstat (limited to 'cmd')
-rw-r--r-- | cmd/aes.c | 14 |
1 files changed, 10 insertions, 4 deletions
@@ -11,6 +11,7 @@ #include <malloc.h> #include <asm/byteorder.h> #include <linux/compiler.h> +#include <mapmem.h> /** * do_aes() - Handle the "aes" command-line command @@ -46,10 +47,10 @@ static int do_aes(cmd_tbl_t *cmdtp, int flag, int argc, char *const argv[]) dst_addr = simple_strtoul(argv[5], NULL, 16); len = simple_strtoul(argv[6], NULL, 16); - key_ptr = (uint8_t *)key_addr; - iv_ptr = (uint8_t *)iv_addr; - src_ptr = (uint8_t *)src_addr; - dst_ptr = (uint8_t *)dst_addr; + key_ptr = (uint8_t *)map_sysmem(key_addr, 128 / 8); + iv_ptr = (uint8_t *)map_sysmem(iv_addr, 128 / 8); + src_ptr = (uint8_t *)map_sysmem(src_addr, len); + dst_ptr = (uint8_t *)map_sysmem(dst_addr, len); /* First we expand the key. */ aes_expand_key(key_ptr, key_exp); @@ -64,6 +65,11 @@ static int do_aes(cmd_tbl_t *cmdtp, int flag, int argc, char *const argv[]) aes_cbc_decrypt_blocks(key_exp, iv_ptr, src_ptr, dst_ptr, aes_blocks); + unmap_sysmem(key_ptr); + unmap_sysmem(iv_ptr); + unmap_sysmem(src_ptr); + unmap_sysmem(dst_ptr); + return 0; } |