summaryrefslogtreecommitdiff
path: root/source3/libads
diff options
context:
space:
mode:
authorStefan Metzmacher <metze@samba.org>2016-08-23 10:38:58 +0200
committerRalph Boehme <slow@samba.org>2017-02-21 16:09:22 +0100
commit00136940757ea6947f97c9c92b25207d9413727b (patch)
treed66ca13e6abedbeb6b690524402cc9b381a437ce /source3/libads
parentc21e9981d04fa016ef708941ea82051d0438b7a7 (diff)
downloadsamba-00136940757ea6947f97c9c92b25207d9413727b.tar.gz
s3:libads: use trust_pw_new_value() for krb5 machine passwords
BUG: https://bugzilla.samba.org/show_bug.cgi?id=12262 Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org>
Diffstat (limited to 'source3/libads')
-rw-r--r--source3/libads/util.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/source3/libads/util.c b/source3/libads/util.c
index 2e22bca02e5..b0754be3f56 100644
--- a/source3/libads/util.c
+++ b/source3/libads/util.c
@@ -35,9 +35,12 @@ ADS_STATUS ads_change_trust_account_password(ADS_STRUCT *ads, char *host_princip
return ADS_ERROR_SYSTEM(ENOENT);
}
- new_password = generate_random_password(talloc_tos(),
- DEFAULT_TRUST_ACCOUNT_PASSWORD_LENGTH,
- DEFAULT_TRUST_ACCOUNT_PASSWORD_LENGTH);
+ new_password = trust_pw_new_value(talloc_tos(), SEC_CHAN_WKSTA, SEC_ADS);
+ if (new_password == NULL) {
+ ret = ADS_ERROR_SYSTEM(errno);
+ DEBUG(1,("Failed to generate machine password\n"));
+ goto failed;
+ }
ret = kerberos_set_password(ads->auth.kdc_server, host_principal, password, host_principal, new_password, ads->auth.time_offset);