Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix SPNEGO crash #74

Closed
wants to merge 3 commits into from
Closed
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions gssapi/raw/sec_contexts.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,7 @@ flags=None, lifetime=None, channel_bindings=None, input_token=None)
input_token_buffer.value = input_token
input_token_buffer.length = len(input_token)

cdef gss_OID actual_mech_type
cdef gss_OID actual_mech_type = GSS_C_NO_OID;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please remove the ; from the end of this line

cdef gss_buffer_desc output_token_buffer = gss_buffer_desc(0, NULL)
cdef OM_uint32 ret_flags
cdef OM_uint32 output_ttl
Expand Down Expand Up @@ -232,7 +232,9 @@ flags=None, lifetime=None, channel_bindings=None, input_token=None)

cdef OID output_mech_type = OID()
if maj_stat == GSS_S_COMPLETE or maj_stat == GSS_S_CONTINUE_NEEDED:
output_mech_type.raw_oid = actual_mech_type[0]
if actual_mech_type:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you might want to make this is not GSS_C_NO_OID or != GSS_C_NO_OID (your code works fine because GSS_C_NO_OID is actually NULL, but it's a bit clearer)

output_mech_type.raw_oid = actual_mech_type[0]

return InitSecContextResult(output_context, output_mech_type,
IntEnumFlagSet(RequirementFlag, ret_flags),
output_token,
Expand Down Expand Up @@ -362,7 +364,6 @@ channel_bindings=None)
ret_flags),
output_ttl_py, oc,
maj_stat == GSS_S_CONTINUE_NEEDED)
return res
else:
raise GSSError(maj_stat, min_stat, token=output_token)

Expand Down