unifdef FORWARD

git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@5920 ec53bebd-3082-4978-b11e-865c3cabbd6b
This commit is contained in:
Assar Westerlund
1999-04-10 23:46:06 +00:00
parent f91baf6b28
commit cf19609c3c

View File

@@ -78,15 +78,6 @@ RCSID("$Id$");
#include "auth.h" #include "auth.h"
#include "misc.h" #include "misc.h"
extern int auth_debug_mode;
/* where should this really reside? */
#ifdef KRB5
#define FORWARD
#endif
#ifdef FORWARD
int forward_flags = 0; /* Flags get set in telnet/main.c on -f and -F */ int forward_flags = 0; /* Flags get set in telnet/main.c on -f and -F */
/* These values need to be the same as those defined in telnet/main.c. */ /* These values need to be the same as those defined in telnet/main.c. */
@@ -96,8 +87,6 @@ int forward_flags = 0; /* Flags get set in telnet/main.c on -f and -F */
void kerberos5_forward (Authenticator *); void kerberos5_forward (Authenticator *);
#endif /* FORWARD */
static unsigned char str_data[1024] = { IAC, SB, TELOPT_AUTHENTICATION, 0, static unsigned char str_data[1024] = { IAC, SB, TELOPT_AUTHENTICATION, 0,
AUTHTYPE_KERBEROS_V5, }; AUTHTYPE_KERBEROS_V5, };
@@ -106,11 +95,9 @@ static unsigned char str_data[1024] = { IAC, SB, TELOPT_AUTHENTICATION, 0,
#define KRB_ACCEPT 2 /* Accepted */ #define KRB_ACCEPT 2 /* Accepted */
#define KRB_RESPONSE 3 /* Response for mutual auth. */ #define KRB_RESPONSE 3 /* Response for mutual auth. */
#ifdef FORWARD
#define KRB_FORWARD 4 /* Forwarded credentials follow */ #define KRB_FORWARD 4 /* Forwarded credentials follow */
#define KRB_FORWARD_ACCEPT 5 /* Forwarded credentials accepted */ #define KRB_FORWARD_ACCEPT 5 /* Forwarded credentials accepted */
#define KRB_FORWARD_REJECT 6 /* Forwarded credentials rejected */ #define KRB_FORWARD_REJECT 6 /* Forwarded credentials rejected */
#endif /* FORWARD */
static krb5_data auth; static krb5_data auth;
static krb5_ticket *ticket; static krb5_ticket *ticket;
@@ -419,7 +406,6 @@ kerberos5_is(Authenticator *ap, unsigned char *data, int cnt)
krb5_free_keyblock_contents(context, key_block); krb5_free_keyblock_contents(context, key_block);
break; break;
#ifdef FORWARD
case KRB_FORWARD: { case KRB_FORWARD: {
struct passwd *pwd; struct passwd *pwd;
char ccname[1024]; /* XXX */ char ccname[1024]; /* XXX */
@@ -478,7 +464,6 @@ kerberos5_is(Authenticator *ap, unsigned char *data, int cnt)
printf("Forwarded credentials obtained\r\n"); printf("Forwarded credentials obtained\r\n");
break; break;
} }
#endif /* FORWARD */
default: default:
if (auth_debug_mode) if (auth_debug_mode)
printf("Unknown Kerberos option %d\r\n", data[-1]); printf("Unknown Kerberos option %d\r\n", data[-1]);
@@ -539,10 +524,8 @@ kerberos5_reply(Authenticator *ap, unsigned char *data, int cnt)
encrypt_session_key(&skey, 0); encrypt_session_key(&skey, 0);
krb5_free_keyblock_contents (context, keyblock); krb5_free_keyblock_contents (context, keyblock);
auth_finished(ap, AUTH_USER); auth_finished(ap, AUTH_USER);
#ifdef FORWARD
if (forward_flags & OPTS_FORWARD_CREDS) if (forward_flags & OPTS_FORWARD_CREDS)
kerberos5_forward(ap); kerberos5_forward(ap);
#endif /* FORWARD */
break; break;
} }
case KRB_RESPONSE: case KRB_RESPONSE:
@@ -566,7 +549,6 @@ kerberos5_reply(Authenticator *ap, unsigned char *data, int cnt)
mutual_complete = 1; mutual_complete = 1;
} }
return; return;
#ifdef FORWARD
case KRB_FORWARD_ACCEPT: case KRB_FORWARD_ACCEPT:
printf("[ Kerberos V5 accepted forwarded credentials ]\r\n"); printf("[ Kerberos V5 accepted forwarded credentials ]\r\n");
return; return;
@@ -574,7 +556,6 @@ kerberos5_reply(Authenticator *ap, unsigned char *data, int cnt)
printf("[ Kerberos V5 refuses forwarded credentials because %.*s ]\r\n", printf("[ Kerberos V5 refuses forwarded credentials because %.*s ]\r\n",
cnt, data); cnt, data);
return; return;
#endif /* FORWARD */
default: default:
if (auth_debug_mode) if (auth_debug_mode)
printf("Unknown Kerberos option %d\r\n", data[-1]); printf("Unknown Kerberos option %d\r\n", data[-1]);
@@ -637,7 +618,6 @@ kerberos5_printsub(unsigned char *data, int cnt, unsigned char *buf, int buflen)
strcpy_truncate((char *)buf, " RESPONSE", buflen); strcpy_truncate((char *)buf, " RESPONSE", buflen);
goto common2; goto common2;
#ifdef FORWARD
case KRB_FORWARD: /* Forwarded credentials follow */ case KRB_FORWARD: /* Forwarded credentials follow */
strcpy_truncate((char *)buf, " FORWARD", buflen); strcpy_truncate((char *)buf, " FORWARD", buflen);
goto common2; goto common2;
@@ -650,7 +630,6 @@ kerberos5_printsub(unsigned char *data, int cnt, unsigned char *buf, int buflen)
/* (reason might follow) */ /* (reason might follow) */
strcpy_truncate((char *)buf, " FORWARD_REJECT", buflen); strcpy_truncate((char *)buf, " FORWARD_REJECT", buflen);
goto common2; goto common2;
#endif /* FORWARD */
default: default:
snprintf(buf, buflen, " %d (unknown)", data[3]); snprintf(buf, buflen, " %d (unknown)", data[3]);
@@ -664,7 +643,6 @@ kerberos5_printsub(unsigned char *data, int cnt, unsigned char *buf, int buflen)
} }
} }
#ifdef FORWARD
void void
kerberos5_forward(Authenticator *ap) kerberos5_forward(Authenticator *ap)
{ {
@@ -739,6 +717,5 @@ kerberos5_forward(Authenticator *ap)
printf("Forwarded local Kerberos V5 credentials to server\r\n"); printf("Forwarded local Kerberos V5 credentials to server\r\n");
} }
} }
#endif
#endif /* KRB5 */ #endif /* KRB5 */