From: tb Date: Sat, 31 Aug 2024 09:36:38 +0000 (+0000) Subject: Stop using conf->meth_data and make CONF_type_default const X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=bf20285611a855bfa4173a88ea891fdb4bf81ba5;p=openbsd Stop using conf->meth_data and make CONF_type_default const Now that we no longer need to hang a poor man's ctype substitute off the conf structure, we can get rid of the otherwise unused meth_data member. This allows us to const correct CONF_type_default. Hopefully we can remove it soon. ok beck jsing --- diff --git a/lib/libcrypto/conf/conf.h b/lib/libcrypto/conf/conf.h index 59222e8ca1f..f5c449e5475 100644 --- a/lib/libcrypto/conf/conf.h +++ b/lib/libcrypto/conf/conf.h @@ -1,4 +1,4 @@ -/* $OpenBSD: conf.h,v 1.20 2024/08/31 09:34:05 tb Exp $ */ +/* $OpenBSD: conf.h,v 1.21 2024/08/31 09:36:38 tb Exp $ */ /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) * All rights reserved. * @@ -127,7 +127,6 @@ void OPENSSL_no_config(void); struct conf_st { CONF_METHOD *meth; - void *meth_data; LHASH_OF(CONF_VALUE) *data; }; diff --git a/lib/libcrypto/conf/conf_def.c b/lib/libcrypto/conf/conf_def.c index f0baee52610..5698bfdbaf5 100644 --- a/lib/libcrypto/conf/conf_def.c +++ b/lib/libcrypto/conf/conf_def.c @@ -1,4 +1,4 @@ -/* $OpenBSD: conf_def.c,v 1.40 2024/08/31 09:34:05 tb Exp $ */ +/* $OpenBSD: conf_def.c,v 1.41 2024/08/31 09:36:38 tb Exp $ */ /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) * All rights reserved. * @@ -101,7 +101,6 @@ def_init_default(CONF *conf) return 0; conf->meth = NCONF_default(); - conf->meth_data = CONF_type_default; conf->data = NULL; return 1; diff --git a/lib/libcrypto/conf/conf_def.h b/lib/libcrypto/conf/conf_def.h index 07b0adf81d9..36a8aac4de7 100644 --- a/lib/libcrypto/conf/conf_def.h +++ b/lib/libcrypto/conf/conf_def.h @@ -1,4 +1,4 @@ -/* $OpenBSD: conf_def.h,v 1.7 2024/08/31 09:34:05 tb Exp $ */ +/* $OpenBSD: conf_def.h,v 1.8 2024/08/31 09:36:38 tb Exp $ */ /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) * All rights reserved. * @@ -79,7 +79,9 @@ __BEGIN_HIDDEN_DECLS #define CONF_ALPHA_NUMERIC_PUNCT (CONF_ALPHA|CONF_NUMBER|CONF_UNDER| \ CONF_PUNCTUATION) -#define KEYTYPES(c) ((unsigned short *)((c)->meth_data)) +static const unsigned short CONF_type_default[256]; + +#define KEYTYPES(c) (CONF_type_default) #define IS_COMMENT(c,a) (KEYTYPES(c)[(a)&0xff]&CONF_COMMENT) #define IS_FCOMMENT(c,a) (KEYTYPES(c)[(a)&0xff]&CONF_FCOMMENT) #define IS_EOF(c,a) (KEYTYPES(c)[(a)&0xff]&CONF_EOF) @@ -93,7 +95,7 @@ __BEGIN_HIDDEN_DECLS #define IS_DQUOTE(c,a) (KEYTYPES(c)[(a)&0xff]&CONF_DQUOTE) #define IS_HIGHBIT(c,a) (KEYTYPES(c)[(a)&0xff]&CONF_HIGHBIT) -static unsigned short CONF_type_default[256] = { +static const unsigned short CONF_type_default[256] = { 0x0008, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0010, 0x0010, 0x0000, 0x0000, 0x0010, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,