for (j = 0; j < keyblock->length/sizeof(mit_des_cblock); j++) {
mit_des_fixup_key_parity(key[j]);
if (mit_des_is_weak_key(key[j]))
- *((krb5_octet *)(key[j])) ^= 0xf0;
+ ((krb5_octet *)(key[j]))[7] ^= 0xf0;
}
/* Now, CBC encrypt with itself */
for (j = 0; j < keyblock->length/sizeof(mit_des_cblock); j++) {
mit_des_fixup_key_parity(key[j]);
if (mit_des_is_weak_key(key[j]))
- *((krb5_octet *)(key[j])) ^= 0xf0;
+ ((krb5_octet *)(key[j]))[7] ^= 0xf0;
}
return 0;
/* fix key parity */
mit_des_fixup_key_parity(key);
+ if (mit_des_is_weak_key(key))
+ ((krb5_octet *)key)[7] ^= 0xf0;
/* Now one-way encrypt it with the folded key */
(void) mit_des_key_sched(key, key_sked);
/* now fix up key parity again */
mit_des_fixup_key_parity(key);
+ if (mit_des_is_weak_key(key))
+ ((krb5_octet *)key)[7] ^= 0xf0;
#if 0
if (mit_des_debug)