summaryrefslogtreecommitdiff
path: root/tools/cert_create
diff options
context:
space:
mode:
authorLauren Wehrmeister <lauren.wehrmeister@arm.com>2021-01-27 18:06:18 +0000
committerTrustedFirmware Code Review <review@review.trustedfirmware.org>2021-01-27 18:06:18 +0000
commit42ea70e86a30088c8b6b08af176dd19c9b42570b (patch)
treec2fb64957f3a9ecdf8ca3480e7e9248f7798d990 /tools/cert_create
parent26dccba6dd1313113252357f433c8085f2c63a09 (diff)
parent1ed941c0b0ff89980dd421d720ec7d9b00c71d57 (diff)
downloadarm-trusted-firmware-42ea70e86a30088c8b6b08af176dd19c9b42570b.tar.gz
Merge "cert-tool: avoid duplicates in extension stack" into integration
Diffstat (limited to 'tools/cert_create')
-rw-r--r--tools/cert_create/src/main.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/tools/cert_create/src/main.c b/tools/cert_create/src/main.c
index d5abe4917..1d2d9ae41 100644
--- a/tools/cert_create/src/main.c
+++ b/tools/cert_create/src/main.c
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2015-2020, ARM Limited and Contributors. All rights reserved.
+ * Copyright (c) 2015-2021, ARM Limited and Contributors. All rights reserved.
*
* SPDX-License-Identifier: BSD-3-Clause
*/
@@ -492,7 +492,12 @@ int main(int argc, char *argv[])
*/
switch (ext->type) {
case EXT_TYPE_NVCOUNTER:
- if (ext->arg) {
+ if (ext->optional && ext->arg == NULL) {
+ /* Skip this NVCounter */
+ continue;
+ } else {
+ /* Checked by `check_cmd_params` */
+ assert(ext->arg != NULL);
nvctr = atoi(ext->arg);
CHECK_NULL(cert_ext, ext_new_nvcounter(ext_nid,
EXT_CRIT, nvctr));
@@ -505,7 +510,7 @@ int main(int argc, char *argv[])
memset(md, 0x0, SHA512_DIGEST_LENGTH);
} else {
/* Do not include this hash in the certificate */
- break;
+ continue;
}
} else {
/* Calculate the hash of the file */