krb5_keyblock *keys;
int n_keys, i;
char *name;
+ const char *password;
+ char pwbuf[512];
+
+ random_password(pwbuf, sizeof(pwbuf));
+ password = pwbuf;
ret = krb5_unparse_name(context, princ, &name);
if (ret) {
mask |= KADM5_MAX_RLIFE;
}
ent.attributes |= attributes | KRB5_KDB_DISALLOW_ALL_TIX;
- mask |= KADM5_ATTRIBUTES | KADM5_KEY_DATA;
+ mask |= KADM5_ATTRIBUTES;
- /* Create the entry with no keys or password */
- ret = kadm5_s_create_principal_with_key(kadm_handle, &ent, mask);
+ /* Create the entry with a random password */
+ ret = kadm5_create_principal(kadm_handle, &ent, mask, password);
if(ret) {
if (ret == KADM5_DUP && (flags & CRE_DUP_OK))
goto out;
- krb5_warn(context, ret, "create_random_entry(%s): create failed",
+ krb5_warn(context, ret, "create_random_entry(%s): randkey failed",
name);
goto out;
}