The various hash #includes in rand_lcl.h *are* needed despite
[openssl.git] / apps / crl.c
index 3b5725f23f2c4335aed373140bd8ed991009e4f4..5ea59d0169aabbdd047b366474d774eceb1c9618 100644 (file)
@@ -124,7 +124,7 @@ int MAIN(int argc, char **argv)
                if ((bio_out=BIO_new(BIO_s_file())) != NULL)
                        {
                        BIO_set_fp(bio_out,stdout,BIO_NOCLOSE);
-#ifdef VMS
+#ifdef OPENSSL_SYS_VMS
                        {
                        BIO *tmpbio = BIO_new(BIO_f_linebuffer());
                        bio_out = BIO_push(tmpbio, bio_out);
@@ -214,7 +214,7 @@ int MAIN(int argc, char **argv)
                {
 bad:
                for (pp=crl_usage; (*pp != NULL); pp++)
-                       BIO_printf(bio_err,*pp);
+                       BIO_printf(bio_err,"%s",*pp);
                goto end;
                }
 
@@ -235,7 +235,11 @@ bad:
                        X509_LOOKUP_add_dir(lookup,NULL,X509_FILETYPE_DEFAULT);
                ERR_clear_error();
 
-               X509_STORE_CTX_init(&ctx, store, NULL, NULL);
+               if(!X509_STORE_CTX_init(&ctx, store, NULL, NULL)) {
+                       BIO_printf(bio_err,
+                               "Error initialising X509 store\n");
+                       goto end;
+               }
 
                i = X509_STORE_get_by_subject(&ctx, X509_LU_X509, 
                                        X509_CRL_get_issuer(x), &xobj);
@@ -324,7 +328,7 @@ bad:
        if (outfile == NULL)
                {
                BIO_set_fp(out,stdout,BIO_NOCLOSE);
-#ifdef VMS
+#ifdef OPENSSL_SYS_VMS
                {
                BIO *tmpbio = BIO_new(BIO_f_linebuffer());
                out = BIO_push(tmpbio, out);
@@ -364,6 +368,7 @@ end:
                X509_STORE_CTX_cleanup(&ctx);
                X509_STORE_free(store);
        }
+       apps_shutdown();
        EXIT(ret);
        }