When reading enctypes from keytabs, we need to ntohs() the 16-bit
value we read in before sign-extending it to a 32-bit value in the
keyblock, or we run the risk of extending the wrong sign.
ticket: 6720
git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@24016
dc483132-0cff-0310-8789-
dd5450dbe970
error = KRB5_KT_END;
goto fail;
}
- ret_entry->key.enctype = (krb5_enctype)enctype;
-
if (KTVERSION(id) != KRB5_KT_VNO_1)
- ret_entry->key.enctype = ntohs(ret_entry->key.enctype);
+ enctype = ntohs(enctype);
+ ret_entry->key.enctype = (krb5_enctype)enctype;
/* key contents */
ret_entry->key.magic = KV5M_KEYBLOCK;