return ADS_ERROR_SYSTEM(ENOENT);
}
- new_password = generate_random_str(talloc_tos(), DEFAULT_TRUST_ACCOUNT_PASSWORD_LENGTH);
-
+ new_password = generate_random_password(talloc_tos(),
+ DEFAULT_TRUST_ACCOUNT_PASSWORD_LENGTH,
+ DEFAULT_TRUST_ACCOUNT_PASSWORD_LENGTH);
+
ret = kerberos_set_password(ads->auth.kdc_server, host_principal, password, host_principal, new_password, ads->auth.time_offset);
if (!ADS_ERR_OK(ret)) {
}
if (!r->in.machine_password) {
- r->in.machine_password = generate_random_str(mem_ctx, DEFAULT_TRUST_ACCOUNT_PASSWORD_LENGTH);
+ r->in.machine_password = generate_random_password(mem_ctx,
+ DEFAULT_TRUST_ACCOUNT_PASSWORD_LENGTH,
+ DEFAULT_TRUST_ACCOUNT_PASSWORD_LENGTH);
NT_STATUS_HAVE_NO_MEMORY(r->in.machine_password);
}
}
if (!r->in.machine_password) {
- r->in.machine_password = generate_random_str(mem_ctx, DEFAULT_TRUST_ACCOUNT_PASSWORD_LENGTH);
+ r->in.machine_password = generate_random_password(mem_ctx,
+ DEFAULT_TRUST_ACCOUNT_PASSWORD_LENGTH,
+ DEFAULT_TRUST_ACCOUNT_PASSWORD_LENGTH);
NT_STATUS_HAVE_NO_MEMORY(r->in.machine_password);
}
}
/* Create a random machine account password */
- new_trust_passwd = generate_random_str(mem_ctx, DEFAULT_TRUST_ACCOUNT_PASSWORD_LENGTH);
-
+ new_trust_passwd = generate_random_password(mem_ctx,
+ DEFAULT_TRUST_ACCOUNT_PASSWORD_LENGTH,
+ DEFAULT_TRUST_ACCOUNT_PASSWORD_LENGTH);
if (new_trust_passwd == NULL) {
- DEBUG(0, ("talloc_strdup failed\n"));
+ DEBUG(0, ("generate_random_password failed\n"));
return NT_STATUS_NO_MEMORY;
}
/* Create a random machine account password */
- clear_trust_password = generate_random_str(talloc_tos(), DEFAULT_TRUST_ACCOUNT_PASSWORD_LENGTH);
+ clear_trust_password = generate_random_password(talloc_tos(),
+ DEFAULT_TRUST_ACCOUNT_PASSWORD_LENGTH,
+ DEFAULT_TRUST_ACCOUNT_PASSWORD_LENGTH);
E_md4hash(clear_trust_password, md4_trust_password);
/* Set password on machine account */
}
DEBUG(0, ("Using random trust password.\n"));
- /* FIXME: why only 8 characters work? Would it be possible to use a
- * random binary password? */
- trust_pw = generate_random_str(mem_ctx, 8);
+ trust_pw = generate_random_password(mem_ctx,
+ DEFAULT_TRUST_ACCOUNT_PASSWORD_LENGTH,
+ DEFAULT_TRUST_ACCOUNT_PASSWORD_LENGTH);
if (trust_pw == NULL) {
- DEBUG(0, ("generate_random_str failed.\n"));
+ DEBUG(0, ("generate_random_password failed.\n"));
goto done;
}
} else {