VMS below version 7 doesn't have strcasecmp, so let's roll our own on VMS.
[oweals/openssl.git] / apps / asn1pars.c
index 30e1da443a7be0f62629ea041e54bf5b76b06bed..8f178db851eb4d6b1d3b847f35c2d68cde379dd1 100644 (file)
@@ -103,6 +103,9 @@ int MAIN(int argc, char **argv)
                if ((bio_err=BIO_new(BIO_s_file())) != NULL)
                        BIO_set_fp(bio_err,stderr,BIO_NOCLOSE|BIO_FP_TEXT);
 
+       if (!load_config(bio_err, NULL))
+               goto end;
+
        prog=argv[0];
        argc--;
        argv++;
@@ -181,7 +184,7 @@ bad:
                BIO_printf(bio_err,"where options are\n");
                BIO_printf(bio_err," -inform arg   input format - one of DER TXT PEM\n");
                BIO_printf(bio_err," -in arg       input file\n");
-               BIO_printf(bio_err," -out arg      output file\n");
+               BIO_printf(bio_err," -out arg      output file (output format is always DER\n");
                BIO_printf(bio_err," -noout arg    don't produce any output\n");
                BIO_printf(bio_err," -offset arg   offset into file\n");
                BIO_printf(bio_err," -length arg   length of section in file\n");
@@ -192,7 +195,6 @@ bad:
                BIO_printf(bio_err," -strparse offset\n");
                BIO_printf(bio_err,"               a series of these can be used to 'dig' into multiple\n");
                BIO_printf(bio_err,"               ASN1 blob wrappings\n");
-               BIO_printf(bio_err," -out filename output DER encoding to file\n");
                goto end;
                }
 
@@ -206,6 +208,12 @@ bad:
                goto end;
                }
        BIO_set_fp(out,stdout,BIO_NOCLOSE|BIO_FP_TEXT);
+#ifdef OPENSSL_SYS_VMS
+       {
+       BIO *tmpbio = BIO_new(BIO_f_linebuffer());
+       out = BIO_push(tmpbio, out);
+       }
+#endif
 
        if (oidfile != NULL)
                {
@@ -315,7 +323,7 @@ bad:
 end:
        BIO_free(derout);
        if (in != NULL) BIO_free(in);
-       if (out != NULL) BIO_free(out);
+       if (out != NULL) BIO_free_all(out);
        if (b64 != NULL) BIO_free(b64);
        if (ret != 0)
                ERR_print_errors(bio_err);
@@ -323,6 +331,7 @@ end:
        if (at != NULL) ASN1_TYPE_free(at);
        if (osk != NULL) sk_free(osk);
        OBJ_cleanup();
+       apps_shutdown();
        EXIT(ret);
        }