diff options
Diffstat (limited to 'lib/krb5_wrap/krb5_samba.c')
-rw-r--r-- | lib/krb5_wrap/krb5_samba.c | 120 |
1 files changed, 0 insertions, 120 deletions
diff --git a/lib/krb5_wrap/krb5_samba.c b/lib/krb5_wrap/krb5_samba.c index dc90f19075..2d237ffa12 100644 --- a/lib/krb5_wrap/krb5_samba.c +++ b/lib/krb5_wrap/krb5_samba.c @@ -1436,126 +1436,6 @@ krb5_error_code smb_krb5_get_credentials(krb5_context context, return ret; } -/* - * smb_krb5_get_creds - * - * @brief Get krb5 credentials for a server - * - * @param[in] server_s The string name of the service - * @param[in] time_offset The offset to the KDCs time in seconds (optional) - * @param[in] cc The krb5 credential cache string name (optional) - * @param[in] impersonate_princ_s The string principal name to impersonate (optional) - * @param[out] creds_p The returned krb5_creds structure - * @return krb5_error_code - * - */ -krb5_error_code smb_krb5_get_creds(const char *server_s, - time_t time_offset, - const char *cc, - const char *impersonate_princ_s, - krb5_creds **creds_p) -{ - krb5_error_code ret; - krb5_context context = NULL; - krb5_principal me = NULL; - krb5_principal server = NULL; - krb5_principal impersonate_princ = NULL; - krb5_creds *creds = NULL; - krb5_ccache ccache = NULL; - - *creds_p = NULL; - - initialize_krb5_error_table(); - ret = krb5_init_context(&context); - if (ret) { - goto done; - } - - if (time_offset != 0) { - krb5_set_real_time(context, time(NULL) + time_offset, 0); - } - - ret = krb5_cc_resolve(context, cc ? cc : - krb5_cc_default_name(context), &ccache); - if (ret) { - goto done; - } - - ret = krb5_cc_get_principal(context, ccache, &me); - if (ret) { - goto done; - } - - ret = smb_krb5_parse_name(context, server_s, &server); - if (ret) { - goto done; - } - - if (impersonate_princ_s) { - ret = smb_krb5_parse_name(context, impersonate_princ_s, - &impersonate_princ); - if (ret) { - goto done; - } - } - - ret = smb_krb5_get_credentials(context, ccache, - me, server, impersonate_princ, - &creds); - if (ret) { - goto done; - } - - ret = krb5_cc_store_cred(context, ccache, creds); - if (ret) { - goto done; - } - - if (creds_p) { - *creds_p = creds; - } - - DEBUG(1,("smb_krb5_get_creds: got ticket for %s\n", - server_s)); - - if (impersonate_princ_s) { - char *client = NULL; - - ret = smb_krb5_unparse_name(talloc_tos(), context, creds->client, &client); - if (ret) { - goto done; - } - DEBUGADD(1,("smb_krb5_get_creds: using S4U2SELF impersonation as %s\n", - client)); - TALLOC_FREE(client); - } - - done: - if (!context) { - return ret; - } - - if (creds && ret) { - krb5_free_creds(context, creds); - } - if (server) { - krb5_free_principal(context, server); - } - if (me) { - krb5_free_principal(context, me); - } - if (impersonate_princ) { - krb5_free_principal(context, impersonate_princ); - } - if (ccache) { - krb5_cc_close(context, ccache); - } - krb5_free_context(context); - - return ret; -} - - krb5_error_code smb_krb5_keyblock_init_contents(krb5_context context, krb5_enctype enctype, const void *data, |