r.in.new_password = &new_password;
r.out.return_authenticator = &return_authenticator;
- password = generate_random_str(tctx, 8);
+ password = generate_random_password(tctx, 8, 255);
E_md4hash(password, new_password.hash);
netlogon_creds_des_encrypt(creds, &new_password);
r.in.new_password = &new_password;
r.out.return_authenticator = &return_authenticator;
- password = generate_random_str(tctx, 8);
+ password = generate_random_password(tctx, 8, 255);
E_md4hash(password, new_password.hash);
netlogon_creds_des_encrypt(creds, &new_password);
r.in.new_password = &new_password;
r.out.return_authenticator = &return_authenticator;
- password = generate_random_str(tctx, 8);
+ password = generate_random_password(tctx, 8, 255);
encode_pw_buffer(password_buf.data, password, STR_UNICODE);
netlogon_creds_arcfour_crypt(creds, password_buf.data, 516);
"ServerPasswordSet failed to actually change the password");
/* now try a random password */
- password = generate_random_str(tctx, 8);
+ password = generate_random_password(tctx, 8, 255);
encode_pw_buffer(password_buf.data, password, STR_UNICODE);
netlogon_creds_arcfour_crypt(creds, password_buf.data, 516);
{
struct netr_ServerPasswordSet s;
- char *password = generate_random_str(wks_creds, 8);
+ char *password = generate_random_password(wks_creds, 8, 255);
struct netlogon_creds_CredentialState *creds_state;
struct netr_Authenticator credential, return_authenticator;
struct samr_Password new_password;
cli_credentials_set_username(wks_creds, wks_name, CRED_SPECIFIED);
cli_credentials_set_workstation(wks_creds, wks_name, CRED_SPECIFIED);
cli_credentials_set_password(wks_creds,
- generate_random_str(wks_creds, 8),
+ generate_random_password(wks_creds, 8, 255),
CRED_SPECIFIED);
if (!join3(cli, torture->lp_ctx, false, cmdline_credentials, wks_creds)) {
cli_credentials_set_username(wks_creds, wks_name, CRED_SPECIFIED);
cli_credentials_set_workstation(wks_creds, wks_name, CRED_SPECIFIED);
cli_credentials_set_password(wks_creds,
- generate_random_str(wks_creds, 8),
+ generate_random_password(wks_creds, 8, 255),
CRED_SPECIFIED);
if (!join3(cli, tctx->lp_ctx, use_level25, samr_creds, wks_creds)) {
cli_credentials_set_username(user_creds, "torture_username",
CRED_SPECIFIED);
cli_credentials_set_password(user_creds,
- generate_random_str(user_creds, 8),
+ generate_random_password(user_creds, 8, 255),
CRED_SPECIFIED);
if (!create_user(mem_ctx, cli, torture->lp_ctx, cmdline_credentials,
*/
static char *samr_rand_pass_silent(TALLOC_CTX *mem_ctx, int min_len)
{
- size_t len = MAX(8, min_len) + (random() % 6);
- char *s = generate_random_str(mem_ctx, len);
+ size_t len = MAX(8, min_len);
+ char *s = generate_random_password(mem_ctx, len, len+6);
return s;
}
*/
static char *samr_rand_pass_fixed_len(TALLOC_CTX *mem_ctx, int len)
{
- char *s = generate_random_str(mem_ctx, len);
+ char *s = generate_random_password(mem_ctx, len, len);
printf("Generated password '%s'\n", s);
return s;
}
{
struct netr_ServerPasswordSet pwset;
- char *password = generate_random_str(s->join_ctx1, 8);
+ char *password = generate_random_password(s->join_ctx1, 8, 255);
struct netlogon_creds_CredentialState *creds_state;
struct dcerpc_pipe *net_pipe;
struct netr_Authenticator credential, return_authenticator;
policy_min_pw_len = pwp.out.info->min_password_length;
}
- random_pw = generate_random_str(join, MAX(8, policy_min_pw_len));
+ random_pw = generate_random_password(join, MAX(8, policy_min_pw_len), 255);
printf("Setting account password '%s'\n", random_pw);