-
Notifications
You must be signed in to change notification settings - Fork 46
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
Implement remaining GGF extensions #151
Conversation
d64e1c7
to
2dcb2ba
Compare
If |
gssapi/raw/ext_ggf.pyx
Outdated
Creds: The output credential. | ||
|
||
Raises: | ||
GSS_ERROR |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should be the python type (GSSError
)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(can you fix that up in the rest of these functions, too? Don't know how that snuck by last time).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure, don't know why I wrote them this way.
gssapi/raw/ext_ggf.pyx
Outdated
An example of how this can be used would be to reset the NTLM crypto engine | ||
used in gss-ntlmssp. The OID that controls this value is | ||
'1.3.6.1.4.1.7165.655.1.3' and it takes it a byte value that represents | ||
an int32 where 1 reset's the verifier handle and any other int resets the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
s/reset's/resets/
gssapi/tests/test_raw.py
Outdated
# nothing much we can test here apart from it doesn't fail and the | ||
# id of the return cred is the same as the input one | ||
output_cred = gb.set_cred_option(no_ci_flags_x, creds=orig_cred) | ||
id(orig_cred).should_be(id(output_cred)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
oof, I don't like testing the id
like that. Just drop that line. It's probably fine to just test that it doesn't error out.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Will do.
gssapi/tests/test_raw.py
Outdated
b"\x00") | ||
|
||
# TODO: get these tests to detect gss-ntlmssp once it is installed | ||
""" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
gss-ntlmssp will be installed as part of #150, so we just need to figure out how to detect it, and get that merged into k5test.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sounds good.
gssapi/tests/test_raw.py
Outdated
# because MIT krb5 doesn't implement any OID's for | ||
# gss_set_sec_context_option, we just need to query any OID and it will | ||
# raise an exception | ||
gb.set_sec_context_option.should_raise(gb.GSSError, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this test feels fragile. Is there anything else we can do?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Once the NTLMSSP stuff works in the tests we can call that with an invalid value instead.
2dcb2ba
to
a121831
Compare
Thanks for the review @DirectXMan12, let me know what you would like me to do about the |
It's there on master now. |
Must have done something wrong the first time, have updated the tests to use ntlmssp. |
a7489c1
to
726366d
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
new revisions look good at a glance. Feel free to merge @frozencemetery.
These parts of th GGF extensions provide extended support for managing security contexts and credentials. In particular, with NTLM, they can be used to reset the crypto handles using the GSS_NTLMSSP_RESET_CRYPTO_OID_LENGTH OID. Draft IETF document for the gss_set_sec_context_option(): https://tools.ietf.org/html/draft-engert-ggf-gss-extensions-00 Draft IETF document for the gss_set_cred_option(): https://tools.ietf.org/html/draft-ietf-kitten-channel-bound-flag-02 Fixes: pythongssapi#51 [[email protected] edited commit message]
726366d
to
13467fb
Compare
This PR implements the remaining GGF extensions #51, excluding the
gss_{import,export}_cred
variants as they are not implemented as per the GGF spec in both MIT krb5 and Heimdal. This PR adds in thegss_set_cred_option
andgss_set_sec_context_option
functions.While
gss_set_cred_option
doesn't seem to be a function that was part of the GGF draft, most implementations bundle it together with the GGFgss_set_sec_context_option
and so I decided to keep it inext_ggf
, please let me know if you want to split them up further.I also have a commented out test for
gss_set_sec_context_option
, it requiresgss-ntlmssp
and unfortunately I was unable to get that working in the docker container tests. Not sure if I needed to do anything extra (apart from installing it from apt/dnf) as it was unable to find the mech when i supplied it as part of the test. For now it is commented out until someone smarter can figure it out.