Add generationQualifier OID (proposed by Fiel Cabral).
[openssl.git] / apps / spkac.c
index 918efc0e5a4d2e3e2737e355e5ac5f5602d9a707..049a37963c2b6511f2251456cfca43f1e6223466 100644 (file)
@@ -69,7 +69,6 @@
 #include <openssl/lhash.h>
 #include <openssl/x509.h>
 #include <openssl/pem.h>
-#include <openssl/engine.h>
 
 #undef PROG
 #define PROG   spkac_main
@@ -90,7 +89,7 @@ int MAIN(int argc, char **argv)
        char *passargin = NULL, *passin = NULL;
        char *spkac = "SPKAC", *spksect = "default", *spkstr = NULL;
        char *challenge = NULL, *keyfile = NULL;
-       LHASH *conf = NULL;
+       CONF *conf = NULL;
        NETSCAPE_SPKI *spki = NULL;
        EVP_PKEY *pkey = NULL;
        char *engine=NULL;
@@ -99,6 +98,9 @@ int MAIN(int argc, char **argv)
 
        if (!bio_err) bio_err = BIO_new_fp(stderr, BIO_NOCLOSE);
 
+       if (!load_config(bio_err, NULL))
+               goto end;
+
        prog=argv[0];
        argc--;
        argv++;
@@ -228,15 +230,16 @@ bad:
                goto end;
        }
 
-       conf = CONF_load_bio(NULL, in, NULL);
+       conf = NCONF_new(NULL);
+       i = NCONF_load_bio(conf, in, NULL);
 
-       if(!conf) {
+       if(!i) {
                BIO_printf(bio_err, "Error parsing config file\n");
                ERR_print_errors(bio_err);
                goto end;
        }
 
-       spkstr = CONF_get_string(conf, spksect, spkac);
+       spkstr = NCONF_get_string(conf, spksect, spkac);
                
        if(!spkstr) {
                BIO_printf(bio_err, "Can't find SPKAC called \"%s\"\n", spkac);
@@ -285,7 +288,7 @@ bad:
        ret = 0;
 
 end:
-       CONF_free(conf);
+       NCONF_free(conf);
        NETSCAPE_SPKI_free(spki);
        BIO_free(in);
        BIO_free_all(out);