OpenSSL 1.1.1-pre2

This commit is contained in:
Hakase
2018-04-07 17:29:40 +09:00
parent 82a44d2483
commit bbac8ca55d
17755 changed files with 221242 additions and 98415 deletions
+15 -14
View File
@@ -9,11 +9,11 @@
/* Part of the code in here was originally in conf.c, which is now removed */
#include "e_os.h"
#include <stdlib.h>
#include <string.h>
#include <openssl/conf.h>
#include <openssl/conf_api.h>
#include "e_os.h"
static void value_free_hash(const CONF_VALUE *a, LHASH_OF(CONF_VALUE) *conf);
static void value_free_stack_doall(CONF_VALUE *a);
@@ -24,11 +24,11 @@ CONF_VALUE *_CONF_get_section(const CONF *conf, const char *section)
CONF_VALUE *v, vv;
if ((conf == NULL) || (section == NULL))
return (NULL);
return NULL;
vv.name = NULL;
vv.section = (char *)section;
v = lh_CONF_VALUE_retrieve(conf->data, &vv);
return (v);
return v;
}
/* Up until OpenSSL 0.9.5a, this was CONF_get_section */
@@ -41,7 +41,7 @@ STACK_OF(CONF_VALUE) *_CONF_get_section_values(const CONF *conf,
if (v != NULL)
return ((STACK_OF(CONF_VALUE) *)v->value);
else
return (NULL);
return NULL;
}
int _CONF_add_string(CONF *conf, CONF_VALUE *section, CONF_VALUE *value)
@@ -73,29 +73,29 @@ char *_CONF_get_string(const CONF *conf, const char *section,
char *p;
if (name == NULL)
return (NULL);
return NULL;
if (conf != NULL) {
if (section != NULL) {
vv.name = (char *)name;
vv.section = (char *)section;
v = lh_CONF_VALUE_retrieve(conf->data, &vv);
if (v != NULL)
return (v->value);
return v->value;
if (strcmp(section, "ENV") == 0) {
p = getenv(name);
if (p != NULL)
return (p);
return p;
}
}
vv.section = "default";
vv.name = (char *)name;
v = lh_CONF_VALUE_retrieve(conf->data, &vv);
if (v != NULL)
return (v->value);
return v->value;
else
return (NULL);
return NULL;
} else
return (getenv(name));
return getenv(name);
}
static unsigned long conf_value_hash(const CONF_VALUE *v)
@@ -110,14 +110,14 @@ static int conf_value_cmp(const CONF_VALUE *a, const CONF_VALUE *b)
if (a->section != b->section) {
i = strcmp(a->section, b->section);
if (i)
return (i);
return i;
}
if ((a->name != NULL) && (b->name != NULL)) {
i = strcmp(a->name, b->name);
return (i);
return i;
} else if (a->name == b->name)
return (0);
return 0;
else
return ((a->name == NULL) ? -1 : 1);
}
@@ -204,7 +204,8 @@ CONF_VALUE *_CONF_new_section(CONF *conf, const char *section)
v->value = (char *)sk;
vv = lh_CONF_VALUE_insert(conf->data, v);
OPENSSL_assert(vv == NULL);
if (vv != NULL)
goto err;
return v;
err: