113498266Sopenharmony_ci#ifndef HEADER_CURL_GSSAPI_H
213498266Sopenharmony_ci#define HEADER_CURL_GSSAPI_H
313498266Sopenharmony_ci/***************************************************************************
413498266Sopenharmony_ci *                                  _   _ ____  _
513498266Sopenharmony_ci *  Project                     ___| | | |  _ \| |
613498266Sopenharmony_ci *                             / __| | | | |_) | |
713498266Sopenharmony_ci *                            | (__| |_| |  _ <| |___
813498266Sopenharmony_ci *                             \___|\___/|_| \_\_____|
913498266Sopenharmony_ci *
1013498266Sopenharmony_ci * Copyright (C) Daniel Stenberg, <daniel@haxx.se>, et al.
1113498266Sopenharmony_ci *
1213498266Sopenharmony_ci * This software is licensed as described in the file COPYING, which
1313498266Sopenharmony_ci * you should have received as part of this distribution. The terms
1413498266Sopenharmony_ci * are also available at https://curl.se/docs/copyright.html.
1513498266Sopenharmony_ci *
1613498266Sopenharmony_ci * You may opt to use, copy, modify, merge, publish, distribute and/or sell
1713498266Sopenharmony_ci * copies of the Software, and permit persons to whom the Software is
1813498266Sopenharmony_ci * furnished to do so, under the terms of the COPYING file.
1913498266Sopenharmony_ci *
2013498266Sopenharmony_ci * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
2113498266Sopenharmony_ci * KIND, either express or implied.
2213498266Sopenharmony_ci *
2313498266Sopenharmony_ci * SPDX-License-Identifier: curl
2413498266Sopenharmony_ci *
2513498266Sopenharmony_ci ***************************************************************************/
2613498266Sopenharmony_ci
2713498266Sopenharmony_ci#include "curl_setup.h"
2813498266Sopenharmony_ci#include "urldata.h"
2913498266Sopenharmony_ci
3013498266Sopenharmony_ci#ifdef HAVE_GSSAPI
3113498266Sopenharmony_ciextern gss_OID_desc Curl_spnego_mech_oid;
3213498266Sopenharmony_ciextern gss_OID_desc Curl_krb5_mech_oid;
3313498266Sopenharmony_ci
3413498266Sopenharmony_ci/* Common method for using GSS-API */
3513498266Sopenharmony_ciOM_uint32 Curl_gss_init_sec_context(
3613498266Sopenharmony_ci    struct Curl_easy *data,
3713498266Sopenharmony_ci    OM_uint32 *minor_status,
3813498266Sopenharmony_ci    gss_ctx_id_t *context,
3913498266Sopenharmony_ci    gss_name_t target_name,
4013498266Sopenharmony_ci    gss_OID mech_type,
4113498266Sopenharmony_ci    gss_channel_bindings_t input_chan_bindings,
4213498266Sopenharmony_ci    gss_buffer_t input_token,
4313498266Sopenharmony_ci    gss_buffer_t output_token,
4413498266Sopenharmony_ci    const bool mutual_auth,
4513498266Sopenharmony_ci    OM_uint32 *ret_flags);
4613498266Sopenharmony_ci
4713498266Sopenharmony_ci/* Helper to log a GSS-API error status */
4813498266Sopenharmony_civoid Curl_gss_log_error(struct Curl_easy *data, const char *prefix,
4913498266Sopenharmony_ci                        OM_uint32 major, OM_uint32 minor);
5013498266Sopenharmony_ci
5113498266Sopenharmony_ci/* Provide some definitions missing in old headers */
5213498266Sopenharmony_ci#ifdef HAVE_OLD_GSSMIT
5313498266Sopenharmony_ci#define GSS_C_NT_HOSTBASED_SERVICE gss_nt_service_name
5413498266Sopenharmony_ci#define NCOMPAT 1
5513498266Sopenharmony_ci#endif
5613498266Sopenharmony_ci
5713498266Sopenharmony_ci/* Define our privacy and integrity protection values */
5813498266Sopenharmony_ci#define GSSAUTH_P_NONE      1
5913498266Sopenharmony_ci#define GSSAUTH_P_INTEGRITY 2
6013498266Sopenharmony_ci#define GSSAUTH_P_PRIVACY   4
6113498266Sopenharmony_ci
6213498266Sopenharmony_ci#endif /* HAVE_GSSAPI */
6313498266Sopenharmony_ci#endif /* HEADER_CURL_GSSAPI_H */
64