-
Notifications
You must be signed in to change notification settings - Fork 49
cred_store should allow specifying empty values #182
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
Comments
Effectively, this performs the None -> NULL transformation between Python and C. Currently both MIT krb5 and Heimdal will both treat NULL as an unspecified value, which causes it to be skipped. Resolves: pythongssapi#182
Effectively, this performs the None -> NULL transformation between Python and C. Currently both MIT krb5 and Heimdal will both treat NULL as an unspecified value, which causes it to be skipped. Resolves: #182
I do not really understand this and the fix looks incomplete as it will cause the cred store to have a key but not a value if I read it right ? |
Clarifying: do not understand why you'd pass a client_keytab key at all if you have no value, just do not pass it in ? |
@simo5 for released FreeIPA versions, we cannot fix
As you can see, the value in |
To expand a bit, if this is fixed like in #183, we then can use |
The C code does accidentally allow this, but we should definitely not rely on it, we do not know how Heimdal will implement it for example. |
@frozencemetery you implemented #183 so may want to comment here |
The code as written in #183 will I believe result in a key with NULL value. Heimdal already implemented the cred store extensions; I checked their implementation as well, and it supports NULL values. The behavior before #183 is entirely incorrect: it throws an error about how NoneType doesn't have the required string-ish methods. This change causes None to be converted to the appropriate C object (i.e., NULL). Lacking a standard for these extensions, it's hard for me to say what's the "right" thing to do here. It sounds like there's some (albeit unintentional) use case for passing through NULL here; while I can see an argument for throwing an (appropriate) exception instead, that puts python-gssapi in the position of adding additional restrictions to the de-facto behavior that are not imposed by other implementations. |
As one of the originators of that API I would strongly prefer not to use the implementation detail that current implementations tolerate empty keys, but I guess the cat is out of the bag now :-( |
@simo5 Well, I haven't cut a release with it, just committed to master. We can still do something else if it'd be better somehow. In my opinion, whether to use the implementation detail is on the calling application (here, freeipa), not python-gssapi. Nothing I can find from Nico or you proposes behavior for NULL values in the cred_store API. If you and @abbra agree on a better solution to the problem for freeipa, I'm happy to do something different here? |
let's pull @nicowilliams in the discussion and see what he thinks |
I agree with Simo. If I understand properly:
Relying on the emergent behavior is inferior to solving the problem at a higher layer. |
I agree with @simo5 and @greghudson. Because we didn't specify behavior with |
Thanks for the discussion. It all started when we tried to add support for the default client keytab in ansible-freeipa. We can change FreeIPA's |
I'm a little confused. Are old releases of python-gssapi (two layers down) less of a concern than old releases of FreeIPA (one layer down)? |
you are right that both would be problematic. Anyway, for ansible-freeipa the choice is between explicitly passing a keytab path from |
From my perspective, before #183, python-gssapi throws an unexpected exception (i.e., not mentioned in docs) when given a |
I think throwing a bad-value exception is better than passing on an invalid cred store. |
When relying on
KRB5_CLIENT_KTNAME
to specify a keytab, it is useful to support emptyclient_keytab
values in the cred store.FreeIPA has a helper
kinit_keytab
which usespython-gssapi
and when passing aNone
for keytab there,python-gssapi
fails:This is because of the following code: https://github.com/pythongssapi/python-gssapi/blob/master/gssapi/raw/ext_cred_store.pyx#L68-L88 where I'd suggest skip assignment of None values to avoid the problem I verified that
kg_value_from_cred_store()
will happily work with NULL values:The text was updated successfully, but these errors were encountered: