From: tb Date: Tue, 18 Jun 2024 08:29:40 +0000 (+0000) Subject: Make local BIT_STRING_BITNAME variables const X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=2aedf8d3ee534e1b30e0cb212769030b45e869b3;p=openbsd Make local BIT_STRING_BITNAME variables const There's no reason for them not to be const. This is a piece of a larger diff that I carry in several of my trees to move more things to rodata or relro. The full diff requires a change to a public header and it's very annoying to have to 'make includes' and recompile the entire lib all the time when hopping from tree to tree. --- diff --git a/lib/libcrypto/x509/x509_bitst.c b/lib/libcrypto/x509/x509_bitst.c index 97c630d8b71..4c36d31b030 100644 --- a/lib/libcrypto/x509/x509_bitst.c +++ b/lib/libcrypto/x509/x509_bitst.c @@ -1,4 +1,4 @@ -/* $OpenBSD: x509_bitst.c,v 1.4 2023/04/21 06:11:56 tb Exp $ */ +/* $OpenBSD: x509_bitst.c,v 1.5 2024/06/18 08:29:40 tb Exp $ */ /* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL * project 1999. */ @@ -157,7 +157,7 @@ STACK_OF(CONF_VALUE) * i2v_ASN1_BIT_STRING(X509V3_EXT_METHOD *method, ASN1_BIT_STRING *bits, STACK_OF(CONF_VALUE) *ret) { - BIT_STRING_BITNAME *bnam; + const BIT_STRING_BITNAME *bnam; STACK_OF(CONF_VALUE) *free_ret = NULL; if (ret == NULL) { @@ -188,7 +188,7 @@ v2i_ASN1_BIT_STRING(X509V3_EXT_METHOD *method, X509V3_CTX *ctx, CONF_VALUE *val; ASN1_BIT_STRING *bs; int i; - BIT_STRING_BITNAME *bnam; + const BIT_STRING_BITNAME *bnam; if (!(bs = ASN1_BIT_STRING_new())) { X509V3error(ERR_R_MALLOC_FAILURE); diff --git a/lib/libcrypto/x509/x509_utl.c b/lib/libcrypto/x509/x509_utl.c index 14b43e8b6cc..e5e95bfac5e 100644 --- a/lib/libcrypto/x509/x509_utl.c +++ b/lib/libcrypto/x509/x509_utl.c @@ -1,4 +1,4 @@ -/* $OpenBSD: x509_utl.c,v 1.17 2023/05/12 19:02:10 tb Exp $ */ +/* $OpenBSD: x509_utl.c,v 1.18 2024/06/18 08:29:40 tb Exp $ */ /* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL * project. */ @@ -210,7 +210,7 @@ LCRYPTO_ALIAS(i2s_ASN1_ENUMERATED); char * i2s_ASN1_ENUMERATED_TABLE(X509V3_EXT_METHOD *method, const ASN1_ENUMERATED *e) { - BIT_STRING_BITNAME *enam; + const BIT_STRING_BITNAME *enam; long strval; strval = ASN1_ENUMERATED_get(e);