s3:secrets: make use of des_salt_key() in secrets_store_machine_pw_sync()
authorStefan Metzmacher <metze@samba.org>
Mon, 22 May 2017 10:18:33 +0000 (12:18 +0200)
committerStefan Metzmacher <metze@samba.org>
Tue, 27 Jun 2017 14:57:45 +0000 (16:57 +0200)
BUG: https://bugzilla.samba.org/show_bug.cgi?id=12782

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
source3/passdb/machine_account_secrets.c

index 7d31734931fa24dbed0be5b0741ddf3c1e841e11..369f774e9cbaaa4d7b36fb7ff64c6856214653f6 100644 (file)
@@ -34,6 +34,8 @@
 #undef DBGC_CLASS
 #define DBGC_CLASS DBGC_PASSDB
 
+static char *des_salt_key(const char *realm);
+
 /**
  * Form a key for fetching the domain sid
  *
@@ -545,11 +547,7 @@ bool secrets_store_machine_pw_sync(const char *pass, const char *oldpass, const
        }
 
        if (realm && salting_principal) {
-               char *key = talloc_asprintf(frame, "%s/DES/%s", SECRETS_SALTING_PRINCIPAL, realm);
-               if (!key) {
-                       TALLOC_FREE(frame);
-                       return false;
-               }
+               char *key = des_salt_key(realm);
                ret = secrets_store(key, salting_principal, strlen(salting_principal)+1 );
        }