X-Git-Url: http://andersk.mit.edu/gitweb/openssh.git/blobdiff_plain/343288b87ad0bcea5272cd50b40f1adb8929c3bf..24a8705591ca37179d353fc7b155d8d8072bd1bb:/auth-skey.c diff --git a/auth-skey.c b/auth-skey.c index f9ea03fd..9c981ec8 100644 --- a/auth-skey.c +++ b/auth-skey.c @@ -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.20 2002/06/30 21:59:45 deraadt 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(""); *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; }