diff options
author | markm <markm@FreeBSD.org> | 1999-09-19 14:19:32 +0000 |
---|---|---|
committer | markm <markm@FreeBSD.org> | 1999-09-19 14:19:32 +0000 |
commit | fe83e8abf357ee11114856a5278bb38431a9517c (patch) | |
tree | 36ce70fe2e8419130e546c38a7790e8ab224a362 /crypto/kerberosIV/lib/krb/recvauth.c | |
parent | a8a89cfaf983bc64f4b42f7c35209a5a36dd0fe8 (diff) | |
download | FreeBSD-src-fe83e8abf357ee11114856a5278bb38431a9517c.zip FreeBSD-src-fe83e8abf357ee11114856a5278bb38431a9517c.tar.gz |
Clean import of KTH krb4-0.10.1.
Diffstat (limited to 'crypto/kerberosIV/lib/krb/recvauth.c')
-rw-r--r-- | crypto/kerberosIV/lib/krb/recvauth.c | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/crypto/kerberosIV/lib/krb/recvauth.c b/crypto/kerberosIV/lib/krb/recvauth.c index 6c96897..f164b2b 100644 --- a/crypto/kerberosIV/lib/krb/recvauth.c +++ b/crypto/kerberosIV/lib/krb/recvauth.c @@ -21,7 +21,7 @@ or implied warranty. #include "krb_locl.h" -RCSID("$Id: recvauth.c,v 1.17 1997/03/23 03:53:16 joda Exp $"); +RCSID("$Id: recvauth.c,v 1.19 1998/06/09 19:25:25 joda Exp $"); /* * krb_recvauth() reads (and optionally responds to) a message sent @@ -117,10 +117,12 @@ krb_recvauth(int32_t options, /* bit-pattern of options */ int32_t priv_len; u_char tmp_buf[MAX_KTXT_LEN+max(KRB_SENDAUTH_VLEN+1,21)]; - /* read the protocol version number */ - if (krb_net_read(fd, krb_vers, KRB_SENDAUTH_VLEN) != KRB_SENDAUTH_VLEN) - return(errno); - krb_vers[KRB_SENDAUTH_VLEN] = '\0'; + if (!(options & KOPT_IGNORE_PROTOCOL)) { + /* read the protocol version number */ + if (krb_net_read(fd, krb_vers, KRB_SENDAUTH_VLEN) != KRB_SENDAUTH_VLEN) + return(errno); + krb_vers[KRB_SENDAUTH_VLEN] = '\0'; + } /* read the application version string */ if (krb_net_read(fd, version, KRB_SENDAUTH_VLEN) != KRB_SENDAUTH_VLEN) @@ -168,7 +170,7 @@ krb_recvauth(int32_t options, /* bit-pattern of options */ for return to the client */ { unsigned char cs[4]; - krb_put_int(kdata->checksum + 1, cs, 4); + krb_put_int(kdata->checksum + 1, cs, sizeof(cs), 4); #ifndef NOENCRYPTION des_key_sched(&kdata->session,schedule); #endif @@ -181,7 +183,7 @@ krb_recvauth(int32_t options, /* bit-pattern of options */ faddr); } /* mk_priv will never fail */ - priv_len += krb_put_int(priv_len, tmp_buf, 4); + priv_len += krb_put_int(priv_len, tmp_buf, 4, 4); if((cc = krb_net_write(fd, tmp_buf, priv_len)) != priv_len) return -1; |