This commits the changes to STACK macros forced by recent ENGINE surgery.
[openssl.git] / apps / apps.c
index d3b6ca82eefe42bc810a283ac8c0719e1681c553..628405ef1bf0112e32134e69a57cc94a606eaeba 100644 (file)
@@ -71,6 +71,7 @@
 #include <openssl/pkcs12.h>
 #include <openssl/ui.h>
 #include <openssl/safestack.h>
+#include <openssl/engine.h>
 
 #ifdef OPENSSL_SYS_WINDOWS
 #define strcasecmp _stricmp
@@ -459,6 +460,15 @@ int password_callback(char *buf, int bufsiz, int verify,
                        prompt_info = cb_data->prompt_info;
                }
 
+       if (password)
+               {
+               res = strlen(password);
+               if (res > bufsiz)
+                       res = bufsiz;
+               memcpy(buf, password, res);
+               return res;
+               }
+
        ui = UI_new_method(ui_method);
        if (ui)
                {
@@ -591,18 +601,18 @@ static char *app_get_pass(BIO *err, char *arg, int keepbio)
        return BUF_strdup(tpass);
 }
 
-int add_oid_section(BIO *err, LHASH *conf)
+int add_oid_section(BIO *err, CONF *conf)
 {      
        char *p;
        STACK_OF(CONF_VALUE) *sktmp;
        CONF_VALUE *cnf;
        int i;
-       if(!(p=CONF_get_string(conf,NULL,"oid_section")))
+       if(!(p=NCONF_get_string(conf,NULL,"oid_section")))
                {
                ERR_clear_error();
                return 1;
                }
-       if(!(sktmp = CONF_get_section(conf, p))) {
+       if(!(sktmp = NCONF_get_section(conf, p))) {
                BIO_printf(err, "problem loading oid section %s\n", p);
                return 0;
        }
@@ -1156,7 +1166,11 @@ ENGINE *setup_engine(BIO *err, const char *engine, int debug)
                        BIO_printf(err,"can't use that engine\n");
                        return NULL;
                        }
+
+               ENGINE_load_engine_ciphers(e);
+
                BIO_printf(err,"engine \"%s\" set.\n", engine);
+
                /* Free our "structural" reference. */
                ENGINE_free(e);
                }