]> andersk Git - openssh.git/blobdiff - auth-skey.c
- stevesk@cvs.openbsd.org 2006/07/26 13:57:17
[openssh.git] / auth-skey.c
index b64550443c7620067625a1466e158d7d154e57d5..9c981ec838018ce3c4ab7099321b706f9526e5dd 100644 (file)
@@ -1,3 +1,4 @@
+/* $OpenBSD: auth-skey.c,v 1.23 2006/03/25 13:17:01 djm Exp $ */
 /*
  * Copyright (c) 2001 Markus Friedl.  All rights reserved.
  *
@@ -22,7 +23,6 @@
  * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 #include "includes.h"
-RCSID("$OpenBSD: auth-skey.c,v 1.18 2002/05/13 02:37:39 itojun Exp $");
 
 #ifdef SKEY
 
@@ -47,21 +47,17 @@ skey_query(void *ctx, char **name, char **infotxt,
        int len;
        struct skey skey;
 
-       if (skeychallenge(&skey, authctxt->user, challenge) == -1)
+       if (_compat_skeychallenge(&skey, authctxt->user, challenge,
+           sizeof(challenge)) == -1)
                return -1;
 
-       *name       = xstrdup("");
-       *infotxt    = xstrdup("");
+       *name  = xstrdup("");
+       *infotxt  = xstrdup("");
        *numprompts = 1;
-       *prompts = xmalloc(*numprompts * sizeof(char*));
-       *echo_on = xmalloc(*numprompts * sizeof(u_int));
-       (*echo_on)[0] = 0;
+       *prompts = xcalloc(*numprompts, sizeof(char *));
+       *echo_on = xcalloc(*numprompts, sizeof(u_int));
 
-       len = strlen(challenge) + strlen(SKEY_PROMPT) + 1;
-       p = xmalloc(len);
-       strlcpy(p, challenge, len);
-       strlcat(p, SKEY_PROMPT, len);
-       (*prompts)[0] = p;
+       xasprintf(*prompts, "%s%s", challenge, SKEY_PROMPT);
 
        return 0;
 }
This page took 0.031195 seconds and 4 git commands to generate.