summaryrefslogtreecommitdiffstats
path: root/crypto/openssh/auth-skey.c
diff options
context:
space:
mode:
authordes <des@FreeBSD.org>2006-09-30 13:38:06 +0000
committerdes <des@FreeBSD.org>2006-09-30 13:38:06 +0000
commit4ff234ef46a16b6174dfb970b7bbc9fe2baf3e1a (patch)
treee8ca9ffe5bcb164be41a74f30a765b86bb38c885 /crypto/openssh/auth-skey.c
parent1a954502d4f34f44a7b1d861ea2dadc117ca6a64 (diff)
downloadFreeBSD-src-4ff234ef46a16b6174dfb970b7bbc9fe2baf3e1a.zip
FreeBSD-src-4ff234ef46a16b6174dfb970b7bbc9fe2baf3e1a.tar.gz
Merge conflicts.
MFC after: 1 week
Diffstat (limited to 'crypto/openssh/auth-skey.c')
-rw-r--r--crypto/openssh/auth-skey.c29
1 files changed, 16 insertions, 13 deletions
diff --git a/crypto/openssh/auth-skey.c b/crypto/openssh/auth-skey.c
index c37eba5..426b052 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,12 +22,17 @@
* (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 $");
-RCSID("$FreeBSD$");
+__RCSID("$FreeBSD$");
#ifdef SKEY
+#include <sys/types.h>
+
+#include <pwd.h>
+#include <stdio.h>
+
#ifdef OPIE
#include <opie.h>
#define skey opie
@@ -38,7 +44,10 @@ RCSID("$FreeBSD$");
#endif
#include "xmalloc.h"
+#include "key.h"
+#include "hostfile.h"
#include "auth.h"
+#include "ssh-gss.h"
#include "monitor_wrap.h"
static void *
@@ -52,8 +61,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,
@@ -63,15 +71,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;
}
OpenPOWER on IntegriCloud