auth_disable(), auth_onoff(), auth_togdebug(), auth_status(),
auth_name(), auth_sendname(), auth_debug(), and auth_printsub().
* auth.c: Include unistd.h and cleanup some assignments in
conditionals.
* auth.h: Explicitly declare auth_debug mode as an int.
* enc-proto.h: Add prototypes for EncryptDisable(), EncryptType(),
EncryptStart(), EncryptStartInput(), EncryptStartOutput(),
EncryptStop(), EncryptStopInput(), EncryptStopOutput(),
EncryptStatus(), encrypt_gen_printsub(), printsub().
* enc_des.c: Declare encrypt_debug_mode as int. Cleanup unused
variables and assignments in conditionals.
* encrypt.c: Include stdio.h for sprintf prototype. Cleanup
assignments in conditionals.
* getent.c: Conditionalize definition of some variables.
* kerberos5.c: Explicitly declare auth_debug_mode an int.
* misc-proto.h: Add prototype for auth_encrypt_user().
* misc.c: Include auth.h and encrypt.h for prototypes.
* misc.h: Add prototypes for isprfix(), genget(), Ambiguous().
* parsetos.c: Include stdlib.h for strtol() prototype.
* forward.c, kerberos.c, setenv.c: Assignment in conditional cleanup.
git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@13280
dc483132-0cff-0310-8789-
dd5450dbe970
+2001-06-06 Ezra Peisach <epeisach@rna.mit.edu>
+
+ * auth-proto.h: Add prototypes for getauthmask(), auth_enable,
+ auth_disable(), auth_onoff(), auth_togdebug(), auth_status(),
+ auth_name(), auth_sendname(), auth_debug(), and auth_printsub().
+
+ * auth.c: Include unistd.h and cleanup some assignments in
+ conditionals.
+
+ * auth.h: Explicitly declare auth_debug mode as an int.
+
+ * enc-proto.h: Add prototypes for EncryptDisable(), EncryptType(),
+ EncryptStart(), EncryptStartInput(), EncryptStartOutput(),
+ EncryptStop(), EncryptStopInput(), EncryptStopOutput(),
+ EncryptStatus(), encrypt_gen_printsub(), printsub().
+
+ * enc_des.c: Declare encrypt_debug_mode as int. Cleanup unused
+ variables and assignments in conditionals.
+
+ * encrypt.c: Include stdio.h for sprintf prototype. Cleanup
+ assignments in conditionals.
+
+ * getent.c: Conditionalize definition of some variables.
+
+ * kerberos5.c: Explicitly declare auth_debug_mode an int.
+
+ * misc-proto.h: Add prototype for auth_encrypt_user().
+
+ * misc.c: Include auth.h and encrypt.h for prototypes.
+
+ * misc.h: Add prototypes for isprfix(), genget(), Ambiguous().
+
+ * parsetos.c: Include stdlib.h for strtol() prototype.
+
+ * forward.c, kerberos.c, setenv.c: Assignment in conditional cleanup.
+
2001-04-03 Tom Yu <tlyu@mit.edu>
* configure.in: Check for setenv, unsetenv, and getenv. Compile
void auth_disable_name P((char *));
void auth_gen_printsub P((unsigned char *, int, unsigned char *, int));
+
+int getauthmask P((char *, int *));
+int auth_enable P((char *));
+int auth_disable P((char *));
+int auth_onoff P((char *, int));
+int auth_togdebug P((int));
+int auth_status P((void));
+void auth_name P((unsigned char *, int));
+int auth_sendname P((unsigned char *, int));
+void auth_debug P((int));
+void auth_printsub P((unsigned char *, int, unsigned char *, int));
+
+
#ifdef KRB4
int kerberos4_init P((Authenticator *, int));
int kerberos4_send P((Authenticator *));
#include <arpa/telnet.h>
#ifdef __STDC__
#include <stdlib.h>
+#include <unistd.h>
#endif
#ifdef HAVE_STRING_H
#include <string.h>
return;
}
- if (ap = findauthenticator(data[0], data[1])) {
+ if ((ap = findauthenticator(data[0], data[1]))) {
if (ap->is)
(*ap->is)(ap, data+2, cnt-2);
} else if (auth_debug_mode)
if (cnt < 2)
return;
- if (ap = findauthenticator(data[0], data[1])) {
+ if ((ap = findauthenticator(data[0], data[1]))) {
if (ap->reply)
(*ap->reply)(ap, data+2, cnt-2);
} else if (auth_debug_mode)
#define OPTS_FORWARD_CREDS 0x00000002
#define OPTS_FORWARDABLE_CREDS 0x00000001
-extern auth_debug_mode;
+extern int auth_debug_mode;
#endif
void encrypt_send_end P((void));
void encrypt_wait P((void));
int encrypt_is_encrypting P((void));
+int EncryptEnable P((char *, char *));
+int EncryptDisable P((char *, char *));
+int EncryptType P((char *, char *));
+int EncryptStart P((char *));
+int EncryptStartInput P((void));
+int EncryptStartOutput P((void));
+int EncryptStop P((char *));
+int EncryptStopInput P((void));
+int EncryptStopOutput P((void));
+int EncryptStatus P((void));
void encrypt_send_support P((void));
void encrypt_send_keyid P((int, unsigned char *, int, int));
int net_write P((unsigned char *, int));
+void encrypt_gen_printsub P((unsigned char *, int, unsigned char *, int));
#ifdef TELENTD
void encrypt_wait P((void));
#else
+void printsub P((int, unsigned char *, int));
int encrypt_cmd P((int, char **));
void encrypt_display P((void));
#endif
#include "key-proto.h"
#include "misc-proto.h"
-extern encrypt_debug_mode;
+extern int encrypt_debug_mode;
extern krb5_context telnet_context;
int dir;
int server;
{
- Block b;
int x;
unsigned char *p;
register int state;
d.data = fbp->temp_feed;
d.length = sizeof(fbp->temp_feed);
- if (code = krb5_c_random_make_octets(telnet_context,
- &d))
+ if ((code = krb5_c_random_make_octets(telnet_context,
+ &d)))
return(FAILED);
}
int cnt;
struct fb *fbp;
{
- int x;
unsigned char *p;
- Block b;
register int state = fbp->state[DIR_DECRYPT-1];
if (cnt-- < 1)
int cnt;
struct fb *fbp;
{
- int x;
- unsigned char *p;
- Block b;
register int state = fbp->state[DIR_ENCRYPT-1];
if (cnt-- < 1)
#ifdef ENCRYPTION
+#include <stdio.h>
#define ENCRYPT_NAMES
#include <arpa/telnet.h>
if (isprefix(type, "help") || isprefix(type, "?")) {
printf("Usage: encrypt disable <type> [input|output]\n");
encrypt_list_types();
- } else if ((ep = (Encryptions *)genget(type, encryptions,
+ } else if ((ep = (Encryptions *)genget(type, (char **) encryptions,
sizeof(Encryptions))) == 0) {
printf("%s: invalid encryption type\n", type);
} else if (Ambiguous(ep)) {
if (isprefix(type, "help") || isprefix(type, "?")) {
printf("Usage: encrypt type <type> [input|output]\n");
encrypt_list_types();
- } else if ((ep = (Encryptions *)genget(type, encryptions,
+ } else if ((ep = (Encryptions *)genget(type, (char **) encryptions,
sizeof(Encryptions))) == 0) {
printf("%s: invalid encryption type\n", type);
} else if (Ambiguous(ep)) {
return;
}
- if (ep = finddecryption(decrypt_mode)) {
+ if ((ep = finddecryption(decrypt_mode))) {
decrypt_input = ep->input;
if (encrypt_verbose)
printf("[ Input is now decrypted with type %s ]\r\n",
krb5_error_code retval;
char ccname[35];
krb5_ccache ccache = NULL;
- char *tty;
- if (retval = krb5_rd_cred(context, auth_context, inbuf, &creds, NULL))
+ if ((retval = krb5_rd_cred(context, auth_context, inbuf, &creds, NULL)))
return(retval);
- sprintf(ccname, "FILE:/tmp/krb5cc_p%d", getpid());
+ sprintf(ccname, "FILE:/tmp/krb5cc_p%ld", (long) getpid());
setenv(KRB5_ENV_CCNAME, ccname, 1);
- if (retval = krb5_cc_resolve(context, ccname, &ccache))
+ if ((retval = krb5_cc_resolve(context, ccname, &ccache)))
goto cleanup;
- if (retval = krb5_cc_initialize(context, ccache, ticket->enc_part2->client))
+ if ((retval = krb5_cc_initialize(context, ccache,
+ ticket->enc_part2->client)))
goto cleanup;
- if (retval = krb5_cc_store_cred(context, ccache, *creds))
+ if ((retval = krb5_cc_store_cred(context, ccache, *creds)))
goto cleanup;
cleanup:
/* based on @(#)getent.c 8.1 (Berkeley) 6/4/93 */
+#ifdef HAVE_CGETENT
static char *area;
+#endif
/*ARGSUSED*/
+int
getent(cp, name)
char *cp, *name;
{
#include "auth.h"
#include "misc.h"
-extern auth_debug_mode;
+extern int auth_debug_mode;
extern krb5_context telnet_context;
+int kerberos4_cksum P((unsigned char *, int));
+
static unsigned char str_data[1024] = { IAC, SB, TELOPT_AUTHENTICATION, 0,
AUTHTYPE_KERBEROS_V4, };
+#if 0
static unsigned char str_name[1024] = { IAC, SB, TELOPT_AUTHENTICATION,
TELQUAL_NAME, };
+#endif
#define KRB_AUTH 0 /* Authentication data follows */
#define KRB_REJECT 1 /* Rejected (reason might follow) */
static AUTH_DAT adat = { 0 };
#ifdef ENCRYPTION
static Block session_key = { 0 };
-static Schedule sched;
static krb5_keyblock krbkey;
static Block challenge = { 0 };
#endif /* ENCRYPTION */
memset(instance, 0, sizeof(instance));
- if (realm = krb_get_phost(RemoteHostName))
+ if ((realm = krb_get_phost(RemoteHostName)))
strncpy(instance, realm, sizeof(instance));
instance[sizeof(instance)-1] = '\0';
printf("Kerberos V4: no realm for %s\r\n", RemoteHostName);
return(0);
}
- if (r = krb_mk_req(&auth, KRB_SERVICE_NAME, instance, realm, 0)) {
+ if ((r = krb_mk_req(&auth, KRB_SERVICE_NAME, instance, realm, 0))) {
printf("mk_req failed: %s\r\n", krb_err_txt[r]);
return(0);
}
- if (r = krb_get_cred(KRB_SERVICE_NAME, instance, realm, &cred)) {
+ if ((r = krb_get_cred(KRB_SERVICE_NAME, instance, realm, &cred))) {
printf("get_cred failed: %s\r\n", krb_err_txt[r]);
return(0);
}
data.data = cred.session;
data.length = 8; /* sizeof(cred.session) */;
- if (code = krb5_c_random_seed(telnet_context, &data)) {
+ if ((code = krb5_c_random_seed(telnet_context, &data))) {
com_err("libtelnet", code,
"while seeding random number generator");
return(0);
}
- if (code = krb5_c_make_random_key(telnet_context,
- ENCTYPE_DES_CBC_RAW,
- &random_key)) {
+ if ((code = krb5_c_make_random_key(telnet_context,
+ ENCTYPE_DES_CBC_RAW,
+ &random_key))) {
com_err("libtelnet", code,
"while creating random session key");
return(0);
encdata.ciphertext.length = 8;
encdata.enctype = ENCTYPE_UNKNOWN;
- if (code = krb5_c_encrypt(telnet_context, &krbkey, 0, 0, &data,
- &encdata)) {
+ if ((code = krb5_c_encrypt(telnet_context, &krbkey, 0, 0,
+ &data, &encdata))) {
com_err("libtelnet", code, "while encrypting random key");
return(0);
}
printf("\r\n");
}
instance[0] = '*'; instance[1] = 0;
- if (r = krb_rd_req(&auth, KRB_SERVICE_NAME,
- instance, 0, &adat, "")) {
+ if ((r = krb_rd_req(&auth, KRB_SERVICE_NAME,
+ instance, 0, &adat, ""))) {
if (auth_debug_mode)
printf("Kerberos failed him as %s\r\n", name);
Data(ap, KRB_REJECT, (void *)krb_err_txt[r], -1);
kdata.data = session_key;
kdata.length = 8;
- if (code = krb5_c_random_seed(telnet_context, &kdata)) {
+ if ((code = krb5_c_random_seed(telnet_context, &kdata))) {
com_err("libtelnet", code,
"while seeding random number generator");
return;
encdata.ciphertext.length = 8;
encdata.enctype = ENCTYPE_UNKNOWN;
- if (code = krb5_c_encrypt(telnet_context, &krbkey, 0, 0,
- &kdata, &encdata)) {
+ if ((code = krb5_c_encrypt(telnet_context, &krbkey, 0, 0,
+ &kdata, &encdata))) {
com_err("libtelnet", code, "while encrypting random key");
return;
}
kdata.data = challenge;
kdata.length = 8;
- if (code = krb5_c_decrypt(telnet_context, &krbkey, 0, 0,
- &encdata, &kdata)) {
+ if ((code = krb5_c_decrypt(telnet_context, &krbkey, 0, 0,
+ &encdata, &kdata))) {
com_err("libtelnet", code, "while decrypting challenge");
return;
}
encdata.ciphertext.length = 8;
encdata.enctype = ENCTYPE_UNKNOWN;
- if (code = krb5_c_encrypt(telnet_context, &krbkey, 0, 0,
- &kdata, &encdata)) {
+ if ((code = krb5_c_encrypt(telnet_context, &krbkey, 0, 0,
+ &kdata, &encdata))) {
com_err("libtelnet", code, "while decrypting challenge");
return;
}
encdata.ciphertext.length = 8;
encdata.enctype = ENCTYPE_UNKNOWN;
- if (code = krb5_c_encrypt(telnet_context, &krbkey,
- 0, 0, &kdata, &encdata)) {
+ if ((code = krb5_c_encrypt(telnet_context, &krbkey,
+ 0, 0, &kdata, &encdata))) {
com_err("libtelnet", code,
"while encrypting session_key");
return;
#include "auth.h"
#include "misc.h"
-extern auth_debug_mode;
+extern int auth_debug_mode;
extern int net;
#ifdef FORWARD
#endif
void auth_encrypt_init P((char *, char *, char *, int));
+void auth_encrypt_user P((char *));
void auth_encrypt_connect P((int));
void printd P((unsigned char *, int));
/* based on @(#)misc.c 8.1 (Berkeley) 6/4/93 */
-#include "misc.h"
#include <stdio.h>
+#include <stdlib.h>
+#include "misc.h"
+#include "auth.h"
+#include "encrypt.h"
char *RemoteHostName;
char *LocalHostName;
extern int ConnectedCount;
extern int ReservedPort;
+#if !defined(P)
+#ifdef __STDC__
+#define P(x) x
+#else
+#define P(x) ()
+#endif
+#endif
+
+int isprefix P((char *, char *));
+char **genget P((char *, char **, int));
+int Ambiguous P((void *));
+
#include "misc-proto.h"
*/
#include <stdio.h>
+#include <stdlib.h>
#include <sys/types.h>
#include <netdb.h>
#include <errno.h>
char *name;
char *proto;
{
+#if 0
register char *c;
+#endif
int tos;
#ifdef HAVE_GETTOSBYNAME
* "value". If rewrite is set, replace any current value.
*/
#ifndef HAVE_SETENV
+int
setenv(name, value, rewrite)
register const char *name;
register const char *value;
if (!rewrite)
return (0);
if (strlen(c) >= l_value) { /* old larger; copy over */
- while (*c++ = *value++);
+ while ((*c++ = *value++));
return (0);
}
} else { /* create new slot */
malloc((size_t)((int)(c - name) + l_value + 2))))
return (-1);
for (c = environ[offset]; (*c = *name++) && *c != '='; ++c);
- for (*c++ = '='; *c++ = *value++;);
+ for (*c++ = '='; (*c++ = *value++););
return (0);
}
#endif