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, <[email protected]>, 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 | struct ssl_peer;
|
---|
47 |
|
---|
48 | struct gtls_instance {
|
---|
49 | gnutls_session_t session;
|
---|
50 | gnutls_certificate_credentials_t cred;
|
---|
51 | #ifdef USE_GNUTLS_SRP
|
---|
52 | gnutls_srp_client_credentials_t srp_client_cred;
|
---|
53 | #endif
|
---|
54 | };
|
---|
55 |
|
---|
56 | CURLcode
|
---|
57 | gtls_client_init(struct Curl_easy *data,
|
---|
58 | struct ssl_primary_config *config,
|
---|
59 | struct ssl_config_data *ssl_config,
|
---|
60 | struct ssl_peer *peer,
|
---|
61 | struct gtls_instance *gtls,
|
---|
62 | long *pverifyresult);
|
---|
63 |
|
---|
64 | CURLcode
|
---|
65 | Curl_gtls_verifyserver(struct Curl_easy *data,
|
---|
66 | gnutls_session_t session,
|
---|
67 | struct ssl_primary_config *config,
|
---|
68 | struct ssl_config_data *ssl_config,
|
---|
69 | struct ssl_peer *peer,
|
---|
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 */
|
---|