summaryrefslogtreecommitdiffstats
path: root/crypto/conf
diff options
context:
space:
mode:
authorTomas Mraz <tmraz@fedoraproject.org>2019-02-01 14:32:36 +0100
committerRichard Levitte <levitte@openssl.org>2019-02-11 15:25:00 +0100
commit95f59d398c3f28f7ee50f092106c5910d25f9e30 (patch)
tree4bdea915f77e3231ff129c052523bbc1461172a0 /crypto/conf
parenta12b338f06442573a04932dbedaad3023113ee25 (diff)
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 = <filename> syntax which is interpreted as variable assignment by the old openssl config file parser. Reviewed-by: Matt Caswell <matt@openssl.org> Reviewed-by: Richard Levitte <levitte@openssl.org> (Merged from https://github.com/openssl/openssl/pull/8141) (cherry picked from commit 9d5560331d86c6463e965321f774e4eed582ce0b)
Diffstat (limited to 'crypto/conf')
-rw-r--r--crypto/conf/conf_def.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/crypto/conf/conf_def.c b/crypto/conf/conf_def.c
index 7f0d70ea69..450eeb9f48 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;