@@ -22,6 +22,10 @@ cdef extern from "gssapi.h":
2222 OM_uint32 gss_indicate_mechs(OM_uint32 * minor_status,
2323 gss_OID_set * mech_set)
2424
25+ OM_uint32 gss_inquire_names_for_mech(OM_uint32 * minor_status,
26+ const gss_OID mech_type,
27+ gss_OID_set * name_types)
28+
2529
2630def indicate_mechs ():
2731 """
@@ -43,6 +47,35 @@ def indicate_mechs():
4347 raise GSSError(maj_stat, min_stat)
4448
4549
50+ def inquire_names_for_mech (OID mech_type not None ):
51+ """ Get the name types supported by a mechanism.
52+
53+ This method retrives the different name types supported by
54+ the given mechanism.
55+
56+ Args:
57+ mech_type (OID): the mechanism in question
58+
59+ Returns:
60+ list: the name type OIDs supported by the given mechanism
61+
62+ Raises:
63+ GSSError
64+ """
65+
66+ cdef gss_OID_set name_types
67+
68+ cdef OM_uint32 maj_stat, min_stat
69+
70+ maj_stat = gss_inquire_names_for_mech(& min_stat, & mech_type.raw_oid,
71+ & name_types)
72+
73+ if maj_stat == GSS_S_COMPLETE:
74+ return c_create_oid_set(name_types)
75+ else :
76+ raise GSSError(maj_stat, min_stat)
77+
78+
4679def _display_status (unsigned int error_code , bint is_major_code ,
4780 OID mech_type = None , unsigned int message_context = 0 ):
4881 """
0 commit comments