diff options
Diffstat (limited to 'apps/req.c')
-rw-r--r-- | apps/req.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/apps/req.c b/apps/req.c index 23757044ab7f..73b320a7098c 100644 --- a/apps/req.c +++ b/apps/req.c @@ -1,5 +1,5 @@ /* - * Copyright 1995-2022 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 1995-2023 The OpenSSL Project Authors. All Rights Reserved. * * Licensed under the Apache License 2.0 (the "License"). You may not use * this file except in compliance with the License. You can obtain a copy @@ -199,7 +199,7 @@ static int duplicated(LHASH_OF(OPENSSL_STRING) *addexts, char *kv) /* Check syntax. */ /* Skip leading whitespace, make a copy. */ - while (*kv && isspace(*kv)) + while (*kv && isspace(_UC(*kv))) if (*++kv == '\0') return 1; if ((p = strchr(kv, '=')) == NULL) @@ -210,7 +210,7 @@ static int duplicated(LHASH_OF(OPENSSL_STRING) *addexts, char *kv) /* Skip trailing space before the equal sign. */ for (p = kv + off; p > kv; --p) - if (!isspace(p[-1])) + if (!isspace(_UC(p[-1]))) break; if (p == kv) { OPENSSL_free(kv); @@ -635,8 +635,10 @@ int req_main(int argc, char **argv) if (newreq && pkey == NULL) { app_RAND_load_conf(req_conf, section); - if (!NCONF_get_number(req_conf, section, BITS, &newkey_len)) + if (!NCONF_get_number(req_conf, section, BITS, &newkey_len)) { + ERR_clear_error(); newkey_len = DEFAULT_KEY_LENGTH; + } genctx = set_keygen_ctx(keyalg, &keyalgstr, &newkey_len, gen_eng); if (genctx == NULL) |