Commit 294e2656 authored by Manish V Badarkhe's avatar Manish V Badarkhe
Browse files

tools: cert_create: Create only requested certificates


The certification tool creates all the certificates mentioned
statically in the code rather than taking explicit certificate
requests from the command line parameters.

Code is optimized to avoid unnecessary attempts to create
non-requested certificates.
Signed-off-by: default avatarManish V Badarkhe <Manish.Badarkhe@arm.com>
Change-Id: I78feac25bc701bf8f08c6aa5a2e1590bec92d0f2
parent 70311692
Showing with 6 additions and 1 deletion
+6 -1
......@@ -473,6 +473,11 @@ int main(int argc, char *argv[])
cert = &certs[i];
if (cert->fn == NULL) {
/* Certificate not requested. Skip to the next one */
continue;
}
/* Create a new stack of extensions. This stack will be used
* to create the certificate */
CHECK_NULL(sk, sk_X509_EXTENSION_new_null());
......@@ -534,7 +539,7 @@ int main(int argc, char *argv[])
}
/* Create certificate. Signed with corresponding key */
if (cert->fn && !cert_new(hash_alg, cert, VAL_DAYS, 0, sk)) {
if (!cert_new(hash_alg, cert, VAL_DAYS, 0, sk)) {
ERROR("Cannot create %s\n", cert->cn);
exit(1);
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment