* encode.c (encode_int32, decode_int32): Do not assume
sizeof(int) == 4.
* conv_creds.c (krb524_convert_creds_kdc): Do not assume
sizeof(int) == 4 in network packet.
* cnv_tkt_skey.c (krb524int_krb_cr_tkt_int): Ensure that OTW flags
is one byte long. An error was introduced when prototypes were
widened.
* Makefile.in (includes): When testing to see if krb524_err.h
exists in the include directory, compare against the build trees
version.
git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@12725
dc483132-0cff-0310-8789-
dd5450dbe970
+2000-10-06 Ezra Peisach <epeisach@mit.edu>
+
+ * krb524d.c (do_connection): Do not assume that sizeof(int) == 4.
+
+ * encode.c (encode_int32, decode_int32): Do not assume
+ sizeof(int) == 4.
+
+ * conv_creds.c (krb524_convert_creds_kdc): Do not assume
+ sizeof(int) == 4 in network packet.
+
+ * cnv_tkt_skey.c (krb524int_krb_cr_tkt_int): Ensure that OTW flags
+ is one byte long. An error was introduced when prototypes were
+ widened.
+
+ * Makefile.in (includes): When testing to see if krb524_err.h
+ exists in the include directory, compare against the build trees
+ version.
+
2000-10-03 Ezra Peisach <epeisach@mit.edu>
* Makefile.in: Install krb524.h and krb524_err.h header file so
$(CP) $(srcdir)/krb524.h \
$(BUILDTOP)/include/krb524.h) ; \
fi
- if cmp $(srcdir)/krb524_err.h \
+ if cmp krb524_err.h \
$(BUILDTOP)/include/krb524_err.h >/dev/null 2>&1; then :; \
else \
(set -x; $(RM) $(BUILDTOP)/include/krb524_err.h; \
}
static int
-krb524int_krb_cr_tkt_int(tkt, flags, pname, pinstance, prealm, paddress,
+krb524int_krb_cr_tkt_int(tkt, flags_in, pname, pinstance, prealm, paddress,
session, life, time_sec, sname, sinstance, key, k5key)
KTEXT tkt; /* Gets filled in by the ticket */
- unsigned int flags; /* Various Kerberos flags */
+ unsigned int flags_in; /* Various Kerberos flags */
char *pname; /* Principal's name */
char *pinstance; /* Principal's instance */
char *prealm; /* Principal's authentication domain */
Key_schedule key_s;
register char *data; /* running index into ticket */
+ unsigned char flags = flags_in & 0xFF; /* This must be one byte */
+
tkt->length = 0; /* Clear previous data */
/* Check length of ticket */
p = reply.data;
ret = ntohl(*((krb5_error_code *) p));
- p += sizeof(krb5_error_code);
- reply.length -= sizeof(krb5_error_code);
+ p += sizeof(krb5_int32);
+ reply.length -= sizeof(krb5_int32);
if (ret)
goto fail;
v4creds->kvno = ntohl(*((krb5_error_code *) p));
- p += sizeof(int);
- reply.length -= sizeof(int);
+ p += sizeof(krb5_int32);
+ reply.length -= sizeof(krb5_int32);
ret = decode_v4tkt(&v4creds->ticket_st, p, &reply.length);
fail:
int *outlen;
krb5_int32 *v;
{
- int nv;
+ krb5_int32 nv; /* Must be 4 bytes */
nv = htonl(*v);
return encode_bytes(out, outlen, (char *) &nv, sizeof(nv));
krb5_int32 *v;
{
int ret;
- int nv;
+ krb5_int32 nv; /* Must be four bytes */
if ((ret = decode_bytes(out, outlen, (char *) &nv, sizeof(nv))))
return ret;
krb5_keyblock v5_service_key, v4_service_key;
krb5_data msgdata, tktdata;
char msgbuf[MSGSIZE], tktbuf[TKT_BUFSIZ], *p;
- int n, ret, saddrlen;
+ int ret, saddrlen;
+ krb5_int32 n; /* Must be 4 bytes */
krb5_kvno v4kvno;
/* Clear out keyblock contents so we don't accidentally free the stack.*/
break;
default:
/* try and recognize our own error packet */
- if (msgdata.length == sizeof(int))
+ if (msgdata.length == sizeof(krb5_int32))
return KRB5_BADMSGTYPE;
else
goto error;
msgdata.length = 0;
n = htonl(ret);
- memcpy(p, (char *) &n, sizeof(int));
- p += sizeof(int);
- msgdata.length += sizeof(int);
+ memcpy(p, (char *) &n, sizeof(krb5_int32));
+ p += sizeof(krb5_int32);
+ msgdata.length += sizeof(krb5_int32);
if (ret)
goto write_msg;
n = htonl(v4kvno);
- memcpy(p, (char *) &n, sizeof(int));
- p += sizeof(int);
- msgdata.length += sizeof(int);
+ memcpy(p, (char *) &n, sizeof(krb5_int32));
+ p += sizeof(krb5_int32);
+ msgdata.length += sizeof(krb5_int32);
memcpy(p, tktdata.data, tktdata.length);
p += tktdata.length;