]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
s3:libads: remove unused kerberos_secrets_store_salting_principal()
authorStefan Metzmacher <metze@samba.org>
Wed, 17 May 2017 14:13:37 +0000 (16:13 +0200)
committerStefan Metzmacher <metze@samba.org>
Thu, 13 Jul 2017 08:51:17 +0000 (10:51 +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>
(cherry picked from commit c56043a94a10c76a220ce3c7eb7cb8cf2e992cab)

source3/libads/kerberos.c
source3/libads/kerberos_proto.h

index 2872b00956e54bedbd0bcfaedbdb8d0d8bb97bc1..cd3291ac94c7147531155b779e16ea1370220992 100644 (file)
@@ -522,78 +522,6 @@ int create_kerberos_key_from_string(krb5_context context,
        return ret;
 }
 
-/************************************************************************
- Routine to set the salting principal for this service.  Active
- Directory may use a non-obvious principal name to generate the salt
- when it determines the key to use for encrypting tickets for a service,
- and hopefully we detected that when we joined the domain.
- Setting principal to NULL deletes this entry.
- ************************************************************************/
-
-bool kerberos_secrets_store_salting_principal(const char *service,
-                                             int enctype,
-                                             const char *principal)
-{
-       char *key = NULL;
-       bool ret = False;
-       krb5_context context = NULL;
-       krb5_principal princ = NULL;
-       char *princ_s = NULL;
-       char *unparsed_name = NULL;
-       krb5_error_code code;
-
-       if (((code = krb5_init_context(&context)) != 0) || (context == NULL)) {
-               DEBUG(5, ("kerberos_secrets_store_salting_pricipal: kdb5_init_context failed: %s\n",
-                         error_message(code)));
-               return False;
-       }
-       if (strchr_m(service, '@')) {
-               if (asprintf(&princ_s, "%s", service) == -1) {
-                       goto out;
-               }
-       } else {
-               if (asprintf(&princ_s, "%s@%s", service, lp_realm()) == -1) {
-                       goto out;
-               }
-       }
-
-       if (smb_krb5_parse_name(context, princ_s, &princ) != 0) {
-               goto out;
-       }
-       if (smb_krb5_unparse_name(talloc_tos(), context, princ, &unparsed_name) != 0) {
-               goto out;
-       }
-
-       if (asprintf(&key, "%s/%s/enctype=%d",
-                    SECRETS_SALTING_PRINCIPAL, unparsed_name, enctype)
-           == -1) {
-               goto out;
-       }
-
-       if ((principal != NULL) && (strlen(principal) > 0)) {
-               ret = secrets_store(key, principal, strlen(principal) + 1);
-       } else {
-               ret = secrets_delete(key);
-       }
-
- out:
-
-       SAFE_FREE(key);
-       SAFE_FREE(princ_s);
-       TALLOC_FREE(unparsed_name);
-
-       if (princ) {
-               krb5_free_principal(context, princ);
-       }
-
-       if (context) {
-               krb5_free_context(context);
-       }
-
-       return ret;
-}
-
-
 /************************************************************************
 ************************************************************************/
 
index 7c566729a11c374f3e066f431a11e492668a1a2a..8917d63b178a8a38675d693be131e1378ee8d2b2 100644 (file)
@@ -62,9 +62,6 @@ char *kerberos_fetch_salt_princ_for_host_princ(krb5_context context,
                                               const char *host_princ_s,
                                               int enctype);
 
-bool kerberos_secrets_store_salting_principal(const char *service,
-                                             int enctype,
-                                             const char *principal);
 int kerberos_kinit_password(const char *principal,
                            const char *password,
                            int time_offset,