File: OID.xs

package info (click to toggle)
libgssapi-perl 0.22-1
  • links: PTS
  • area: main
  • in suites: etch, etch-m68k
  • size: 180 kB
  • ctags: 35
  • sloc: perl: 706; makefile: 53
file content (176 lines) | stat: -rw-r--r-- 2,901 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176

GSSAPI::OID_out
new(class)
	char *		class
    CODE:
	RETVAL = NULL;
    OUTPUT:
	RETVAL

void
DESTROY(oid)
	GSSAPI::OID	oid
    PREINIT:
	OM_uint32	minor;
    PPCODE:
#if !defined(HEIMDAL)
	if (oid != NULL &&
	    oid != __KRB5_MECHTYPE_OID &&
	    oid != __KRB5_OLD_MECHTYPE_OID &&
	    oid != __GSS_KRB5_NT_USER_NAME &&
	    oid != __GSS_KRB5_NT_PRINCIPAL_NAME &&
	    oid != __SPNEGO_MECHTYPE_OID &&
	    oid != __gss_mech_krb5_v2  ) {
	    (void)gss_release_oid(&minor, &oid);
	}
#endif
#if defined(HEIMDAL)
#    warn("gss_release_oid is unsupported and not Part of the API!");
#endif

GSSAPI::Status
from_str(class, oid, str)
	char *		class
	GSSAPI::OID_out	oid
	gss_buffer_str	str
    CODE:
#if !defined(HEIMDAL)
	RETVAL.major = gss_str_to_oid(&RETVAL.minor, &str, &oid);
#endif
#if defined(HEIMDAL)
	croak("gss_str_to_oid() is not defined in Heimdal API!");
#endif
    OUTPUT:
	RETVAL
	oid

GSSAPI::Status
to_str(oid, str)
	GSSAPI::OID		oid
	gss_buffer_str_out	str
    CODE:
	if (oid == NULL) {
	    sv_setsv_mg(ST(1), &PL_sv_undef);
	    XSRETURN_UNDEF;
	}
#if !defined(HEIMDAL)
	RETVAL.major = gss_oid_to_str(&RETVAL.minor, oid, &str);
#endif
#if defined(HEIMDAL)
	croak("gss_oid_to_str() is not defined in Heimdal API!");
#endif
    OUTPUT:
	RETVAL
	str

GSSAPI::Status
inquire_names(oid, oidset)
	GSSAPI::OID		oid
	GSSAPI::OID::Set_out	oidset
    CODE:
	RETVAL.major =
		gss_inquire_names_for_mech(&RETVAL.minor, oid, &oidset);
    OUTPUT:
	RETVAL
	oidset


#
#	generic OIDs
#

GSSAPI::OID_const
gss_nt_user_name()
    CODE:
	RETVAL = GSS_C_NT_USER_NAME;
    OUTPUT:
	RETVAL

GSSAPI::OID_const
gss_nt_machine_uid_name()
    CODE:
	RETVAL = GSS_C_NT_MACHINE_UID_NAME;
    OUTPUT:
	RETVAL

GSSAPI::OID_const
gss_nt_string_uid_name()
    CODE:
	RETVAL =  GSS_C_NT_STRING_UID_NAME;
    OUTPUT:
	RETVAL

GSSAPI::OID_const
gss_nt_service_name()
    CODE:
	RETVAL = GSS_C_NT_HOSTBASED_SERVICE;
    OUTPUT:
	RETVAL

GSSAPI::OID_const
gss_nt_exported_name()
    CODE:
	RETVAL = GSS_C_NT_EXPORT_NAME;
    OUTPUT:
	RETVAL

GSSAPI::OID_const
gss_nt_service_name_v2()
    CODE:
	RETVAL = GSS_C_NT_HOSTBASED_SERVICE;
    OUTPUT:
	RETVAL


#
#	Kerberos OIDs
#

GSSAPI::OID_const
gss_nt_krb5_name()
    CODE:
	RETVAL = __GSS_KRB5_NT_USER_NAME;
    OUTPUT:
	RETVAL

GSSAPI::OID_const
gss_nt_krb5_principal()
    CODE:
	RETVAL = __GSS_KRB5_NT_PRINCIPAL_NAME;
    OUTPUT:
	RETVAL

GSSAPI::OID_const
gss_mech_krb5()
    CODE:
	RETVAL = __KRB5_MECHTYPE_OID;
    OUTPUT:
	RETVAL

GSSAPI::OID_const
gss_mech_spnego()
    CODE:
	RETVAL = __SPNEGO_MECHTYPE_OID;
    OUTPUT:
	RETVAL

GSSAPI::OID_const
gss_mech_krb5_old()
    CODE:
	RETVAL = __KRB5_OLD_MECHTYPE_OID;
    OUTPUT:
	RETVAL

GSSAPI::OID_const
gss_mech_krb5_v2()
    CODE:
	RETVAL = __gss_mech_krb5_v2;
    OUTPUT:
	RETVAL

GSSAPI::OID_const
gss_nt_hostbased_service()
     CODE:
        RETVAL = GSS_C_NT_HOSTBASED_SERVICE;
     OUTPUT:
        RETVAL