=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/ssh/Attic/auth-skey.c,v retrieving revision 1.20.14.1 retrieving revision 1.21 diff -u -r1.20.14.1 -r1.21 --- src/usr.bin/ssh/Attic/auth-skey.c 2006/10/06 03:19:32 1.20.14.1 +++ src/usr.bin/ssh/Attic/auth-skey.c 2006/03/19 18:51:18 1.21 @@ -1,4 +1,3 @@ -/* $OpenBSD: auth-skey.c,v 1.20.14.1 2006/10/06 03:19:32 brad Exp $ */ /* * Copyright (c) 2001 Markus Friedl. All rights reserved. * @@ -22,19 +21,13 @@ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ +#include "includes.h" #ifdef SKEY -#include - -#include -#include - #include #include "xmalloc.h" -#include "key.h" -#include "hostfile.h" #include "auth.h" #include "monitor_wrap.h" @@ -49,7 +42,8 @@ u_int* numprompts, char ***prompts, u_int **echo_on) { Authctxt *authctxt = ctx; - char challenge[1024]; + char challenge[1024], *p; + int len; struct skey skey; if (skeychallenge(&skey, authctxt->user, challenge) == -1) @@ -58,10 +52,15 @@ *name = xstrdup(""); *infotxt = xstrdup(""); *numprompts = 1; - *prompts = xcalloc(*numprompts, sizeof(char *)); - *echo_on = xcalloc(*numprompts, sizeof(u_int)); + *prompts = xmalloc(*numprompts * sizeof(char *)); + *echo_on = xmalloc(*numprompts * sizeof(u_int)); + (*echo_on)[0] = 0; - xasprintf(*prompts, "%s%s", challenge, SKEY_PROMPT); + len = strlen(challenge) + strlen(SKEY_PROMPT) + 1; + p = xmalloc(len); + strlcpy(p, challenge, len); + strlcat(p, SKEY_PROMPT, len); + (*prompts)[0] = p; return 0; }