From 9d5560331d86c6463e965321f774e4eed582ce0b Mon Sep 17 00:00:00 2001 From: Tomas Mraz Date: Fri, 1 Feb 2019 14:32:36 +0100 Subject: Allow the syntax of the .include directive to optionally have '=' If the old openssl versions not supporting the .include directive load a config file with it, they will bail out with error. This change allows using the .include = syntax which is interpreted as variable assignment by the old openssl config file parser. Reviewed-by: Matt Caswell Reviewed-by: Richard Levitte (Merged from https://github.com/openssl/openssl/pull/8141) --- crypto/conf/conf_def.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'crypto/conf/conf_def.c') diff --git a/crypto/conf/conf_def.c b/crypto/conf/conf_def.c index 8a34218748..594f7c5e5a 100644 --- a/crypto/conf/conf_def.c +++ b/crypto/conf/conf_def.c @@ -348,10 +348,15 @@ static int def_load_bio(CONF *conf, BIO *in, long *line) psection = section; } p = eat_ws(conf, end); - if (strncmp(pname, ".include", 8) == 0 && p != pname + 8) { + if (strncmp(pname, ".include", 8) == 0 + && (p != pname + 8 || *p == '=')) { char *include = NULL; BIO *next; + if (*p == '=') { + p++; + p = eat_ws(conf, p); + } trim_ws(conf, p); if (!str_copy(conf, psection, &include, p)) goto err; -- cgit v1.2.3