Remove ASN1_ADB_INTEGER.

Nothing uses it, and I've never seen an ASN.1 spec use ANY DEFINED BY
with an integer selector. (Although X.680 1997 does seem to allow it.)

Change-Id: Ie1076f58838e4b889c5e6e12e9ca6dd1012472e7
Reviewed-on: https://boringssl-review.googlesource.com/c/boringssl/+/51636
Reviewed-by: Adam Langley <agl@google.com>
Commit-Queue: David Benjamin <davidben@google.com>
diff --git a/crypto/asn1/tasn_utl.c b/crypto/asn1/tasn_utl.c
index 9b1da0b..0b6048c 100644
--- a/crypto/asn1/tasn_utl.c
+++ b/crypto/asn1/tasn_utl.c
@@ -223,7 +223,6 @@
                                  int nullerr) {
   const ASN1_ADB *adb;
   const ASN1_ADB_TABLE *atbl;
-  long selector;
   ASN1_VALUE **sfld;
   int i;
   if (!(tt->flags & ASN1_TFLG_ADB_MASK)) {
@@ -244,14 +243,11 @@
     return adb->null_tt;
   }
 
-  /* Convert type to a long:
+  /* Convert type to a NID:
    * NB: don't check for NID_undef here because it
    * might be a legitimate value in the table */
-  if (tt->flags & ASN1_TFLG_ADB_OID) {
-    selector = OBJ_obj2nid((ASN1_OBJECT *)*sfld);
-  } else {
-    selector = ASN1_INTEGER_get((ASN1_INTEGER *)*sfld);
-  }
+  assert(tt->flags & ASN1_TFLG_ADB_OID);
+  int selector = OBJ_obj2nid((ASN1_OBJECT *)*sfld);
 
   /* Try to find matching entry in table Maybe should check application types
    * first to allow application override? Might also be useful to have a flag
diff --git a/include/openssl/asn1t.h b/include/openssl/asn1t.h
index dccbd1a..b65272d 100644
--- a/include/openssl/asn1t.h
+++ b/include/openssl/asn1t.h
@@ -260,7 +260,6 @@
 /* Any defined by macros: the field used is in the table itself */
 
 #define ASN1_ADB_OBJECT(tblname) { ASN1_TFLG_ADB_OID, -1, 0, #tblname, (const ASN1_ITEM *)&(tblname##_adb) }
-#define ASN1_ADB_INTEGER(tblname) { ASN1_TFLG_ADB_INT, -1, 0, #tblname, (const ASN1_ITEM *)&(tblname##_adb) }
 /* Plain simple type */
 #define ASN1_SIMPLE(stname, field, type) ASN1_EX_TYPE(0,0, stname, field, type)
 
@@ -377,7 +376,7 @@
 };
 
 struct ASN1_ADB_TABLE_st {
-	long value;		/* NID for an object or value for an int */
+	int value;		/* NID for an object */
 	const ASN1_TEMPLATE tt;		/* item for this value */
 };
 
@@ -442,8 +441,6 @@
 
 #define ASN1_TFLG_ADB_OID	(0x1<<8)
 
-#define ASN1_TFLG_ADB_INT	(0x1<<9)
-
 /* This flag means a parent structure is passed
  * instead of the field: this is useful is a
  * SEQUENCE is being combined with a CHOICE for