summaryrefslogtreecommitdiffstats
path: root/container.c
diff options
context:
space:
mode:
authorDave Heller <hellerda@us.ibm.com>2017-07-29 12:50:00 -0400
committerDave Heller <hellerda@us.ibm.com>2017-07-29 12:50:00 -0400
commit8706c1ec90a2fec4cb79fea1973374ba37a26d36 (patch)
tree8051bc06276834d72c0f87c507bb4897663d854e /container.c
parent0144ed1f3ba0faae7d0c9047c02ebd75ea5f9215 (diff)
downloadsb-signing-utils-8706c1ec90a2fec4cb79fea1973374ba37a26d36.tar.gz
sb-signing-utils-8706c1ec90a2fec4cb79fea1973374ba37a26d36.zip
Add --validate and --verify options to crtSignedContainer.sh
Diffstat (limited to 'container.c')
-rw-r--r--container.c18
1 files changed, 14 insertions, 4 deletions
diff --git a/container.c b/container.c
index ba42234..1f180a5 100644
--- a/container.c
+++ b/container.c
@@ -28,7 +28,7 @@
extern char *progname;
-extern bool verbose;
+extern bool verbose, debug;
extern int wrap;
#define die(status, msg, ...) \
@@ -43,10 +43,8 @@ extern int wrap;
if (verbose) fprintf(stdout, "--> %s: " msg "\n", progname, \
__VA_ARGS__);
-void verbose_print(char *lead, unsigned char *buffer, size_t buflen)
+void hex_print(char *lead, unsigned char *buffer, size_t buflen)
{
- if (!verbose)
- return;
unsigned int i, indent = 4;
char prelead[100];
snprintf(prelead, 100, "--> %s: ", progname);
@@ -66,6 +64,18 @@ void verbose_print(char *lead, unsigned char *buffer, size_t buflen)
fprintf(stdout, "\n");
}
+void verbose_print(char *lead, unsigned char *buffer, size_t buflen)
+{
+ if (verbose)
+ hex_print(lead, buffer, buflen);
+}
+
+void debug_print(char *lead, unsigned char *buffer, size_t buflen)
+{
+ if (debug)
+ hex_print(lead, buffer, buflen);
+}
+
int isValidHex(char *input, int len) {
int r;
size_t maxlen = 512; // sane limit
OpenPOWER on IntegriCloud