summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDarren Tucker <dtucker@zip.com.au>2004-04-14 17:24:30 +1000
committerDarren Tucker <dtucker@zip.com.au>2004-04-14 17:24:30 +1000
commit06a8cfe796bc9afb8bdd9127f348139ec68809fd (patch)
treecacace28ddb2b3e2611bdaed86e60a581cd6ff28
parent3b908f65b4b668d20ef0d20c695cb053829bdaef (diff)
- (dtucker) [auth-skey.c defines.h monitor.c] Make skeychallenge explicitly
4-arg, with compatibility for 3-arg versions. From djm@, ok me.
-rw-r--r--ChangeLog4
-rw-r--r--auth-skey.c3
-rw-r--r--defines.h13
-rw-r--r--monitor.c3
4 files changed, 14 insertions, 9 deletions
diff --git a/ChangeLog b/ChangeLog
index 409c9bae5..d8cab5caa 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -3,6 +3,8 @@
3 from bug #701 (text from jfh at cise.ufl.edu). 3 from bug #701 (text from jfh at cise.ufl.edu).
4 - (dtucker) [acconfig.h configure.ac defines.h] Bug #673: check for 4-arg 4 - (dtucker) [acconfig.h configure.ac defines.h] Bug #673: check for 4-arg
5 skeychallenge(), eg on NetBSD. ok mouring@ 5 skeychallenge(), eg on NetBSD. ok mouring@
6 - (dtucker) [auth-skey.c defines.h monitor.c] Make skeychallenge explicitly
7 4-arg, with compatibility for 3-arg versions. From djm@, ok me.
6 8
720040408 920040408
8 - (dtucker) [loginrec.c] Use UT_LINESIZE if available, prevents truncating 10 - (dtucker) [loginrec.c] Use UT_LINESIZE if available, prevents truncating
@@ -963,4 +965,4 @@
963 - (djm) Trim deprecated options from INSTALL. Mention UsePAM 965 - (djm) Trim deprecated options from INSTALL. Mention UsePAM
964 - (djm) Fix quote handling in sftp; Patch from admorten AT umich.edu 966 - (djm) Fix quote handling in sftp; Patch from admorten AT umich.edu
965 967
966$Id: ChangeLog,v 1.3309 2004/04/14 05:26:39 dtucker Exp $ 968$Id: ChangeLog,v 1.3310 2004/04/14 07:24:30 dtucker Exp $
diff --git a/auth-skey.c b/auth-skey.c
index f9ea03fd1..ac1af69ed 100644
--- a/auth-skey.c
+++ b/auth-skey.c
@@ -47,7 +47,8 @@ skey_query(void *ctx, char **name, char **infotxt,
47 int len; 47 int len;
48 struct skey skey; 48 struct skey skey;
49 49
50 if (skeychallenge(&skey, authctxt->user, challenge) == -1) 50 if (_compat_skeychallenge(&skey, authctxt->user, challenge,
51 sizeof(challenge)) == -1)
51 return -1; 52 return -1;
52 53
53 *name = xstrdup(""); 54 *name = xstrdup("");
diff --git a/defines.h b/defines.h
index f52dfd256..9b72afecb 100644
--- a/defines.h
+++ b/defines.h
@@ -25,7 +25,7 @@
25#ifndef _DEFINES_H 25#ifndef _DEFINES_H
26#define _DEFINES_H 26#define _DEFINES_H
27 27
28/* $Id: defines.h,v 1.114 2004/04/14 05:26:39 dtucker Exp $ */ 28/* $Id: defines.h,v 1.115 2004/04/14 07:24:30 dtucker Exp $ */
29 29
30 30
31/* Constants */ 31/* Constants */
@@ -538,6 +538,12 @@ struct winsize {
538# define krb5_get_err_text(context,code) error_message(code) 538# define krb5_get_err_text(context,code) error_message(code)
539#endif 539#endif
540 540
541#if defined(SKEYCHALLENGE_4ARG)
542# define _compat_skeychallenge(a,b,c,d) skeychallenge(a,b,c,d)
543#else
544# define _compat_skeychallenge(a,b,c,d) skeychallenge(a,b,c)
545#endif
546
541/* Maximum number of file descriptors available */ 547/* Maximum number of file descriptors available */
542#ifdef HAVE_SYSCONF 548#ifdef HAVE_SYSCONF
543# define SSH_SYSFDMAX sysconf(_SC_OPEN_MAX) 549# define SSH_SYSFDMAX sysconf(_SC_OPEN_MAX)
@@ -546,11 +552,6 @@ struct winsize {
546#endif 552#endif
547 553
548 554
549/* Some platforms, eg NetBSD, have a 4th argument for skeychallenge() */
550#ifdef SKEYCHALLENGE_4ARG
551# define skeychallenge(a,b,c) skeychallenge((a), (b), (c), (sizeof(c)))
552#endif
553
554/* 555/*
555 * Define this to use pipes instead of socketpairs for communicating with the 556 * Define this to use pipes instead of socketpairs for communicating with the
556 * client program. Socketpairs do not seem to work on all systems. 557 * client program. Socketpairs do not seem to work on all systems.
diff --git a/monitor.c b/monitor.c
index 37d40fcca..9c30c1c39 100644
--- a/monitor.c
+++ b/monitor.c
@@ -744,7 +744,8 @@ mm_answer_skeyquery(int socket, Buffer *m)
744 char challenge[1024]; 744 char challenge[1024];
745 u_int success; 745 u_int success;
746 746
747 success = skeychallenge(&skey, authctxt->user, challenge) < 0 ? 0 : 1; 747 success = _compat_skeychallenge(&skey, authctxt->user, challenge,
748 sizeof(challenge)) < 0 ? 0 : 1;
748 749
749 buffer_clear(m); 750 buffer_clear(m);
750 buffer_put_int(m, success); 751 buffer_put_int(m, success);