diff options
| author | tb <> | 2024-06-18 08:29:40 +0000 |
|---|---|---|
| committer | tb <> | 2024-06-18 08:29:40 +0000 |
| commit | ebb3997accd48702584a825430f955919f82be13 (patch) | |
| tree | 9e309bce1cefc6c6838a79e04b5242d4fd3b4f26 /src | |
| parent | 5f45d4e4c7fe19320bebbb43a431df9b61b9813b (diff) | |
| download | openbsd-ebb3997accd48702584a825430f955919f82be13.tar.gz openbsd-ebb3997accd48702584a825430f955919f82be13.tar.bz2 openbsd-ebb3997accd48702584a825430f955919f82be13.zip | |
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.
Diffstat (limited to 'src')
| -rw-r--r-- | src/lib/libcrypto/x509/x509_bitst.c | 6 | ||||
| -rw-r--r-- | src/lib/libcrypto/x509/x509_utl.c | 4 |
2 files changed, 5 insertions, 5 deletions
diff --git a/src/lib/libcrypto/x509/x509_bitst.c b/src/lib/libcrypto/x509/x509_bitst.c index 97c630d8b7..4c36d31b03 100644 --- a/src/lib/libcrypto/x509/x509_bitst.c +++ b/src/lib/libcrypto/x509/x509_bitst.c | |||
| @@ -1,4 +1,4 @@ | |||
| 1 | /* $OpenBSD: x509_bitst.c,v 1.4 2023/04/21 06:11:56 tb Exp $ */ | 1 | /* $OpenBSD: x509_bitst.c,v 1.5 2024/06/18 08:29:40 tb Exp $ */ |
| 2 | /* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL | 2 | /* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL |
| 3 | * project 1999. | 3 | * project 1999. |
| 4 | */ | 4 | */ |
| @@ -157,7 +157,7 @@ STACK_OF(CONF_VALUE) * | |||
| 157 | i2v_ASN1_BIT_STRING(X509V3_EXT_METHOD *method, ASN1_BIT_STRING *bits, | 157 | i2v_ASN1_BIT_STRING(X509V3_EXT_METHOD *method, ASN1_BIT_STRING *bits, |
| 158 | STACK_OF(CONF_VALUE) *ret) | 158 | STACK_OF(CONF_VALUE) *ret) |
| 159 | { | 159 | { |
| 160 | BIT_STRING_BITNAME *bnam; | 160 | const BIT_STRING_BITNAME *bnam; |
| 161 | STACK_OF(CONF_VALUE) *free_ret = NULL; | 161 | STACK_OF(CONF_VALUE) *free_ret = NULL; |
| 162 | 162 | ||
| 163 | if (ret == NULL) { | 163 | if (ret == NULL) { |
| @@ -188,7 +188,7 @@ v2i_ASN1_BIT_STRING(X509V3_EXT_METHOD *method, X509V3_CTX *ctx, | |||
| 188 | CONF_VALUE *val; | 188 | CONF_VALUE *val; |
| 189 | ASN1_BIT_STRING *bs; | 189 | ASN1_BIT_STRING *bs; |
| 190 | int i; | 190 | int i; |
| 191 | BIT_STRING_BITNAME *bnam; | 191 | const BIT_STRING_BITNAME *bnam; |
| 192 | 192 | ||
| 193 | if (!(bs = ASN1_BIT_STRING_new())) { | 193 | if (!(bs = ASN1_BIT_STRING_new())) { |
| 194 | X509V3error(ERR_R_MALLOC_FAILURE); | 194 | X509V3error(ERR_R_MALLOC_FAILURE); |
diff --git a/src/lib/libcrypto/x509/x509_utl.c b/src/lib/libcrypto/x509/x509_utl.c index 14b43e8b6c..e5e95bfac5 100644 --- a/src/lib/libcrypto/x509/x509_utl.c +++ b/src/lib/libcrypto/x509/x509_utl.c | |||
| @@ -1,4 +1,4 @@ | |||
| 1 | /* $OpenBSD: x509_utl.c,v 1.17 2023/05/12 19:02:10 tb Exp $ */ | 1 | /* $OpenBSD: x509_utl.c,v 1.18 2024/06/18 08:29:40 tb Exp $ */ |
| 2 | /* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL | 2 | /* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL |
| 3 | * project. | 3 | * project. |
| 4 | */ | 4 | */ |
| @@ -210,7 +210,7 @@ LCRYPTO_ALIAS(i2s_ASN1_ENUMERATED); | |||
| 210 | char * | 210 | char * |
| 211 | i2s_ASN1_ENUMERATED_TABLE(X509V3_EXT_METHOD *method, const ASN1_ENUMERATED *e) | 211 | i2s_ASN1_ENUMERATED_TABLE(X509V3_EXT_METHOD *method, const ASN1_ENUMERATED *e) |
| 212 | { | 212 | { |
| 213 | BIT_STRING_BITNAME *enam; | 213 | const BIT_STRING_BITNAME *enam; |
| 214 | long strval; | 214 | long strval; |
| 215 | 215 | ||
| 216 | strval = ASN1_ENUMERATED_get(e); | 216 | strval = ASN1_ENUMERATED_get(e); |
