mit_des_cbc_cksum(), and mit_des3_cbc_encrypt() to take unsigned
long lengths.
* d3_cbc.c (mit_des3_cbc_encrypt): Length argument now takes an
unsigned long.
* f_cbc.c (mit_des_cbc_encrypt): Length argument now takes an
unsigned long.
* f_cksum.c (mit_des_cbc_cksum): Length argument now takes an
unsigned long.
* string2key.c: Unsigned/signed int cleanup. Test for a
salt-length of SALT_TYPE_AFS_LENGTH or -1 (for backwards
compatibilty) for use of mit_afs_string_to_key().
git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@12774
dc483132-0cff-0310-8789-
dd5450dbe970
+2000-10-17 Ezra Peisach <epeisach@mit.edu>
+
+ * des_int.h: Change prototypes for mit_des_cbc_encrypt(),
+ mit_des_cbc_cksum(), and mit_des3_cbc_encrypt() to take unsigned
+ long lengths.
+
+ * d3_cbc.c (mit_des3_cbc_encrypt): Length argument now takes an
+ unsigned long.
+
+ * f_cbc.c (mit_des_cbc_encrypt): Length argument now takes an
+ unsigned long.
+
+ * f_cksum.c (mit_des_cbc_cksum): Length argument now takes an
+ unsigned long.
+
+ * string2key.c: Unsigned/signed int cleanup. Test for a
+ salt-length of SALT_TYPE_AFS_LENGTH or -1 (for backwards
+ compatibilty) for use of mit_afs_string_to_key().
+
2000-06-30 Ezra Peisach <epeisach@mit.edu>
* afsstring2key.c: Initialization of S[8][64] - each 64 elements
set up. */
char *realm = salt->data;
- register int i;
+ register unsigned int i;
register krb5_octet *key = keyblock->contents;
if (data->length <= 8) {
mit_des_cblock ikey, tkey;
static mit_des_key_schedule key_sked;
- int pw_len = strlen(realm)+data->length;
+ unsigned int pw_len = strlen(realm)+data->length;
char *password = malloc(pw_len+1);
if (!password) return ENOMEM;
mit_des3_cbc_encrypt(in, out, length, ks1, ks2, ks3, ivec, encrypt)
const mit_des_cblock FAR *in;
mit_des_cblock FAR *out;
- long length;
+ unsigned long length;
mit_des_key_schedule ks1, ks2, ks3;
mit_des_cblock ivec;
int encrypt;
/* f_cksum.c */
extern unsigned long mit_des_cbc_cksum
- PROTOTYPE((krb5_octet FAR *, krb5_octet FAR *, long , mit_des_key_schedule ,
+ PROTOTYPE((krb5_octet FAR *, krb5_octet FAR *, unsigned long , mit_des_key_schedule ,
krb5_octet FAR *));
/* f_ecb.c */
/* f_cbc.c */
extern int mit_des_cbc_encrypt
- PROTOTYPE((const mit_des_cblock FAR *in, mit_des_cblock FAR *out, long length,
+ PROTOTYPE((const mit_des_cblock FAR *in, mit_des_cblock FAR *out,
+ unsigned long length,
mit_des_key_schedule schedule, mit_des_cblock ivec,
int encrypt));
extern int mit_des3_cbc_encrypt
PROTOTYPE((const mit_des_cblock FAR *in,
mit_des_cblock FAR *out,
- long length,
+ unsigned long length,
mit_des_key_schedule ks1,
mit_des_key_schedule ks2,
mit_des_key_schedule ks3,
mit_des_cbc_encrypt(in, out, length, schedule, ivec, encrypt)
const mit_des_cblock FAR *in;
mit_des_cblock FAR *out;
- long length;
+ unsigned long length;
mit_des_key_schedule schedule;
mit_des_cblock ivec;
int encrypt;
mit_des_cbc_cksum(in, out, length, schedule, ivec)
krb5_octet FAR *in;
krb5_octet FAR *out;
- long length;
+ unsigned long length;
mit_des_key_schedule schedule;
krb5_octet FAR *ivec;
{
const krb5_data FAR * data;
const krb5_data FAR * salt;
{
- register char *str, *copystr;
+ register krb5_octet *str, *copystr;
register krb5_octet *key;
register unsigned temp;
register long i;
register int j;
- register long length;
+ register unsigned long length;
unsigned char *k_p;
int forward;
register char *p_char;
key = keyblock->contents;
if (salt) {
- if (salt->length == -1) {
+ if (salt->length == SALT_TYPE_AFS_LENGTH || salt->length == (unsigned) -1) {
/* cheat and do AFS string2key instead */
return mit_afs_string_to_key (keyblock, data, salt);
} else
memset((char *)key_sked, 0, sizeof(key_sked));
/* clean & free the input string */
- memset(copystr, 0, (size_t) length);
+ memset(copystr, 0, length);
krb5_xfree(copystr);
/* now fix up key parity again */