From fa8aa6dfe7e9aaab9f8fa1e3290e7242fc12d83d Mon Sep 17 00:00:00 2001 From: des Date: Sun, 23 Jun 2002 16:09:08 +0000 Subject: Resolve conflicts. Known issues: - sshd fails to set TERM correctly. - privilege separation may break PAM and is currently turned off. - man pages have not yet been updated I will have these issues resolved, and privilege separation turned on by default, in time for DP2. Sponsored by: DARPA, NAI Labs --- crypto/openssh/auth-skey.c | 25 ++++++++++++++++--------- 1 file changed, 16 insertions(+), 9 deletions(-) (limited to 'crypto/openssh/auth-skey.c') diff --git a/crypto/openssh/auth-skey.c b/crypto/openssh/auth-skey.c index b538b39..18243ee 100644 --- a/crypto/openssh/auth-skey.c +++ b/crypto/openssh/auth-skey.c @@ -22,7 +22,7 @@ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ #include "includes.h" -RCSID("$OpenBSD: auth-skey.c,v 1.16 2002/01/12 13:10:29 markus Exp $"); +RCSID("$OpenBSD: auth-skey.c,v 1.19 2002/06/19 00:27:55 deraadt Exp $"); RCSID("$FreeBSD$"); #ifdef SKEY @@ -31,6 +31,7 @@ RCSID("$FreeBSD$"); #include "xmalloc.h" #include "auth.h" +#include "monitor_wrap.h" static void * skey_init_ctx(Authctxt *authctxt) @@ -38,9 +39,7 @@ skey_init_ctx(Authctxt *authctxt) return authctxt; } -#define PROMPT "\nOPIE Password: " - -static int +int skey_query(void *ctx, char **name, char **infotxt, u_int* numprompts, char ***prompts, u_int **echo_on) { @@ -54,23 +53,23 @@ skey_query(void *ctx, char **name, char **infotxt, if (opiechallenge(&opie, authctxt->user, 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; - len = strlen(challenge) + strlen(PROMPT) + 1; + len = strlen(challenge) + strlen(SKEY_PROMPT) + 1; p = xmalloc(len); strlcpy(p, challenge, len); - strlcat(p, PROMPT, len); + strlcat(p, SKEY_PROMPT, len); (*prompts)[0] = p; return 0; } -static int +int skey_respond(void *ctx, u_int numresponses, char **responses) { Authctxt *authctxt = ctx; @@ -96,4 +95,12 @@ KbdintDevice skey_device = { skey_respond, skey_free_ctx }; + +KbdintDevice mm_skey_device = { + "skey", + skey_init_ctx, + mm_skey_query, + mm_skey_respond, + skey_free_ctx +}; #endif /* SKEY */ -- cgit v1.1