summaryrefslogtreecommitdiff
path: root/auth/credentials
diff options
context:
space:
mode:
authorStefan Metzmacher <metze@samba.org>2017-05-18 10:54:06 +0200
committerStefan Metzmacher <metze@samba.org>2017-06-27 16:57:47 +0200
commit5d99f9bb6229bc7c3537796d9d2e71cdb79a7820 (patch)
tree239bd0648ac7d302837ec9a0d78f5d6788b1980a /auth/credentials
parent3e33fb8a3760dba2f25f661bd775a9bdddee8465 (diff)
downloadsamba-5d99f9bb6229bc7c3537796d9d2e71cdb79a7820.tar.gz
auth/credentials: remove unused smb_krb5_create_salt_principal()
Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org>
Diffstat (limited to 'auth/credentials')
-rw-r--r--auth/credentials/credentials_krb5.c79
1 files changed, 0 insertions, 79 deletions
diff --git a/auth/credentials/credentials_krb5.c b/auth/credentials/credentials_krb5.c
index 6db294bfcc3..b88497dcace 100644
--- a/auth/credentials/credentials_krb5.c
+++ b/auth/credentials/credentials_krb5.c
@@ -953,85 +953,6 @@ _PUBLIC_ struct cli_credentials *cli_credentials_shallow_copy(TALLOC_CTX *mem_ct
return dst;
}
-#if 0
-static int smb_krb5_create_salt_principal(TALLOC_CTX *mem_ctx,
- const char *samAccountName,
- const char *realm,
- const char **salt_principal,
- const char **error_string)
-{
- char *machine_username;
- bool is_machine_account = false;
- char *upper_realm;
- TALLOC_CTX *tmp_ctx;
- int rc = -1;
-
- if (samAccountName == NULL) {
- *error_string = "Cannot determine salt principal, no "
- "saltPrincipal or samAccountName specified";
- return rc;
- }
-
- if (realm == NULL) {
- *error_string = "Cannot make principal without a realm";
- return rc;
- }
-
- tmp_ctx = talloc_new(mem_ctx);
- if (tmp_ctx == NULL) {
- *error_string = "Cannot allocate talloc context";
- return rc;
- }
-
- upper_realm = strupper_talloc(tmp_ctx, realm);
- if (upper_realm == NULL) {
- *error_string = "Cannot allocate to upper case realm";
- goto out;
- }
-
- machine_username = strlower_talloc(tmp_ctx, samAccountName);
- if (!machine_username) {
- *error_string = "Cannot duplicate samAccountName";
- goto out;
- }
-
- if (machine_username[strlen(machine_username) - 1] == '$') {
- machine_username[strlen(machine_username) - 1] = '\0';
- is_machine_account = true;
- }
-
- if (is_machine_account) {
- char *lower_realm;
-
- lower_realm = strlower_talloc(tmp_ctx, realm);
- if (lower_realm == NULL) {
- *error_string = "Cannot allocate to lower case realm";
- goto out;
- }
-
- *salt_principal = talloc_asprintf(mem_ctx,
- "host/%s.%s@%s",
- machine_username,
- lower_realm,
- upper_realm);
- } else {
- *salt_principal = talloc_asprintf(mem_ctx,
- "%s@%s",
- machine_username,
- upper_realm);
- }
- if (*salt_principal == NULL) {
- *error_string = "Cannot create salt principal";
- goto out;
- }
-
- rc = 0;
-out:
- talloc_free(tmp_ctx);
- return rc;
-}
-#endif
-
/* Get the keytab (actually, a container containing the krb5_keytab)
* attached to this context. If this hasn't been done or set before,
* it will be generated from the password.