#include <string.h>
#include <unistd.h>
+#ifdef HAVE_KRB4
#include <des.h>
+#endif
RCSID("$Header$");
#define MIN(a, b) (((a) < (b)) ? (a) : (b))
#endif /* MIN */
+#ifdef HAVE_KRB4
static des_key_schedule sched;
static des_cblock ivec;
extern des_cblock session;
+#endif
static int get_block(int conn, int fd, int max_size, int encrypt);
if (encrypt)
{
+#ifdef HAVE_KRB4
des_key_sched(session, sched);
memcpy(ivec, session, sizeof(ivec));
+#else
+ /* The session key only gets stored if auth happens in krb4 to
+ begin with. If you don't have krb4, you can't possibly be
+ coming up with a valid session key. */
+ return MR_NO_KRB4;
+#endif
}
n_written = 0;
if (encrypt)
{
+#ifdef HAVE_KRB4
char *unenc = malloc(len);
if (!unenc)
ivec[i] = data[len - 8 + i] ^ unenc[len - 8 + i];
free(data);
data = unenc;
+#endif
}
n_read = MIN(len, max_size);