+Thu Feb 29 19:39:23 1996 Theodore Y. Ts'o <tytso@dcl>
+
+ * util_token.c (der_length_size, der_write_size): Fix to work on
+ 16-bit platforms (we don't allow greater than 64k tokens
+ on these platforms).
+
Tue Feb 27 17:49:54 1996 Theodore Y. Ts'o <tytso@dcl>
* gssapi.h (size_t): Make sure size_t and uid_t are defined under
return(1);
else if (length < (1<<8))
return(2);
+#if (SIZEOF_INT == 2)
+ else
+ return(3);
+#else
else if (length < (1<<16))
return(3);
else if (length < (1<<24))
return(4);
else
return(5);
+#endif
}
static void der_write_length(buf, length)
*(*buf)++ = (unsigned char) length;
} else {
*(*buf)++ = (unsigned char) (der_length_size(length)+127);
+#if (SIZEOF_INT > 2)
if (length >= (1<<24))
*(*buf)++ = (unsigned char) (length>>24);
if (length >= (1<<16))
*(*buf)++ = (unsigned char) ((length>>16)&0xff);
+#endif
if (length >= (1<<8))
*(*buf)++ = (unsigned char) ((length>>8)&0xff);
*(*buf)++ = (unsigned char) (length&0xff);
if (sf & 0x80) {
if ((sf &= 0x7f) > ((*bufsize)-1))
return(-1);
+ if (sf > SIZEOF_INT)
+ return (-1);
ret = 0;
for (; sf; sf--) {
ret = (ret<<8) + (*(*buf)++);