-/* $OpenBSD: conf.h,v 1.24 2024/08/31 09:44:00 tb Exp $ */
+/* $OpenBSD: conf.h,v 1.25 2024/08/31 09:50:52 tb Exp $ */
/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
* All rights reserved.
*
#define CONF_MFLAGS_IGNORE_MISSING_FILE 0x10
#define CONF_MFLAGS_DEFAULT_SECTION 0x20
-int CONF_set_default_method(CONF_METHOD *meth);
void CONF_set_nconf(CONF *conf, LHASH_OF(CONF_VALUE) *hash);
-LHASH_OF(CONF_VALUE) *CONF_load(LHASH_OF(CONF_VALUE) *conf, const char *file,
- long *eline);
-LHASH_OF(CONF_VALUE) *CONF_load_fp(LHASH_OF(CONF_VALUE) *conf, FILE *fp,
- long *eline);
-LHASH_OF(CONF_VALUE) *CONF_load_bio(LHASH_OF(CONF_VALUE) *conf, BIO *bp, long *eline);
-STACK_OF(CONF_VALUE) *CONF_get_section(LHASH_OF(CONF_VALUE) *conf,
- const char *section);
-char *CONF_get_string(LHASH_OF(CONF_VALUE) *conf, const char *group,
- const char *name);
-long CONF_get_number(LHASH_OF(CONF_VALUE) *conf, const char *group,
- const char *name);
-void CONF_free(LHASH_OF(CONF_VALUE) *conf);
void OPENSSL_config(const char *config_name);
void OPENSSL_no_config(void);
-/* $OpenBSD: conf_lib.c,v 1.23 2024/08/31 09:41:53 tb Exp $ */
+/* $OpenBSD: conf_lib.c,v 1.24 2024/08/31 09:50:52 tb Exp $ */
/* Written by Richard Levitte (richard@levitte.org) for the OpenSSL
* project 2000.
*/
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;
-
- in = BIO_new_file(file, "rb");
- if (in == NULL) {
- CONFerror(ERR_R_SYS_LIB);
- return NULL;
- }
-
- ltmp = CONF_load_bio(conf, in, eline);
- BIO_free(in);
-
- return ltmp;
-}
-LCRYPTO_ALIAS(CONF_load);
-
-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))) {
- CONFerror(ERR_R_BUF_LIB);
- return NULL;
- }
- ltmp = CONF_load_bio(conf, btmp, eline);
- BIO_free(btmp);
- return ltmp;
-}
-
-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);
- }
-}
-LCRYPTO_ALIAS(CONF_get_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);
- }
-}
-LCRYPTO_ALIAS(CONF_get_string);
-
-long
-CONF_get_number(LHASH_OF(CONF_VALUE) *conf, const char *group,
- const char *name)
-{
- int status;
- long result = 0;
-
- 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);
- }
-
- if (status == 0) {
- /* This function does not believe in errors... */
- ERR_clear_error();
- }
- return result;
-}
-LCRYPTO_ALIAS(CONF_get_number);
-
-void
-CONF_free(LHASH_OF(CONF_VALUE) *conf)
-{
- CONF ctmp;
-
- CONF_set_nconf(&ctmp, conf);
- ctmp.meth->destroy_data(&ctmp);
-}
-LCRYPTO_ALIAS(CONF_free);
-
-/* 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(const CONF_METHOD *meth)
{
-/* $OpenBSD: conf.h,v 1.6 2024/08/31 09:44:00 tb Exp $ */
+/* $OpenBSD: conf.h,v 1.7 2024/08/31 09:50:52 tb Exp $ */
/*
* Copyright (c) 2024 Bob Beck <beck@openbsd.org>
*
#endif
#include "crypto_namespace.h"
-LCRYPTO_USED(CONF_set_default_method);
LCRYPTO_USED(CONF_set_nconf);
-LCRYPTO_USED(CONF_load);
-LCRYPTO_USED(CONF_load_fp);
-LCRYPTO_USED(CONF_load_bio);
-LCRYPTO_USED(CONF_get_section);
-LCRYPTO_USED(CONF_get_string);
-LCRYPTO_USED(CONF_get_number);
-LCRYPTO_USED(CONF_free);
LCRYPTO_USED(OPENSSL_config);
LCRYPTO_USED(OPENSSL_no_config);
LCRYPTO_USED(NCONF_new);