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

Invalid cred usage not rejected #202

Closed
michael-o opened this issue Apr 28, 2020 · 1 comment · Fixed by #203
Closed

Invalid cred usage not rejected #202

michael-o opened this issue Apr 28, 2020 · 1 comment · Fixed by #203

Comments

@michael-o
Copy link
Contributor

What went wrong?

I have passed invalid creg usage to gssapi.Credentials(usage) and it has been accepted.

How do we reproduce?

$ python3
> Python 3.7.7 (default, Mar 19 2020, 21:26:00)
> [Clang 9.0.1 (git@github.com:llvm/llvm-project.git c1a0a213378a458fbea1a5c77b31 on freebsd12
> Type "help", "copyright", "credits" or "license" for more information.
 import gssapi
 cred = gssapi.Credentials(usage='nonsense')
 cred.usage
> 'both'

Component versions (python-gssapi, Kerberos, OS / distro, etc.)

Installed via FreeBSD Ports.

Expected behavior

My expectation is that it should yield to an exception as does MIT Kerberos:
https://github.com/krb5/krb5/blob/6d4eb6eb473c93f0db05409195448364382760a9/src/lib/gssapi/mechglue/g_acquire_cred.c#L73-L78

@frozencemetery
Copy link
Member

In general I don't think we want to be in the business of input validation - we'd rather punt that to krb5. However, I think it makes sense because we perform translation and a typo here wouldn't be caught. Patch forthcoming.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants