diff options
author | Dag-Erling Smørgrav <des@FreeBSD.org> | 2006-09-30 13:29:51 +0000 |
---|---|---|
committer | Dag-Erling Smørgrav <des@FreeBSD.org> | 2006-09-30 13:29:51 +0000 |
commit | 761efaa70c2ed8d35722b7bc234a46bf2457f876 (patch) | |
tree | bba6f2fe7855d7b0095f9dc7720dc27bea4d1fdf /crypto/openssh/auth-skey.c | |
parent | 30c2033ae748d441213eed2e5c3fae760cc8ea61 (diff) | |
download | src-test2-761efaa70c2ed8d35722b7bc234a46bf2457f876.tar.gz src-test2-761efaa70c2ed8d35722b7bc234a46bf2457f876.zip |
Notes
Diffstat (limited to 'crypto/openssh/auth-skey.c')
-rw-r--r-- | crypto/openssh/auth-skey.c | 27 |
1 files changed, 15 insertions, 12 deletions
diff --git a/crypto/openssh/auth-skey.c b/crypto/openssh/auth-skey.c index f676dbec9594..25073dbae0d8 100644 --- a/crypto/openssh/auth-skey.c +++ b/crypto/openssh/auth-skey.c @@ -1,3 +1,4 @@ +/* $OpenBSD: auth-skey.c,v 1.26 2006/08/05 08:28:24 dtucker Exp $ */ /* * Copyright (c) 2001 Markus Friedl. All rights reserved. * @@ -21,15 +22,23 @@ * (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" -RCSID("$OpenBSD: auth-skey.c,v 1.20 2002/06/30 21:59:45 deraadt Exp $"); #ifdef SKEY +#include <sys/types.h> + +#include <pwd.h> +#include <stdio.h> + #include <skey.h> #include "xmalloc.h" +#include "key.h" +#include "hostfile.h" #include "auth.h" +#include "ssh-gss.h" #include "monitor_wrap.h" static void * @@ -43,8 +52,7 @@ skey_query(void *ctx, char **name, char **infotxt, u_int* numprompts, char ***prompts, u_int **echo_on) { Authctxt *authctxt = ctx; - char challenge[1024], *p; - int len; + char challenge[1024]; struct skey skey; if (_compat_skeychallenge(&skey, authctxt->user, challenge, @@ -54,15 +62,10 @@ skey_query(void *ctx, char **name, char **infotxt, *name = xstrdup(""); *infotxt = xstrdup(""); *numprompts = 1; - *prompts = xmalloc(*numprompts * sizeof(char *)); - *echo_on = xmalloc(*numprompts * sizeof(u_int)); - (*echo_on)[0] = 0; - - len = strlen(challenge) + strlen(SKEY_PROMPT) + 1; - p = xmalloc(len); - strlcpy(p, challenge, len); - strlcat(p, SKEY_PROMPT, len); - (*prompts)[0] = p; + *prompts = xcalloc(*numprompts, sizeof(char *)); + *echo_on = xcalloc(*numprompts, sizeof(u_int)); + + xasprintf(*prompts, "%s%s", challenge, SKEY_PROMPT); return 0; } |