summaryrefslogtreecommitdiff
path: root/server
diff options
context:
space:
mode:
authorGravatar Karl Ramm <kcr@mit.edu>2008-01-21 19:12:44 +0000
committerGravatar Karl Ramm <kcr@mit.edu>2008-01-21 19:12:44 +0000
commit76e39391f4f5277f65e87a93e70fdf1fa6035051 (patch)
tree8844d727e14a60914d92620de254688acbc57ba6 /server
parent5de536083518144acf875e49288f8154eb401ed7 (diff)
no more NOENCRYPTION
Diffstat (limited to 'server')
-rw-r--r--server/bdump.c8
-rw-r--r--server/kstuff.c14
-rw-r--r--server/subscr.c6
-rw-r--r--server/zserver.h2
4 files changed, 2 insertions, 28 deletions
diff --git a/server/bdump.c b/server/bdump.c
index 4f5b5d5..ced6167 100644
--- a/server/bdump.c
+++ b/server/bdump.c
@@ -114,10 +114,8 @@ static long ticket_time;
#define TKTLIFETIME 120
#define tkt_lifetime(val) ((long) val * 5L * 60L)
-#ifndef NOENCRYPTION
extern C_Block serv_key;
extern Sched serv_ksched;
-#endif
#endif /* HAVE_KRB4 */
static Timer *bdump_timer;
@@ -1030,7 +1028,6 @@ get_tgt(void)
ticket_time = NOW;
}
-#ifndef NOENCRYPTION
retval = read_service_key(SERVER_SERVICE, SERVER_INSTANCE,
ZGetRealm(), 0 /*kvno*/,
srvtab_file, (char *)serv_key);
@@ -1040,7 +1037,6 @@ get_tgt(void)
return 1;
}
des_key_sched(serv_key, serv_ksched.s);
-#endif /* !NOENCRYPTION */
}
#ifdef HAVE_KRB5
/* XXX */
@@ -1292,12 +1288,8 @@ bdump_recv_loop(Server *server)
syslog(LOG_ERR,"brl bad cblk read: %s (%s)",
error_message(retval), cp);
} else {
-#ifdef NOENCRYPTION
- memcpy(cblock, client->session_key, sizeof(C_Block));
-#else
des_ecb_encrypt(cblock, client->session_key, serv_ksched.s,
DES_DECRYPT);
-#endif
}
}
#endif /* HAVE_KRB4 */
diff --git a/server/kstuff.c b/server/kstuff.c
index 63d1f1c..c82f962 100644
--- a/server/kstuff.c
+++ b/server/kstuff.c
@@ -851,11 +851,8 @@ ZCheckAuthentication4(ZNotice_t *notice,
}
/* Check the cryptographic checksum. */
-#ifdef NOENCRYPTION
- checksum = 0;
-#else
checksum = compute_checksum(notice, dat.session);
-#endif
+
if (checksum != notice->z_checksum)
return ZAUTH_FAILED;
@@ -872,9 +869,6 @@ static ZChecksum_t
compute_checksum(ZNotice_t *notice,
C_Block session_key)
{
-#ifdef NOENCRYPTION
- return 0;
-#else
ZChecksum_t checksum;
char *cstart, *cend, *hstart = notice->z_packet, *hend = notice->z_message;
@@ -885,23 +879,19 @@ compute_checksum(ZNotice_t *notice,
checksum ^= des_quad_cksum((unsigned char *)notice->z_message, NULL, notice->z_message_len,
0, (C_Block *)session_key);
return checksum;
-#endif
}
static ZChecksum_t compute_rlm_checksum(ZNotice_t *notice,
C_Block session_key)
{
-#ifdef NOENCRYPTION
- return 0;
-#else
ZChecksum_t checksum;
char *cstart, *cend, *hstart = notice->z_packet;
cstart = notice->z_default_format + strlen(notice->z_default_format) + 1;
cend = cstart + strlen(cstart) + 1;
checksum = des_quad_cksum((unsigned char *)hstart, NULL, cstart - hstart, 0, (C_Block *)session_key);
+
return checksum;
-#endif
}
#ifdef HAVE_KRB5
diff --git a/server/subscr.c b/server/subscr.c
index 8ed6189..949243f 100644
--- a/server/subscr.c
+++ b/server/subscr.c
@@ -62,11 +62,9 @@ static const char rcsid_subscr_c[] = "$Id$";
*/
#ifdef HAVE_KRB4
-#ifndef NOENCRYPTION
C_Block serv_key;
Sched serv_ksched;
#endif
-#endif
/* for compatibility when sending subscription information to old clients */
@@ -872,11 +870,7 @@ subscr_send_subs(Client *client)
#endif /* HAVE_KRB4 */
#else /* HAVE_KRB5 */
#ifdef HAVE_KRB4
-#ifdef NOENCRYPTION
- memcpy(cblock, client->session_key, sizeof(C_Block));
-#else /* NOENCRYPTION */
des_ecb_encrypt(client->session_key, cblock, serv_ksched.s, DES_ENCRYPT);
-#endif /* NOENCRYPTION */
retval = ZMakeAscii(buf, sizeof(buf), cblock, sizeof(C_Block));
#endif /* HAVE_KRB4 */
diff --git a/server/zserver.h b/server/zserver.h
index 0dcd5e0..00ad972 100644
--- a/server/zserver.h
+++ b/server/zserver.h
@@ -58,13 +58,11 @@ Code_t ZFormatAuthenticNotice(ZNotice_t*, char*, int, int*, C_Block);
#define NOW t_local.tv_sec
#ifdef HAVE_KRB4
-#ifndef NOENCRYPTION
/* Kerberos shouldn't stick us with array types... */
typedef struct {
des_key_schedule s;
} Sched;
#endif
-#endif
typedef struct _Destination Destination;
typedef struct _Destlist Destlist;