2 * lib/gssapi/krb5/inq_names.c
4 * Copyright 1995 by the Massachusetts Institute of Technology.
7 * Export of this software from the United States of America may
8 * require a specific license from the United States Government.
9 * It is the responsibility of any person or organization contemplating
10 * export to obtain such a license before exporting.
12 * WITHIN THAT CONSTRAINT, permission to use, copy, modify, and
13 * distribute this software and its documentation for any purpose and
14 * without fee is hereby granted, provided that the above copyright
15 * notice appear in all copies and that both that copyright notice and
16 * this permission notice appear in supporting documentation, and that
17 * the name of M.I.T. not be used in advertising or publicity pertaining
18 * to distribution of the software without specific, written prior
19 * permission. Furthermore if you modify this software you must label
20 * your software as modified software and not distribute it in such a
21 * fashion that it might be confused with the original M.I.T. software.
22 * M.I.T. makes no representations about the suitability of
23 * this software for any purpose. It is provided "as is" without express
24 * or implied warranty.
29 * inq_names.c - Return set of nametypes supported by the KRB5 mechanism.
31 #include "gssapiP_krb5.h"
35 krb5_gss_inquire_names_for_mech(minor_status
, mechanism
, name_types
)
36 OM_uint32
*minor_status
;
38 gss_OID_set
*name_types
;
40 OM_uint32 major
, minor
;
43 * We only know how to handle our own mechanism.
45 if ((mechanism
!= GSS_C_NULL_OID
) &&
46 !g_OID_equal(gss_mech_krb5
, mechanism
) &&
47 !g_OID_equal(gss_mech_krb5_old
, mechanism
)) {
49 return(GSS_S_BAD_MECH
);
52 /* We're okay. Create an empty OID set */
53 major
= gss_create_empty_oid_set(minor_status
, name_types
);
54 if (major
== GSS_S_COMPLETE
) {
55 /* Now add our members. */
57 ((major
= generic_gss_add_oid_set_member(minor_status
,
60 ) == GSS_S_COMPLETE
) &&
61 ((major
= generic_gss_add_oid_set_member(minor_status
,
62 gss_nt_machine_uid_name
,
64 ) == GSS_S_COMPLETE
) &&
65 ((major
= generic_gss_add_oid_set_member(minor_status
,
66 gss_nt_string_uid_name
,
68 ) == GSS_S_COMPLETE
) &&
69 ((major
= generic_gss_add_oid_set_member(minor_status
,
72 ) == GSS_S_COMPLETE
) &&
73 ((major
= generic_gss_add_oid_set_member(minor_status
,
74 gss_nt_service_name_v2
,
76 ) == GSS_S_COMPLETE
) &&
77 ((major
= generic_gss_add_oid_set_member(minor_status
,
80 ) == GSS_S_COMPLETE
) &&
81 ((major
= generic_gss_add_oid_set_member(minor_status
,
82 (const gss_OID
) gss_nt_krb5_name
, /* Solaris Kerberos */
86 /* Solaris Kerberos */
87 major
= generic_gss_add_oid_set_member(minor_status
,
88 (const gss_OID
) gss_nt_krb5_principal
,
93 * If we choked, then release the set, but don't overwrite the minor
94 * status with the release call.
96 if (major
!= GSS_S_COMPLETE
)
97 (void) gss_release_oid_set(&minor
,