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>
fips-20220613
David Benjamin 3 years ago committed by Boringssl LUCI CQ
parent 6196faba8a
commit ab69425a98
  1. 10
      crypto/asn1/tasn_utl.c
  2. 5
      include/openssl/asn1t.h

@ -223,7 +223,6 @@ const ASN1_TEMPLATE *asn1_do_adb(ASN1_VALUE **pval, const ASN1_TEMPLATE *tt,
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 @@ const ASN1_TEMPLATE *asn1_do_adb(ASN1_VALUE **pval, const ASN1_TEMPLATE *tt,
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

@ -260,7 +260,6 @@ typedef struct ASN1_TLC_st ASN1_TLC;
/* 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_st {
};
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 @@ struct ASN1_ADB_TABLE_st {
#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

Loading…
Cancel
Save