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:
Love Hörnquist Åstrand
2009-05-28 01:19:45 +00:00
parent 001e058f91
commit f0f5f236dc

View File

@@ -546,14 +546,14 @@ check_CRLDistributionPoints(hx509_validate_ctx ctx,
struct { struct {
const char *name; const char *name;
const heim_oid *(*oid)(void); const heim_oid *oid;
int (*func)(hx509_validate_ctx, heim_any *); int (*func)(hx509_validate_ctx, heim_any *);
} check_altname[] = { } altname_types[] = {
{ "pk-init", oid_id_pkinit_san, check_pkinit_san }, { "pk-init", &asn1_oid_id_pkinit_san, check_pkinit_san },
{ "jabber", oid_id_pkix_on_xmppAddr, check_utf8_string_san }, { "jabber", &asn1_oid_id_pkix_on_xmppAddr, check_utf8_string_san },
{ "dns-srv", oid_id_pkix_on_dnsSRV, check_altnull }, { "dns-srv", &asn1_oid_id_pkix_on_dnsSRV, check_altnull },
{ "card-id", oid_id_uspkicommon_card_id, check_altnull }, { "card-id", &asn1_oid_id_uspkicommon_card_id, check_altnull },
{ "Microsoft NT-PRINCIPAL-NAME", oid_id_pkinit_ms_san, check_utf8_string_san } { "Microsoft NT-PRINCIPAL-NAME", &asn1_oid_id_pkinit_ms_san, check_utf8_string_san }
}; };
static int static int
@@ -596,17 +596,17 @@ check_altName(hx509_validate_ctx ctx,
validate_print(ctx, HX509_VALIDATE_F_VERBOSE, validate_print(ctx, HX509_VALIDATE_F_VERBOSE,
"%sAltName otherName ", name); "%sAltName otherName ", name);
for (j = 0; j < sizeof(check_altname)/sizeof(check_altname[0]); j++) { for (j = 0; j < sizeof(altname_types)/sizeof(altname_types[0]); j++) {
if (der_heim_oid_cmp((*check_altname[j].oid)(), if (der_heim_oid_cmp(altname_types[j].oid,
&gn.val[i].u.otherName.type_id) != 0) &gn.val[i].u.otherName.type_id) != 0)
continue; continue;
validate_print(ctx, HX509_VALIDATE_F_VERBOSE, "%s: ", validate_print(ctx, HX509_VALIDATE_F_VERBOSE, "%s: ",
check_altname[j].name); altname_types[j].name);
(*check_altname[j].func)(ctx, &gn.val[i].u.otherName.value); (*altname_types[j].func)(ctx, &gn.val[i].u.otherName.value);
break; 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, hx509_oid_print(&gn.val[i].u.otherName.type_id,
validate_vprint, ctx); validate_vprint, ctx);
validate_print(ctx, HX509_VALIDATE_F_VERBOSE, " unknown"); validate_print(ctx, HX509_VALIDATE_F_VERBOSE, " unknown");