[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.20 and 1.20.16.1

version 1.20, 2002/06/30 21:59:45 version 1.20.16.1, 2006/09/30 04:06:50
Line 1 
Line 1 
   /* $OpenBSD$ */
 /*  /*
  * Copyright (c) 2001 Markus Friedl.  All rights reserved.   * Copyright (c) 2001 Markus Friedl.  All rights reserved.
  *   *
Line 21 
Line 22 
  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF   * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
  * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.   * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */   */
 #include "includes.h"  
 RCSID("$OpenBSD$");  
   
 #ifdef SKEY  #ifdef SKEY
   
   #include <sys/types.h>
   
   #include <pwd.h>
   #include <stdio.h>
   
 #include <skey.h>  #include <skey.h>
   
 #include "xmalloc.h"  #include "xmalloc.h"
   #include "key.h"
   #include "hostfile.h"
 #include "auth.h"  #include "auth.h"
 #include "monitor_wrap.h"  #include "monitor_wrap.h"
   
Line 43 
Line 49 
     u_int* numprompts, char ***prompts, u_int **echo_on)      u_int* numprompts, char ***prompts, u_int **echo_on)
 {  {
         Authctxt *authctxt = ctx;          Authctxt *authctxt = ctx;
         char challenge[1024], *p;          char challenge[1024];
         int len;  
         struct skey skey;          struct skey skey;
   
         if (skeychallenge(&skey, authctxt->user, challenge) == -1)          if (skeychallenge(&skey, authctxt->user, challenge) == -1)
Line 53 
Line 58 
         *name  = xstrdup("");          *name  = xstrdup("");
         *infotxt  = xstrdup("");          *infotxt  = xstrdup("");
         *numprompts = 1;          *numprompts = 1;
         *prompts = xmalloc(*numprompts * sizeof(char *));          *prompts = xcalloc(*numprompts, sizeof(char *));
         *echo_on = xmalloc(*numprompts * sizeof(u_int));          *echo_on = xcalloc(*numprompts, sizeof(u_int));
         (*echo_on)[0] = 0;  
   
         len = strlen(challenge) + strlen(SKEY_PROMPT) + 1;          xasprintf(*prompts, "%s%s", challenge, SKEY_PROMPT);
         p = xmalloc(len);  
         strlcpy(p, challenge, len);  
         strlcat(p, SKEY_PROMPT, len);  
         (*prompts)[0] = p;  
   
         return 0;          return 0;
 }  }

Legend:
Removed from v.1.20  
changed lines
  Added in v.1.20.16.1