krb5 commit [krb5-1.11]: Alter responder function signature for consistency

Tom Yu tlyu at MIT.EDU
Tue Oct 30 11:25:39 EDT 2012


https://github.com/krb5/krb5/commit/31fbc2f0afaca005c5787201f0c86b2fcd9fbf9f
commit 31fbc2f0afaca005c5787201f0c86b2fcd9fbf9f
Author: Greg Hudson <ghudson at mit.edu>
Date:   Tue Oct 23 13:16:44 2012 -0400

    Alter responder function signature for consistency
    
    For the responder callback signature, put the closure argument just
    after the context, and use KRB5_CALLCONV.  These changes make the
    signature consistent with most other libkrb5 callbacks.
    
    (cherry picked from commit 8450ead695639f09862fdcecd46530b1d1b59bfe)
    
    ticket: 7419
    version_fixed: 1.11
    status: resolved

 src/include/krb5/krb5.hin   |    6 +++---
 src/lib/krb5/krb/preauth2.c |    4 ++--
 2 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/src/include/krb5/krb5.hin b/src/include/krb5/krb5.hin
index 6a4f995..1db6474 100644
--- a/src/include/krb5/krb5.hin
+++ b/src/include/krb5/krb5.hin
@@ -6479,8 +6479,8 @@ krb5_responder_set_answer(krb5_context ctx, krb5_responder_context rctx,
  * Responder function for an initial credential exchange.
  *
  * @param [in] ctx              Library context
- * @param [in] rctx             Responder context
  * @param [in] data             Callback data
+ * @param [in] rctx             Responder context
  *
  * A responder function is like a prompter function, but is used for handling
  * questions and answers as potentially complex data types.  Client
@@ -6496,8 +6496,8 @@ krb5_responder_set_answer(krb5_context ctx, krb5_responder_context rctx,
  * If a required question is unanswered, the prompter may be called.
  */
 typedef krb5_error_code
-(*krb5_responder_fn)(krb5_context ctx, krb5_responder_context rctx,
-                     void *data);
+(KRB5_CALLCONV *krb5_responder_fn)(krb5_context ctx, void *data,
+                                   krb5_responder_context rctx);
 
 typedef struct _krb5_responder_otp_tokeninfo {
     krb5_flags flags;
diff --git a/src/lib/krb5/krb/preauth2.c b/src/lib/krb5/krb/preauth2.c
index 9ce82d5..b900ce4 100644
--- a/src/lib/krb5/krb/preauth2.c
+++ b/src/lib/krb5/krb/preauth2.c
@@ -1006,8 +1006,8 @@ krb5_do_preauth(krb5_context context, krb5_kdc_req *request,
 
     /* Call the responder to answer response items. */
     if (responder != NULL && !k5_response_items_empty(rock->rctx.items)) {
-        ret = (*responder)(context, &rock->rctx,
-                           opte->opt_private->responder_data);
+        ret = (*responder)(context, opte->opt_private->responder_data,
+                           &rock->rctx);
         if (ret)
             goto error;
     }


More information about the cvs-krb5 mailing list