Latest update.
This commit is contained in:
+67
-19
@@ -54,7 +54,7 @@ static BIO *get_next_file(const char *path, OPENSSL_DIR_CTX **dirctx);
|
||||
|
||||
static CONF *def_create(CONF_METHOD *meth);
|
||||
static int def_init_default(CONF *conf);
|
||||
#if !OPENSSL_API_3
|
||||
#ifndef OPENSSL_NO_DEPRECATED_3_0
|
||||
static int def_init_WIN32(CONF *conf);
|
||||
#endif
|
||||
static int def_destroy(CONF *conf);
|
||||
@@ -83,7 +83,7 @@ CONF_METHOD *NCONF_default(void)
|
||||
return &default_method;
|
||||
}
|
||||
|
||||
#if ! OPENSSL_API_3
|
||||
#ifndef OPENSSL_NO_DEPRECATED_3_0
|
||||
static CONF_METHOD WIN32_method = {
|
||||
"WIN32",
|
||||
def_create,
|
||||
@@ -121,22 +121,22 @@ static int def_init_default(CONF *conf)
|
||||
if (conf == NULL)
|
||||
return 0;
|
||||
|
||||
memset(conf, 0, sizeof(*conf));
|
||||
conf->meth = &default_method;
|
||||
conf->meth_data = (void *)CONF_type_default;
|
||||
conf->data = NULL;
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
#if ! OPENSSL_API_3
|
||||
#ifndef OPENSSL_NO_DEPRECATED_3_0
|
||||
static int def_init_WIN32(CONF *conf)
|
||||
{
|
||||
if (conf == NULL)
|
||||
return 0;
|
||||
|
||||
memset(conf, 0, sizeof(*conf));
|
||||
conf->meth = &WIN32_method;
|
||||
conf->meth_data = (void *)CONF_type_win32;
|
||||
conf->data = NULL;
|
||||
|
||||
return 1;
|
||||
}
|
||||
@@ -354,7 +354,49 @@ static int def_load_bio(CONF *conf, BIO *in, long *line)
|
||||
psection = section;
|
||||
}
|
||||
p = eat_ws(conf, end);
|
||||
if (strncmp(pname, ".include", 8) == 0
|
||||
if (strncmp(pname, ".pragma", 7) == 0
|
||||
&& (p != pname + 7 || *p == '=')) {
|
||||
char *pval;
|
||||
|
||||
if (*p == '=') {
|
||||
p++;
|
||||
p = eat_ws(conf, p);
|
||||
}
|
||||
trim_ws(conf, p);
|
||||
|
||||
/* Pragma values take the form keyword:value */
|
||||
pval = strchr(p, ':');
|
||||
if (pval == NULL || pval == p || pval[1] == '\0') {
|
||||
CONFerr(CONF_F_DEF_LOAD_BIO, CONF_R_INVALID_PRAGMA);
|
||||
goto err;
|
||||
}
|
||||
|
||||
*pval++ = '\0';
|
||||
trim_ws(conf, p);
|
||||
pval = eat_ws(conf, pval);
|
||||
|
||||
/*
|
||||
* Known pragmas:
|
||||
*
|
||||
* dollarid takes "on", "true or "off", "false"
|
||||
*/
|
||||
if (strcmp(p, "dollarid") == 0) {
|
||||
if (strcmp(pval, "on") == 0
|
||||
|| strcmp(pval, "true") == 0) {
|
||||
conf->flag_dollarid = 1;
|
||||
} else if (strcmp(pval, "off") == 0
|
||||
|| strcmp(pval, "false") == 0) {
|
||||
conf->flag_dollarid = 0;
|
||||
} else {
|
||||
CONFerr(CONF_F_DEF_LOAD_BIO, CONF_R_INVALID_PRAGMA);
|
||||
goto err;
|
||||
}
|
||||
}
|
||||
/*
|
||||
* We *ignore* any unknown pragma.
|
||||
*/
|
||||
continue;
|
||||
} else if (strncmp(pname, ".include", 8) == 0
|
||||
&& (p != pname + 8 || *p == '=')) {
|
||||
char *include = NULL;
|
||||
BIO *next;
|
||||
@@ -414,6 +456,7 @@ static int def_load_bio(CONF *conf, BIO *in, long *line)
|
||||
continue;
|
||||
} else if (*p != '=') {
|
||||
CONFerr(CONF_F_DEF_LOAD_BIO, CONF_R_MISSING_EQUAL_SIGN);
|
||||
ERR_add_error_data(2, "HERE-->", p);
|
||||
goto err;
|
||||
}
|
||||
*end = '\0';
|
||||
@@ -590,7 +633,10 @@ static int str_copy(CONF *conf, char *section, char **pto, char *from)
|
||||
buf->data[to++] = v;
|
||||
} else if (IS_EOF(conf, *from))
|
||||
break;
|
||||
else if (*from == '$') {
|
||||
else if (*from == '$'
|
||||
&& (!conf->flag_dollarid
|
||||
|| from[1] == '{'
|
||||
|| from[1] == '(')) {
|
||||
size_t newsize;
|
||||
|
||||
/* try to expand it */
|
||||
@@ -607,7 +653,8 @@ static int str_copy(CONF *conf, char *section, char **pto, char *from)
|
||||
s++;
|
||||
cp = section;
|
||||
e = np = s;
|
||||
while (IS_ALNUM(conf, *e))
|
||||
while (IS_ALNUM(conf, *e)
|
||||
|| (conf->flag_dollarid && IS_DOLLAR(conf, *e)))
|
||||
e++;
|
||||
if ((e[0] == ':') && (e[1] == ':')) {
|
||||
cp = np;
|
||||
@@ -616,7 +663,8 @@ static int str_copy(CONF *conf, char *section, char **pto, char *from)
|
||||
*rrp = '\0';
|
||||
e += 2;
|
||||
np = e;
|
||||
while (IS_ALNUM(conf, *e))
|
||||
while (IS_ALNUM(conf, *e)
|
||||
|| (conf->flag_dollarid && IS_DOLLAR(conf, *e)))
|
||||
e++;
|
||||
}
|
||||
r = *e;
|
||||
@@ -729,7 +777,9 @@ static BIO *process_include(char *include, OPENSSL_DIR_CTX **dirctx,
|
||||
static BIO *get_next_file(const char *path, OPENSSL_DIR_CTX **dirctx)
|
||||
{
|
||||
const char *filename;
|
||||
size_t pathlen;
|
||||
|
||||
pathlen = strlen(path);
|
||||
while ((filename = OPENSSL_DIR_read(dirctx, path)) != NULL) {
|
||||
size_t namelen;
|
||||
|
||||
@@ -742,7 +792,7 @@ static BIO *get_next_file(const char *path, OPENSSL_DIR_CTX **dirctx)
|
||||
char *newpath;
|
||||
BIO *bio;
|
||||
|
||||
newlen = strlen(path) + namelen + 2;
|
||||
newlen = pathlen + namelen + 2;
|
||||
newpath = OPENSSL_zalloc(newlen);
|
||||
if (newpath == NULL) {
|
||||
CONFerr(CONF_F_GET_NEXT_FILE, ERR_R_MALLOC_FAILURE);
|
||||
@@ -753,14 +803,11 @@ static BIO *get_next_file(const char *path, OPENSSL_DIR_CTX **dirctx)
|
||||
* If the given path isn't clear VMS syntax,
|
||||
* we treat it as on Unix.
|
||||
*/
|
||||
{
|
||||
size_t pathlen = strlen(path);
|
||||
|
||||
if (path[pathlen - 1] == ']' || path[pathlen - 1] == '>'
|
||||
|| path[pathlen - 1] == ':') {
|
||||
/* Clear VMS directory syntax, just copy as is */
|
||||
OPENSSL_strlcpy(newpath, path, newlen);
|
||||
}
|
||||
if (path[pathlen - 1] == ']'
|
||||
|| path[pathlen - 1] == '>'
|
||||
|| path[pathlen - 1] == ':') {
|
||||
/* Clear VMS directory syntax, just copy as is */
|
||||
OPENSSL_strlcpy(newpath, path, newlen);
|
||||
}
|
||||
#endif
|
||||
if (newpath[0] == '\0') {
|
||||
@@ -833,7 +880,8 @@ static char *eat_alpha_numeric(CONF *conf, char *p)
|
||||
p = scan_esc(conf, p);
|
||||
continue;
|
||||
}
|
||||
if (!IS_ALNUM_PUNCT(conf, *p))
|
||||
if (!(IS_ALNUM_PUNCT(conf, *p)
|
||||
|| (conf->flag_dollarid && IS_DOLLAR(conf, *p))))
|
||||
return p;
|
||||
p++;
|
||||
}
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* WARNING: do not edit!
|
||||
* Generated by crypto/conf/keysets.pl
|
||||
*
|
||||
* Copyright 1995-2019 The OpenSSL Project Authors. All Rights Reserved.
|
||||
* Copyright 1995-2020 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
|
||||
* in the file LICENSE in the source distribution or at
|
||||
@@ -20,6 +20,7 @@
|
||||
#define CONF_DQUOTE 1024
|
||||
#define CONF_COMMENT 128
|
||||
#define CONF_FCOMMENT 2048
|
||||
#define CONF_DOLLAR 4096
|
||||
#define CONF_EOF 8
|
||||
#define CONF_ALPHA (CONF_UPPER|CONF_LOWER)
|
||||
#define CONF_ALNUM (CONF_ALPHA|CONF_NUMBER|CONF_UNDER)
|
||||
@@ -36,13 +37,14 @@
|
||||
#define IS_ALNUM_PUNCT(conf,c) is_keytype(conf, c, CONF_ALNUM_PUNCT)
|
||||
#define IS_QUOTE(conf,c) is_keytype(conf, c, CONF_QUOTE)
|
||||
#define IS_DQUOTE(conf,c) is_keytype(conf, c, CONF_DQUOTE)
|
||||
#define IS_DOLLAR(conf,c) is_keytype(conf, c, CONF_DOLLAR)
|
||||
|
||||
static const unsigned short CONF_type_default[128] = {
|
||||
0x0008, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
|
||||
0x0000, 0x0010, 0x0010, 0x0000, 0x0000, 0x0010, 0x0000, 0x0000,
|
||||
0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
|
||||
0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
|
||||
0x0010, 0x0200, 0x0040, 0x0080, 0x0000, 0x0200, 0x0200, 0x0040,
|
||||
0x0010, 0x0200, 0x0040, 0x0080, 0x1000, 0x0200, 0x0200, 0x0040,
|
||||
0x0000, 0x0000, 0x0200, 0x0200, 0x0200, 0x0200, 0x0200, 0x0200,
|
||||
0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001,
|
||||
0x0001, 0x0001, 0x0000, 0x0200, 0x0000, 0x0000, 0x0000, 0x0200,
|
||||
@@ -56,13 +58,13 @@ static const unsigned short CONF_type_default[128] = {
|
||||
0x0004, 0x0004, 0x0004, 0x0000, 0x0200, 0x0000, 0x0200, 0x0000,
|
||||
};
|
||||
|
||||
#if ! OPENSSL_API_3
|
||||
#ifndef OPENSSL_NO_DEPRECATED_3_0
|
||||
static const unsigned short CONF_type_win32[128] = {
|
||||
0x0008, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
|
||||
0x0000, 0x0010, 0x0010, 0x0000, 0x0000, 0x0010, 0x0000, 0x0000,
|
||||
0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
|
||||
0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
|
||||
0x0010, 0x0200, 0x0400, 0x0000, 0x0000, 0x0200, 0x0200, 0x0000,
|
||||
0x0010, 0x0200, 0x0400, 0x0000, 0x1000, 0x0200, 0x0200, 0x0000,
|
||||
0x0000, 0x0000, 0x0200, 0x0200, 0x0200, 0x0200, 0x0200, 0x0200,
|
||||
0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001,
|
||||
0x0001, 0x0001, 0x0000, 0x0A00, 0x0000, 0x0000, 0x0000, 0x0200,
|
||||
|
||||
@@ -15,8 +15,11 @@
|
||||
|
||||
static const ERR_STRING_DATA CONF_str_reasons[] = {
|
||||
{ERR_PACK(ERR_LIB_CONF, 0, CONF_R_ERROR_LOADING_DSO), "error loading dso"},
|
||||
{ERR_PACK(ERR_LIB_CONF, 0, CONF_R_INVALID_PRAGMA), "invalid pragma"},
|
||||
{ERR_PACK(ERR_LIB_CONF, 0, CONF_R_LIST_CANNOT_BE_NULL),
|
||||
"list cannot be null"},
|
||||
{ERR_PACK(ERR_LIB_CONF, 0, CONF_R_MANDATORY_BRACES_IN_VARIABLE_EXPANSION),
|
||||
"mandatory braces in variable expansion"},
|
||||
{ERR_PACK(ERR_LIB_CONF, 0, CONF_R_MISSING_CLOSE_SQUARE_BRACKET),
|
||||
"missing close square bracket"},
|
||||
{ERR_PACK(ERR_LIB_CONF, 0, CONF_R_MISSING_EQUAL_SIGN),
|
||||
|
||||
@@ -27,7 +27,7 @@
|
||||
|
||||
static int openssl_configured = 0;
|
||||
|
||||
#if !OPENSSL_API_1_1_0
|
||||
#ifndef OPENSSL_NO_DEPRECATED_1_1_0
|
||||
void OPENSSL_config(const char *appname)
|
||||
{
|
||||
OPENSSL_INIT_SETTINGS settings;
|
||||
|
||||
@@ -20,6 +20,7 @@ my $QUOTE = 0x0040;
|
||||
my $DQUOTE = 0x0400;
|
||||
my $COMMENT = 0x0080;
|
||||
my $FCOMMENT = 0x0800;
|
||||
my $DOLLAR = 0x1000;
|
||||
my $EOF = 0x0008;
|
||||
my @V_def;
|
||||
my @V_w32;
|
||||
@@ -38,6 +39,7 @@ foreach (0 .. 127) {
|
||||
$v |= $ESC if $c =~ /\\/;
|
||||
$v |= $QUOTE if $c =~ /['`"]/; # for emacs: "`'
|
||||
$v |= $COMMENT if $c =~ /\#/;
|
||||
$v |= $DOLLAR if $c eq '$';
|
||||
$v |= $EOF if $c =~ /\0/;
|
||||
push(@V_def, $v);
|
||||
|
||||
@@ -50,13 +52,13 @@ foreach (0 .. 127) {
|
||||
$v |= $WS if $c =~ /[ \t\r\n]/;
|
||||
$v |= $DQUOTE if $c =~ /["]/; # for emacs: "
|
||||
$v |= $FCOMMENT if $c =~ /;/;
|
||||
$v |= $DOLLAR if $c eq '$';
|
||||
$v |= $EOF if $c =~ /\0/;
|
||||
push(@V_w32, $v);
|
||||
}
|
||||
|
||||
# Output year depends on the year of the script.
|
||||
my $YEAR = [localtime([stat($0)]->[9])]->[5] + 1900;
|
||||
|
||||
# The year the output file is generated.
|
||||
my $YEAR = [localtime()]->[5] + 1900;
|
||||
print <<"EOF";
|
||||
/*
|
||||
* WARNING: do not edit!
|
||||
@@ -80,6 +82,7 @@ print <<"EOF";
|
||||
#define CONF_DQUOTE $DQUOTE
|
||||
#define CONF_COMMENT $COMMENT
|
||||
#define CONF_FCOMMENT $FCOMMENT
|
||||
#define CONF_DOLLAR $DOLLAR
|
||||
#define CONF_EOF $EOF
|
||||
#define CONF_ALPHA (CONF_UPPER|CONF_LOWER)
|
||||
#define CONF_ALNUM (CONF_ALPHA|CONF_NUMBER|CONF_UNDER)
|
||||
@@ -96,6 +99,7 @@ print <<"EOF";
|
||||
#define IS_ALNUM_PUNCT(conf,c) is_keytype(conf, c, CONF_ALNUM_PUNCT)
|
||||
#define IS_QUOTE(conf,c) is_keytype(conf, c, CONF_QUOTE)
|
||||
#define IS_DQUOTE(conf,c) is_keytype(conf, c, CONF_DQUOTE)
|
||||
#define IS_DOLLAR(conf,c) is_keytype(conf, c, CONF_DOLLAR)
|
||||
|
||||
EOF
|
||||
|
||||
@@ -108,7 +112,7 @@ for ($i = 0; $i < 128; $i++) {
|
||||
}
|
||||
print "\n};\n\n";
|
||||
|
||||
print "#if ! OPENSSL_API_3\n";
|
||||
print "#ifndef OPENSSL_NO_DEPRECATED_3_0\n";
|
||||
print "static const unsigned short CONF_type_win32[128] = {";
|
||||
for ($i = 0; $i < 128; $i++) {
|
||||
print "\n " if ($i % 8) == 0;
|
||||
|
||||
Reference in New Issue
Block a user