Update scripts to use "openssl" instead of "ssleay"
[openssl.git] / apps / req.c
index f51345f5a2890f731a83757762d759121b023057..17f58d07cb825bf82f284e16c81193880e9ae5d9 100644 (file)
@@ -357,12 +357,14 @@ bad:
 
 #ifndef MONOLITH
        /* Lets load up our environment a little */
-       p=getenv("SSLEAY_CONF");
+       p=getenv("OPENSSL_CONF");
+       if (p == NULL)
+               p=getenv("SSLEAY_CONF");
        if (p == NULL)
                {
                strcpy(config_name,X509_get_default_cert_area());
                strcat(config_name,"/lib/");
-               strcat(config_name,SSLEAY_CONF);
+               strcat(config_name,OPENSSL_CONF);
                p=config_name;
                }
         default_config_file=p;
@@ -392,6 +394,29 @@ bad:
                        }
                }
 
+       if (req_conf != NULL)
+               {
+               p=CONF_get_string(req_conf,NULL,"oid_file");
+               if (p != NULL)
+                       {
+                       BIO *oid_bio;
+
+                       oid_bio=BIO_new_file(p,"r");
+                       if (oid_bio == NULL) 
+                               {
+                               /*
+                               BIO_printf(bio_err,"problems opening %s for extra oid's\n",p);
+                               ERR_print_errors(bio_err);
+                               */
+                               }
+                       else
+                               {
+                               OBJ_create_objects(oid_bio);
+                               BIO_free(oid_bio);
+                               }
+                       }
+               }
+
        if ((md_alg == NULL) &&
                ((p=CONF_get_string(req_conf,SECTION,"default_md")) != NULL))
                {
@@ -695,9 +720,11 @@ loop:
                        goto end; 
                        }
                fprintf(stdout,"Modulus=");
+#ifndef NO_RSA
                if (pubkey->type == EVP_PKEY_RSA)
                        BN_print(out,pubkey->pkey.rsa->n);
                else
+#endif
                        fprintf(stdout,"Wrong Algorithm type");
                fprintf(stdout,"\n");
                }