@@ -133,6 +133,7 @@ static int PrintDer(FILE* fp)
133133 return ret ;
134134}
135135
136+ #ifndef NO_CODING
136137/* Print ASN.1 of a file containing Base64 encoding of BER/DER data.
137138 *
138139 * @param [in] fp File pointer to read from.
@@ -279,6 +280,7 @@ static int PrintPem(FILE* fp, int pem_skip)
279280
280281 return ret ;
281282}
283+ #endif
282284
283285/* Usage lines to show. */
284286const char * usage [] = {
@@ -288,7 +290,9 @@ const char* usage[] = {
288290 "Options:" ,
289291 " -?, --help display this help and exit" ,
290292 " -b, --branch draw branches before tag name" ,
293+ #ifndef NO_CODING
291294 " -B, --base64 file contents are Base64 encoded" ,
295+ #endif
292296 " -d, --dump show all ASN.1 item data as a hex dump" ,
293297 " -h, --headers show all ASN.1 item headers as a hex dump" ,
294298 " -i, --indent indent tag name with depth" ,
@@ -297,7 +301,9 @@ const char* usage[] = {
297301 " -N, --no-dump-text do not show data as a hex dump text" ,
298302 " -o, --offset OFFSET start decoding from offset" ,
299303 " -O, --oid show wolfSSL OID value in text" ,
304+ #ifndef NO_CODING
300305 " -p, --pem file contents are PEM" ,
306+ #endif
301307 " -s, --skip-pem NUM number of PEM blocks to skip" ,
302308};
303309/* Number of usage lines. */
@@ -342,11 +348,13 @@ int main(int argc, char* argv[])
342348 (strcmp (argv [0 ], "--branch" ) == 0 )) {
343349 wc_Asn1PrintOptions_Set (& opts , ASN1_PRINT_OPT_DRAW_BRANCH , 1 );
344350 }
351+ #ifndef NO_CODING
345352 /* File is Base64 encoded data. */
346353 else if ((strcmp (argv [0 ], "- b64 ") == 0) ||
347354 (strcmp (argv [0 ], "--base64" ) == 0 )) {
348355 file_format = FORMAT_BASE64 ;
349356 }
357+ #endif
350358 /* Dump all ASN.1 item data. */
351359 else if ((strcmp (argv [0 ], "- d ") == 0) ||
352360 (strcmp (argv [0 ], "--dump" ) == 0 )) {
@@ -403,11 +411,13 @@ int main(int argc, char* argv[])
403411 (strcmp (argv [0 ], "--oid" ) == 0 )) {
404412 wc_Asn1PrintOptions_Set (& opts , ASN1_PRINT_OPT_SHOW_OID , 1 );
405413 }
414+ #ifndef NO_CODING
406415 /* File contains PEM blocks. */
407416 else if ((strcmp (argv [0 ], "- p ") == 0) ||
408417 (strcmp (argv [0 ], "--pem" ) == 0 )) {
409418 file_format = FORMAT_PEM ;
410419 }
420+ #endif
411421 /* Skip a number of PEM blocks. */
412422 else if ((strcmp (argv [0 ], "- s ") == 0) ||
413423 (strcmp (argv [0 ], "--skip-pem" ) == 0 )) {
@@ -458,12 +468,16 @@ int main(int argc, char* argv[])
458468 if (file_format == FORMAT_DER ) {
459469 ret = PrintDer (fp );
460470 }
471+ #ifndef NO_CODING
461472 else if (file_format == FORMAT_BASE64 ) {
462473 ret = PrintBase64 (fp );
463474 }
475+ #endif
476+ #ifndef NO_CODING
464477 else if (file_format == FORMAT_PEM ) {
465478 ret = PrintPem (fp , pem_skip );
466479 }
480+ #endif
467481
468482 if (ret != 0 ) {
469483 fprintf (stderr , "%s\n" , wc_GetErrorString (ret ));
0 commit comments