}
if (days == 0) {
- if (!NCONF_get_number(conf, section, ENV_DEFAULT_DAYS, &days)) {
- ERR_clear_error();
+ if (!app_conf_try_number(conf, section, ENV_DEFAULT_DAYS, &days))
days = 0;
- }
}
if (enddate == NULL && days == 0) {
BIO_printf(bio_err, "cannot lookup how many days to certify for\n");
}
if (!crldays && !crlhours && !crlsec) {
- if (!NCONF_get_number(conf, section,
- ENV_DEFAULT_CRL_DAYS, &crldays)) {
- ERR_clear_error();
+ if (!app_conf_try_number(conf, section,
+ ENV_DEFAULT_CRL_DAYS, &crldays))
crldays = 0;
- }
- if (!NCONF_get_number(conf, section,
- ENV_DEFAULT_CRL_HOURS, &crlhours)) {
- ERR_clear_error();
+ if (!app_conf_try_number(conf, section,
+ ENV_DEFAULT_CRL_HOURS, &crlhours))
crlhours = 0;
- }
}
if ((crl_nextupdate == NULL) &&
(crldays == 0) && (crlhours == 0) && (crlsec == 0)) {
BIO *bio_open_default(const char *filename, char mode, int format);
BIO *bio_open_default_quiet(const char *filename, char mode, int format);
char *app_conf_try_string(const CONF *cnf, const char *group, const char *name);
+int app_conf_try_number(const CONF *conf, const char *group, const char *name,
+ long *result);
CONF *app_load_config_bio(BIO *in, const char *filename);
# define app_load_config(filename) app_load_config_internal(filename, 0)
# define app_load_config_quiet(filename) app_load_config_internal(filename, 1)
if (newreq && pkey == NULL) {
app_RAND_load_conf(req_conf, section);
- if (!NCONF_get_number(req_conf, section, BITS, &newkey_len))
+ if (!app_conf_try_number(req_conf, section, BITS, &newkey_len))
newkey_len = DEFAULT_KEY_LENGTH;
genctx = set_keygen_ctx(keyalg, &keyalgstr, &newkey_len, gen_eng);
if (!join(buf, sizeof(buf), v->name, "_min", "Name"))
return 0;
- if (!NCONF_get_number(req_conf, dn_sect, buf, &n_min)) {
- ERR_clear_error();
+ if (!app_conf_try_number(req_conf, dn_sect, buf, &n_min))
n_min = -1;
- }
if (!join(buf, sizeof(buf), v->name, "_max", "Name"))
return 0;
- if (!NCONF_get_number(req_conf, dn_sect, buf, &n_max)) {
- ERR_clear_error();
+ if (!app_conf_try_number(req_conf, dn_sect, buf, &n_max))
n_max = -1;
- }
if (!add_DN_object(subj, v->value, def, value, nid,
n_min, n_max, chtype, mval))
if (!join(buf, sizeof(buf), type, "_min", "Name"))
return 0;
- if (!NCONF_get_number(req_conf, attr_sect, buf, &n_min)) {
- ERR_clear_error();
+ if (!app_conf_try_number(req_conf, attr_sect, buf, &n_min))
n_min = -1;
- }
if (!join(buf, sizeof(buf), type, "_max", "Name"))
return 0;
- if (!NCONF_get_number(req_conf, attr_sect, buf, &n_max)) {
- ERR_clear_error();
+ if (!app_conf_try_number(req_conf, attr_sect, buf, &n_max))
n_max = -1;
- }
if (!add_attribute_object(req,
v->value, def, value, nid, n_min,