From af98f5cdbc5f574e1562f0b8b599d38cbeb1f6ac Mon Sep 17 00:00:00 2001 From: tb <> Date: Fri, 21 Apr 2023 06:07:10 +0000 Subject: Move i2s_ASN1_ENUMERATED_TABLE() next to i2s_ASN1_ENUMERATED() These functions probably belong into asn1/ but they definitely don't belong into separate files. --- src/lib/libcrypto/x509/x509_enum.c | 17 +---------------- src/lib/libcrypto/x509/x509_utl.c | 18 +++++++++++++++++- 2 files changed, 18 insertions(+), 17 deletions(-) (limited to 'src/lib') diff --git a/src/lib/libcrypto/x509/x509_enum.c b/src/lib/libcrypto/x509/x509_enum.c index 7eabab7483..0f3bfea4c7 100644 --- a/src/lib/libcrypto/x509/x509_enum.c +++ b/src/lib/libcrypto/x509/x509_enum.c @@ -1,4 +1,4 @@ -/* $OpenBSD: x509_enum.c,v 1.5 2023/04/21 06:00:24 tb Exp $ */ +/* $OpenBSD: x509_enum.c,v 1.6 2023/04/21 06:07:10 tb Exp $ */ /* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL * project 1999. */ @@ -92,18 +92,3 @@ const X509V3_EXT_METHOD v3_crl_reason = { .r2i = NULL, .usr_data = crl_reasons, }; - -char * -i2s_ASN1_ENUMERATED_TABLE(X509V3_EXT_METHOD *method, const ASN1_ENUMERATED *e) -{ - BIT_STRING_BITNAME *enam; - long strval; - - strval = ASN1_ENUMERATED_get(e); - for (enam = method->usr_data; enam->lname; enam++) { - if (strval == enam->bitnum) - return strdup(enam->lname); - } - return i2s_ASN1_ENUMERATED(method, e); -} -LCRYPTO_ALIAS(i2s_ASN1_ENUMERATED_TABLE); diff --git a/src/lib/libcrypto/x509/x509_utl.c b/src/lib/libcrypto/x509/x509_utl.c index 08151f16d5..6a907ffac9 100644 --- a/src/lib/libcrypto/x509/x509_utl.c +++ b/src/lib/libcrypto/x509/x509_utl.c @@ -1,4 +1,4 @@ -/* $OpenBSD: x509_utl.c,v 1.7 2023/04/10 14:10:26 tb Exp $ */ +/* $OpenBSD: x509_utl.c,v 1.8 2023/04/21 06:07:10 tb Exp $ */ /* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL * project. */ @@ -61,6 +61,7 @@ #include #include +#include #include #include #include @@ -204,6 +205,21 @@ i2s_ASN1_ENUMERATED(X509V3_EXT_METHOD *method, const ASN1_ENUMERATED *a) } LCRYPTO_ALIAS(i2s_ASN1_ENUMERATED); +char * +i2s_ASN1_ENUMERATED_TABLE(X509V3_EXT_METHOD *method, const ASN1_ENUMERATED *e) +{ + BIT_STRING_BITNAME *enam; + long strval; + + strval = ASN1_ENUMERATED_get(e); + for (enam = method->usr_data; enam->lname; enam++) { + if (strval == enam->bitnum) + return strdup(enam->lname); + } + return i2s_ASN1_ENUMERATED(method, e); +} +LCRYPTO_ALIAS(i2s_ASN1_ENUMERATED_TABLE); + char * i2s_ASN1_INTEGER(X509V3_EXT_METHOD *method, const ASN1_INTEGER *a) { -- cgit v1.2.3-55-g6feb