Move i2s_ASN1_ENUMERATED_TABLE() next to i2s_ASN1_ENUMERATED()
authortb <tb@openbsd.org>
Fri, 21 Apr 2023 06:07:10 +0000 (06:07 +0000)
committertb <tb@openbsd.org>
Fri, 21 Apr 2023 06:07:10 +0000 (06:07 +0000)
These functions probably belong into asn1/ but they definitely don't
belong into separate files.

lib/libcrypto/x509/x509_enum.c
lib/libcrypto/x509/x509_utl.c

index 7eabab7..0f3bfea 100644 (file)
@@ -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);
index 08151f1..6a907ff 100644 (file)
@@ -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 <stdio.h>
 #include <string.h>
 
+#include <openssl/asn1.h>
 #include <openssl/bn.h>
 #include <openssl/conf.h>
 #include <openssl/err.h>
@@ -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)
 {