summaryrefslogtreecommitdiff
path: root/src/lib/libcrypto/conf
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/libcrypto/conf')
-rw-r--r--src/lib/libcrypto/conf/conf_api.c27
-rw-r--r--src/lib/libcrypto/conf/conf_mod.c3
-rw-r--r--src/lib/libcrypto/conf/ssleay.cnf78
3 files changed, 16 insertions, 92 deletions
diff --git a/src/lib/libcrypto/conf/conf_api.c b/src/lib/libcrypto/conf/conf_api.c
index 0d5a67d9a5..f04243d36c 100644
--- a/src/lib/libcrypto/conf/conf_api.c
+++ b/src/lib/libcrypto/conf/conf_api.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: conf_api.c,v 1.29 2025/12/21 07:31:22 tb Exp $ */ 1/* $OpenBSD: conf_api.c,v 1.30 2026/06/22 08:45:55 tb Exp $ */
2/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) 2/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
3 * All rights reserved. 3 * All rights reserved.
4 * 4 *
@@ -76,12 +76,13 @@ _CONF_get_section(const CONF *conf, const char *section)
76{ 76{
77 CONF_VALUE *v, vv; 77 CONF_VALUE *v, vv;
78 78
79 if ((conf == NULL) || (section == NULL)) 79 if (conf == NULL || section == NULL)
80 return (NULL); 80 return NULL;
81 vv.name = NULL; 81 vv.name = NULL;
82 vv.section = (char *)section; 82 vv.section = (char *)section;
83 v = lh_CONF_VALUE_retrieve(conf->data, &vv); 83 v = lh_CONF_VALUE_retrieve(conf->data, &vv);
84 return (v); 84
85 return v;
85} 86}
86 87
87int 88int
@@ -113,24 +114,24 @@ _CONF_get_string(const CONF *conf, const char *section, const char *name)
113 CONF_VALUE *v, vv; 114 CONF_VALUE *v, vv;
114 115
115 if (name == NULL) 116 if (name == NULL)
116 return (NULL); 117 return NULL;
117 if (conf != NULL) { 118 if (conf != NULL) {
118 if (section != NULL) { 119 if (section != NULL) {
119 vv.name = (char *)name; 120 vv.name = (char *)name;
120 vv.section = (char *)section; 121 vv.section = (char *)section;
121 v = lh_CONF_VALUE_retrieve(conf->data, &vv); 122 v = lh_CONF_VALUE_retrieve(conf->data, &vv);
122 if (v != NULL) 123 if (v != NULL)
123 return (v->value); 124 return v->value;
124 } 125 }
125 vv.section = "default"; 126 vv.section = "default";
126 vv.name = (char *)name; 127 vv.name = (char *)name;
127 v = lh_CONF_VALUE_retrieve(conf->data, &vv); 128 v = lh_CONF_VALUE_retrieve(conf->data, &vv);
128 if (v != NULL) 129 if (v != NULL)
129 return (v->value); 130 return v->value;
130 else 131 else
131 return (NULL); 132 return NULL;
132 } else 133 } else
133 return (NULL); 134 return NULL;
134} 135}
135 136
136static unsigned long 137static unsigned long
@@ -149,15 +150,15 @@ conf_value_cmp(const CONF_VALUE *a, const CONF_VALUE *b)
149 if (a->section != b->section) { 150 if (a->section != b->section) {
150 i = strcmp(a->section, b->section); 151 i = strcmp(a->section, b->section);
151 if (i) 152 if (i)
152 return (i); 153 return i;
153 } 154 }
154 if ((a->name != NULL) && (b->name != NULL)) { 155 if ((a->name != NULL) && (b->name != NULL)) {
155 i = strcmp(a->name, b->name); 156 i = strcmp(a->name, b->name);
156 return (i); 157 return i;
157 } else if (a->name == b->name) 158 } else if (a->name == b->name)
158 return (0); 159 return 0;
159 else 160 else
160 return ((a->name == NULL)?-1 : 1); 161 return a->name == NULL ? -1 : 1;
161} 162}
162 163
163static IMPLEMENT_LHASH_COMP_FN(conf_value, CONF_VALUE) 164static IMPLEMENT_LHASH_COMP_FN(conf_value, CONF_VALUE)
diff --git a/src/lib/libcrypto/conf/conf_mod.c b/src/lib/libcrypto/conf/conf_mod.c
index 6e697cc478..f90cf0f729 100644
--- a/src/lib/libcrypto/conf/conf_mod.c
+++ b/src/lib/libcrypto/conf/conf_mod.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: conf_mod.c,v 1.41 2025/05/10 05:54:38 tb Exp $ */ 1/* $OpenBSD: conf_mod.c,v 1.42 2026/07/31 00:50:52 kenjiro Exp $ */
2/* Written by Stephen Henson (steve@openssl.org) for the OpenSSL 2/* Written by Stephen Henson (steve@openssl.org) for the OpenSSL
3 * project 2001. 3 * project 2001.
4 */ 4 */
@@ -65,6 +65,7 @@
65#include <openssl/crypto.h> 65#include <openssl/crypto.h>
66#include <openssl/x509.h> 66#include <openssl/x509.h>
67 67
68#include "conf_local.h"
68#include "err_local.h" 69#include "err_local.h"
69 70
70/* This structure contains data about supported modules. */ 71/* This structure contains data about supported modules. */
diff --git a/src/lib/libcrypto/conf/ssleay.cnf b/src/lib/libcrypto/conf/ssleay.cnf
deleted file mode 100644
index ed33af601e..0000000000
--- a/src/lib/libcrypto/conf/ssleay.cnf
+++ /dev/null
@@ -1,78 +0,0 @@
1#
2# This is a test configuration file for use in SSLeay etc...
3#
4
5init = 5
6in\#it1 =10
7init2='10'
8init3='10\''
9init4="10'"
10init5='='10\'' again'
11
12SSLeay::version = 0.5.0
13
14[genrsa]
15default_bits = 512
16SSLEAY::version = 0.5.0
17
18[gendh]
19default_bits = 512
20def_generator = 2
21
22[s_client]
23cipher1 = DES_CBC_MD5:DES_CBC_SHA:DES_EDE_SHA:RC4_MD5\
24cipher2 = 'DES_CBC_MD5 DES_CBC_SHA DES_EDE_SHA RC4_MD5'
25cipher3 = "DES_CBC_MD5 DES_CBC_SHA DES_EDE_SHA RC4_MD5"
26cipher4 = DES_CBC_MD5 DES_CBC_SHA DES_EDE_SHA RC4_MD5
27
28[ default ]
29cert_dir = $ENV::HOME/.ca_certs
30
31HOME = /tmp/eay
32
33tmp_cert_dir = $HOME/.ca_certs
34tmp2_cert_dir = thisis$(HOME)stuff
35
36LOGNAME = Eric Young (home=$HOME)
37
38[ special ]
39
40H=$HOME
41H=$default::HOME
42H=$ENV::HOME
43#
44# SSLeay example configuration file.
45# This is mostly being used for generation of certificate requests.
46#
47
48RANDFILE = $HOME/.rand
49
50[ req ]
51default_bits = 512
52default_keyfile = privkey.pem
53
54Attribute_type_1 = countryName
55Attribute_text_1 = Country Name (2 letter code)
56Attribute_default_1 = AU
57
58Attribute_type_2 = stateOrProvinceName
59Attribute_text_2 = State or Province Name (full name)
60Attribute_default_2 = Queensland
61
62Attribute_type_3 = localityName
63Attribute_text_3 = Locality Name (eg, city)
64
65Attribute_type_4 = organizationName
66Attribute_text_4 = Organization Name (eg, company)
67Attribute_default_4 = Mincom Pty Ltd
68
69Attribute_type_5 = organizationalUnitName
70Attribute_text_5 = Organizational Unit Name (eg, section)
71Attribute_default_5 = TR
72
73Attribute_type_6 = commonName
74Attribute_text_6 = Common Name (eg, YOUR name)
75
76Attribute_type_7 = emailAddress
77Attribute_text_7 = Email Address
78