Skip to content

Commit 3826b71

Browse files
committed
Handle GSS_C_NO_OID_SET when creating sets
Some methods can return GSS_C_NO_OID_SET on success, so we should handle that in our set converter by returning the empty set. Fixes #148
1 parent 7018e58 commit 3826b71

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

gssapi/raw/cython_converters.pyx

+7
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,13 @@ cdef gss_OID_set c_get_mech_oid_set(object mechs):
2929
cdef object c_create_oid_set(gss_OID_set mech_set, bint free=True):
3030
"""Convert a GSS OID set struct to a set of OIDs"""
3131

32+
if mech_set == GSS_C_NO_OID_SET:
33+
# return the empty set if the we get passed the C equivalent
34+
# (it could be argued that the C equivalent is closer to None,
35+
# but returning None would make the API harder to work with,
36+
# without much value)
37+
return set()
38+
3239
py_set = set()
3340
cdef i
3441
for i in range(mech_set.count):

0 commit comments

Comments
 (0)