changed to unsigned int. KRB5_ETYPE_NO_LENGTH defined. Change
prototype decode_krb5_sam_key to decode_krb5_enc_sam_key which is
what the code says.
krb5int_access - change timeouts, shifts, etc to unsigned ints.
* krb5.hin: krb5_data, krb5_address, krb5_keyblock, krb5_checksum,
krb5_authdata, and krb5_pa_data length fields changed to unsigned
int. krb5_kt_get_name(), krb5_unparse_name_ext(),
krb5_build_principal(), krb5_build_principal_ext(),
krb5_build_principal_va() and krb5_read_password() all take or
return unsigned int lengths.
* port-sockets.h (SOCKET): Under unix, a socket is of type int.
git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@12773
dc483132-0cff-0310-8789-
dd5450dbe970
+2000-10-17 Ezra Peisach <epeisach@mit.edu>
+
+ * k5-int.h: krb5_alt_method, krb5_etype_info_entry length fields
+ changed to unsigned int. KRB5_ETYPE_NO_LENGTH defined. Change
+ prototype decode_krb5_sam_key to decode_krb5_enc_sam_key which is
+ what the code says.
+ krb5int_access - change timeouts, shifts, etc to unsigned ints.
+
+ * krb5.hin: krb5_data, krb5_address, krb5_keyblock, krb5_checksum,
+ krb5_authdata, and krb5_pa_data length fields changed to unsigned
+ int. krb5_kt_get_name(), krb5_unparse_name_ext(),
+ krb5_build_principal(), krb5_build_principal_ext(),
+ krb5_build_principal_va() and krb5_read_password() all take or
+ return unsigned int lengths.
+
+ * port-sockets.h (SOCKET): Under unix, a socket is of type int.
+
2000-10-03 Ezra Peisach <epeisach@mit.edu>
* krb5.hin, k5-int.h: krb5_cc_get_name now returns const char *.
typedef struct _krb5_alt_method {
krb5_magic magic;
krb5_int32 method;
- int length;
+ unsigned int length;
krb5_octet *data;
} krb5_alt_method;
typedef struct _krb5_etype_info_entry {
krb5_magic magic;
krb5_enctype etype;
- int length;
+ unsigned int length;
krb5_octet *salt;
} krb5_etype_info_entry;
+/*
+ * This is essentially -1 without sign extension which can screw up
+ * comparisons on 64 bit machines. If the length is this value, then
+ * the salt data is not present. This is to distinguish between not
+ * being set and being of 0 length.
+ */
+#define KRB5_ETYPE_NO_SALT VALID_UINT_BITS
+
typedef krb5_etype_info_entry ** krb5_etype_info;
/*
*/
void krb5_nfold
-KRB5_PROTOTYPE((int inbits, krb5_const unsigned char *in,
- int outbits, unsigned char *out));
+KRB5_PROTOTYPE((unsigned int inbits, krb5_const unsigned char *in,
+ unsigned int outbits, unsigned char *out));
krb5_error_code krb5_hmac
KRB5_PROTOTYPE((krb5_const struct krb5_hash_provider *hash,
krb5_error_code decode_krb5_sam_challenge
KRB5_PROTOTYPE((const krb5_data *, krb5_sam_challenge **));
-krb5_error_code decode_krb5_sam_key
+krb5_error_code decode_krb5_enc_sam_key
KRB5_PROTOTYPE((const krb5_data *, krb5_sam_key **));
krb5_error_code decode_krb5_enc_sam_response_enc
struct sockaddr **,
int *,
int));
- int krb5_max_skdc_timeout;
- int krb5_skdc_timeout_shift;
- int krb5_skdc_timeout_1;
- int krb5_max_dgram_size;
+ unsigned int krb5_max_skdc_timeout;
+ unsigned int krb5_skdc_timeout_shift;
+ unsigned int krb5_skdc_timeout_1;
+ unsigned int krb5_max_dgram_size;
} krb5int_access;
#define KRB5INT_ACCESS_VERSION \
typedef struct _krb5_data {
krb5_magic magic;
- int length;
+ unsigned int length;
char FAR *data;
} krb5_data;
+/*
+ * Hack length for crypto library to use the afs_string_to_key It is
+ * equivalent to -1 without possible sign extension
+ * We also overload for an unset salt type length - which is also -1, but
+ * hey, why not....
+*/
+#define SALT_TYPE_AFS_LENGTH VALID_UINT_BITS
+#define SALT_TYPE_NO_LENGTH VALID_UINT_BITS
+
/* Define krb5_const as necessary */
/*
typedef struct _krb5_address {
krb5_magic magic;
krb5_addrtype addrtype;
- int length;
+ unsigned int length;
krb5_octet FAR *contents;
} krb5_address;
typedef struct _krb5_keyblock {
krb5_magic magic;
krb5_enctype enctype;
- int length;
+ unsigned int length;
krb5_octet FAR *contents;
} krb5_keyblock;
typedef struct _krb5_checksum {
krb5_magic magic;
krb5_cksumtype checksum_type; /* checksum type */
- int length;
+ unsigned int length;
krb5_octet FAR *contents;
} krb5_checksum;
typedef struct _krb5_authdata {
krb5_magic magic;
krb5_authdatatype ad_type;
- int length;
+ unsigned int length;
krb5_octet FAR *contents;
} krb5_authdata;
typedef struct _krb5_pa_data {
krb5_magic magic;
krb5_preauthtype pa_type;
- int length;
+ unsigned int length;
krb5_octet FAR *contents;
} krb5_pa_data;
KRB5_NPROTOTYPE((krb5_context,
krb5_keytab,
char FAR *,
- int));
+ unsigned int));
krb5_error_code (KRB5_CALLCONV *close)
KRB5_NPROTOTYPE((krb5_context,
krb5_keytab));
KRB5_PROTOTYPE((krb5_context,
krb5_const_principal,
char FAR * FAR *,
- int FAR *));
+ unsigned int FAR *));
KRB5_DLLIMP krb5_error_code KRB5_CALLCONV krb5_set_principal_realm
KRB5_PROTOTYPE((krb5_context, krb5_principal, const char FAR *));
KRB5_PROTOTYPE((krb5_context,
krb5_const krb5_data *, krb5_rcache *));
KRB5_DLLIMP krb5_error_code KRB5_CALLCONV_C krb5_build_principal_ext
- KRB5_STDARG_P((krb5_context, krb5_principal FAR *, int, krb5_const char FAR *, ...));
+ KRB5_STDARG_P((krb5_context, krb5_principal FAR *, unsigned int, krb5_const char FAR *, ...));
KRB5_DLLIMP krb5_error_code KRB5_CALLCONV_C krb5_build_principal
- KRB5_STDARG_P((krb5_context, krb5_principal FAR *, int, krb5_const char FAR *, ...));
+ KRB5_STDARG_P((krb5_context, krb5_principal FAR *, unsigned int, krb5_const char FAR *, ...));
#ifdef va_start
/* XXX depending on varargs include file defining va_start... */
krb5_error_code krb5_build_principal_va
KRB5_PROTOTYPE((krb5_context,
- krb5_principal, int, krb5_const char *, va_list));
+ krb5_principal, unsigned int, krb5_const char *, va_list));
#endif
KRB5_DLLIMP krb5_error_code KRB5_CALLCONV krb5_425_conv_principal
const char FAR *,
const char FAR *,
char FAR *,
- int FAR * ));
+ unsigned int FAR * ));
krb5_error_code krb5_aname_to_localname
KRB5_PROTOTYPE((krb5_context,
krb5_const_principal,
/*
* Compatability with WinSock calls on MS-Windows...
*/
-#define SOCKET unsigned int
+#define SOCKET int
#define INVALID_SOCKET ((SOCKET)~0)
#define closesocket close
#define ioctlsocket ioctl