logo_kerberos.gif

Difference between revisions of "Projects/Responder"

From K5Wiki
Jump to: navigation, search
m (Projects/ResponseSet moved to Projects/Response set: Consistency with other wiki page names)
(No difference)

Revision as of 09:27, 4 September 2012

An announcement has been sent to krbdev@mit.edu starting a review of this project. That review will conclude on 2012-07-20.

Comments can be sent to krbdev@mit.edu.

This project is targeted at release 1.11.


Description

The response set mechanism is an alternative to the prompting interface for libkrb5 client preauth plugins.

Problem

The existing prompting interface permits client preauth plugins to ask questions of the user in order to resolve conflicts or ascertain data in order to properly process padata. Most commonly this is something akin to asking the user for a password. However, as time has progressed, user interfaces have moved from text based to graphical and the complexity of questions has increased. This results in a situation where the prompter interface is not the most efficient way to answer complex questions.

Further, the prompter interface requires linear interaction. If multiple questions are required, they have to be asked in serial. However, graphical interfaces present to option to answer multiple questions simultaneously.

The response set mechanism presents the consumer of libkrb5 with a full list of questions needing answers. The responder callback can consider the list and answer whichever questions it chooses to. Each named question is a binary contract between the preauth mechanism and the responder callback, allowing complex questions to be handled.

Proposal

libkrb5 will add a new callback to gic_opts:

typedef void *
(*krb5_response_set_get_item_fn)(krb5_context context, krb5_response_set *rset,
                                 const char *name);

typedef krb5_error_code
(*krb5_responder_fn)(krb5_context context, void *data, krb5_response_set *rset,
                     krb5_response_set_get_item_fn get_item);


krb5_error_code KRB5_CALLCONV
krb5_get_init_creds_opt_set_responder(krb5_context context,
                                      krb5_get_init_creds_opt *opt,
                                      krb5_responder_fn responder, void *data);

The response set is a name to value mapping, where the name is the unique name of some interface a clpreauth plugin wishes to expose to the consumer of libkrb5, and the (void *) value is a binary value to be altered by the consumer. The structure of the binary value should be detailed in a public header and used both inside the clpreauth plugin and by the responder.

The responder callback will be called after libkrb5 receives padata, but before the process() function of the clpreauth interface is called. The responder function will process some or all of the values contained in the response set.

In order to populate the response set, a new (optional) function will be added to the clpreauth interface:

typedef krb5_error_code
(*krb5_clpreauth_fill_rset_fn)(krb5_context context,
                               krb5_clpreauth_moddata moddata,
                               krb5_clpreauth_modreq modreq,
                               krb5_get_init_creds_opt *opt,
                               krb5_clpreauth_callbacks cb,
                               krb5_clpreauth_rock rock,
                               krb5_kdc_req *request,
                               krb5_data *encoded_request_body,
                               krb5_data *encoded_previous_request,
                               krb5_pa_data *pa_data);

This function will be called after receiving padata, but before the process() function is called. Its responsibility is to identify any decisions that need to be made and to expose these decisions via the krb5_response_set data structure.

Expected Behavior

All memory stored within the interface exposed via krb5_response_set should be allocated and freed by the clpreauth plugin. The plugin should anticipate that the responder may not process one or more of its exposed interfaces. The plugin may fall back to the prompter interface in that case.

Testing

In lib/krb5/krb, a new program t_response_set will exercise the internal response set manipulation functions.

Documentation

New API functions will have doxygen markup.

The new facility will be documented in init_creds.rst.

Release notes

Developer experience:

  • Add an optional responder callback to the krb5_get_init_creds functions. The responder callback can consider and answer all preauth-related questions at once, and can process more complicated questions than the prompter.
  • Add a method to the clpreauth interface to allow modules to supply response items for consideration by the responder callback.