summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authortb <>2024-08-31 09:39:31 +0000
committertb <>2024-08-31 09:39:31 +0000
commitc6ff9992123d41fbd71d986b1491805789c71e99 (patch)
tree409e6ba5b6c6edc3c3c315bf9ae084023111919b
parent344b6554f8409b3c53c8086f5ea3d2a58f09c1ff (diff)
downloadopenbsd-c6ff9992123d41fbd71d986b1491805789c71e99.tar.gz
openbsd-c6ff9992123d41fbd71d986b1491805789c71e99.tar.bz2
openbsd-c6ff9992123d41fbd71d986b1491805789c71e99.zip
const correct uses of CONF_METHOD
While not all of this is strictly needed, it was simply incorrect. This way another global which was modifiable for no good reason becomes const. ok beck jsing
-rw-r--r--src/lib/libcrypto/conf/conf.h8
-rw-r--r--src/lib/libcrypto/conf/conf_def.c8
-rw-r--r--src/lib/libcrypto/conf/conf_lib.c6
-rw-r--r--src/lib/libcrypto/conf/conf_local.h4
4 files changed, 13 insertions, 13 deletions
diff --git a/src/lib/libcrypto/conf/conf.h b/src/lib/libcrypto/conf/conf.h
index f5c449e547..7ddb33ccd4 100644
--- a/src/lib/libcrypto/conf/conf.h
+++ b/src/lib/libcrypto/conf/conf.h
@@ -1,4 +1,4 @@
1/* $OpenBSD: conf.h,v 1.21 2024/08/31 09:36:38 tb Exp $ */ 1/* $OpenBSD: conf.h,v 1.22 2024/08/31 09:39:31 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 *
@@ -126,12 +126,12 @@ void OPENSSL_no_config(void);
126 If that wasn't the case, the above functions would have been replaced */ 126 If that wasn't the case, the above functions would have been replaced */
127 127
128struct conf_st { 128struct conf_st {
129 CONF_METHOD *meth; 129 const CONF_METHOD *meth;
130 LHASH_OF(CONF_VALUE) *data; 130 LHASH_OF(CONF_VALUE) *data;
131}; 131};
132 132
133CONF *NCONF_new(CONF_METHOD *meth); 133CONF *NCONF_new(const CONF_METHOD *meth);
134CONF_METHOD *NCONF_default(void); 134const CONF_METHOD *NCONF_default(void);
135void NCONF_free(CONF *conf); 135void NCONF_free(CONF *conf);
136void NCONF_free_data(CONF *conf); 136void NCONF_free_data(CONF *conf);
137 137
diff --git a/src/lib/libcrypto/conf/conf_def.c b/src/lib/libcrypto/conf/conf_def.c
index 5698bfdbaf..26e273c841 100644
--- a/src/lib/libcrypto/conf/conf_def.c
+++ b/src/lib/libcrypto/conf/conf_def.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: conf_def.c,v 1.41 2024/08/31 09:36:38 tb Exp $ */ 1/* $OpenBSD: conf_def.c,v 1.42 2024/08/31 09:39:31 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 *
@@ -81,7 +81,7 @@ static char *scan_dquote(CONF *conf, char *p);
81#define scan_esc(conf,p) (((IS_EOF((conf),(p)[1]))?((p)+1):((p)+2))) 81#define scan_esc(conf,p) (((IS_EOF((conf),(p)[1]))?((p)+1):((p)+2)))
82 82
83static CONF * 83static CONF *
84def_create(CONF_METHOD *meth) 84def_create(const CONF_METHOD *meth)
85{ 85{
86 CONF *ret; 86 CONF *ret;
87 87
@@ -634,7 +634,7 @@ def_to_int(const CONF *conf, char c)
634 return c - '0'; 634 return c - '0';
635} 635}
636 636
637static CONF_METHOD default_method = { 637static const CONF_METHOD default_method = {
638 .name = "OpenSSL default", 638 .name = "OpenSSL default",
639 .create = def_create, 639 .create = def_create,
640 .init = def_init_default, 640 .init = def_init_default,
@@ -647,7 +647,7 @@ static CONF_METHOD default_method = {
647 .load = def_load, 647 .load = def_load,
648}; 648};
649 649
650CONF_METHOD * 650const CONF_METHOD *
651NCONF_default(void) 651NCONF_default(void)
652{ 652{
653 return &default_method; 653 return &default_method;
diff --git a/src/lib/libcrypto/conf/conf_lib.c b/src/lib/libcrypto/conf/conf_lib.c
index ccd09c0258..d7a2870520 100644
--- a/src/lib/libcrypto/conf/conf_lib.c
+++ b/src/lib/libcrypto/conf/conf_lib.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: conf_lib.c,v 1.21 2024/08/31 09:29:03 tb Exp $ */ 1/* $OpenBSD: conf_lib.c,v 1.22 2024/08/31 09:39:31 tb Exp $ */
2/* Written by Richard Levitte (richard@levitte.org) for the OpenSSL 2/* Written by Richard Levitte (richard@levitte.org) for the OpenSSL
3 * project 2000. 3 * project 2000.
4 */ 4 */
@@ -64,7 +64,7 @@
64 64
65#include "conf_local.h" 65#include "conf_local.h"
66 66
67static CONF_METHOD *default_CONF_method = NULL; 67static const CONF_METHOD *default_CONF_method = NULL;
68 68
69/* Init a 'CONF' structure from an old LHASH */ 69/* Init a 'CONF' structure from an old LHASH */
70 70
@@ -202,7 +202,7 @@ LCRYPTO_ALIAS(CONF_free);
202 by the "CONF classic" functions, for consistency. */ 202 by the "CONF classic" functions, for consistency. */
203 203
204CONF * 204CONF *
205NCONF_new(CONF_METHOD *meth) 205NCONF_new(const CONF_METHOD *meth)
206{ 206{
207 CONF *ret; 207 CONF *ret;
208 208
diff --git a/src/lib/libcrypto/conf/conf_local.h b/src/lib/libcrypto/conf/conf_local.h
index c991f0629b..f2c755bbf6 100644
--- a/src/lib/libcrypto/conf/conf_local.h
+++ b/src/lib/libcrypto/conf/conf_local.h
@@ -1,4 +1,4 @@
1/* $OpenBSD: conf_local.h,v 1.3 2024/08/31 09:29:03 tb Exp $ */ 1/* $OpenBSD: conf_local.h,v 1.4 2024/08/31 09:39:31 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 *
@@ -63,7 +63,7 @@ __BEGIN_HIDDEN_DECLS
63 63
64struct conf_method_st { 64struct conf_method_st {
65 const char *name; 65 const char *name;
66 CONF *(*create)(CONF_METHOD *meth); 66 CONF *(*create)(const CONF_METHOD *meth);
67 int (*init)(CONF *conf); 67 int (*init)(CONF *conf);
68 int (*destroy)(CONF *conf); 68 int (*destroy)(CONF *conf);
69 int (*destroy_data)(CONF *conf); 69 int (*destroy_data)(CONF *conf);