Skip to content

Invalid cred usage not rejected #202

Closed
@michael-o

Description

@michael-o

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions