2 * Copyright (c) 2001, 2010, Oracle and/or its affiliates. All rights reserved.
6 * WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING
8 * Openvision retains the copyright to derivative works of
9 * this source code. Do *NOT* create a derivative of this
10 * source code before consulting with your legal department.
11 * Do *NOT* integrate *ANY* of this source code into another
12 * product before consulting with your legal department.
14 * For further information, read the top-level Openvision
15 * copyright which is contained in the top-level MIT Kerberos
18 * WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING
23 * Copyright 1993 OpenVision Technologies, Inc., All Rights Reserved
29 #include <kadm5/server_internal.h>
30 #include <kadm5/admin.h>
34 * Function: chpass_principal_wrapper_3
36 * Purpose: wrapper to kadm5_chpass_principal that checks to see if
37 * pw_min_life has been reached. if not it returns an error.
38 * otherwise it calls kadm5_chpass_principal
41 * principal (input) krb5_principals whose password we are
43 * keepold (input) whether to preserve old keys
44 * n_ks_tuple (input) the number of key-salt tuples in ks_tuple
45 * ks_tuple (input) array of tuples indicating the caller's
46 * requested enctypes/salttypes
47 * password (input) password we are going to change to.
48 * <return value> 0 on success error code on failure.
51 * kadm5_init to have been run.
54 * calls kadm5_chpass_principal which changes the kdb and the
59 chpass_principal_wrapper_3(void *server_handle
,
60 krb5_principal principal
,
63 krb5_key_salt_tuple
*ks_tuple
,
68 /* Solaris Kerberos */
69 ret
= kadm5_check_min_life(server_handle
, principal
, NULL
, 0);
73 return kadm5_chpass_principal_3(server_handle
, principal
,
74 keepold
, n_ks_tuple
, ks_tuple
,
80 * Function: randkey_principal_wrapper_3
82 * Purpose: wrapper to kadm5_randkey_principal which checks the
83 * password's min. life.
86 * principal (input) krb5_principal whose password we are
88 * keepold (input) whether to preserve old keys
89 * n_ks_tuple (input) the number of key-salt tuples in ks_tuple
90 * ks_tuple (input) array of tuples indicating the caller's
91 * requested enctypes/salttypes
92 * key (output) new random key
93 * <return value> 0, error code on error.
96 * kadm5_init needs to be run
99 * calls kadm5_randkey_principal
103 randkey_principal_wrapper_3(void *server_handle
,
104 krb5_principal principal
,
105 krb5_boolean keepold
,
107 krb5_key_salt_tuple
*ks_tuple
,
108 krb5_keyblock
**keys
, int *n_keys
)
112 /* Solaris Kerberos */
113 ret
= kadm5_check_min_life(server_handle
, principal
, NULL
, 0);
116 return kadm5_randkey_principal_3(server_handle
, principal
,
117 keepold
, n_ks_tuple
, ks_tuple
,
122 schpw_util_wrapper(void *server_handle
, krb5_principal princ
,
123 char *new_pw
, char **ret_pw
,
124 char *msg_ret
, unsigned int msg_len
)
128 /* Solaris Kerberos */
129 ret
= kadm5_check_min_life(server_handle
, princ
, msg_ret
, msg_len
);
133 return kadm5_chpass_principal_util(server_handle
, princ
,
139 randkey_principal_wrapper(void *server_handle
, krb5_principal princ
,
140 krb5_keyblock
** keys
, int *n_keys
)
144 /* Solaris Kerberos */
145 ret
= kadm5_check_min_life(server_handle
, princ
, NULL
, 0);
149 return kadm5_randkey_principal(server_handle
, princ
, keys
, n_keys
);