diff options
author | Stefan Metzmacher <metze@samba.org> | 2017-05-17 16:13:37 +0200 |
---|---|---|
committer | Stefan Metzmacher <metze@samba.org> | 2017-06-27 16:57:43 +0200 |
commit | c56043a94a10c76a220ce3c7eb7cb8cf2e992cab (patch) | |
tree | 7375eb397e7fb7a1e2ab26cde36266747495a159 /source3/libads | |
parent | 4260b52a399667bcdbaa375a20952237ff68449c (diff) | |
download | samba-c56043a94a10c76a220ce3c7eb7cb8cf2e992cab.tar.gz |
s3:libads: remove unused kerberos_secrets_store_salting_principal()
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>
Diffstat (limited to 'source3/libads')
-rw-r--r-- | source3/libads/kerberos.c | 72 | ||||
-rw-r--r-- | source3/libads/kerberos_proto.h | 3 |
2 files changed, 0 insertions, 75 deletions
diff --git a/source3/libads/kerberos.c b/source3/libads/kerberos.c index 13c48ca4023..b4bd76894e1 100644 --- a/source3/libads/kerberos.c +++ b/source3/libads/kerberos.c @@ -434,78 +434,6 @@ int create_kerberos_key_from_string(krb5_context context, } /************************************************************************ - 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; -} - - -/************************************************************************ ************************************************************************/ int kerberos_kinit_password(const char *principal, diff --git a/source3/libads/kerberos_proto.h b/source3/libads/kerberos_proto.h index 7c566729a11..8917d63b178 100644 --- a/source3/libads/kerberos_proto.h +++ b/source3/libads/kerberos_proto.h @@ -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, |