summaryrefslogtreecommitdiffstats
path: root/crypto/heimdal/appl/rsh/common.c
diff options
context:
space:
mode:
Diffstat (limited to 'crypto/heimdal/appl/rsh/common.c')
-rw-r--r--crypto/heimdal/appl/rsh/common.c20
1 files changed, 12 insertions, 8 deletions
diff --git a/crypto/heimdal/appl/rsh/common.c b/crypto/heimdal/appl/rsh/common.c
index 6614137..686e681 100644
--- a/crypto/heimdal/appl/rsh/common.c
+++ b/crypto/heimdal/appl/rsh/common.c
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997 - 1999 Kungliga Tekniska Högskolan
+ * Copyright (c) 1997 - 1999, 2002 Kungliga Tekniska Högskolan
* (Royal Institute of Technology, Stockholm, Sweden).
* All rights reserved.
*
@@ -32,22 +32,24 @@
*/
#include "rsh_locl.h"
-RCSID("$Id: common.c,v 1.12 1999/12/02 17:04:56 joda Exp $");
+RCSID("$Id: common.c,v 1.14 2002/02/18 20:01:05 joda Exp $");
+
+#if defined(KRB4) || defined(KRB5)
ssize_t
do_read (int fd,
void *buf,
size_t sz)
{
- int ret;
-
if (do_encrypt) {
#ifdef KRB4
if (auth_method == AUTH_KRB4) {
return des_enc_read (fd, buf, sz, schedule, &iv);
} else
#endif /* KRB4 */
+#ifdef KRB5
if(auth_method == AUTH_KRB5) {
+ krb5_error_code ret;
u_int32_t len, outer_len;
int status;
krb5_data data;
@@ -76,9 +78,9 @@ do_read (int fd,
memcpy (buf, data.data, len);
krb5_data_free (&data);
return len;
- } else {
+ } else
+#endif /* KRB5 */
abort ();
- }
} else
return read (fd, buf, sz);
}
@@ -92,6 +94,7 @@ do_write (int fd, void *buf, size_t sz)
return des_enc_write (fd, buf, sz, schedule, &iv);
} else
#endif /* KRB4 */
+#ifdef KRB5
if(auth_method == AUTH_KRB5) {
krb5_error_code status;
krb5_data data;
@@ -116,9 +119,10 @@ do_write (int fd, void *buf, size_t sz)
return ret;
free (data.data);
return sz;
- } else {
+ } else
+#endif /* KRB5 */
abort();
- }
} else
return write (fd, buf, sz);
}
+#endif /* KRB4 || KRB5 */
OpenPOWER on IntegriCloud