Debian Codegraph @

extra/curl/curl-8.14.1/lib/vtls/wolfssl.h

raw
1 #ifndef HEADER_CURL_WOLFSSL_H
2 #define HEADER_CURL_WOLFSSL_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 #include "../curl_setup.h"
27
28 #ifdef USE_WOLFSSL
29
30 #include "../urldata.h"
31
32 struct alpn_spec;
33 struct ssl_peer;
34 struct Curl_ssl_session;
35
36 struct WOLFSSL;
37 struct WOLFSSL_CTX;
38 struct WOLFSSL_SESSION;
39
40 extern const struct Curl_ssl Curl_ssl_wolfssl;
41
42 struct wssl_ctx {
43 struct WOLFSSL_CTX *ssl_ctx;
44 struct WOLFSSL *ssl;
45 CURLcode io_result; /* result of last BIO cfilter operation */
46 CURLcode hs_result; /* result of handshake */
47 int io_send_blocked_len; /* length of last BIO write that EAGAINed */
48 BIT(x509_store_setup); /* x509 store has been set up */
49 BIT(shutting_down); /* TLS is being shut down */
50 };
51
52 size_t Curl_wssl_version(char *buffer, size_t size);
53
54 typedef CURLcode Curl_wssl_ctx_setup_cb(struct Curl_cfilter *cf,
55 struct Curl_easy *data,
56 void *user_data);
57
58 typedef CURLcode Curl_wssl_init_session_reuse_cb(struct Curl_cfilter *cf,
59 struct Curl_easy *data,
60 struct alpn_spec *alpns,
61 struct Curl_ssl_session *scs,
62 bool *do_early_data);
63
64 CURLcode Curl_wssl_ctx_init(struct wssl_ctx *wctx,
65 struct Curl_cfilter *cf,
66 struct Curl_easy *data,
67 struct ssl_peer *peer,
68 const struct alpn_spec *alpns,
69 Curl_wssl_ctx_setup_cb *cb_setup,
70 void *cb_user_data,
71 void *ssl_user_data,
72 Curl_wssl_init_session_reuse_cb *sess_reuse_cb);
73
74 CURLcode Curl_wssl_setup_x509_store(struct Curl_cfilter *cf,
75 struct Curl_easy *data,
76 struct wssl_ctx *wssl);
77
78 CURLcode Curl_wssl_cache_session(struct Curl_cfilter *cf,
79 struct Curl_easy *data,
80 const char *ssl_peer_key,
81 struct WOLFSSL_SESSION *session,
82 int ietf_tls_id,
83 const char *alpn,
84 unsigned char *quic_tp,
85 size_t quic_tp_len);
86
87 CURLcode Curl_wssl_verify_pinned(struct Curl_cfilter *cf,
88 struct Curl_easy *data,
89 struct wssl_ctx *wssl);
90
91
92 #endif /* USE_WOLFSSL */
93 #endif /* HEADER_CURL_WOLFSSL_H */