2005-04-13 Ken Raeburn <raeburn@mit.edu>
+ * aes_s2k.c (krb5int_aes_string_to_key): Widen bytes of iteration
+ count before shifting.
+
* Makefile.in (all-unix): Don't build aes-gen by default, leave it
for 'make check'.
unsigned char *p = (unsigned char *) params->data;
if (params->length != 4)
return KRB5_ERR_BAD_S2K_PARAMS;
- iter_count = ((p[0] << 24) | (p[1] << 16) | (p[2] << 8) | (p[3]));
+ /* The first two need casts in case 'int' is 16 bits. */
+ iter_count = (((unsigned long)p[0] << 24)
+ | ((unsigned long)p[1] << 16)
+ | (p[2] << 8)
+ | (p[3]));
if (iter_count == 0) {
iter_count = (1L << 16) << 16;
if (((iter_count >> 16) >> 16) != 1)