X-Git-Url: http://wagner.pp.ru/gitweb/?a=blobdiff_plain;f=gost_ctl.c;h=8e3c1c62462adcfbcaba428cdbba676b2cdb8ec9;hb=refs%2Fheads%2Fopenssl_1_0_2;hp=6c93c4584d6ddd2cfa63d9d877e1e01e2a5b9703;hpb=c98ba9d03213d0c63d6874539d59f7b55fbc3fae;p=openssl-gost%2Fengine.git diff --git a/gost_ctl.c b/gost_ctl.c index 6c93c45..8e3c1c6 100644 --- a/gost_ctl.c +++ b/gost_ctl.c @@ -15,34 +15,28 @@ #include "gost_lcl.h" static char *gost_params[GOST_PARAM_MAX + 1] = { NULL }; -static const char *gost_envnames[] = { "CRYPT_PARAMS" }; +static const char *gost_envnames[] = { "CRYPT_PARAMS", "GOST_PBE_HMAC" }; const ENGINE_CMD_DEFN gost_cmds[] = { -/*- { GOST_CTRL_RNG, - "RNG", - "Type of random number generator to use", - ENGINE_CMD_FLAG_STRING - }, - { GOST_CTRL_RNG_PARAMS, - "RNG_PARAMS", - "Parameter for random number generator", - ENGINE_CMD_FLAG_STRING - }, -*/ {GOST_CTRL_CRYPT_PARAMS, - "CRYPT_PARAMS", - "OID of default GOST 28147-89 parameters", - ENGINE_CMD_FLAG_STRING}, + {GOST_CTRL_CRYPT_PARAMS, + "CRYPT_PARAMS", + "OID of default GOST 28147-89 parameters", + ENGINE_CMD_FLAG_STRING}, + {GOST_CTRL_PBE_PARAMS, + "PBE_PARAMS", + "Shortname of default digest alg for PBE", + ENGINE_CMD_FLAG_STRING}, {0, NULL, NULL, 0} }; void gost_param_free() { int i; - for (i = 0; i <= GOST_PARAM_MAX; i++) - if (gost_params[i] != NULL) { - OPENSSL_free(gost_params[i]); - gost_params[i] = NULL; - } + + for (i = 0; i <= GOST_PARAM_MAX; i++) { + OPENSSL_free(gost_params[i]); + gost_params[i] = NULL; + } } @@ -66,8 +60,7 @@ const char *get_gost_engine_param(int param) } tmp = getenv(gost_envnames[param]); if (tmp) { - if (gost_params[param]) - OPENSSL_free(gost_params[param]); + OPENSSL_free(gost_params[param]); gost_params[param] = BUF_strdup(tmp); return gost_params[param]; } @@ -85,8 +78,7 @@ int gost_set_default_param(int param, const char *value) */ if (!tmp) tmp = value; - if (gost_params[param]) - OPENSSL_free(gost_params[param]); + OPENSSL_free(gost_params[param]); gost_params[param] = BUF_strdup(tmp); return 1;