[BACK]Return to auth-skey.c CVS log [TXT][DIR] Up to [local] / src / usr.bin / ssh

Diff for /src/usr.bin/ssh/Attic/auth-skey.c between version 1.12.4.4 and 1.13

version 1.12.4.4, 2002/10/11 14:53:06 version 1.13, 2001/12/19 07:18:56
Line 30 
Line 30 
   
 #include "xmalloc.h"  #include "xmalloc.h"
 #include "auth.h"  #include "auth.h"
 #include "monitor_wrap.h"  
   
 static void *  static void *
 skey_init_ctx(Authctxt *authctxt)  skey_init_ctx(Authctxt *authctxt)
Line 38 
Line 37 
         return authctxt;          return authctxt;
 }  }
   
 int  #define PROMPT "\nS/Key Password: "
   
   static int
 skey_query(void *ctx, char **name, char **infotxt,  skey_query(void *ctx, char **name, char **infotxt,
     u_int* numprompts, char ***prompts, u_int **echo_on)      u_int* numprompts, char ***prompts, u_int **echo_on)
 {  {
Line 50 
Line 51 
         if (skeychallenge(&skey, authctxt->user, challenge) == -1)          if (skeychallenge(&skey, authctxt->user, challenge) == -1)
                 return -1;                  return -1;
   
         *name  = xstrdup("");          *name       = xstrdup("");
         *infotxt  = xstrdup("");          *infotxt    = xstrdup("");
         *numprompts = 1;          *numprompts = 1;
         *prompts = xmalloc(*numprompts * sizeof(char *));          *prompts = xmalloc(*numprompts * sizeof(char*));
         *echo_on = xmalloc(*numprompts * sizeof(u_int));          *echo_on = xmalloc(*numprompts * sizeof(u_int));
         (*echo_on)[0] = 0;          (*echo_on)[0] = 0;
   
         len = strlen(challenge) + strlen(SKEY_PROMPT) + 1;          len = strlen(challenge) + strlen(PROMPT) + 1;
         p = xmalloc(len);          p = xmalloc(len);
         strlcpy(p, challenge, len);          p[0] = '\0';
         strlcat(p, SKEY_PROMPT, len);          strlcat(p, challenge, len);
           strlcat(p, PROMPT, len);
         (*prompts)[0] = p;          (*prompts)[0] = p;
   
         return 0;          return 0;
 }  }
   
 int  static int
 skey_respond(void *ctx, u_int numresponses, char **responses)  skey_respond(void *ctx, u_int numresponses, char **responses)
 {  {
         Authctxt *authctxt = ctx;          Authctxt *authctxt = ctx;
Line 90 
Line 92 
         skey_init_ctx,          skey_init_ctx,
         skey_query,          skey_query,
         skey_respond,          skey_respond,
         skey_free_ctx  
 };  
   
 KbdintDevice mm_skey_device = {  
         "skey",  
         skey_init_ctx,  
         mm_skey_query,  
         mm_skey_respond,  
         skey_free_ctx          skey_free_ctx
 };  };
 #endif /* SKEY */  #endif /* SKEY */

Legend:
Removed from v.1.12.4.4  
changed lines
  Added in v.1.13