Debian Codegraph @

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

raw symbols SCIP
1 #ifndef AWS_IO_TLS_CHANNEL_HANDLER_SHARED_H
2 #define AWS_IO_TLS_CHANNEL_HANDLER_SHARED_H
3 /**
4 * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
5 * SPDX-License-Identifier: Apache-2.0.
6 */
7
8 #include <aws/io/io.h>
9
10 #include <aws/io/channel.h>
11 #include <aws/io/statistics.h>
12
13 struct aws_tls_connection_options;
14
15 struct aws_tls_channel_handler_shared {
16 uint32_t tls_timeout_ms;
17 struct aws_channel_handler *handler;
18 struct aws_channel_task timeout_task;
19 struct aws_crt_statistics_tls stats;
20 };
21
22 enum aws_tls_handler_read_state {
23 AWS_TLS_HANDLER_OPEN,
24 AWS_TLS_HANDLER_READ_SHUTTING_DOWN,
25 AWS_TLS_HANDLER_READ_SHUT_DOWN_COMPLETE,
26 };
27
28 AWS_EXTERN_C_BEGIN
29
30 AWS_IO_API bool aws_is_using_secitem(void);
31
32 AWS_IO_API void aws_tls_channel_handler_shared_init(
33 struct aws_tls_channel_handler_shared *tls_handler_shared,
34 struct aws_channel_handler *handler,
35 struct aws_tls_connection_options *options);
36
37 AWS_IO_API void aws_tls_channel_handler_shared_clean_up(struct aws_tls_channel_handler_shared *tls_handler_shared);
38
39 AWS_IO_API void aws_on_drive_tls_negotiation(struct aws_tls_channel_handler_shared *tls_handler_shared);
40
41 AWS_IO_API void aws_on_tls_negotiation_completed(
42 struct aws_tls_channel_handler_shared *tls_handler_shared,
43 int error_code);
44
45 /**
46 * Returns true if an aws_byte_buf on aws_tls_ctx_options was set by the user.
47 * Use this to determine whether a buf was set. DO NOT simply check if buf.len > 0.
48 *
49 * Reasoning:
50 * If the user calls a setter function but passes a 0 length file or cursor, buf.len will be zero.
51 * TLS should still respect the fact that the setter was called.
52 * TLS should not use defaults instead just because length is 0.
53 */
54 AWS_IO_API bool aws_tls_options_buf_is_set(const struct aws_byte_buf *buf);
55
56 AWS_EXTERN_C_END
57
58 #endif /* AWS_IO_TLS_CHANNEL_HANDLER_SHARED_H */