Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tls1.3 win update #676

Draft
wants to merge 164 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from 160 commits
Commits
Show all changes
164 commits
Select commit Hold shift + click to select a range
624fe50
tls1.3 support
alfred2g May 16, 2024
6c28ad0
add version check
alfred2g May 18, 2024
de09df2
add version check
alfred2g May 18, 2024
5586e6a
sync
alfred2g May 18, 2024
c20a5dd
version info
alfred2g May 18, 2024
4f50b77
crate acquire common section
alfred2g May 18, 2024
a5a3390
Split newer and older versions of windows
alfred2g May 19, 2024
9d7eec0
more cleanups
alfred2g May 19, 2024
f8299fa
Fix missing definitions sc_ctx
alfred2g May 20, 2024
f49ae4a
typo
alfred2g May 20, 2024
bcf5e8a
Fix dwflags
alfred2g May 20, 2024
4625803
Fix version number fetch
alfred2g May 20, 2024
3f25df0
separate credentials into common parameter
alfred2g May 20, 2024
cd61590
remove duplicate status
alfred2g May 20, 2024
ff9ba3b
fix some errors
alfred2g May 20, 2024
ec1653b
Add local schannel credential
alfred2g May 20, 2024
07f3959
fix reference paCred
alfred2g May 20, 2024
41e5652
use common code for credentials
alfred2g May 20, 2024
3bb3396
Remove comments
alfred2g May 21, 2024
eee6ade
Fix indentation
alfred2g May 21, 2024
75db3db
Fix warnings
alfred2g May 21, 2024
324ade1
add logs
alfred2g May 21, 2024
e9871c6
Fix warnings
alfred2g May 21, 2024
bf25cd2
clang format
alfred2g May 21, 2024
f5f8c3b
clang format
alfred2g May 21, 2024
92c9936
Style: clang-format
alfred2g May 21, 2024
4fa64c2
enable protocol fields
alfred2g May 22, 2024
6c8743f
clang format
alfred2g May 22, 2024
7469078
enable tls1.3
alfred2g May 22, 2024
228d45b
Fix enabled protocols
alfred2g May 22, 2024
38e9e10
Remove some logs
alfred2g May 22, 2024
9841bd3
Fix review comments
alfred2g May 24, 2024
f03bf38
clang-format
alfred2g May 24, 2024
5e405da
Better logging for windows version
alfred2g May 24, 2024
ebf3bbe
Add Variable check
alfred2g May 29, 2024
f256416
Clang format
alfred2g May 29, 2024
38ee533
clang format
alfred2g May 29, 2024
69c58da
style: clang-format
alfred2g May 29, 2024
b4a4801
Add comment for the environment variable
alfred2g May 29, 2024
2d69731
test tls1.3 on aws endpoint
alfred2g May 29, 2024
1aa6c8d
test update
alfred2g May 29, 2024
ac82db7
clang format
alfred2g May 29, 2024
b7f9af3
Enable testcase
alfred2g May 29, 2024
d0e8b18
send packet to iot core
alfred2g May 31, 2024
1a1c938
fix build error
alfred2g May 31, 2024
c2b67df
fix timeout
alfred2g Jun 2, 2024
7368732
Fix syntax error
alfred2g Jun 2, 2024
7e90e13
certificate
alfred2g Jun 3, 2024
1e78132
Fix test
alfred2g Jun 4, 2024
26ea49d
Run 1.3 test only on windows
alfred2g Jun 4, 2024
7ece56a
run tls1.3 test only on supported windows version
alfred2g Jun 5, 2024
e1ea12e
Remove weird characters
alfred2g Jun 5, 2024
3c1f42d
change license
alfred2g Jun 5, 2024
42ca698
fix build error
alfred2g Jun 5, 2024
69a0823
print windows machine version
alfred2g Jun 5, 2024
8c24342
add root ca
alfred2g Jun 5, 2024
211ba95
debug print
alfred2g Jun 5, 2024
ed181f7
different connect packet
alfred2g Jun 5, 2024
3f3de38
connect test to port 8883
alfred2g Jun 13, 2024
6f1f73c
add connack assertions
alfred2g Jun 13, 2024
b8524ec
uncomment code
alfred2g Jun 13, 2024
7331dfc
clang format
alfred2g Jun 13, 2024
6d3e19d
remove blank lines
alfred2g Jun 13, 2024
19fa6da
add alpn protocol
alfred2g Jun 13, 2024
bafa0bc
remove commented code
alfred2g Jun 13, 2024
e056004
clang format
alfred2g Jun 13, 2024
98a9ebc
clang-format
alfred2g Jun 13, 2024
895c348
clang-format
alfred2g Jun 13, 2024
4cf7d05
clang-format
alfred2g Jun 13, 2024
8c84482
clang format
alfred2g Jun 13, 2024
fc98455
clang format
alfred2g Jun 13, 2024
558f075
Add and remove environment variable
alfred2g Jun 14, 2024
e3be4f5
Add test case to cmakefiles
alfred2g Jun 14, 2024
d6bef11
Fix unreachable code
alfred2g Jun 14, 2024
3ecbac8
clang-format
alfred2g Jun 14, 2024
279c609
Fix environment variable
alfred2g Jun 14, 2024
a5b4131
fix syntax error
alfred2g Jun 14, 2024
2380f9e
syntax error
alfred2g Jun 14, 2024
adb7b43
get environment variable
alfred2g Jun 14, 2024
e7b5a59
clang format
alfred2g Jun 14, 2024
acabfe5
clang format
alfred2g Jun 14, 2024
50d7064
Change build version for server 2022
alfred2g Jun 14, 2024
6d37fd8
fix memory cleanup
alfred2g Jun 18, 2024
11c0e29
merge with main
sbSteveK Sep 16, 2024
57e5cb3
missing close bracket
sbSteveK Sep 16, 2024
a8edf64
remove duplicate pcerts
sbSteveK Sep 16, 2024
640e48d
Windows version check renaming
sbSteveK Sep 16, 2024
2f932ed
there is no need to convert to ul. If there is an issue with int, it'…
sbSteveK Sep 16, 2024
a798351
missed a few
sbSteveK Sep 16, 2024
2be13e3
update cr changes
xiazhvera Sep 22, 2024
08f34fe
quick compile fix
xiazhvera Sep 23, 2024
9c944ee
move windows private function to new header file
xiazhvera Sep 23, 2024
0d364bd
Merge branch 'tls1.3_win_update' of https://github.com/awslabs/aws-c-…
xiazhvera Sep 23, 2024
913168a
reset credential.cCreds to default 0
xiazhvera Sep 23, 2024
3687654
Fix ALPN regression
bretambrose Sep 27, 2024
1499b68
Fix comment
sfodagain Oct 2, 2024
e08da9e
Remove resetting buffer on renegotiation
sfodagain Oct 2, 2024
f01b604
Fix raising error unconditionally
sfodagain Oct 2, 2024
1554b15
Merge branch 'main' into tls1.3_win_update
sfodagain Oct 17, 2024
37dc1ec
Split SEC_E_OK and SEC_I_RENEGOTIATE
sfodagain Nov 20, 2024
a2574dc
format
sfodagain Nov 20, 2024
88e4985
Fix conversion warning
sfodagain Nov 20, 2024
f743fe1
Merge branch 'main' into tls1.3_win_update
sfodagain Nov 20, 2024
7d66548
Run local TLS server
sfodagain Nov 22, 2024
914d75e
Simplify check
sfodagain Nov 22, 2024
df17fd8
Use local TLS server in TLS 1.3 test
sfodagain Nov 22, 2024
7819260
test fixup
sfodagain Nov 22, 2024
810c671
debugging
sfodagain Nov 22, 2024
c416590
debugging
sfodagain Nov 22, 2024
221184a
debugging
sfodagain Nov 22, 2024
0258e31
Add trace, use 127.0.0.1
sfodagain Nov 22, 2024
0ca64ac
Print openssl logs
sfodagain Nov 22, 2024
0963767
Listen on 127.0.0.1
sfodagain Nov 22, 2024
ce8e3d2
Remove -trace
sfodagain Nov 22, 2024
d342953
Change port
sfodagain Nov 22, 2024
6062cc1
Print openssl version
sfodagain Nov 23, 2024
ab19921
fixup
sfodagain Nov 23, 2024
6252e28
debugging
sfodagain Nov 23, 2024
72dd3e7
Print more
sfodagain Nov 23, 2024
f5cf27e
debugging
sfodagain Nov 23, 2024
54bc002
Try no tls 1.3
sfodagain Nov 26, 2024
8740984
debugging
sfodagain Nov 26, 2024
41c6ae2
debugging
sfodagain Nov 27, 2024
c07fda6
Use communicate
sfodagain Nov 27, 2024
e7a8cf7
Add s_client
sfodagain Nov 27, 2024
8bd355e
Fix port typo
sfodagain Nov 27, 2024
279aa22
Add CA file
sfodagain Nov 27, 2024
5ba2a0b
Add debug
sfodagain Nov 28, 2024
9b84984
Set servername
sfodagain Nov 28, 2024
cdc3265
debugging
sfodagain Nov 28, 2024
00f4ae3
List ciphers
sfodagain Nov 28, 2024
8dddbb8
fixup
sfodagain Nov 28, 2024
810a79c
debugging
sfodagain Nov 28, 2024
fd4c494
debugging
sfodagain Nov 28, 2024
687707f
Generate new creds
sfodagain Nov 28, 2024
5b41dac
remove client creds
sfodagain Nov 28, 2024
bcaac99
use chain
sfodagain Nov 28, 2024
c80a444
debugging
sfodagain Nov 28, 2024
9a708bb
Add persisting RSA keys
sfodagain Dec 5, 2024
87b1643
Add cert to trusted store
sfodagain Dec 6, 2024
cc36e1b
Use python ssl
sfodagain Dec 6, 2024
5634ad5
Fix path
sfodagain Dec 6, 2024
6950ac5
Print cwd
sfodagain Dec 6, 2024
aaef323
debugging
sfodagain Dec 6, 2024
f5af977
Move python server
sfodagain Dec 6, 2024
db527b3
fixup
sfodagain Dec 6, 2024
9233a26
Use new keys
sfodagain Dec 9, 2024
ee307c4
Add client root cert
sfodagain Dec 9, 2024
87d9a38
Clean up setting up tls server
sfodagain Dec 9, 2024
61218a0
Cleanup setting up test TLS server
sfodagain Dec 9, 2024
21a322b
Remove excess files
sfodagain Dec 9, 2024
6b06194
Merge client and server RSA import
sfodagain Dec 9, 2024
500609f
Disable tls 1.3 for ephemeral keys
sfodagain Dec 9, 2024
4a40cd0
fixup
sfodagain Dec 9, 2024
eecfbb7
Merge branch 'main' into tls1.3_win_update
sfodagain Dec 9, 2024
2d20528
Remove unused files
sfodagain Dec 9, 2024
95a909d
Fix comments
sfodagain Dec 10, 2024
8daa924
Fix test name
sfodagain Dec 10, 2024
6a16eb1
fixup tls server
sfodagain Dec 10, 2024
aa7cc7b
Add more checks
sfodagain Dec 10, 2024
d6d5244
Remove excess coment
sfodagain Dec 10, 2024
7e88849
Fix test name
sfodagain Dec 17, 2024
6ace418
Fix log messages
sfodagain Dec 17, 2024
695d70c
Use separate status var for alpn
sfodagain Dec 17, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
43 changes: 43 additions & 0 deletions .builder/actions/tls_server_setup.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
"""
Setup local TLS server for tests
"""

import Builder

import os
import sys
import subprocess
import atexit
import time


class TlsServerSetup(Builder.Action):
"""
Set up this machine for running the mock server test

This action should be run in the 'pre_build_steps' or 'build_steps' stage.
"""

def run(self, env):
if not env.project.needs_tests(env):
print("Skipping TLS server setup because tests disabled for project")
return

self.env = env

base_dir = os.path.dirname(os.path.realpath(__file__))
dir = os.path.join(base_dir, "..", "..", "tests", "tls_server")

print("Running openssl TLS server")

python_path = sys.executable
p = subprocess.Popen([python_path, "tls_server.py",
], cwd=dir, stdout=subprocess.PIPE, stderr=subprocess.PIPE)

@atexit.register
def close_tls_server():
print("Terminating openssl TLS server")
p.terminate()
out, err = p.communicate()
print("TLS server stdout:\n{}".format(out))
print("TLS server stderr:\n{}".format(err))
4 changes: 4 additions & 0 deletions builder.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,10 @@
"linux": {
"_comment": "set up SoftHSM2 for PKCS#11 tests (see: ./builder/actions/pkcs11_test_setup.py)",
"+pre_build_steps": ["pkcs11-test-setup"]
},
"windows": {
"+pre_build_steps": ["tls-server-setup"]

}
},
"build_env": {
Expand Down
3 changes: 2 additions & 1 deletion include/aws/io/private/pki_utils.h
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,8 @@ AWS_IO_API int aws_import_key_pair_to_cert_context(
HCERTSTORE *cert_store,
PCCERT_CONTEXT *certs,
HCRYPTPROV *crypto_provider,
HCRYPTKEY *private_key_handle);
HCRYPTKEY *private_key_handle,
bool *tls13_disabled);

#endif /* _WIN32 */

Expand Down
22 changes: 22 additions & 0 deletions include/aws/io/private/tls_channel_handler_private.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
#ifndef AWS_IO_TLS_CHANNEL_HANDLER_PRIVATE_H
#define AWS_IO_TLS_CHANNEL_HANDLER_PRIVATE_H

/**
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
*/
#include <aws/io/io.h>

AWS_EXTERN_C_BEGIN

#ifdef _WIN32
/**
* Force to use schannel creds. Default to false.
* For windows build above WINDOWS_BUILD_1809, we have deprecated CHANNEL_CREDS.
* Set the value to true to force to use CHANNEL_CREDS.
*/
AWS_IO_API void aws_windows_force_schannel_creds(bool use_schannel_creds);
#endif

AWS_EXTERN_C_END
#endif /* AWS_IO_TLS_CHANNEL_HANDLER_PRIVATE_H */
611 changes: 492 additions & 119 deletions source/windows/secure_channel_tls_handler.c

Large diffs are not rendered by default.

154 changes: 116 additions & 38 deletions source/windows/windows_pki_utils.c
Original file line number Diff line number Diff line change
Expand Up @@ -269,83 +269,108 @@ void aws_close_cert_store(HCERTSTORE cert_store) {
CertCloseStore(cert_store, 0);
}

static int s_cert_context_import_rsa_private_key(
enum aws_rsa_private_key_container_type {
AWS_RPKCT_PERSIST_TO_USER_PROFILE,
AWS_RPKCT_PERSIST_TO_GLOBAL,
AWS_RPKCT_EPHEMERAL,
};

static int s_cert_context_import_rsa_private_key_to_key_container(
PCCERT_CONTEXT certs,
const BYTE *key,
DWORD decoded_len,
bool is_client_mode,
wchar_t uuid_wstr[AWS_UUID_STR_LEN],
enum aws_rsa_private_key_container_type key_container_type,
HCRYPTPROV *out_crypto_provider,
HCRYPTKEY *out_private_key_handle) {
HCRYPTKEY *out_private_key_handle,
bool *tls13_disabled) {

/* out-params will adopt these resources if the function is successful.
* if function fails these resources will be cleaned up before returning */
HCRYPTPROV crypto_prov = 0;
HCRYPTKEY h_key = 0;

if (is_client_mode) {
/* use CRYPT_VERIFYCONTEXT so that keys are ephemeral (not stored to disk, registry, etc) */
if (!CryptAcquireContextW(&crypto_prov, NULL, NULL, PROV_RSA_FULL, CRYPT_VERIFYCONTEXT)) {
AWS_LOGF_ERROR(
AWS_LS_IO_PKI,
"static: error creating a new rsa crypto context for key with errno %d",
(int)GetLastError());
aws_raise_error(AWS_ERROR_SYS_CALL_FAILURE);
goto on_error;
}
const wchar_t *container_name = NULL;
DWORD acquire_context_flags = 0;

if (!CryptImportKey(crypto_prov, key, decoded_len, 0, 0, &h_key)) {
AWS_LOGF_ERROR(
AWS_LS_IO_PKI, "static: failed to import rsa key into crypto provider, error code %d", GetLastError());
aws_raise_error(AWS_ERROR_SYS_CALL_FAILURE);
goto on_error;
}
switch (key_container_type) {
case AWS_RPKCT_PERSIST_TO_USER_PROFILE:
container_name = uuid_wstr;
acquire_context_flags = CRYPT_NEWKEYSET;
break;
case AWS_RPKCT_PERSIST_TO_GLOBAL:
container_name = uuid_wstr;
acquire_context_flags = CRYPT_NEWKEYSET | CRYPT_MACHINE_KEYSET;
break;
case AWS_RPKCT_EPHEMERAL:
break;
}

if (!CryptAcquireContextW(&crypto_prov, container_name, NULL, PROV_RSA_FULL, acquire_context_flags)) {
/* The NTE_EXISTS error returned by CryptAcquireContextW is actually recoverable, meaning the requested key
* container already exists. But since we use UUID as a name, this error should never happen. */
AWS_LOGF_WARN(
AWS_LS_IO_PKI,
"static: error creating a new rsa crypto context for key: key container type %d; error code %d",
(int)key_container_type,
(int)GetLastError());
aws_raise_error(AWS_ERROR_SYS_CALL_FAILURE);
goto on_error;
}

if (!CryptImportKey(crypto_prov, key, decoded_len, 0, 0, &h_key)) {
AWS_LOGF_ERROR(
AWS_LS_IO_PKI,
"static: failed to import rsa key into crypto provider: key container type %d; error code %d",
(int)key_container_type,
GetLastError());
aws_raise_error(AWS_ERROR_SYS_CALL_FAILURE);
goto on_error;
}

if (key_container_type == AWS_RPKCT_EPHEMERAL) {
if (!CertSetCertificateContextProperty(certs, CERT_KEY_PROV_HANDLE_PROP_ID, 0, (void *)crypto_prov)) {
AWS_LOGF_ERROR(
AWS_LS_IO_PKI,
"static: error creating a new certificate context for rsa key with errno %d",
"static: error setting a certificate context property for rsa key: key container type %d; error code "
"%d",
(int)key_container_type,
(int)GetLastError());
aws_raise_error(AWS_ERROR_SYS_CALL_FAILURE);
goto on_error;
}
/* Secure Channel doesn't support TLS 1.3 with ephemeral keys. */
AWS_LOGF_INFO(AWS_LS_IO_PKI, "static: TLS 1.3 does not support ephemeral keys, disabling TLS 1.3");
*tls13_disabled = true;
} else {
if (!CryptAcquireContextW(&crypto_prov, uuid_wstr, NULL, PROV_RSA_FULL, CRYPT_NEWKEYSET)) {
AWS_LOGF_ERROR(
AWS_LS_IO_PKI, "static: error creating a new rsa crypto context with errno %d", (int)GetLastError());
aws_raise_error(AWS_ERROR_SYS_CALL_FAILURE);
goto on_error;
}

if (!CryptImportKey(crypto_prov, key, decoded_len, 0, 0, &h_key)) {
AWS_LOGF_ERROR(
AWS_LS_IO_PKI, "static: failed to import rsa key into crypto provider, error code %d", GetLastError());
aws_raise_error(AWS_ERROR_SYS_CALL_FAILURE);
goto on_error;
}

CRYPT_KEY_PROV_INFO key_prov_info;
AWS_ZERO_STRUCT(key_prov_info);
key_prov_info.pwszContainerName = uuid_wstr;
key_prov_info.dwProvType = PROV_RSA_FULL;
if (key_container_type == AWS_RPKCT_PERSIST_TO_GLOBAL) {
key_prov_info.dwFlags = CRYPT_MACHINE_KEYSET;
}
key_prov_info.dwKeySpec = AT_KEYEXCHANGE;

if (!CertSetCertificateContextProperty(certs, CERT_KEY_PROV_INFO_PROP_ID, 0, &key_prov_info)) {
AWS_LOGF_ERROR(
AWS_LS_IO_PKI,
"static: error creating a new certificate context for key with errno %d",
"static: error setting a certificate context property: key container type %d; error code %d",
(int)key_container_type,
(int)GetLastError());
aws_raise_error(AWS_ERROR_SYS_CALL_FAILURE);
goto on_error;
}
}

AWS_LOGF_DEBUG(
AWS_LS_IO_PKI, "static: successfully imported rsa private key, key container type %d", (int)key_container_type);

*out_crypto_provider = crypto_prov;
*out_private_key_handle = h_key;
return AWS_OP_SUCCESS;

on_error:

if (h_key != 0) {
CryptDestroyKey(h_key);
}
Expand All @@ -357,6 +382,51 @@ static int s_cert_context_import_rsa_private_key(
return AWS_OP_ERR;
}

static int s_cert_context_import_rsa_private_key(
PCCERT_CONTEXT certs,
const BYTE *key,
DWORD decoded_len,
bool is_client_mode,
wchar_t uuid_wstr[AWS_UUID_STR_LEN],
HCRYPTPROV *out_crypto_provider,
HCRYPTKEY *out_private_key_handle,
bool *tls13_disabled) {

const enum aws_rsa_private_key_container_type client_available_key_container_types[] = {
AWS_RPKCT_PERSIST_TO_USER_PROFILE,
AWS_RPKCT_PERSIST_TO_GLOBAL,
AWS_RPKCT_EPHEMERAL,
};

/* NOTE We didn't verify server-side with ephemeral keys, so use only persistent key containers. */
const enum aws_rsa_private_key_container_type server_available_key_container_types[] = {
AWS_RPKCT_PERSIST_TO_USER_PROFILE,
AWS_RPKCT_PERSIST_TO_GLOBAL,
};

size_t key_container_types_num = is_client_mode ? AWS_ARRAY_SIZE(client_available_key_container_types)
: AWS_ARRAY_SIZE(server_available_key_container_types);
const enum aws_rsa_private_key_container_type *available_key_container_types =
is_client_mode ? client_available_key_container_types : server_available_key_container_types;

/* Try importing into various Windows key containers until we succeed or exhaust all possible options. */
for (size_t i = 0; i < key_container_types_num; ++i) {
if (s_cert_context_import_rsa_private_key_to_key_container(
certs,
key,
decoded_len,
uuid_wstr,
available_key_container_types[i],
out_crypto_provider,
out_private_key_handle,
tls13_disabled) == AWS_OP_SUCCESS) {
return AWS_OP_SUCCESS;
}
}

return AWS_OP_ERR;
}

#define ECC_256_MAGIC_NUMBER 0x20
#define ECC_384_MAGIC_NUMBER 0x30

Expand Down Expand Up @@ -546,7 +616,8 @@ int aws_import_key_pair_to_cert_context(
HCERTSTORE *store,
PCCERT_CONTEXT *certs,
HCRYPTPROV *crypto_provider,
HCRYPTKEY *private_key_handle) {
HCRYPTKEY *private_key_handle,
bool *tls13_disabled) {

struct aws_array_list certificates, private_keys;
AWS_ZERO_STRUCT(certificates);
Expand Down Expand Up @@ -724,7 +795,14 @@ int aws_import_key_pair_to_cert_context(
switch (cert_type) {
case AWS_CT_X509_RSA:
result = s_cert_context_import_rsa_private_key(
*certs, key, decoded_len, is_client_mode, uuid_wstr, crypto_provider, private_key_handle);
*certs,
key,
decoded_len,
is_client_mode,
uuid_wstr,
crypto_provider,
private_key_handle,
tls13_disabled);
break;

#ifndef AWS_SUPPORT_WIN7
Expand Down
11 changes: 11 additions & 0 deletions tests/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,18 @@ add_test_case(sock_write_cb_is_async)
add_test_case(socket_validate_port)

if(WIN32)
set(WIN_VERSION ${CMAKE_SYSTEM_VERSION})
string(REPLACE "." ";" BUILD_VERSION ${CMAKE_SYSTEM_VERSION})
separate_arguments(BUILD_VERSION)
list(GET BUILD_VERSION 2 BUILD_V)
message("Windows Version " ${CMAKE_SYSTEM_VERSION})

if(${BUILD_V} GREATER_EQUAL 20348)
message("Building for version 22000 or higher: supporting TLS1.3")
add_net_test_case(tls_client_channel_negotiation_success_tls1_3)
endif()
add_test_case(local_socket_pipe_connected_race)
add_test_case(tls_client_channel_negotiation_success_ecc384_deprecated)
endif()

add_test_case(channel_setup)
Expand Down
28 changes: 28 additions & 0 deletions tests/resources/tls13_device.key
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
-----BEGIN PRIVATE KEY-----
MIIEvQIBADANBgkqhkiG9w0BAQEFAASCBKcwggSjAgEAAoIBAQC+g+9xsahL85TU
Gtvib/yIZsTO0qNj2AorItR+nZ0M2r4X4M45NdQsUKMpkcJ6mGMmpNW28RC1+DI+
VnxKAlY+Bztr1C2SMkZej3fRUMvdix1mKFWjm3M9w7YUFdasSKvAEuioL0/23agz
3eGiLhN8GxZ9BhjvuRPb2BD1QNt2QeMM/dR5B05zXxvvkZ8xhXCzu601EG8/2cwL
59wH7wVzKlneCxQkbXIB1RUgQLSVLZ9+v2vxJlBFtHUWenAJDnnKKe+FxCYJ3lgw
JvH0QnnTGiNWxd6QZnqWbQ5RiWikK2cJTfhNw6rV/qZ6rJslUGJhp3hlXqktmwbb
A82hbK+7AgMBAAECggEAKwg8Bm89d2JehIZIkl3/KYQlAh5b34qFyXaFjs/lEGk8
NMKHci6xbQ0Nva75wZ04EBt9VmQfBSs5lhEM496hQkN57YIwhOwsLuGzC6l3UuRA
ULndliXfotzY/LJuGd4URT9AI/UD19v7STPd6jcEGa04qCa/bS5dyPOF6Q+sQop8
2omzQ1HBIA+bQz/XNb/APgS3Cz1DUG5KpLZ/JdMbEVbZZv1uMq/vtopri2mVrF1i
2hrO+Rzchgko0prpM/CJECPUq/tzf9vKJJPQTPjSq6gW0w7iDcwwvZ53e/eevwE8
hgddW9OH9VdzlVUiYUP9Mo/o2LpblRleYy5oiRG0QQKBgQD4kM2qSH8ujTmwcQR3
YBcQkWXP7M6tQnsvAis+hJVuRUE5IK0ptLKnNOUNtVWaXmjjTx4M6wq39LP+gjhP
z1aD2HIxq6S94wzkUBd5UQ25qRE+sm0/blWWjTiUTsZljH9kP+dt4ehNlLH1+IWr
UdWoFy0iXJ/RfJq3Ix2G5RIW4QKBgQDENqhTVMd7OxA2TRbgFy19RzTd42lVbLJQ
aL8XOKLrB3w7vPRnMRtEb9NWTCrzGKRFWhetOk2mRjdJdrUzvEYiCB1zHIvHWT3r
VZtqKpRopjnBz0quTiTE8eyIW2zb/2i2K67funEY/6mcPmrNeUTDV+VgqKha8YIG
EmbGKlsGGwKBgQDYErhV0FOOmgGOGZCyXPtv0ZTZnJdFEceXY6FH5WUoyFccXAVr
fcLXiymaMwnI+UzgXERZInDc3IEjOvvMlQY18o/CEd1Rm+/3AJCHSyhNPmTZRa2m
ODl6eCS494mLeQi8kriRUpHn7tyMX4+DD85VImB/wFjFeDXeAU6HltWUwQKBgFFP
8UuvS4em/13xbnRpRoGvO5pkfqdXB0JJVj9yShmqHXLIKGSHNiyTRvpxUC8z3Aed
gUhZbApm+Mxp9Ee/UzURNdsZTlfLhNx8uo4xnRUNJcxKckFvws8XDpWnhaJZ4vPz
gGHY6ruYX5qPR0VlZvio+TaoTjR59w87GvouXVBXAoGAegBMrk0AnDrkp24qLIou
Wuex7zPT0ch8m3oAO2HTw5+eQsRq3jHIsGe5bWmYmb38JdMX9hDoG6xoA9KtZ5GR
p9tvssL61lcjVHKqPMB0lGbHUYkV1dFHQLyST1rU2dGRLrasOfA5+O+JIvcUfXkt
fDPgrVwKYwFMF3lHfqurlv4=
-----END PRIVATE KEY-----
24 changes: 24 additions & 0 deletions tests/resources/tls13_device.pem.crt
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
-----BEGIN CERTIFICATE-----
MIIEBjCCAu6gAwIBAgIUS65CZ7+pv9CHaRQf1/uFEpbc8gUwDQYJKoZIhvcNAQEL
BQAwgZoxCzAJBgNVBAYTAlVTMRMwEQYDVQQIDApXYXNoaW5ndG9uMRAwDgYDVQQH
DAdTZWF0dGxlMQ8wDQYDVQQKDAZBbWF6b24xDTALBgNVBAsMBFNES3MxEjAQBgNV
BAMMCWxvY2FsaG9zdDEwMC4GCSqGSIb3DQEJARYhYXdzLXNkay1jb21tb24tcnVu
dGltZUBhbWF6b24uY29tMB4XDTI0MTIwOTE4MTgyMloXDTI2MDQyMzE4MTgyMlow
gZoxCzAJBgNVBAYTAlVTMRMwEQYDVQQIDApXYXNoaW5ndG9uMRAwDgYDVQQHDAdT
ZWF0dGxlMQ8wDQYDVQQKDAZBbWF6b24xDTALBgNVBAsMBFNES3MxEjAQBgNVBAMM
CWxvY2FsaG9zdDEwMC4GCSqGSIb3DQEJARYhYXdzLXNkay1jb21tb24tcnVudGlt
ZUBhbWF6b24uY29tMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAvoPv
cbGoS/OU1Brb4m/8iGbEztKjY9gKKyLUfp2dDNq+F+DOOTXULFCjKZHCephjJqTV
tvEQtfgyPlZ8SgJWPgc7a9QtkjJGXo930VDL3YsdZihVo5tzPcO2FBXWrEirwBLo
qC9P9t2oM93hoi4TfBsWfQYY77kT29gQ9UDbdkHjDP3UeQdOc18b75GfMYVws7ut
NRBvP9nMC+fcB+8FcypZ3gsUJG1yAdUVIEC0lS2ffr9r8SZQRbR1FnpwCQ55yinv
hcQmCd5YMCbx9EJ50xojVsXekGZ6lm0OUYlopCtnCU34TcOq1f6meqybJVBiYad4
ZV6pLZsG2wPNoWyvuwIDAQABo0IwQDAdBgNVHQ4EFgQU9e1gHOdRMBOQfOm+Iv/8
1O1nERkwHwYDVR0jBBgwFoAUsScN2gc75tU4sIBIyoSZ7jk8isAwDQYJKoZIhvcN
AQELBQADggEBAF37+XsR7k+Lx//10DwJvGU9WlQ+q+jQ0US3XPX7/QPkTY8fDeGE
sGzVZ8WzmZQ10sP/Ac3MSMcG2Wp8aDZ52NSxyW6q7BQWLUSk+HQLkPyfULZ5oxYT
JZ5iiqIswIJxGEl+hAtm/plxY9ndRnN9Gn7JQqj/Yjw1yvIoge/mQ5GyLjv4IPIi
JqF1mwbmI0GOFGJNExvDjFrtKNYMloYRrSEjeUkr7hRKyoKo5/HNfuqFQz4DE9wq
LYPYo3Ul/WyoduSG2WtXOLMd8zGEnXDfdwB0oCJrEMwQQbPk4rUbvHDEu3zkpqls
MbxduaL9hTEgkNczKi5QHp60u3njrpvvWW0=
-----END CERTIFICATE-----
Loading