diff options
author | nectar <nectar@FreeBSD.org> | 2002-08-30 21:23:27 +0000 |
---|---|---|
committer | nectar <nectar@FreeBSD.org> | 2002-08-30 21:23:27 +0000 |
commit | a77dba08ca7d8ad2f2dcd653974ac66df78cfa49 (patch) | |
tree | 6015f89700252fb05eb8fa267c46dba41913e9d8 /crypto/heimdal/appl/rsh/common.c | |
parent | 69a91bec14ec3ad49d1c8a82c40a796755f9e4a3 (diff) | |
download | FreeBSD-src-a77dba08ca7d8ad2f2dcd653974ac66df78cfa49.zip FreeBSD-src-a77dba08ca7d8ad2f2dcd653974ac66df78cfa49.tar.gz |
Import of Heimdal Kerberos from KTH repository circa 2002/08/29.
Diffstat (limited to 'crypto/heimdal/appl/rsh/common.c')
-rw-r--r-- | crypto/heimdal/appl/rsh/common.c | 20 |
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 */ |