sync with OpenBSD -current
This commit is contained in:
parent
84a7643638
commit
bf0d2e284c
48 changed files with 439 additions and 307 deletions
|
@ -1,4 +1,4 @@
|
|||
/* $OpenBSD: ts_conf.c,v 1.14 2024/03/26 00:39:22 beck Exp $ */
|
||||
/* $OpenBSD: ts_conf.c,v 1.15 2024/08/26 22:01:28 op Exp $ */
|
||||
/* Written by Zoltan Glozik (zglozik@stones.com) for the OpenSSL
|
||||
* project 2002.
|
||||
*/
|
||||
|
@ -56,6 +56,8 @@
|
|||
*
|
||||
*/
|
||||
|
||||
#include <limits.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
||||
#include <openssl/opensslconf.h>
|
||||
|
@ -394,6 +396,7 @@ TS_CONF_set_accuracy(CONF *conf, const char *section, TS_RESP_CTX *ctx)
|
|||
int secs = 0, millis = 0, micros = 0;
|
||||
STACK_OF(CONF_VALUE) *list = NULL;
|
||||
char *accuracy = NCONF_get_string(conf, section, ENV_ACCURACY);
|
||||
const char *errstr;
|
||||
|
||||
if (accuracy && !(list = X509V3_parse_list(accuracy))) {
|
||||
TS_CONF_invalid(section, ENV_ACCURACY);
|
||||
|
@ -402,14 +405,33 @@ TS_CONF_set_accuracy(CONF *conf, const char *section, TS_RESP_CTX *ctx)
|
|||
for (i = 0; i < sk_CONF_VALUE_num(list); ++i) {
|
||||
CONF_VALUE *val = sk_CONF_VALUE_value(list, i);
|
||||
if (strcmp(val->name, ENV_VALUE_SECS) == 0) {
|
||||
if (val->value)
|
||||
secs = atoi(val->value);
|
||||
if (val->value) {
|
||||
secs = strtonum(val->value, 0, INT_MAX,
|
||||
&errstr);
|
||||
if (errstr != NULL) {
|
||||
TS_CONF_invalid(section,
|
||||
ENV_VALUE_SECS);
|
||||
goto err;
|
||||
}
|
||||
}
|
||||
} else if (strcmp(val->name, ENV_VALUE_MILLISECS) == 0) {
|
||||
if (val->value)
|
||||
millis = atoi(val->value);
|
||||
if (val->value) {
|
||||
millis = strtonum(val->value, 1, 999, &errstr);
|
||||
if (errstr != NULL) {
|
||||
TS_CONF_invalid(section,
|
||||
ENV_VALUE_MILLISECS);
|
||||
goto err;
|
||||
}
|
||||
}
|
||||
} else if (strcmp(val->name, ENV_VALUE_MICROSECS) == 0) {
|
||||
if (val->value)
|
||||
micros = atoi(val->value);
|
||||
if (val->value) {
|
||||
micros = strtonum(val->value, 1, 999, &errstr);
|
||||
if (errstr != NULL) {
|
||||
TS_CONF_invalid(section,
|
||||
ENV_VALUE_MICROSECS);
|
||||
goto err;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
TS_CONF_invalid(section, ENV_ACCURACY);
|
||||
goto err;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue