+2002-11-15 Ezra Peisach <epeisach@bu.edu>
+
+ * enc-proto.h, enc_des.c, encrypt.c: Unsigned/signed cleanups.
+
+ * forward.c: Include unistd.h if present on machine.
+
+ * misc-proto.h misc.c (auth_encrypt_user): Declare argument as
+ const.
+
+ * auth.c: Cast argument auth_encrypt_user. auth_gen_printsub() and
+ auth_printsub() take unsigned int as buffer length.
+
+ * auth.h, auth-proto.h, kerberos.c, kerberos5.c, spx.c:
+ auth_gen_printsub(), auth_printsub(), kerberos4_printsub(),
+ kerberos5_printsub(), spx_printsub() take unsigned int as length
+ argument.
+
+ * configure.in: Check for unistd.h
+
2002-08-29 Ken Raeburn <raeburn@mit.edu>
* Makefile.in: Revert $(S)=>/ change, for Windows support.
int auth_wait (char *);
int auth_must_encrypt (void);
void auth_disable_name (char *);
-void auth_gen_printsub (unsigned char *, int, unsigned char *, int);
+void auth_gen_printsub (unsigned char *, int, unsigned char *, unsigned int);
int getauthmask (char *, int *);
void auth_name (unsigned char *, int);
int auth_sendname (unsigned char *, int);
void auth_debug (int);
-void auth_printsub (unsigned char *, int, unsigned char *, int);
+void auth_printsub (unsigned char *, int, unsigned char *, unsigned int);
#ifdef KRB4
void kerberos4_is (Authenticator *, unsigned char *, int);
void kerberos4_reply (Authenticator *, unsigned char *, int);
int kerberos4_status (Authenticator *, char *, int);
-void kerberos4_printsub (unsigned char *, int, unsigned char *, int);
+void kerberos4_printsub (unsigned char *, int, unsigned char *, unsigned int);
#endif
#ifdef KRB5
void kerberos5_is (Authenticator *, unsigned char *, int);
void kerberos5_reply (Authenticator *, unsigned char *, int);
int kerberos5_status (Authenticator *, char *, int);
-void kerberos5_printsub (unsigned char *, int, unsigned char *, int);
+void kerberos5_printsub (unsigned char *, int, unsigned char *, unsigned int);
void kerberos5_cleanup (void);
#endif
#endif
savename[cnt] = '\0'; /* Null terminate */
if (auth_debug_mode)
printf(">>>%s: Got NAME [%s]\r\n", Name, savename);
- auth_encrypt_user(savename);
+ auth_encrypt_user((const char *)savename);
}
int
void
auth_printsub(data, cnt, buf, buflen)
unsigned char *data, *buf;
- int cnt, buflen;
+ int cnt;
+ unsigned int buflen;
{
Authenticator *ap;
void
auth_gen_printsub(data, cnt, buf, buflen)
unsigned char *data, *buf;
- int cnt, buflen;
+ int cnt;
+ unsigned int buflen;
{
register unsigned char *cp;
unsigned char tbuf[16];
void (*is) (struct XauthP *, unsigned char *, int);
void (*reply) (struct XauthP *, unsigned char *, int);
int (*status) (struct XauthP *, char *, int);
- void (*printsub) (unsigned char *, int, unsigned char *, int);
+ void (*printsub) (unsigned char *, int, unsigned char *, unsigned int);
} Authenticator;
#include "auth-proto.h"
AC_PROG_RANLIB
AC_REPLACE_FUNCS([strcasecmp strdup setsid strerror strftime getopt herror parsetos])
AC_CHECK_FUNCS(setenv unsetenv getenv gettosbyname cgetent)
-AC_CHECK_HEADERS(stdlib.h string.h)
+AC_CHECK_HEADERS(stdlib.h string.h unistd.h)
if test $ac_cv_func_setenv = no || test $ac_cv_func_unsetenv = no \
|| test $ac_cv_func_getenv = no; then
SETENVSRC=setenv.c
int EncryptStatus (void);
int EncryptVerbose (int);
void encrypt_send_support (void);
-void encrypt_send_keyid (int, unsigned char *, int, int);
+void encrypt_send_keyid (int, unsigned char *, unsigned int, int);
int net_write (unsigned char *, int);
void encrypt_gen_printsub (unsigned char *, int, unsigned char *, int);
void encrypt_printsub (unsigned char *, int, unsigned char *, int);
unsigned char *data, *buf;
int cnt, buflen;
{
- fb64_printsub(data, cnt, buf, buflen, "CFB64");
+ fb64_printsub(data, cnt, buf, buflen, (unsigned char *) "CFB64");
}
void
unsigned char *data, *buf;
int cnt, buflen;
{
- fb64_printsub(data, cnt, buf, buflen, "OFB64");
+ fb64_printsub(data, cnt, buf, buflen, (unsigned char *) "OFB64");
}
void
static unsigned char str_keyid[(MAXKEYLEN*2)+5] = { IAC, SB, TELOPT_ENCRYPT };
-static void encrypt_keyid (struct key_info *kp, unsigned char *, int);
+static void encrypt_keyid (struct key_info *kp, unsigned char *, unsigned int);
void encrypt_enc_keyid(keyid, len)
unsigned char *keyid;
int len;
{
- encrypt_keyid(&ki[1], keyid, len);
+ encrypt_keyid(&ki[1], keyid, (unsigned) len);
}
void encrypt_dec_keyid(keyid, len)
unsigned char *keyid;
int len;
{
- encrypt_keyid(&ki[0], keyid, len);
+ encrypt_keyid(&ki[0], keyid, (unsigned) len);
}
static void encrypt_keyid(kp, keyid, len)
struct key_info *kp;
unsigned char *keyid;
- int len;
+ unsigned int len;
{
Encryptions *ep;
int dir = kp->dir;
if (ep->keyid)
(void)(*ep->keyid)(dir, kp->keyid, &kp->keylen);
- } else if ((len != kp->keylen) || (memcmp(keyid, kp->keyid, len) != 0)) {
+ } else if ((len != kp->keylen) ||
+ (memcmp(keyid, kp->keyid, len) != 0)) {
/*
* Length or contents are different
*/
return;
}
- encrypt_send_keyid(dir, kp->keyid, kp->keylen, 0);
+ encrypt_send_keyid(dir, kp->keyid, (unsigned) kp->keylen, 0);
}
void
encrypt_send_keyid(dir, keyid, keylen, saveit)
int dir;
unsigned char *keyid;
- int keylen;
+ unsigned int keylen;
int saveit;
{
unsigned char *strp;
#if defined(KERBEROS) || defined(KRB5)
#include <stdio.h>
#include <netdb.h>
+#ifdef HAVE_UNISTD_H
+#include <unistd.h>
+#endif
#include "krb5.h"
#include <errno.h>
}
char dst_realm_buf[REALM_SZ], *dest_realm = NULL;
-int dst_realm_sz = REALM_SZ;
+unsigned int dst_realm_sz = REALM_SZ;
int
kerberos4_send(ap)
void
kerberos4_printsub(data, cnt, buf, buflen)
unsigned char *data, *buf;
- int cnt, buflen;
+ int cnt;
+ unsigned int buflen;
{
char lbuf[32];
register int i;
return(0);
}
- if (!auth_sendname(UserNameRequested, strlen(UserNameRequested))) {
+ if (!auth_sendname((unsigned char *) UserNameRequested,
+ (int) strlen(UserNameRequested))) {
if (auth_debug_mode)
printf("telnet: Not enough room for user name\r\n");
return(0);
void
kerberos5_printsub(data, cnt, buf, buflen)
unsigned char *data, *buf;
- int cnt, buflen;
+ int cnt;
+ unsigned int buflen;
{
char lbuf[32];
register int i;
#define __MISC_PROTO__
void auth_encrypt_init (char *, char *, char *, int);
-void auth_encrypt_user (char *);
+void auth_encrypt_user (const char *);
void auth_encrypt_connect (int);
void printd (const unsigned char *, int);
void
auth_encrypt_user(name)
- char *name;
+ const char *name;
{
extern char *strdup();
extern char **environ;
static int alloced; /* if allocated space before */
register char *c;
+ const char *c2;
int l_value, offset;
if (*value == '=') /* no `=' in value */
environ[cnt + 1] = NULL;
offset = cnt;
}
- for (c = (char *)name; *c && *c != '='; ++c); /* no `=' in name */
+ for (c2 = name; *c2 && *c2 != '='; ++c2); /* no `=' in name */
if (!(environ[offset] = /* name + `=' + value */
- malloc((size_t)((int)(c - name) + l_value + 2))))
+ malloc((size_t)((int)(c2 - name) + l_value + 2))))
return (-1);
for (c = environ[offset]; (*c = *name++) && *c != '='; ++c);
for (*c++ = '='; (*c++ = *value++););
int *offset;
{
extern char **environ;
- register int len;
+ register unsigned int len;
register const char *np;
register char **p, *c;
void
spx_printsub(data, cnt, buf, buflen)
unsigned char *data, *buf;
- int cnt, buflen;
+ int cnt;
+ unsigned int buflen;
{
char lbuf[32];
register int i;