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

Handle GSS_C_NO_OID_SET when creating sets #150

Merged
merged 2 commits into from
Mar 26, 2018

Conversation

DirectXMan12
Copy link
Member

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

@DirectXMan12
Copy link
Member Author

cc @simo5 @frozencemetery can one of you test this, and or figure out a good way to write a gated unit test for it?

@DirectXMan12 DirectXMan12 added this to the 1.4.2 milestone Mar 21, 2018
Copy link
Member

@frozencemetery frozencemetery left a comment

Choose a reason for hiding this comment

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

>>> import gssapi
>>> ntlm_mech = gssapi.OID.from_int_seq("1.3.6.1.4.1.311.2.2.10")
>>> gssapi.raw.inquire_attrs_for_mech(ntlm_mech)
InquireAttrsResult(mech_attrs=set([]), known_mech_attrs=set([]))
>>> 

Copy link
Contributor

@simo5 simo5 left a comment

Choose a reason for hiding this comment

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

One nit but otherwise LGTM

# but returning None would make the API harder to work with,
# without much value)
return set()

Copy link
Contributor

Choose a reason for hiding this comment

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

If we ever need the distinction we may need to make an incompatible API change and start returning None, is that ok ?

Copy link
Member Author

Choose a reason for hiding this comment

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

yes, but we'll have to rev the major version. I'm curious as to what that situation might be -- you're not using this to detect errors (we have errors for that), so fundamentally, what's the difference here between "a set with no items", and "no set" from the user perspective.

Copy link
Contributor

Choose a reason for hiding this comment

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

ok

@frozencemetery
Copy link
Member

@DirectXMan12 are you happy with the way this is being tested, or do you want something different?

@DirectXMan12
Copy link
Member Author

Yeah, I'm not certain there's much more we can do, unless there's a dummy OID that we know will never have any attrs. This should be good to merge.

DirectXMan12 and others added 2 commits March 26, 2018 10:59
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
This lets us test that the NTLM mechanism behaves correctly and
properly test #148.
@frozencemetery frozencemetery merged commit 5e58d2e into master Mar 26, 2018
@DirectXMan12 DirectXMan12 deleted the bug/empty_set_inquire_attrs branch March 27, 2018 14:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants