Amazon Kinesis Webrtc C SDK
Loading...
Searching...
No Matches
AwsLcPqc.h
Go to the documentation of this file.
1
13#ifndef __KINESIS_VIDEO_WEBRTC_CLIENT_CRYPTO_AWSLC_PQC__
14#define __KINESIS_VIDEO_WEBRTC_CLIENT_CRYPTO_AWSLC_PQC__
15
16#pragma once
17
18#ifdef __cplusplus
19extern "C" {
20#endif
21
22#ifdef KVS_USE_AWS_LC
23
31static inline STATUS awsLcConfigureTlsGroups(SSL_CTX* pSslCtx)
32{
33 STATUS retStatus = STATUS_SUCCESS;
34 /* Plain `int`, not INT32: SSL_CTX_set1_groups takes `const int *`. */
35 const int pqcGroups[] = KVS_AWS_LC_PQC_GROUPS;
36
37 CHK(pSslCtx != NULL, STATUS_NULL_ARG);
38
39 /*
40 * SSL_CTX_set1_groups takes NIDs and returns 1 on success. Chosen over
41 * SSL_CTX_set1_group_ids (codepoints) because the latter does not exist in
42 * the AWS-LC-FIPS releases.
43 */
44 CHK(SSL_CTX_set1_groups(pSslCtx, pqcGroups, ARRAY_SIZE(pqcGroups)) == 1, STATUS_SSL_CTX_CREATION_FAILED);
45
46 /*
47 * Drop TLS 1.0 and 1.1. ML-KEM still needs TLS 1.3, so a TLS 1.2 server gets
48 * a classical handshake.
49 */
50 CHK(SSL_CTX_set_min_proto_version(pSslCtx, TLS1_2_VERSION) == 1, STATUS_SSL_CTX_CREATION_FAILED);
51
52CleanUp:
53 return retStatus;
54}
55
56#endif /* KVS_USE_AWS_LC */
57
58#ifdef __cplusplus
59}
60#endif
61#endif //__KINESIS_VIDEO_WEBRTC_CLIENT_CRYPTO_AWSLC_PQC__
#define STATUS_SSL_CTX_CREATION_FAILED
Definition Include.h:354