Use OID variable instead of function.
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@25246 ec53bebd-3082-4978-b11e-865c3cabbd6b
This commit is contained in:
@@ -546,14 +546,14 @@ check_CRLDistributionPoints(hx509_validate_ctx ctx,
|
||||
|
||||
struct {
|
||||
const char *name;
|
||||
const heim_oid *(*oid)(void);
|
||||
const heim_oid *oid;
|
||||
int (*func)(hx509_validate_ctx, heim_any *);
|
||||
} check_altname[] = {
|
||||
{ "pk-init", oid_id_pkinit_san, check_pkinit_san },
|
||||
{ "jabber", oid_id_pkix_on_xmppAddr, check_utf8_string_san },
|
||||
{ "dns-srv", oid_id_pkix_on_dnsSRV, check_altnull },
|
||||
{ "card-id", oid_id_uspkicommon_card_id, check_altnull },
|
||||
{ "Microsoft NT-PRINCIPAL-NAME", oid_id_pkinit_ms_san, check_utf8_string_san }
|
||||
} altname_types[] = {
|
||||
{ "pk-init", &asn1_oid_id_pkinit_san, check_pkinit_san },
|
||||
{ "jabber", &asn1_oid_id_pkix_on_xmppAddr, check_utf8_string_san },
|
||||
{ "dns-srv", &asn1_oid_id_pkix_on_dnsSRV, check_altnull },
|
||||
{ "card-id", &asn1_oid_id_uspkicommon_card_id, check_altnull },
|
||||
{ "Microsoft NT-PRINCIPAL-NAME", &asn1_oid_id_pkinit_ms_san, check_utf8_string_san }
|
||||
};
|
||||
|
||||
static int
|
||||
@@ -596,17 +596,17 @@ check_altName(hx509_validate_ctx ctx,
|
||||
validate_print(ctx, HX509_VALIDATE_F_VERBOSE,
|
||||
"%sAltName otherName ", name);
|
||||
|
||||
for (j = 0; j < sizeof(check_altname)/sizeof(check_altname[0]); j++) {
|
||||
if (der_heim_oid_cmp((*check_altname[j].oid)(),
|
||||
for (j = 0; j < sizeof(altname_types)/sizeof(altname_types[0]); j++) {
|
||||
if (der_heim_oid_cmp(altname_types[j].oid,
|
||||
&gn.val[i].u.otherName.type_id) != 0)
|
||||
continue;
|
||||
|
||||
validate_print(ctx, HX509_VALIDATE_F_VERBOSE, "%s: ",
|
||||
check_altname[j].name);
|
||||
(*check_altname[j].func)(ctx, &gn.val[i].u.otherName.value);
|
||||
altname_types[j].name);
|
||||
(*altname_types[j].func)(ctx, &gn.val[i].u.otherName.value);
|
||||
break;
|
||||
}
|
||||
if (j == sizeof(check_altname)/sizeof(check_altname[0])) {
|
||||
if (j == sizeof(altname_types)/sizeof(altname_types[0])) {
|
||||
hx509_oid_print(&gn.val[i].u.otherName.type_id,
|
||||
validate_vprint, ctx);
|
||||
validate_print(ctx, HX509_VALIDATE_F_VERBOSE, " unknown");
|
||||
|
Reference in New Issue
Block a user