summaryrefslogtreecommitdiff
path: root/src/bin/eet/eet_main.c
diff options
context:
space:
mode:
authorCarsten Haitzler (Rasterman) <raster@rasterman.com>2017-03-24 14:03:20 +0900
committerCarsten Haitzler (Rasterman) <raster@rasterman.com>2017-03-24 14:14:51 +0900
commit8b8c8bf7df7600bacd2b87b5f0bcb85537f6e244 (patch)
treee3c1c00b71d6ab4b181613bcb9fa815d5a6b631e /src/bin/eet/eet_main.c
parent25fcdde3564824087fd23f0380c129f28bd08869 (diff)
eet cmdline tool - dont give garbage certificate length if there is none
Diffstat (limited to 'src/bin/eet/eet_main.c')
-rw-r--r--src/bin/eet/eet_main.c15
1 files changed, 11 insertions, 4 deletions
diff --git a/src/bin/eet/eet_main.c b/src/bin/eet/eet_main.c
index a3652e873c..9f61bcadcc 100644
--- a/src/bin/eet/eet_main.c
+++ b/src/bin/eet/eet_main.c
@@ -394,11 +394,18 @@ do_eet_check(const char *file)
394 394
395 der = eet_identity_x509(ef, &der_length); 395 der = eet_identity_x509(ef, &der_length);
396 396
397 fprintf(stdout, "Certificate length %i.\n", der_length); 397 if (!der)
398 eet_identity_certificate_print(der, der_length, stdout); 398 {
399 fprintf(stdout, "No Certificate.\n");
400 }
401 else
402 {
403 fprintf(stdout, "Certificate length %i.\n", der_length);
404 eet_identity_certificate_print(der, der_length, stdout);
399 405
400 eet_identity_signature(ef, &sign_length); 406 eet_identity_signature(ef, &sign_length);
401 fprintf(stdout, "Signature length %i.\n", sign_length); 407 fprintf(stdout, "Signature length %i.\n", sign_length);
408 }
402 409
403 eet_close(ef); 410 eet_close(ef);
404} /* do_eet_check */ 411} /* do_eet_check */