Add function load_csr(file,format,desc) to apps/lib/apps.c
[openssl.git] / apps / x509.c
index 16c1f9575453da0b32dbecc3a05ee5ebc5472c8d..d891b42f927030632c37331278050ca4b9dfb301 100644 (file)
@@ -572,14 +572,8 @@ int x509_main(int argc, char **argv)
 
     if (reqfile) {
         EVP_PKEY *pkey;
-        BIO *in;
-
-        in = bio_open_default(infile, 'r', informat);
-        if (in == NULL)
-            goto end;
-        req = PEM_read_bio_X509_REQ(in, NULL, NULL, NULL);
-        BIO_free(in);
 
+        req = load_csr(infile, informat, "certificate request input");
         if (req == NULL) {
             ERR_print_errors(bio_err);
             goto end;