projects
/
openssl.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Add -show_chain option to print out verified chain.
[openssl.git]
/
crypto
/
engine
/
eng_cnf.c
diff --git
a/crypto/engine/eng_cnf.c
b/crypto/engine/eng_cnf.c
index 7bc30602e92a26769eee2b6a73b5fa52e1283704..95c407001574bc25c0de96890835e8a57d52445a 100644
(file)
--- a/
crypto/engine/eng_cnf.c
+++ b/
crypto/engine/eng_cnf.c
@@
-1,5
+1,5
@@
/* eng_cnf.c */
/* eng_cnf.c */
-/* Written by Stephen Henson (s
henson@bigfoot.com
) for the OpenSSL
+/* Written by Stephen Henson (s
teve@openssl.org
) for the OpenSSL
* project 2001.
*/
/* ====================================================================
* project 2001.
*/
/* ====================================================================
@@
-95,9
+95,11
@@
static int int_engine_configure(char *name, char *value, const CONF *cnf)
int ret = 0;
long do_init = -1;
STACK_OF(CONF_VALUE) *ecmds;
int ret = 0;
long do_init = -1;
STACK_OF(CONF_VALUE) *ecmds;
- CONF_VALUE *ecmd;
+ CONF_VALUE *ecmd
= NULL
;
char *ctrlname, *ctrlvalue;
ENGINE *e = NULL;
char *ctrlname, *ctrlvalue;
ENGINE *e = NULL;
+ int soft = 0;
+
name = skip_dot(name);
#ifdef ENGINE_CONF_DEBUG
fprintf(stderr, "Configuring engine %s\n", name);
name = skip_dot(name);
#ifdef ENGINE_CONF_DEBUG
fprintf(stderr, "Configuring engine %s\n", name);
@@
-125,6
+127,8
@@
static int int_engine_configure(char *name, char *value, const CONF *cnf)
/* Override engine name to use */
if (!strcmp(ctrlname, "engine_id"))
name = ctrlvalue;
/* Override engine name to use */
if (!strcmp(ctrlname, "engine_id"))
name = ctrlvalue;
+ else if (!strcmp(ctrlname, "soft_load"))
+ soft = 1;
/* Load a dynamic ENGINE */
else if (!strcmp(ctrlname, "dynamic_path"))
{
/* Load a dynamic ENGINE */
else if (!strcmp(ctrlname, "dynamic_path"))
{
@@
-147,15
+151,20
@@
static int int_engine_configure(char *name, char *value, const CONF *cnf)
if (!e)
{
e = ENGINE_by_id(name);
if (!e)
{
e = ENGINE_by_id(name);
+ if (!e && soft)
+ {
+ ERR_clear_error();
+ return 1;
+ }
if (!e)
if (!e)
-
return 0
;
+
goto err
;
}
/* Allow "EMPTY" to mean no value: this allows a valid
* "value" to be passed to ctrls of type NO_INPUT
*/
if (!strcmp(ctrlvalue, "EMPTY"))
ctrlvalue = NULL;
}
/* Allow "EMPTY" to mean no value: this allows a valid
* "value" to be passed to ctrls of type NO_INPUT
*/
if (!strcmp(ctrlvalue, "EMPTY"))
ctrlvalue = NULL;
-
else
if (!strcmp(ctrlname, "init"))
+ if (!strcmp(ctrlname, "init"))
{
if (!NCONF_get_number_e(cnf, value, "init", &do_init))
goto err;
{
if (!NCONF_get_number_e(cnf, value, "init", &do_init))
goto err;
@@
-177,16
+186,27
@@
static int int_engine_configure(char *name, char *value, const CONF *cnf)
}
else if (!ENGINE_ctrl_cmd_string(e,
ctrlname, ctrlvalue, 0))
}
else if (!ENGINE_ctrl_cmd_string(e,
ctrlname, ctrlvalue, 0))
-
return 0
;
+
goto err
;
}
}
if (e && (do_init == -1) && !int_engine_init(e))
}
}
if (e && (do_init == -1) && !int_engine_init(e))
+ {
+ ecmd = NULL;
goto err;
goto err;
+ }
ret = 1;
err:
ret = 1;
err:
+ if (ret != 1)
+ {
+ ENGINEerr(ENGINE_F_INT_ENGINE_CONFIGURE, ENGINE_R_ENGINE_CONFIGURATION_ERROR);
+ if (ecmd)
+ ERR_add_error_data(6, "section=", ecmd->section,
+ ", name=", ecmd->name,
+ ", value=", ecmd->value);
+ }
if (e)
ENGINE_free(e);
return ret;
if (e)
ENGINE_free(e);
return ret;