Debian Codegraph @

crt/aws-c-io/include/aws/io/private/tls_channel_handler_private.h

raw symbols SCIP
1 #ifndef AWS_IO_TLS_CHANNEL_HANDLER_PRIVATE_H
2 #define AWS_IO_TLS_CHANNEL_HANDLER_PRIVATE_H
3
4 /**
5 * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
6 * SPDX-License-Identifier: Apache-2.0.
7 */
8 #include <aws/io/io.h>
9 #include <aws/io/tls_channel_handler.h>
10
11 /* V-table for TLS implementation. Allows runtime polymorphism across platform-specific
12 * TLS backends (s2n-tls, Secure Transport, SChannel). */
13 struct aws_tls_vtable {
14 void (*init_static_state)(struct aws_allocator *alloc);
15 void (*clean_up_static_state)(void);
16 bool (*is_alpn_available)(void);
17 bool (*is_cipher_pref_supported)(enum aws_tls_cipher_pref cipher_pref);
18 int (*client_handler_start_negotiation)(struct aws_channel_handler *handler);
19 void (*key_operation_complete)(struct aws_tls_key_operation *operation, struct aws_byte_cursor output);
20 void (*key_operation_complete_with_error)(struct aws_tls_key_operation *operation, int error_code);
21 struct aws_byte_cursor (*key_operation_get_input)(const struct aws_tls_key_operation *operation);
22 enum aws_tls_key_operation_type (*key_operation_get_type)(const struct aws_tls_key_operation *operation);
23 enum aws_tls_signature_algorithm (*key_operation_get_signature_algorithm)(
24 const struct aws_tls_key_operation *operation);
25 enum aws_tls_hash_algorithm (*key_operation_get_digest_algorithm)(const struct aws_tls_key_operation *operation);
26 struct aws_byte_buf (*handler_protocol)(struct aws_channel_handler *handler);
27 struct aws_byte_buf (*handler_server_name)(struct aws_channel_handler *handler);
28 struct aws_channel_handler *(*client_handler_new)(
29 struct aws_allocator *allocator,
30 struct aws_tls_connection_options *options,
31 struct aws_channel_slot *slot);
32 struct aws_channel_handler *(*server_handler_new)(
33 struct aws_allocator *allocator,
34 struct aws_tls_connection_options *options,
35 struct aws_channel_slot *slot);
36 struct aws_tls_ctx *(*server_ctx_new)(struct aws_allocator *alloc, const struct aws_tls_ctx_options *options);
37 struct aws_tls_ctx *(*client_ctx_new)(struct aws_allocator *alloc, const struct aws_tls_ctx_options *options);
38 };
39
40 AWS_EXTERN_C_BEGIN
41
42 #ifdef _WIN32
43 /**
44 * Force to use schannel creds. Default to false.
45 * For windows build above WINDOWS_BUILD_1809, we have deprecated CHANNEL_CREDS.
46 * Set the value to true to force to use CHANNEL_CREDS.
47 */
48 AWS_IO_API void aws_windows_force_schannel_creds(bool use_schannel_creds);
49 #endif
50
51 AWS_EXTERN_C_END
52 #endif /* AWS_IO_TLS_CHANNEL_HANDLER_PRIVATE_H */