summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVadim Bendebury <vbendeb@chromium.org>2019-08-30 17:05:59 -0700
committerCommit Bot <commit-bot@chromium.org>2019-08-31 04:49:33 +0000
commit391afeceb5a603fd19f523ffe5906dedf2b39d80 (patch)
tree7f547890f154c531d376aee73d6b96ca741a27df
parentd612e69e5b6a4914f5ddf93a3d295ef65cccc5fc (diff)
downloadchrome-ec-391afeceb5a603fd19f523ffe5906dedf2b39d80.tar.gz
nvmem: allow printing encrypted contents only in DEV images
The dump_nvmem CLI command used for debugging can also print out the encrypted contents of the NVMEM objects in case it is passed any command line parameter. Let's limit this capability to DEV images only. BRANCH=cr50, cr50-mp BUG=none TEST=verified that the contents still can be printed by images built with CR50_DEV. Change-Id: I4e1204f2470b1481453ffd940102d8739b5d5a34 Signed-off-by: Vadim Bendebury <vbendeb@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1779489 Reviewed-by: Mary Ruthven <mruthven@chromium.org>
-rw-r--r--common/new_nvmem.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/common/new_nvmem.c b/common/new_nvmem.c
index 90976e1ec0..fee15a3fc0 100644
--- a/common/new_nvmem.c
+++ b/common/new_nvmem.c
@@ -3198,9 +3198,15 @@ test_export_static enum ec_error_list browse_flash_contents(int print)
static int command_dump_nvmem(int argc, char **argv)
{
+ int print = 1;
+
nvmem_disable_commits();
- browse_flash_contents(1 + (argc > 1));
+#ifdef CR50_DEV
+ /* Allow dumping ecnrypted NVMEM contents only to DEV builds. */
+ print += (argc > 1);
+#endif
+ browse_flash_contents(print);
nvmem_enable_commits();