Some password-changing library functions take a const char * parameter
but try to assign it to krb5_data.data, which isn't const. PR #364
causes some compilers to produce errors in such situations, so cast
away the constness. This is almost certainly safe because of the
nature of the code that consumes these krb5_data values.
krb5_keyblock * master_key;
krb5_key_salt_tuple * ks_tuple;
int ks_tuple_count;
- char * passwd;
+ const char * passwd;
krb5_db_entry * db_entry;
int kvno;
{
return(KRB5_KDB_BAD_SALTTYPE);
}
- pwd.data = passwd;
- pwd.length = strlen(passwd);
+ pwd = string2data((char *)passwd);
retval = krb5_c_string_to_key_with_params(context,
ks_tuple[i].ks_enctype,
KRB5_AUTH_CONTEXT_DO_SEQUENCE)))
goto cleanup;
- clearpw.length = strlen(passwd);
- clearpw.data = passwd;
+ clearpw = string2data((char *)passwd);
if ((ret = krb5_mk_priv(context, auth_context,
&clearpw, &cipherpw, &replay)))
return(ret);
req.target = targprinc;
- req.password.data = passwd;
- req.password.length = strlen(passwd);
+ req.password = string2data((char *)passwd);
ret = encode_krb5_setpw_req(&req, &encoded_setpw);
if (ret) {
return ret;