• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 #ifndef HEADER_CURL_GTLS_H
2 #define HEADER_CURL_GTLS_H
3 /***************************************************************************
4  *                                  _   _ ____  _
5  *  Project                     ___| | | |  _ \| |
6  *                             / __| | | | |_) | |
7  *                            | (__| |_| |  _ <| |___
8  *                             \___|\___/|_| \_\_____|
9  *
10  * Copyright (C) Daniel Stenberg, <daniel@haxx.se>, et al.
11  *
12  * This software is licensed as described in the file COPYING, which
13  * you should have received as part of this distribution. The terms
14  * are also available at https://curl.se/docs/copyright.html.
15  *
16  * You may opt to use, copy, modify, merge, publish, distribute and/or sell
17  * copies of the Software, and permit persons to whom the Software is
18  * furnished to do so, under the terms of the COPYING file.
19  *
20  * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
21  * KIND, either express or implied.
22  *
23  * SPDX-License-Identifier: curl
24  *
25  ***************************************************************************/
26 
27 #include "curl_setup.h"
28 #include <curl/curl.h>
29 
30 #ifdef USE_GNUTLS
31 
32 #include <gnutls/gnutls.h>
33 
34 #ifdef HAVE_GNUTLS_SRP
35 /* the function exists */
36 #ifdef USE_TLS_SRP
37 /* the functionality is not disabled */
38 #define USE_GNUTLS_SRP
39 #endif
40 #endif
41 
42 struct Curl_easy;
43 struct Curl_cfilter;
44 struct ssl_primary_config;
45 struct ssl_config_data;
46 
47 struct gtls_instance {
48   gnutls_session_t session;
49   gnutls_certificate_credentials_t cred;
50 #ifdef USE_GNUTLS_SRP
51   gnutls_srp_client_credentials_t srp_client_cred;
52 #endif
53 };
54 
55 CURLcode
56 gtls_client_init(struct Curl_easy *data,
57                  struct ssl_primary_config *config,
58                  struct ssl_config_data *ssl_config,
59                  const char *hostname,
60                  struct gtls_instance *gtls,
61                  long *pverifyresult);
62 
63 CURLcode
64 Curl_gtls_verifyserver(struct Curl_easy *data,
65                        gnutls_session_t session,
66                        struct ssl_primary_config *config,
67                        struct ssl_config_data *ssl_config,
68                        const char *hostname,
69                        const char *dispname,
70                        const char *pinned_key);
71 
72 extern const struct Curl_ssl Curl_ssl_gnutls;
73 
74 #endif /* USE_GNUTLS */
75 #endif /* HEADER_CURL_GTLS_H */
76