Adding in curl and openssl repos

This commit is contained in:
2025-08-14 12:09:30 -04:00
parent af2117b574
commit 0ace93e303
21174 changed files with 3607720 additions and 2 deletions

View File

@@ -0,0 +1,4 @@
LIBS=../../libcrypto
SOURCE[../../libcrypto]= \
conf_err.c conf_lib.c conf_api.c conf_def.c conf_mod.c \
conf_mall.c conf_sap.c conf_ssl.c

View File

@@ -0,0 +1,214 @@
/*
* Copyright 1995-2022 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
* https://www.openssl.org/source/license.html
*/
/* Part of the code in here was originally in conf.c, which is now removed */
#include "internal/e_os.h"
#include "internal/cryptlib.h"
#include <stdlib.h>
#include <string.h>
#include <openssl/conf.h>
#include <openssl/conf_api.h>
#include "conf_local.h"
static void value_free_hash(const CONF_VALUE *a, LHASH_OF(CONF_VALUE) *conf);
static void value_free_stack_doall(CONF_VALUE *a);
CONF_VALUE *_CONF_get_section(const CONF *conf, const char *section)
{
CONF_VALUE vv;
if (conf == NULL || section == NULL)
return NULL;
vv.name = NULL;
vv.section = (char *)section;
return conf->data != NULL ? lh_CONF_VALUE_retrieve(conf->data, &vv) : NULL;
}
STACK_OF(CONF_VALUE) *_CONF_get_section_values(const CONF *conf,
const char *section)
{
CONF_VALUE *v;
v = _CONF_get_section(conf, section);
if (v == NULL)
return NULL;
return ((STACK_OF(CONF_VALUE) *)v->value);
}
int _CONF_add_string(CONF *conf, CONF_VALUE *section, CONF_VALUE *value)
{
CONF_VALUE *v = NULL;
STACK_OF(CONF_VALUE) *ts;
ts = (STACK_OF(CONF_VALUE) *)section->value;
value->section = section->section;
if (!sk_CONF_VALUE_push(ts, value))
return 0;
v = lh_CONF_VALUE_insert(conf->data, value);
if (v != NULL) {
(void)sk_CONF_VALUE_delete_ptr(ts, v);
OPENSSL_free(v->name);
OPENSSL_free(v->value);
OPENSSL_free(v);
}
return 1;
}
char *_CONF_get_string(const CONF *conf, const char *section,
const char *name)
{
CONF_VALUE *v, vv;
char *p;
if (name == NULL)
return NULL;
if (conf == NULL)
return ossl_safe_getenv(name);
if (conf->data == NULL)
return 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;
if (strcmp(section, "ENV") == 0) {
p = ossl_safe_getenv(name);
if (p != NULL)
return p;
}
}
vv.section = "default";
vv.name = (char *)name;
v = lh_CONF_VALUE_retrieve(conf->data, &vv);
if (v == NULL)
return NULL;
return v->value;
}
static unsigned long conf_value_hash(const CONF_VALUE *v)
{
return (OPENSSL_LH_strhash(v->section) << 2) ^ OPENSSL_LH_strhash(v->name);
}
static int conf_value_cmp(const CONF_VALUE *a, const CONF_VALUE *b)
{
int i;
if (a->section != b->section) {
i = strcmp(a->section, b->section);
if (i != 0)
return i;
}
if (a->name != NULL && b->name != NULL)
return strcmp(a->name, b->name);
if (a->name == b->name)
return 0;
return (a->name == NULL) ? -1 : 1;
}
int _CONF_new_data(CONF *conf)
{
if (conf == NULL)
return 0;
if (conf->data == NULL) {
conf->data = lh_CONF_VALUE_new(conf_value_hash, conf_value_cmp);
if (conf->data == NULL)
return 0;
}
return 1;
}
typedef LHASH_OF(CONF_VALUE) LH_CONF_VALUE;
IMPLEMENT_LHASH_DOALL_ARG_CONST(CONF_VALUE, LH_CONF_VALUE);
void _CONF_free_data(CONF *conf)
{
if (conf == NULL)
return;
OPENSSL_free(conf->includedir);
if (conf->data == NULL)
return;
/* evil thing to make sure the 'OPENSSL_free()' works as expected */
lh_CONF_VALUE_set_down_load(conf->data, 0);
lh_CONF_VALUE_doall_LH_CONF_VALUE(conf->data, value_free_hash, conf->data);
/*
* We now have only 'section' entries in the hash table. Due to problems
* with
*/
lh_CONF_VALUE_doall(conf->data, value_free_stack_doall);
lh_CONF_VALUE_free(conf->data);
}
static void value_free_hash(const CONF_VALUE *a, LHASH_OF(CONF_VALUE) *conf)
{
if (a->name != NULL)
(void)lh_CONF_VALUE_delete(conf, a);
}
static void value_free_stack_doall(CONF_VALUE *a)
{
CONF_VALUE *vv;
STACK_OF(CONF_VALUE) *sk;
int i;
if (a->name != NULL)
return;
sk = (STACK_OF(CONF_VALUE) *)a->value;
for (i = sk_CONF_VALUE_num(sk) - 1; i >= 0; i--) {
vv = sk_CONF_VALUE_value(sk, i);
OPENSSL_free(vv->value);
OPENSSL_free(vv->name);
OPENSSL_free(vv);
}
sk_CONF_VALUE_free(sk);
OPENSSL_free(a->section);
OPENSSL_free(a);
}
CONF_VALUE *_CONF_new_section(CONF *conf, const char *section)
{
STACK_OF(CONF_VALUE) *sk = NULL;
int i;
CONF_VALUE *v = NULL, *vv;
if ((sk = sk_CONF_VALUE_new_null()) == NULL)
goto err;
if ((v = OPENSSL_malloc(sizeof(*v))) == NULL)
goto err;
i = strlen(section) + 1;
if ((v->section = OPENSSL_malloc(i)) == NULL)
goto err;
memcpy(v->section, section, i);
v->name = NULL;
v->value = (char *)sk;
vv = lh_CONF_VALUE_insert(conf->data, v);
if (vv != NULL || lh_CONF_VALUE_error(conf->data) > 0)
goto err;
return v;
err:
sk_CONF_VALUE_free(sk);
if (v != NULL)
OPENSSL_free(v->section);
OPENSSL_free(v);
return NULL;
}

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,80 @@
/*
* WARNING: do not edit!
* Generated by crypto/conf/keysets.pl
*
* Copyright 1995-2021 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
* https://www.openssl.org/source/license.html
*/
#define CONF_NUMBER 1
#define CONF_UPPER 2
#define CONF_LOWER 4
#define CONF_UNDER 256
#define CONF_PUNCT 512
#define CONF_WS 16
#define CONF_ESC 32
#define CONF_QUOTE 64
#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)
#define CONF_ALNUM_PUNCT (CONF_ALPHA|CONF_NUMBER|CONF_UNDER|CONF_PUNCT)
#define IS_COMMENT(conf,c) is_keytype(conf, c, CONF_COMMENT)
#define IS_FCOMMENT(conf,c) is_keytype(conf, c, CONF_FCOMMENT)
#define IS_EOF(conf,c) is_keytype(conf, c, CONF_EOF)
#define IS_ESC(conf,c) is_keytype(conf, c, CONF_ESC)
#define IS_NUMBER(conf,c) is_keytype(conf, c, CONF_NUMBER)
#define IS_WS(conf,c) is_keytype(conf, c, CONF_WS)
#define IS_ALNUM(conf,c) is_keytype(conf, c, CONF_ALNUM)
#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, 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,
0x0200, 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, 0x0002,
0x0002, 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, 0x0002,
0x0002, 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, 0x0002,
0x0002, 0x0002, 0x0002, 0x0000, 0x0020, 0x0000, 0x0200, 0x0100,
0x0040, 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, 0x0004,
0x0004, 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, 0x0004,
0x0004, 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, 0x0004,
0x0004, 0x0004, 0x0004, 0x0000, 0x0200, 0x0000, 0x0200, 0x0000,
};
#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, 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,
0x0200, 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, 0x0002,
0x0002, 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, 0x0002,
0x0002, 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, 0x0002,
0x0002, 0x0002, 0x0002, 0x0000, 0x0000, 0x0000, 0x0200, 0x0100,
0x0000, 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, 0x0004,
0x0004, 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, 0x0004,
0x0004, 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, 0x0004,
0x0004, 0x0004, 0x0004, 0x0000, 0x0200, 0x0000, 0x0200, 0x0000,
};
#endif

View File

@@ -0,0 +1,74 @@
/*
* Generated by util/mkerr.pl DO NOT EDIT
* Copyright 1995-2023 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
* https://www.openssl.org/source/license.html
*/
#include <openssl/err.h>
#include <openssl/conferr.h>
#include "crypto/conferr.h"
#ifndef OPENSSL_NO_ERR
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),
"missing equal sign"},
{ERR_PACK(ERR_LIB_CONF, 0, CONF_R_MISSING_INIT_FUNCTION),
"missing init function"},
{ERR_PACK(ERR_LIB_CONF, 0, CONF_R_MODULE_INITIALIZATION_ERROR),
"module initialization error"},
{ERR_PACK(ERR_LIB_CONF, 0, CONF_R_NO_CLOSE_BRACE), "no close brace"},
{ERR_PACK(ERR_LIB_CONF, 0, CONF_R_NO_CONF), "no conf"},
{ERR_PACK(ERR_LIB_CONF, 0, CONF_R_NO_CONF_OR_ENVIRONMENT_VARIABLE),
"no conf or environment variable"},
{ERR_PACK(ERR_LIB_CONF, 0, CONF_R_NO_SECTION), "no section"},
{ERR_PACK(ERR_LIB_CONF, 0, CONF_R_NO_SUCH_FILE), "no such file"},
{ERR_PACK(ERR_LIB_CONF, 0, CONF_R_NO_VALUE), "no value"},
{ERR_PACK(ERR_LIB_CONF, 0, CONF_R_NUMBER_TOO_LARGE), "number too large"},
{ERR_PACK(ERR_LIB_CONF, 0, CONF_R_OPENSSL_CONF_REFERENCES_MISSING_SECTION),
"openssl conf references missing section"},
{ERR_PACK(ERR_LIB_CONF, 0, CONF_R_RECURSIVE_DIRECTORY_INCLUDE),
"recursive directory include"},
{ERR_PACK(ERR_LIB_CONF, 0, CONF_R_RECURSIVE_SECTION_REFERENCE),
"recursive section reference"},
{ERR_PACK(ERR_LIB_CONF, 0, CONF_R_RELATIVE_PATH), "relative path"},
{ERR_PACK(ERR_LIB_CONF, 0, CONF_R_SSL_COMMAND_SECTION_EMPTY),
"ssl command section empty"},
{ERR_PACK(ERR_LIB_CONF, 0, CONF_R_SSL_COMMAND_SECTION_NOT_FOUND),
"ssl command section not found"},
{ERR_PACK(ERR_LIB_CONF, 0, CONF_R_SSL_SECTION_EMPTY), "ssl section empty"},
{ERR_PACK(ERR_LIB_CONF, 0, CONF_R_SSL_SECTION_NOT_FOUND),
"ssl section not found"},
{ERR_PACK(ERR_LIB_CONF, 0, CONF_R_UNABLE_TO_CREATE_NEW_SECTION),
"unable to create new section"},
{ERR_PACK(ERR_LIB_CONF, 0, CONF_R_UNKNOWN_MODULE_NAME),
"unknown module name"},
{ERR_PACK(ERR_LIB_CONF, 0, CONF_R_VARIABLE_EXPANSION_TOO_LONG),
"variable expansion too long"},
{ERR_PACK(ERR_LIB_CONF, 0, CONF_R_VARIABLE_HAS_NO_VALUE),
"variable has no value"},
{0, NULL}
};
#endif
int ossl_err_load_CONF_strings(void)
{
#ifndef OPENSSL_NO_ERR
if (ERR_reason_error_string(CONF_str_reasons[0].error) == NULL)
ERR_load_strings_const(CONF_str_reasons);
#endif
return 1;
}

View File

@@ -0,0 +1,485 @@
/*
* Copyright 2000-2024 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
* https://www.openssl.org/source/license.html
*/
#include "internal/e_os.h"
#include <stdio.h>
#include <string.h>
#include "internal/conf.h"
#include "crypto/ctype.h"
#include <openssl/crypto.h>
#include <openssl/err.h>
#include <openssl/conf.h>
#include <openssl/conf_api.h>
#include "conf_local.h"
#include <openssl/lhash.h>
static CONF_METHOD *default_CONF_method = NULL;
/* Init a 'CONF' structure from an old LHASH */
void CONF_set_nconf(CONF *conf, LHASH_OF(CONF_VALUE) *hash)
{
if (default_CONF_method == NULL)
default_CONF_method = NCONF_default();
default_CONF_method->init(conf);
conf->data = hash;
}
/*
* The following section contains the "CONF classic" functions, rewritten in
* terms of the new CONF interface.
*/
int CONF_set_default_method(CONF_METHOD *meth)
{
default_CONF_method = meth;
return 1;
}
LHASH_OF(CONF_VALUE) *CONF_load(LHASH_OF(CONF_VALUE) *conf, const char *file,
long *eline)
{
LHASH_OF(CONF_VALUE) *ltmp;
BIO *in = NULL;
#ifdef OPENSSL_SYS_VMS
in = BIO_new_file(file, "r");
#else
in = BIO_new_file(file, "rb");
#endif
if (in == NULL) {
ERR_raise(ERR_LIB_CONF, ERR_R_SYS_LIB);
return NULL;
}
ltmp = CONF_load_bio(conf, in, eline);
BIO_free(in);
return ltmp;
}
#ifndef OPENSSL_NO_STDIO
LHASH_OF(CONF_VALUE) *CONF_load_fp(LHASH_OF(CONF_VALUE) *conf, FILE *fp,
long *eline)
{
BIO *btmp;
LHASH_OF(CONF_VALUE) *ltmp;
if ((btmp = BIO_new_fp(fp, BIO_NOCLOSE)) == NULL) {
ERR_raise(ERR_LIB_CONF, ERR_R_BUF_LIB);
return NULL;
}
ltmp = CONF_load_bio(conf, btmp, eline);
BIO_free(btmp);
return ltmp;
}
#endif
LHASH_OF(CONF_VALUE) *CONF_load_bio(LHASH_OF(CONF_VALUE) *conf, BIO *bp,
long *eline)
{
CONF ctmp;
int ret;
CONF_set_nconf(&ctmp, conf);
ret = NCONF_load_bio(&ctmp, bp, eline);
if (ret)
return ctmp.data;
return NULL;
}
STACK_OF(CONF_VALUE) *CONF_get_section(LHASH_OF(CONF_VALUE) *conf,
const char *section)
{
if (conf == NULL) {
return NULL;
} else {
CONF ctmp;
CONF_set_nconf(&ctmp, conf);
return NCONF_get_section(&ctmp, section);
}
}
char *CONF_get_string(LHASH_OF(CONF_VALUE) *conf, const char *group,
const char *name)
{
if (conf == NULL) {
return NCONF_get_string(NULL, group, name);
} else {
CONF ctmp;
CONF_set_nconf(&ctmp, conf);
return NCONF_get_string(&ctmp, group, name);
}
}
long CONF_get_number(LHASH_OF(CONF_VALUE) *conf, const char *group,
const char *name)
{
int status;
long result = 0;
ERR_set_mark();
if (conf == NULL) {
status = NCONF_get_number_e(NULL, group, name, &result);
} else {
CONF ctmp;
CONF_set_nconf(&ctmp, conf);
status = NCONF_get_number_e(&ctmp, group, name, &result);
}
ERR_pop_to_mark();
return status == 0 ? 0L : result;
}
void CONF_free(LHASH_OF(CONF_VALUE) *conf)
{
CONF ctmp;
CONF_set_nconf(&ctmp, conf);
NCONF_free_data(&ctmp);
}
#ifndef OPENSSL_NO_STDIO
int CONF_dump_fp(LHASH_OF(CONF_VALUE) *conf, FILE *out)
{
BIO *btmp;
int ret;
if ((btmp = BIO_new_fp(out, BIO_NOCLOSE)) == NULL) {
ERR_raise(ERR_LIB_CONF, ERR_R_BUF_LIB);
return 0;
}
ret = CONF_dump_bio(conf, btmp);
BIO_free(btmp);
return ret;
}
#endif
int CONF_dump_bio(LHASH_OF(CONF_VALUE) *conf, BIO *out)
{
CONF ctmp;
CONF_set_nconf(&ctmp, conf);
return NCONF_dump_bio(&ctmp, out);
}
/*
* The following section contains the "New CONF" functions. They are
* completely centralised around a new CONF structure that may contain
* basically anything, but at least a method pointer and a table of data.
* These functions are also written in terms of the bridge functions used by
* the "CONF classic" functions, for consistency.
*/
CONF *NCONF_new_ex(OSSL_LIB_CTX *libctx, CONF_METHOD *meth)
{
CONF *ret;
if (meth == NULL)
meth = NCONF_default();
ret = meth->create(meth);
if (ret == NULL) {
ERR_raise(ERR_LIB_CONF, ERR_R_CONF_LIB);
return NULL;
}
ret->libctx = libctx;
return ret;
}
CONF *NCONF_new(CONF_METHOD *meth)
{
return NCONF_new_ex(NULL, meth);
}
void NCONF_free(CONF *conf)
{
if (conf == NULL)
return;
conf->meth->destroy(conf);
}
void NCONF_free_data(CONF *conf)
{
if (conf == NULL)
return;
conf->meth->destroy_data(conf);
}
OSSL_LIB_CTX *NCONF_get0_libctx(const CONF *conf)
{
return conf->libctx;
}
typedef STACK_OF(OPENSSL_CSTRING) SECTION_NAMES;
IMPLEMENT_LHASH_DOALL_ARG_CONST(CONF_VALUE, SECTION_NAMES);
static void collect_section_name(const CONF_VALUE *v, SECTION_NAMES *names)
{
/* A section is a CONF_VALUE with name == NULL */
if (v->name == NULL)
sk_OPENSSL_CSTRING_push(names, v->section);
}
static int section_name_cmp(OPENSSL_CSTRING const *a, OPENSSL_CSTRING const *b)
{
return strcmp(*a, *b);
}
STACK_OF(OPENSSL_CSTRING) *NCONF_get_section_names(const CONF *cnf)
{
SECTION_NAMES *names;
if ((names = sk_OPENSSL_CSTRING_new(section_name_cmp)) == NULL)
return NULL;
lh_CONF_VALUE_doall_SECTION_NAMES(cnf->data, collect_section_name, names);
sk_OPENSSL_CSTRING_sort(names);
return names;
}
int NCONF_load(CONF *conf, const char *file, long *eline)
{
if (conf == NULL) {
ERR_raise(ERR_LIB_CONF, CONF_R_NO_CONF);
return 0;
}
return conf->meth->load(conf, file, eline);
}
#ifndef OPENSSL_NO_STDIO
int NCONF_load_fp(CONF *conf, FILE *fp, long *eline)
{
BIO *btmp;
int ret;
if ((btmp = BIO_new_fp(fp, BIO_NOCLOSE)) == NULL) {
ERR_raise(ERR_LIB_CONF, ERR_R_BUF_LIB);
return 0;
}
ret = NCONF_load_bio(conf, btmp, eline);
BIO_free(btmp);
return ret;
}
#endif
int NCONF_load_bio(CONF *conf, BIO *bp, long *eline)
{
if (conf == NULL) {
ERR_raise(ERR_LIB_CONF, CONF_R_NO_CONF);
return 0;
}
return conf->meth->load_bio(conf, bp, eline);
}
STACK_OF(CONF_VALUE) *NCONF_get_section(const CONF *conf, const char *section)
{
if (conf == NULL) {
ERR_raise(ERR_LIB_CONF, CONF_R_NO_CONF);
return NULL;
}
if (section == NULL) {
ERR_raise(ERR_LIB_CONF, CONF_R_NO_SECTION);
return NULL;
}
return _CONF_get_section_values(conf, section);
}
char *NCONF_get_string(const CONF *conf, const char *group, const char *name)
{
char *s = _CONF_get_string(conf, group, name);
/*
* Since we may get a value from an environment variable even if conf is
* NULL, let's check the value first
*/
if (s)
return s;
if (conf == NULL) {
ERR_raise(ERR_LIB_CONF, CONF_R_NO_CONF_OR_ENVIRONMENT_VARIABLE);
return NULL;
}
ERR_raise_data(ERR_LIB_CONF, CONF_R_NO_VALUE,
"group=%s name=%s", group, name);
return NULL;
}
static int default_is_number(const CONF *conf, char c)
{
return ossl_isdigit(c);
}
static int default_to_int(const CONF *conf, char c)
{
return (int)(c - '0');
}
int NCONF_get_number_e(const CONF *conf, const char *group, const char *name,
long *result)
{
char *str;
long res;
int (*is_number)(const CONF *, char) = &default_is_number;
int (*to_int)(const CONF *, char) = &default_to_int;
if (result == NULL) {
ERR_raise(ERR_LIB_CONF, ERR_R_PASSED_NULL_PARAMETER);
return 0;
}
str = NCONF_get_string(conf, group, name);
if (str == NULL)
return 0;
if (conf != NULL) {
if (conf->meth->is_number != NULL)
is_number = conf->meth->is_number;
if (conf->meth->to_int != NULL)
to_int = conf->meth->to_int;
}
for (res = 0; is_number(conf, *str); str++) {
const int d = to_int(conf, *str);
if (res > (LONG_MAX - d) / 10L) {
ERR_raise(ERR_LIB_CONF, CONF_R_NUMBER_TOO_LARGE);
return 0;
}
res = res * 10 + d;
}
*result = res;
return 1;
}
long _CONF_get_number(const CONF *conf, const char *section,
const char *name)
{
int status;
long result = 0;
ERR_set_mark();
status = NCONF_get_number_e(conf, section, name, &result);
ERR_pop_to_mark();
return status == 0 ? 0L : result;
}
#ifndef OPENSSL_NO_STDIO
int NCONF_dump_fp(const CONF *conf, FILE *out)
{
BIO *btmp;
int ret;
if ((btmp = BIO_new_fp(out, BIO_NOCLOSE)) == NULL) {
ERR_raise(ERR_LIB_CONF, ERR_R_BUF_LIB);
return 0;
}
ret = NCONF_dump_bio(conf, btmp);
BIO_free(btmp);
return ret;
}
#endif
int NCONF_dump_bio(const CONF *conf, BIO *out)
{
if (conf == NULL) {
ERR_raise(ERR_LIB_CONF, CONF_R_NO_CONF);
return 0;
}
return conf->meth->dump(conf, out);
}
/*
* These routines call the C malloc/free, to avoid intermixing with
* OpenSSL function pointers before the library is initialized.
*/
OPENSSL_INIT_SETTINGS *OPENSSL_INIT_new(void)
{
OPENSSL_INIT_SETTINGS *ret = malloc(sizeof(*ret));
if (ret == NULL)
return NULL;
memset(ret, 0, sizeof(*ret));
ret->flags = DEFAULT_CONF_MFLAGS;
return ret;
}
#ifndef OPENSSL_NO_STDIO
/*
* If CRYPTO_set_mem_functions is called after this, then
* memory allocation and deallocation in this function can
* become disjointed. Avoid this by always using standard
* strdup & free instead of OPENSSL_strdup & OPENSSL_free.
*/
int OPENSSL_INIT_set_config_filename(OPENSSL_INIT_SETTINGS *settings,
const char *filename)
{
char *newfilename = NULL;
if (filename != NULL) {
newfilename = strdup(filename);
if (newfilename == NULL)
return 0;
}
free(settings->filename);
settings->filename = newfilename;
return 1;
}
void OPENSSL_INIT_set_config_file_flags(OPENSSL_INIT_SETTINGS *settings,
unsigned long flags)
{
settings->flags = flags;
}
/*
* If CRYPTO_set_mem_functions is called after this, then
* memory allocation and deallocation in this function can
* become disjointed. Avoid this by always using standard
* strdup & free instead of OPENSSL_strdup & OPENSSL_free.
*/
int OPENSSL_INIT_set_config_appname(OPENSSL_INIT_SETTINGS *settings,
const char *appname)
{
char *newappname = NULL;
if (appname != NULL) {
newappname = strdup(appname);
if (newappname == NULL)
return 0;
}
free(settings->appname);
settings->appname = newappname;
return 1;
}
#endif
void OPENSSL_INIT_free(OPENSSL_INIT_SETTINGS *settings)
{
if (settings == NULL)
return;
free(settings->filename);
free(settings->appname);
free(settings);
}

View File

@@ -0,0 +1,11 @@
/*
* Copyright 2018-2021 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
* https://www.openssl.org/source/license.html
*/
#include <openssl/conftypes.h>
void ossl_config_add_ssl_module(void);

View File

@@ -0,0 +1,38 @@
/*
* Copyright 2002-2021 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
* https://www.openssl.org/source/license.html
*/
/* We need to use some engine deprecated APIs */
#define OPENSSL_SUPPRESS_DEPRECATED
#include <stdio.h>
#include <openssl/crypto.h>
#include "internal/cryptlib.h"
#include <openssl/conf.h>
#include <openssl/x509.h>
#include <openssl/asn1.h>
#include <openssl/engine.h>
#include "internal/provider.h"
#include "crypto/rand.h"
#include "conf_local.h"
/* Load all OpenSSL builtin modules */
void OPENSSL_load_builtin_modules(void)
{
/* Add builtin modules here */
ASN1_add_oid_module();
ASN1_add_stable_module();
#ifndef OPENSSL_NO_ENGINE
ENGINE_add_conf_module();
#endif
EVP_add_alg_module();
ossl_config_add_ssl_module();
ossl_provider_add_conf_module();
ossl_random_add_conf_module();
}

View File

@@ -0,0 +1,765 @@
/*
* Copyright 2002-2024 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
* https://www.openssl.org/source/license.html
*/
/* We need to use some engine deprecated APIs */
#define OPENSSL_SUPPRESS_DEPRECATED
#include "internal/cryptlib.h"
#include "internal/rcu.h"
#include <stdio.h>
#include <ctype.h>
#include <openssl/crypto.h>
#include "internal/conf.h"
#include <openssl/conf_api.h>
#include "internal/dso.h"
#include "internal/thread_once.h"
#include <openssl/x509.h>
#include <openssl/trace.h>
#include <openssl/engine.h>
#include "conf_local.h"
DEFINE_STACK_OF(CONF_MODULE)
DEFINE_STACK_OF(CONF_IMODULE)
#define DSO_mod_init_name "OPENSSL_init"
#define DSO_mod_finish_name "OPENSSL_finish"
/*
* This structure contains a data about supported modules. entries in this
* table correspond to either dynamic or static modules.
*/
struct conf_module_st {
/* DSO of this module or NULL if static */
DSO *dso;
/* Name of the module */
char *name;
/* Init function */
conf_init_func *init;
/* Finish function */
conf_finish_func *finish;
/* Number of successfully initialized modules */
int links;
void *usr_data;
};
/*
* This structure contains information about modules that have been
* successfully initialized. There may be more than one entry for a given
* module.
*/
struct conf_imodule_st {
CONF_MODULE *pmod;
char *name;
char *value;
unsigned long flags;
void *usr_data;
};
static CRYPTO_ONCE init_module_list_lock = CRYPTO_ONCE_STATIC_INIT;
static CRYPTO_RCU_LOCK *module_list_lock = NULL;
static STACK_OF(CONF_MODULE) *supported_modules = NULL; /* protected by lock */
static STACK_OF(CONF_IMODULE) *initialized_modules = NULL; /* protected by lock */
static CRYPTO_ONCE load_builtin_modules = CRYPTO_ONCE_STATIC_INIT;
static void module_free(CONF_MODULE *md);
static void module_finish(CONF_IMODULE *imod);
static int module_run(const CONF *cnf, const char *name, const char *value,
unsigned long flags);
static CONF_MODULE *module_add(DSO *dso, const char *name,
conf_init_func *ifunc,
conf_finish_func *ffunc);
static CONF_MODULE *module_find(const char *name);
static int module_init(CONF_MODULE *pmod, const char *name, const char *value,
const CONF *cnf);
static CONF_MODULE *module_load_dso(const CONF *cnf, const char *name,
const char *value);
static int conf_modules_finish_int(void);
static void module_lists_free(void)
{
ossl_rcu_lock_free(module_list_lock);
module_list_lock = NULL;
sk_CONF_MODULE_free(supported_modules);
supported_modules = NULL;
sk_CONF_IMODULE_free(initialized_modules);
initialized_modules = NULL;
}
DEFINE_RUN_ONCE_STATIC(do_init_module_list_lock)
{
module_list_lock = ossl_rcu_lock_new(1, NULL);
if (module_list_lock == NULL) {
ERR_raise(ERR_LIB_CONF, ERR_R_CRYPTO_LIB);
return 0;
}
return 1;
}
static int conf_diagnostics(const CONF *cnf)
{
int status;
long result = 0;
ERR_set_mark();
status = NCONF_get_number_e(cnf, NULL, "config_diagnostics", &result);
ERR_pop_to_mark();
if (status > 0) {
OSSL_LIB_CTX_set_conf_diagnostics(cnf->libctx, result > 0);
return result > 0;
}
return OSSL_LIB_CTX_get_conf_diagnostics(cnf->libctx);
}
/* Main function: load modules from a CONF structure */
int CONF_modules_load(const CONF *cnf, const char *appname,
unsigned long flags)
{
STACK_OF(CONF_VALUE) *values;
CONF_VALUE *vl;
char *vsection = NULL;
int ret, i;
if (!cnf)
return 1;
if (conf_diagnostics(cnf))
flags &= ~(CONF_MFLAGS_IGNORE_ERRORS
| CONF_MFLAGS_IGNORE_RETURN_CODES
| CONF_MFLAGS_SILENT
| CONF_MFLAGS_IGNORE_MISSING_FILE);
ERR_set_mark();
if (appname)
vsection = NCONF_get_string(cnf, NULL, appname);
if (!appname || (!vsection && (flags & CONF_MFLAGS_DEFAULT_SECTION)))
vsection = NCONF_get_string(cnf, NULL, "openssl_conf");
if (!vsection) {
ERR_pop_to_mark();
return 1;
}
OSSL_TRACE1(CONF, "Configuration in section %s\n", vsection);
values = NCONF_get_section(cnf, vsection);
if (values == NULL) {
if (!(flags & CONF_MFLAGS_SILENT)) {
ERR_clear_last_mark();
ERR_raise_data(ERR_LIB_CONF,
CONF_R_OPENSSL_CONF_REFERENCES_MISSING_SECTION,
"openssl_conf=%s", vsection);
} else {
ERR_pop_to_mark();
}
return 0;
}
ERR_pop_to_mark();
for (i = 0; i < sk_CONF_VALUE_num(values); i++) {
vl = sk_CONF_VALUE_value(values, i);
ERR_set_mark();
ret = module_run(cnf, vl->name, vl->value, flags);
OSSL_TRACE3(CONF, "Running module %s (%s) returned %d\n",
vl->name, vl->value, ret);
if (ret <= 0)
if (!(flags & CONF_MFLAGS_IGNORE_ERRORS)) {
ERR_clear_last_mark();
return ret;
}
ERR_pop_to_mark();
}
return 1;
}
int CONF_modules_load_file_ex(OSSL_LIB_CTX *libctx, const char *filename,
const char *appname, unsigned long flags)
{
char *file = NULL;
CONF *conf = NULL;
int ret = 0, diagnostics = OSSL_LIB_CTX_get_conf_diagnostics(libctx);
ERR_set_mark();
if (filename == NULL) {
file = CONF_get1_default_config_file();
if (file == NULL)
goto err;
if (*file == '\0') {
/* Do not try to load an empty file name but do not error out */
ret = 1;
goto err;
}
} else {
file = (char *)filename;
}
conf = NCONF_new_ex(libctx, NULL);
if (conf == NULL)
goto err;
if (NCONF_load(conf, file, NULL) <= 0) {
if ((flags & CONF_MFLAGS_IGNORE_MISSING_FILE) &&
(ERR_GET_REASON(ERR_peek_last_error()) == CONF_R_NO_SUCH_FILE)) {
ret = 1;
}
goto err;
}
ret = CONF_modules_load(conf, appname, flags);
/* CONF_modules_load() might change the diagnostics setting, reread it. */
diagnostics = OSSL_LIB_CTX_get_conf_diagnostics(libctx);
err:
if (filename == NULL)
OPENSSL_free(file);
NCONF_free(conf);
if ((flags & CONF_MFLAGS_IGNORE_RETURN_CODES) != 0 && !diagnostics)
ret = 1;
if (ret > 0)
ERR_pop_to_mark();
else
ERR_clear_last_mark();
return ret;
}
int CONF_modules_load_file(const char *filename,
const char *appname, unsigned long flags)
{
return CONF_modules_load_file_ex(NULL, filename, appname, flags);
}
DEFINE_RUN_ONCE_STATIC(do_load_builtin_modules)
{
OPENSSL_load_builtin_modules();
#ifndef OPENSSL_NO_ENGINE
/* Need to load ENGINEs */
ENGINE_load_builtin_engines();
#endif
return 1;
}
static int module_run(const CONF *cnf, const char *name, const char *value,
unsigned long flags)
{
CONF_MODULE *md;
int ret;
if (!RUN_ONCE(&load_builtin_modules, do_load_builtin_modules))
return -1;
md = module_find(name);
/* Module not found: try to load DSO */
if (!md && !(flags & CONF_MFLAGS_NO_DSO))
md = module_load_dso(cnf, name, value);
if (!md) {
if (!(flags & CONF_MFLAGS_SILENT)) {
ERR_raise_data(ERR_LIB_CONF, CONF_R_UNKNOWN_MODULE_NAME,
"module=%s", name);
}
return -1;
}
ret = module_init(md, name, value, cnf);
if (ret <= 0) {
if (!(flags & CONF_MFLAGS_SILENT))
ERR_raise_data(ERR_LIB_CONF, CONF_R_MODULE_INITIALIZATION_ERROR,
"module=%s, value=%s retcode=%-8d",
name, value, ret);
}
return ret;
}
/* Load a module from a DSO */
static CONF_MODULE *module_load_dso(const CONF *cnf,
const char *name, const char *value)
{
DSO *dso = NULL;
conf_init_func *ifunc;
conf_finish_func *ffunc;
const char *path = NULL;
int errcode = 0;
CONF_MODULE *md;
/* Look for alternative path in module section */
path = _CONF_get_string(cnf, value, "path");
if (path == NULL) {
path = name;
}
dso = DSO_load(NULL, path, NULL, 0);
if (dso == NULL) {
errcode = CONF_R_ERROR_LOADING_DSO;
goto err;
}
ifunc = (conf_init_func *)DSO_bind_func(dso, DSO_mod_init_name);
if (ifunc == NULL) {
errcode = CONF_R_MISSING_INIT_FUNCTION;
goto err;
}
ffunc = (conf_finish_func *)DSO_bind_func(dso, DSO_mod_finish_name);
/* All OK, add module */
md = module_add(dso, name, ifunc, ffunc);
if (md == NULL)
goto err;
return md;
err:
DSO_free(dso);
ERR_raise_data(ERR_LIB_CONF, errcode, "module=%s, path=%s", name, path);
return NULL;
}
/* add module to list */
static CONF_MODULE *module_add(DSO *dso, const char *name,
conf_init_func *ifunc, conf_finish_func *ffunc)
{
CONF_MODULE *tmod = NULL;
STACK_OF(CONF_MODULE) *old_modules;
STACK_OF(CONF_MODULE) *new_modules;
if (!RUN_ONCE(&init_module_list_lock, do_init_module_list_lock))
return NULL;
ossl_rcu_write_lock(module_list_lock);
old_modules = ossl_rcu_deref(&supported_modules);
if (old_modules == NULL)
new_modules = sk_CONF_MODULE_new_null();
else
new_modules = sk_CONF_MODULE_dup(old_modules);
if (new_modules == NULL)
goto err;
if ((tmod = OPENSSL_zalloc(sizeof(*tmod))) == NULL)
goto err;
tmod->dso = dso;
tmod->name = OPENSSL_strdup(name);
tmod->init = ifunc;
tmod->finish = ffunc;
if (tmod->name == NULL)
goto err;
if (!sk_CONF_MODULE_push(new_modules, tmod))
goto err;
ossl_rcu_assign_ptr(&supported_modules, &new_modules);
ossl_rcu_write_unlock(module_list_lock);
ossl_synchronize_rcu(module_list_lock);
sk_CONF_MODULE_free(old_modules);
return tmod;
err:
ossl_rcu_write_unlock(module_list_lock);
if (tmod != NULL) {
OPENSSL_free(tmod->name);
OPENSSL_free(tmod);
}
sk_CONF_MODULE_free(new_modules);
return NULL;
}
/*
* Find a module from the list. We allow module names of the form
* modname.XXXX to just search for modname to allow the same module to be
* initialized more than once.
*/
static CONF_MODULE *module_find(const char *name)
{
CONF_MODULE *tmod;
int i, nchar;
char *p;
STACK_OF(CONF_MODULE) *mods;
p = strrchr(name, '.');
if (p)
nchar = p - name;
else
nchar = strlen(name);
if (!RUN_ONCE(&init_module_list_lock, do_init_module_list_lock))
return NULL;
ossl_rcu_read_lock(module_list_lock);
mods = ossl_rcu_deref(&supported_modules);
for (i = 0; i < sk_CONF_MODULE_num(mods); i++) {
tmod = sk_CONF_MODULE_value(mods, i);
if (strncmp(tmod->name, name, nchar) == 0) {
ossl_rcu_read_unlock(module_list_lock);
return tmod;
}
}
ossl_rcu_read_unlock(module_list_lock);
return NULL;
}
/* initialize a module */
static int module_init(CONF_MODULE *pmod, const char *name, const char *value,
const CONF *cnf)
{
int ret = 1;
int init_called = 0;
CONF_IMODULE *imod = NULL;
STACK_OF(CONF_IMODULE) *old_modules;
STACK_OF(CONF_IMODULE) *new_modules;
/* Otherwise add initialized module to list */
imod = OPENSSL_malloc(sizeof(*imod));
if (imod == NULL)
goto err;
imod->pmod = pmod;
imod->name = OPENSSL_strdup(name);
imod->value = OPENSSL_strdup(value);
imod->usr_data = NULL;
if (!imod->name || !imod->value)
goto memerr;
/* Try to initialize module */
if (pmod->init) {
ret = pmod->init(imod, cnf);
init_called = 1;
/* Error occurred, exit */
if (ret <= 0)
goto err;
}
if (!RUN_ONCE(&init_module_list_lock, do_init_module_list_lock))
goto err;
ossl_rcu_write_lock(module_list_lock);
old_modules = ossl_rcu_deref(&initialized_modules);
if (old_modules == NULL)
new_modules = sk_CONF_IMODULE_new_null();
else
new_modules = sk_CONF_IMODULE_dup(old_modules);
if (new_modules == NULL) {
ossl_rcu_write_unlock(module_list_lock);
ERR_raise(ERR_LIB_CONF, ERR_R_CRYPTO_LIB);
goto err;
}
if (!sk_CONF_IMODULE_push(new_modules, imod)) {
ossl_rcu_write_unlock(module_list_lock);
sk_CONF_IMODULE_free(new_modules);
ERR_raise(ERR_LIB_CONF, ERR_R_CRYPTO_LIB);
goto err;
}
pmod->links++;
ossl_rcu_assign_ptr(&initialized_modules, &new_modules);
ossl_rcu_write_unlock(module_list_lock);
ossl_synchronize_rcu(module_list_lock);
sk_CONF_IMODULE_free(old_modules);
return ret;
err:
/* We've started the module so we'd better finish it */
if (pmod->finish && init_called)
pmod->finish(imod);
memerr:
if (imod) {
OPENSSL_free(imod->name);
OPENSSL_free(imod->value);
OPENSSL_free(imod);
}
return -1;
}
/*
* Unload any dynamic modules that have a link count of zero: i.e. have no
* active initialized modules. If 'all' is set then all modules are unloaded
* including static ones.
*/
void CONF_modules_unload(int all)
{
int i;
CONF_MODULE *md;
STACK_OF(CONF_MODULE) *old_modules;
STACK_OF(CONF_MODULE) *new_modules;
STACK_OF(CONF_MODULE) *to_delete;
if (!conf_modules_finish_int()) /* also inits module list lock */
return;
ossl_rcu_write_lock(module_list_lock);
old_modules = ossl_rcu_deref(&supported_modules);
new_modules = sk_CONF_MODULE_dup(old_modules);
if (new_modules == NULL) {
ossl_rcu_write_unlock(module_list_lock);
return;
}
to_delete = sk_CONF_MODULE_new_null();
/* unload modules in reverse order */
for (i = sk_CONF_MODULE_num(new_modules) - 1; i >= 0; i--) {
md = sk_CONF_MODULE_value(new_modules, i);
/* If static or in use and 'all' not set ignore it */
if (((md->links > 0) || !md->dso) && !all)
continue;
/* Since we're working in reverse this is OK */
(void)sk_CONF_MODULE_delete(new_modules, i);
sk_CONF_MODULE_push(to_delete, md);
}
if (sk_CONF_MODULE_num(new_modules) == 0) {
sk_CONF_MODULE_free(new_modules);
new_modules = NULL;
}
ossl_rcu_assign_ptr(&supported_modules, &new_modules);
ossl_rcu_write_unlock(module_list_lock);
ossl_synchronize_rcu(module_list_lock);
sk_CONF_MODULE_free(old_modules);
sk_CONF_MODULE_pop_free(to_delete, module_free);
}
/* unload a single module */
static void module_free(CONF_MODULE *md)
{
DSO_free(md->dso);
OPENSSL_free(md->name);
OPENSSL_free(md);
}
/* finish and free up all modules instances */
static int conf_modules_finish_int(void)
{
CONF_IMODULE *imod;
STACK_OF(CONF_IMODULE) *old_modules;
STACK_OF(CONF_IMODULE) *new_modules = NULL;
if (!RUN_ONCE(&init_module_list_lock, do_init_module_list_lock))
return 0;
/* If module_list_lock is NULL here it means we were already unloaded */
if (module_list_lock == NULL)
return 0;
ossl_rcu_write_lock(module_list_lock);
old_modules = ossl_rcu_deref(&initialized_modules);
ossl_rcu_assign_ptr(&initialized_modules, &new_modules);
ossl_rcu_write_unlock(module_list_lock);
ossl_synchronize_rcu(module_list_lock);
while (sk_CONF_IMODULE_num(old_modules) > 0) {
imod = sk_CONF_IMODULE_pop(old_modules);
module_finish(imod);
}
sk_CONF_IMODULE_free(old_modules);
return 1;
}
void CONF_modules_finish(void)
{
conf_modules_finish_int();
}
/* finish a module instance */
static void module_finish(CONF_IMODULE *imod)
{
if (!imod)
return;
if (imod->pmod->finish)
imod->pmod->finish(imod);
imod->pmod->links--;
OPENSSL_free(imod->name);
OPENSSL_free(imod->value);
OPENSSL_free(imod);
}
/* Add a static module to OpenSSL */
int CONF_module_add(const char *name, conf_init_func *ifunc,
conf_finish_func *ffunc)
{
if (module_add(NULL, name, ifunc, ffunc))
return 1;
else
return 0;
}
void ossl_config_modules_free(void)
{
CONF_modules_unload(1); /* calls CONF_modules_finish */
module_lists_free();
}
/* Utility functions */
const char *CONF_imodule_get_name(const CONF_IMODULE *md)
{
return md->name;
}
const char *CONF_imodule_get_value(const CONF_IMODULE *md)
{
return md->value;
}
void *CONF_imodule_get_usr_data(const CONF_IMODULE *md)
{
return md->usr_data;
}
void CONF_imodule_set_usr_data(CONF_IMODULE *md, void *usr_data)
{
md->usr_data = usr_data;
}
CONF_MODULE *CONF_imodule_get_module(const CONF_IMODULE *md)
{
return md->pmod;
}
unsigned long CONF_imodule_get_flags(const CONF_IMODULE *md)
{
return md->flags;
}
void CONF_imodule_set_flags(CONF_IMODULE *md, unsigned long flags)
{
md->flags = flags;
}
void *CONF_module_get_usr_data(CONF_MODULE *pmod)
{
return pmod->usr_data;
}
void CONF_module_set_usr_data(CONF_MODULE *pmod, void *usr_data)
{
pmod->usr_data = usr_data;
}
/* Return default config file name */
char *CONF_get1_default_config_file(void)
{
const char *t;
char *file, *sep = "";
size_t size;
if ((file = ossl_safe_getenv("OPENSSL_CONF")) != NULL)
return OPENSSL_strdup(file);
t = X509_get_default_cert_area();
/*
* On windows systems with -DOSSL_WINCTX set, if the needed registry
* keys are not yet set, openssl applets will return, due to an inability
* to locate various directories, like the default cert area. In that
* event, clone an empty string here, so that commands like openssl version
* continue to operate properly without needing to set OPENSSL_CONF.
* Applets like cms will fail gracefully later when they try to parse an
* empty config file
*/
if (t == NULL)
return OPENSSL_strdup("");
#ifndef OPENSSL_SYS_VMS
sep = "/";
#endif
size = strlen(t) + strlen(sep) + strlen(OPENSSL_CONF) + 1;
file = OPENSSL_malloc(size);
if (file == NULL)
return NULL;
BIO_snprintf(file, size, "%s%s%s", t, sep, OPENSSL_CONF);
return file;
}
/*
* This function takes a list separated by 'sep' and calls the callback
* function giving the start and length of each member optionally stripping
* leading and trailing whitespace. This can be used to parse comma separated
* lists for example.
*/
int CONF_parse_list(const char *list_, int sep, int nospc,
int (*list_cb) (const char *elem, int len, void *usr),
void *arg)
{
int ret;
const char *lstart, *tmpend, *p;
if (list_ == NULL) {
ERR_raise(ERR_LIB_CONF, CONF_R_LIST_CANNOT_BE_NULL);
return 0;
}
lstart = list_;
for (;;) {
if (nospc) {
while (*lstart && isspace((unsigned char)*lstart))
lstart++;
}
p = strchr(lstart, sep);
if (p == lstart || *lstart == '\0')
ret = list_cb(NULL, 0, arg);
else {
if (p)
tmpend = p - 1;
else
tmpend = lstart + strlen(lstart) - 1;
if (nospc) {
while (isspace((unsigned char)*tmpend))
tmpend--;
}
ret = list_cb(lstart, tmpend - lstart + 1, arg);
}
if (ret <= 0)
return ret;
if (p == NULL)
return 1;
lstart = p + 1;
}
}

View File

@@ -0,0 +1,82 @@
/*
* Copyright 2002-2024 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
* https://www.openssl.org/source/license.html
*/
#include <stdio.h>
#include <openssl/crypto.h>
#include "internal/cryptlib.h"
#include "internal/conf.h"
#include "conf_local.h"
#include <openssl/x509.h>
#include <openssl/asn1.h>
#include <openssl/engine.h>
#if defined(_WIN32) && !defined(__BORLANDC__)
# define strdup _strdup
#endif
/*
* This is the automatic configuration loader: it is called automatically by
* OpenSSL when any of a number of standard initialisation functions are
* called, unless this is overridden by calling OPENSSL_no_config()
*/
static int openssl_configured = 0;
#ifndef OPENSSL_NO_DEPRECATED_1_1_0
void OPENSSL_config(const char *appname)
{
OPENSSL_INIT_SETTINGS settings;
memset(&settings, 0, sizeof(settings));
if (appname != NULL)
settings.appname = strdup(appname);
settings.flags = DEFAULT_CONF_MFLAGS;
OPENSSL_init_crypto(OPENSSL_INIT_LOAD_CONFIG, &settings);
free(settings.appname);
}
#endif
int ossl_config_int(const OPENSSL_INIT_SETTINGS *settings)
{
int ret = 0;
#if defined(OPENSSL_INIT_DEBUG) || !defined(OPENSSL_SYS_UEFI)
const char *filename;
const char *appname;
unsigned long flags;
#endif
if (openssl_configured)
return 1;
#if defined(OPENSSL_INIT_DEBUG) || !defined(OPENSSL_SYS_UEFI)
filename = settings ? settings->filename : NULL;
appname = settings ? settings->appname : NULL;
flags = settings ? settings->flags : DEFAULT_CONF_MFLAGS;
#endif
#ifdef OPENSSL_INIT_DEBUG
fprintf(stderr, "OPENSSL_INIT: ossl_config_int(%s, %s, %lu)\n",
filename, appname, flags);
#endif
#ifndef OPENSSL_SYS_UEFI
ret = CONF_modules_load_file_ex(OSSL_LIB_CTX_get0_global_default(),
filename, appname, flags);
#else
ret = 1;
#endif
openssl_configured = 1;
return ret;
}
void ossl_no_config_int(void)
{
openssl_configured = 1;
}

View File

@@ -0,0 +1,182 @@
/*
* Copyright 2015-2021 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
* https://www.openssl.org/source/license.html
*/
#include <stdio.h>
#include <string.h>
#include <openssl/conf.h>
#include <openssl/err.h>
#include "internal/sslconf.h"
#include "conf_local.h"
/*
* SSL library configuration module placeholder. We load it here but defer
* all decisions about its contents to libssl.
*/
struct ssl_conf_name_st {
/* Name of this set of commands */
char *name;
/* List of commands */
SSL_CONF_CMD *cmds;
/* Number of commands */
size_t cmd_count;
};
struct ssl_conf_cmd_st {
/* Command */
char *cmd;
/* Argument */
char *arg;
};
static struct ssl_conf_name_st *ssl_names;
static size_t ssl_names_count;
static void ssl_module_free(CONF_IMODULE *md)
{
size_t i, j;
if (ssl_names == NULL)
return;
for (i = 0; i < ssl_names_count; i++) {
struct ssl_conf_name_st *tname = ssl_names + i;
OPENSSL_free(tname->name);
for (j = 0; j < tname->cmd_count; j++) {
OPENSSL_free(tname->cmds[j].cmd);
OPENSSL_free(tname->cmds[j].arg);
}
OPENSSL_free(tname->cmds);
}
OPENSSL_free(ssl_names);
ssl_names = NULL;
ssl_names_count = 0;
}
static int ssl_module_init(CONF_IMODULE *md, const CONF *cnf)
{
size_t i, j, cnt;
int rv = 0;
const char *ssl_conf_section;
STACK_OF(CONF_VALUE) *cmd_lists;
ssl_conf_section = CONF_imodule_get_value(md);
cmd_lists = NCONF_get_section(cnf, ssl_conf_section);
if (sk_CONF_VALUE_num(cmd_lists) <= 0) {
int rcode =
cmd_lists == NULL
? CONF_R_SSL_SECTION_NOT_FOUND
: CONF_R_SSL_SECTION_EMPTY;
ERR_raise_data(ERR_LIB_CONF, rcode, "section=%s", ssl_conf_section);
goto err;
}
cnt = sk_CONF_VALUE_num(cmd_lists);
ssl_module_free(md);
ssl_names = OPENSSL_zalloc(sizeof(*ssl_names) * cnt);
if (ssl_names == NULL)
goto err;
ssl_names_count = cnt;
for (i = 0; i < ssl_names_count; i++) {
struct ssl_conf_name_st *ssl_name = ssl_names + i;
CONF_VALUE *sect = sk_CONF_VALUE_value(cmd_lists, (int)i);
STACK_OF(CONF_VALUE) *cmds = NCONF_get_section(cnf, sect->value);
if (sk_CONF_VALUE_num(cmds) <= 0) {
int rcode =
cmds == NULL
? CONF_R_SSL_COMMAND_SECTION_NOT_FOUND
: CONF_R_SSL_COMMAND_SECTION_EMPTY;
ERR_raise_data(ERR_LIB_CONF, rcode,
"name=%s, value=%s", sect->name, sect->value);
goto err;
}
ssl_name->name = OPENSSL_strdup(sect->name);
if (ssl_name->name == NULL)
goto err;
cnt = sk_CONF_VALUE_num(cmds);
ssl_name->cmds = OPENSSL_zalloc(cnt * sizeof(struct ssl_conf_cmd_st));
if (ssl_name->cmds == NULL)
goto err;
ssl_name->cmd_count = cnt;
for (j = 0; j < cnt; j++) {
const char *name;
CONF_VALUE *cmd_conf = sk_CONF_VALUE_value(cmds, (int)j);
struct ssl_conf_cmd_st *cmd = ssl_name->cmds + j;
/* Skip any initial dot in name */
name = strchr(cmd_conf->name, '.');
if (name != NULL)
name++;
else
name = cmd_conf->name;
cmd->cmd = OPENSSL_strdup(name);
cmd->arg = OPENSSL_strdup(cmd_conf->value);
if (cmd->cmd == NULL || cmd->arg == NULL)
goto err;
}
}
rv = 1;
err:
if (rv == 0)
ssl_module_free(md);
return rv;
}
/*
* Returns the set of commands with index |idx| previously searched for via
* conf_ssl_name_find. Also stores the name of the set of commands in |*name|
* and the number of commands in the set in |*cnt|.
*/
const SSL_CONF_CMD *conf_ssl_get(size_t idx, const char **name, size_t *cnt)
{
*name = ssl_names[idx].name;
*cnt = ssl_names[idx].cmd_count;
return ssl_names[idx].cmds;
}
/*
* Search for the named set of commands given in |name|. On success return the
* index for the command set in |*idx|.
* Returns 1 on success or 0 on failure.
*/
int conf_ssl_name_find(const char *name, size_t *idx)
{
size_t i;
const struct ssl_conf_name_st *nm;
if (name == NULL)
return 0;
for (i = 0, nm = ssl_names; i < ssl_names_count; i++, nm++) {
if (strcmp(nm->name, name) == 0) {
*idx = i;
return 1;
}
}
return 0;
}
/*
* Given a command set |cmd|, return details on the command at index |idx| which
* must be less than the number of commands in the set (as returned by
* conf_ssl_get). The name of the command will be returned in |*cmdstr| and the
* argument is returned in |*arg|.
*/
void conf_ssl_get_cmd(const SSL_CONF_CMD *cmd, size_t idx, char **cmdstr,
char **arg)
{
*cmdstr = cmd[idx].cmd;
*arg = cmd[idx].arg;
}
void ossl_config_add_ssl_module(void)
{
CONF_module_add("ssl_conf", ssl_module_init, ssl_module_free);
}

View File

@@ -0,0 +1,125 @@
#! /usr/bin/env perl
# Copyright 1995-2021 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
# https://www.openssl.org/source/license.html
use strict;
use warnings;
use FindBin;
use lib "$FindBin::Bin/../../util/perl";
use OpenSSL::copyright;
my $NUMBER = 0x0001;
my $UPPER = 0x0002;
my $LOWER = 0x0004;
my $UNDER = 0x0100;
my $PUNCTUATION = 0x0200;
my $WS = 0x0010;
my $ESC = 0x0020;
my $QUOTE = 0x0040;
my $DQUOTE = 0x0400;
my $COMMENT = 0x0080;
my $FCOMMENT = 0x0800;
my $DOLLAR = 0x1000;
my $EOF = 0x0008;
my @V_def;
my @V_w32;
my $v;
my $c;
foreach (0 .. 127) {
$c = sprintf("%c", $_);
$v = 0;
$v |= $NUMBER if $c =~ /[0-9]/;
$v |= $UPPER if $c =~ /[A-Z]/;
$v |= $LOWER if $c =~ /[a-z]/;
$v |= $UNDER if $c =~ /_/;
$v |= $PUNCTUATION if $c =~ /[!\.%&\*\+,\/;\?\@\^\~\|-]/;
$v |= $WS if $c =~ /[ \t\r\n]/;
$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);
$v = 0;
$v |= $NUMBER if $c =~ /[0-9]/;
$v |= $UPPER if $c =~ /[A-Z]/;
$v |= $LOWER if $c =~ /[a-z]/;
$v |= $UNDER if $c =~ /_/;
$v |= $PUNCTUATION if $c =~ /[!\.%&\*\+,\/;\?\@\^\~\|-]/;
$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);
}
# The year the output file is generated.
my $YEAR = OpenSSL::copyright::year_of($0);
print <<"EOF";
/*
* WARNING: do not edit!
* Generated by crypto/conf/keysets.pl
*
* Copyright 1995-$YEAR 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
* https://www.openssl.org/source/license.html
*/
#define CONF_NUMBER $NUMBER
#define CONF_UPPER $UPPER
#define CONF_LOWER $LOWER
#define CONF_UNDER $UNDER
#define CONF_PUNCT $PUNCTUATION
#define CONF_WS $WS
#define CONF_ESC $ESC
#define CONF_QUOTE $QUOTE
#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)
#define CONF_ALNUM_PUNCT (CONF_ALPHA|CONF_NUMBER|CONF_UNDER|CONF_PUNCT)
#define IS_COMMENT(conf,c) is_keytype(conf, c, CONF_COMMENT)
#define IS_FCOMMENT(conf,c) is_keytype(conf, c, CONF_FCOMMENT)
#define IS_EOF(conf,c) is_keytype(conf, c, CONF_EOF)
#define IS_ESC(conf,c) is_keytype(conf, c, CONF_ESC)
#define IS_NUMBER(conf,c) is_keytype(conf, c, CONF_NUMBER)
#define IS_WS(conf,c) is_keytype(conf, c, CONF_WS)
#define IS_ALNUM(conf,c) is_keytype(conf, c, CONF_ALNUM)
#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
my $i;
print "static const unsigned short CONF_type_default[128] = {";
for ($i = 0; $i < 128; $i++) {
print "\n " if ($i % 8) == 0;
printf " 0x%04X,", $V_def[$i];
}
print "\n};\n\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;
printf " 0x%04X,", $V_w32[$i];
}
print "\n};\n";
print "#endif\n";

View File

@@ -0,0 +1,16 @@
crypto/conf/libcrypto-lib-conf_api.o: crypto/conf/conf_api.c \
include/internal/e_os.h include/openssl/opensslconf.h \
include/openssl/configuration.h include/openssl/macros.h \
include/openssl/opensslv.h include/openssl/e_os2.h \
include/openssl/crypto.h include/openssl/safestack.h \
include/openssl/stack.h include/openssl/types.h \
include/openssl/cryptoerr.h include/openssl/symhacks.h \
include/openssl/cryptoerr_legacy.h include/openssl/core.h \
include/internal/numbers.h include/internal/cryptlib.h \
include/internal/common.h include/internal/nelem.h \
include/openssl/buffer.h include/openssl/buffererr.h \
include/openssl/bio.h include/openssl/bioerr.h include/openssl/asn1.h \
include/openssl/asn1err.h include/openssl/bn.h include/openssl/bnerr.h \
include/openssl/err.h include/openssl/lhash.h include/openssl/conf.h \
include/openssl/conferr.h include/openssl/conftypes.h \
include/openssl/conf_api.h crypto/conf/conf_local.h

View File

@@ -0,0 +1,17 @@
crypto/conf/libcrypto-lib-conf_def.o: crypto/conf/conf_def.c \
include/internal/e_os.h include/openssl/opensslconf.h \
include/openssl/configuration.h include/openssl/macros.h \
include/openssl/opensslv.h include/openssl/e_os2.h \
include/openssl/crypto.h include/openssl/safestack.h \
include/openssl/stack.h include/openssl/types.h \
include/openssl/cryptoerr.h include/openssl/symhacks.h \
include/openssl/cryptoerr_legacy.h include/openssl/core.h \
include/internal/numbers.h include/internal/cryptlib.h \
include/internal/common.h include/internal/nelem.h \
include/openssl/buffer.h include/openssl/buffererr.h \
include/openssl/bio.h include/openssl/bioerr.h include/openssl/asn1.h \
include/openssl/asn1err.h include/openssl/bn.h include/openssl/bnerr.h \
include/openssl/err.h include/openssl/lhash.h include/internal/o_dir.h \
include/openssl/conf.h include/openssl/conferr.h \
include/openssl/conftypes.h include/openssl/conf_api.h \
crypto/conf/conf_local.h crypto/conf/conf_def.h

View File

@@ -0,0 +1,10 @@
crypto/conf/libcrypto-lib-conf_err.o: crypto/conf/conf_err.c \
include/openssl/err.h include/openssl/macros.h \
include/openssl/opensslconf.h include/openssl/configuration.h \
include/openssl/opensslv.h include/openssl/e_os2.h \
include/openssl/types.h include/openssl/safestack.h \
include/openssl/stack.h include/openssl/bio.h include/openssl/crypto.h \
include/openssl/cryptoerr.h include/openssl/symhacks.h \
include/openssl/cryptoerr_legacy.h include/openssl/core.h \
include/openssl/bioerr.h include/openssl/lhash.h \
include/openssl/conferr.h include/crypto/conferr.h

View File

@@ -0,0 +1,13 @@
crypto/conf/libcrypto-lib-conf_lib.o: crypto/conf/conf_lib.c \
include/internal/e_os.h include/openssl/opensslconf.h \
include/openssl/configuration.h include/openssl/macros.h \
include/openssl/opensslv.h include/openssl/e_os2.h \
include/openssl/crypto.h include/openssl/safestack.h \
include/openssl/stack.h include/openssl/types.h \
include/openssl/cryptoerr.h include/openssl/symhacks.h \
include/openssl/cryptoerr_legacy.h include/openssl/core.h \
include/internal/numbers.h include/internal/conf.h \
include/openssl/conf.h include/openssl/bio.h include/openssl/bioerr.h \
include/openssl/lhash.h include/openssl/conferr.h \
include/openssl/conftypes.h include/crypto/ctype.h include/openssl/err.h \
include/openssl/conf_api.h crypto/conf/conf_local.h

View File

@@ -0,0 +1,32 @@
crypto/conf/libcrypto-lib-conf_mall.o: crypto/conf/conf_mall.c \
include/openssl/crypto.h include/openssl/macros.h \
include/openssl/opensslconf.h include/openssl/configuration.h \
include/openssl/opensslv.h include/openssl/e_os2.h \
include/openssl/safestack.h include/openssl/stack.h \
include/openssl/types.h include/openssl/cryptoerr.h \
include/openssl/symhacks.h include/openssl/cryptoerr_legacy.h \
include/openssl/core.h include/internal/cryptlib.h \
include/internal/common.h include/internal/e_os.h \
include/internal/numbers.h include/internal/nelem.h \
include/openssl/buffer.h include/openssl/buffererr.h \
include/openssl/bio.h include/openssl/bioerr.h include/openssl/asn1.h \
include/openssl/asn1err.h include/openssl/bn.h include/openssl/bnerr.h \
include/openssl/err.h include/openssl/lhash.h include/openssl/conf.h \
include/openssl/conferr.h include/openssl/conftypes.h \
include/openssl/x509.h include/openssl/evp.h \
include/openssl/core_dispatch.h include/openssl/indicator.h \
include/openssl/params.h include/openssl/evperr.h \
include/openssl/objects.h include/openssl/obj_mac.h \
include/openssl/objectserr.h include/openssl/ec.h \
include/openssl/ecerr.h include/openssl/rsa.h include/openssl/rsaerr.h \
include/openssl/dsa.h include/openssl/dh.h include/openssl/dherr.h \
include/openssl/dsaerr.h include/openssl/sha.h include/openssl/x509err.h \
include/openssl/x509_vfy.h include/openssl/pkcs7.h \
include/openssl/pkcs7err.h include/openssl/http.h \
include/openssl/engine.h include/openssl/rand.h \
include/openssl/randerr.h include/openssl/ui.h include/openssl/pem.h \
include/openssl/pemerr.h include/openssl/uierr.h \
include/openssl/engineerr.h include/internal/provider.h \
include/internal/dso.h include/internal/dsoerr.h \
include/internal/symhacks.h include/crypto/rand.h \
include/crypto/rand_pool.h crypto/conf/conf_local.h

View File

@@ -0,0 +1,32 @@
crypto/conf/libcrypto-lib-conf_mod.o: crypto/conf/conf_mod.c \
include/internal/cryptlib.h include/internal/common.h \
include/openssl/configuration.h include/internal/e_os.h \
include/openssl/opensslconf.h include/openssl/macros.h \
include/openssl/opensslv.h include/openssl/e_os2.h \
include/openssl/crypto.h include/openssl/safestack.h \
include/openssl/stack.h include/openssl/types.h \
include/openssl/cryptoerr.h include/openssl/symhacks.h \
include/openssl/cryptoerr_legacy.h include/openssl/core.h \
include/internal/numbers.h include/internal/nelem.h \
include/openssl/buffer.h include/openssl/buffererr.h \
include/openssl/bio.h include/openssl/bioerr.h include/openssl/asn1.h \
include/openssl/asn1err.h include/openssl/bn.h include/openssl/bnerr.h \
include/openssl/err.h include/openssl/lhash.h include/internal/rcu.h \
include/crypto/context.h include/internal/conf.h include/openssl/conf.h \
include/openssl/conferr.h include/openssl/conftypes.h \
include/openssl/conf_api.h include/internal/dso.h \
include/internal/dsoerr.h include/internal/thread_once.h \
include/openssl/x509.h include/openssl/evp.h \
include/openssl/core_dispatch.h include/openssl/indicator.h \
include/openssl/params.h include/openssl/evperr.h \
include/openssl/objects.h include/openssl/obj_mac.h \
include/openssl/objectserr.h include/openssl/ec.h \
include/openssl/ecerr.h include/openssl/rsa.h include/openssl/rsaerr.h \
include/openssl/dsa.h include/openssl/dh.h include/openssl/dherr.h \
include/openssl/dsaerr.h include/openssl/sha.h include/openssl/x509err.h \
include/openssl/x509_vfy.h include/openssl/pkcs7.h \
include/openssl/pkcs7err.h include/openssl/http.h \
include/openssl/trace.h include/openssl/engine.h include/openssl/rand.h \
include/openssl/randerr.h include/openssl/ui.h include/openssl/pem.h \
include/openssl/pemerr.h include/openssl/uierr.h \
include/openssl/engineerr.h crypto/conf/conf_local.h

View File

@@ -0,0 +1,30 @@
crypto/conf/libcrypto-lib-conf_sap.o: crypto/conf/conf_sap.c \
include/openssl/crypto.h include/openssl/macros.h \
include/openssl/opensslconf.h include/openssl/configuration.h \
include/openssl/opensslv.h include/openssl/e_os2.h \
include/openssl/safestack.h include/openssl/stack.h \
include/openssl/types.h include/openssl/cryptoerr.h \
include/openssl/symhacks.h include/openssl/cryptoerr_legacy.h \
include/openssl/core.h include/internal/cryptlib.h \
include/internal/common.h include/internal/e_os.h \
include/internal/numbers.h include/internal/nelem.h \
include/openssl/buffer.h include/openssl/buffererr.h \
include/openssl/bio.h include/openssl/bioerr.h include/openssl/asn1.h \
include/openssl/asn1err.h include/openssl/bn.h include/openssl/bnerr.h \
include/openssl/err.h include/openssl/lhash.h include/internal/conf.h \
include/openssl/conf.h include/openssl/conferr.h \
include/openssl/conftypes.h crypto/conf/conf_local.h \
include/openssl/x509.h include/openssl/evp.h \
include/openssl/core_dispatch.h include/openssl/indicator.h \
include/openssl/params.h include/openssl/evperr.h \
include/openssl/objects.h include/openssl/obj_mac.h \
include/openssl/objectserr.h include/openssl/ec.h \
include/openssl/ecerr.h include/openssl/rsa.h include/openssl/rsaerr.h \
include/openssl/dsa.h include/openssl/dh.h include/openssl/dherr.h \
include/openssl/dsaerr.h include/openssl/sha.h include/openssl/x509err.h \
include/openssl/x509_vfy.h include/openssl/pkcs7.h \
include/openssl/pkcs7err.h include/openssl/http.h \
include/openssl/engine.h include/openssl/rand.h \
include/openssl/randerr.h include/openssl/ui.h include/openssl/pem.h \
include/openssl/pemerr.h include/openssl/uierr.h \
include/openssl/engineerr.h

View File

@@ -0,0 +1,12 @@
crypto/conf/libcrypto-lib-conf_ssl.o: crypto/conf/conf_ssl.c \
include/openssl/conf.h include/openssl/macros.h \
include/openssl/opensslconf.h include/openssl/configuration.h \
include/openssl/opensslv.h include/openssl/bio.h include/openssl/e_os2.h \
include/openssl/crypto.h include/openssl/safestack.h \
include/openssl/stack.h include/openssl/types.h \
include/openssl/cryptoerr.h include/openssl/symhacks.h \
include/openssl/cryptoerr_legacy.h include/openssl/core.h \
include/openssl/bioerr.h include/openssl/lhash.h \
include/openssl/conferr.h include/openssl/conftypes.h \
include/openssl/err.h include/internal/sslconf.h \
crypto/conf/conf_local.h