summaryrefslogtreecommitdiffstats
path: root/apps/ca.c
diff options
context:
space:
mode:
authorRichard Levitte <levitte@openssl.org>2003-11-28 14:45:09 +0000
committerRichard Levitte <levitte@openssl.org>2003-11-28 14:45:09 +0000
commit03ddbdd9b99ea60d0967b831ffc1fe93ae7f9792 (patch)
tree472cf7e91dacd8222a798e63124ddeb8ef6a14fb /apps/ca.c
parent5ebdb390849f832428e00c0b811beec907a56c10 (diff)
Move another common functionality (reproduced so far with cut'n'paste)
to apps.c, and give it the hopefully descriptive name parse_yesno().
Diffstat (limited to 'apps/ca.c')
-rw-r--r--apps/ca.c20
1 files changed, 3 insertions, 17 deletions
diff --git a/apps/ca.c b/apps/ca.c
index 7d10d825b1..0b33811172 100644
--- a/apps/ca.c
+++ b/apps/ca.c
@@ -131,6 +131,7 @@
#define ENV_NAMEOPT "name_opt"
#define ENV_CERTOPT "cert_opt"
#define ENV_EXTCOPY "copy_extensions"
+#define ENV_UNIQUE_SUBJECT "unique_subject"
#define ENV_DATABASE "database"
@@ -638,28 +639,13 @@ bad:
app_RAND_load_file(randfile, bio_err, 0);
db_attr.unique_subject = 1;
- p = NCONF_get_string(conf, section, "unique_subject");
+ p = NCONF_get_string(conf, section, ENV_UNIQUE_SUBJECT);
if (p)
{
#ifdef RL_DEBUG
BIO_printf(bio_err, "DEBUG: unique_subject = \"%s\"\n", p);
#endif
- switch(*p)
- {
- case 'f': /* false */
- case 'F': /* FALSE */
- case 'n': /* no */
- case 'N': /* NO */
- db_attr.unique_subject = 0;
- break;
- case 't': /* true */
- case 'T': /* TRUE */
- case 'y': /* yes */
- case 'Y': /* YES */
- default:
- db_attr.unique_subject = 1;
- break;
- }
+ db_attr.unique_subject = parse_yesno(p,1);
}
#ifdef RL_DEBUG
else