krb5 commit: Set prompt type for OTP preauth prompt

Greg Hudson ghudson at mit.edu
Mon Jul 25 20:39:56 EDT 2016


https://github.com/krb5/krb5/commit/7d497a56279dcb59b6be9f8994257e76788d2e89
commit 7d497a56279dcb59b6be9f8994257e76788d2e89
Author: Greg Hudson <ghudson at mit.edu>
Date:   Mon Jul 25 13:23:31 2016 -0400

    Set prompt type for OTP preauth prompt
    
    Add k5_set_prompt_type() calls around the prompter invocation in
    preauth_otp.c, and add the comment we conventionally put before
    prompter invocations.
    
    ticket: 8464 (new)

 src/lib/krb5/krb/preauth_otp.c |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)

diff --git a/src/lib/krb5/krb/preauth_otp.c b/src/lib/krb5/krb/preauth_otp.c
index 3de528b..01c48b4 100644
--- a/src/lib/krb5/krb/preauth_otp.c
+++ b/src/lib/krb5/krb/preauth_otp.c
@@ -31,6 +31,7 @@
 #include "k5-int.h"
 #include "k5-json.h"
 #include "int-proto.h"
+#include "os-proto.h"
 
 #include <krb5/clpreauth_plugin.h>
 #include <ctype.h>
@@ -475,6 +476,7 @@ doprompt(krb5_context context, krb5_prompter_fct prompter, void *prompter_data,
     krb5_prompt prompt;
     krb5_data prompt_reply;
     krb5_error_code retval;
+    krb5_prompt_type prompt_type = KRB5_PROMPT_TYPE_PREAUTH;
 
     if (prompttxt == NULL || out == NULL)
         return EINVAL;
@@ -486,7 +488,10 @@ doprompt(krb5_context context, krb5_prompter_fct prompter, void *prompter_data,
     prompt.prompt = (char *)prompttxt;
     prompt.hidden = 1;
 
+    /* PROMPTER_INVOCATION */
+    k5_set_prompt_types(context, &prompt_type);
     retval = (*prompter)(context, prompter_data, NULL, banner, 1, &prompt);
+    k5_set_prompt_types(context, NULL);
     if (retval != 0)
         return retval;
 


More information about the cvs-krb5 mailing list