Skip to content

Commit 02907e0

Browse files
authored
Sync Latest - 12/6/19 (#27)
- miTLS support (Windows) - Tools fixes - Tests fixes
1 parent 39a0ff3 commit 02907e0

File tree

19 files changed

+143
-90
lines changed

19 files changed

+143
-90
lines changed
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ cd artifacts/dumps
1313

1414
# Run the tests.
1515
../bin/msquictest \
16+
--gtest_filter=$1 \
1617
--gtest_output=xml:../logs/linux-test-results.xml
1718

1819
# Copy logs to log folder (with correct permsissions).
Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,12 @@
11

22
:: Install ProcDump if not already installed.
3-
PowerShell test\get_procdump.ps1
3+
PowerShell .azure\get_procdump.ps1
4+
5+
:: Enable SChannel TLS 1.3 for client and server.
6+
reg add "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Protocols\TLS 1.3\Server" /v DisabledByDefault /t REG_DWORD /d 1 /f
7+
reg add "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Protocols\TLS 1.3\Server" /v Enabled /t REG_DWORD /d 1 /f
8+
reg add "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Protocols\TLS 1.3\Client" /v DisabledByDefault /t REG_DWORD /d 1 /f
9+
reg add "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Protocols\TLS 1.3\Client" /v Enabled /t REG_DWORD /d 1 /f
410

511
:: Start ProcDump
612
mkdir artifacts\dumps
@@ -19,6 +25,7 @@ netsh trace start sessionname=quic ^
1925

2026
:: Run the tests.
2127
artifacts\bin\Release\msquictest.exe ^
28+
--gtest_filter=%1 ^
2229
--gtest_output=xml:artifacts\logs\windows-test-results.xml
2330

2431
:: Stop log collection.

.gitmodules

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,7 @@
55
path = submodules/openssl
66
url = https://github.com/tatsuhiro-t/openssl.git
77
branch = openssl-quic-draft-24
8+
[submodule "submodules/everest"]
9+
path = submodules/everest
10+
url = https://github.com/nibanks/everest-dist.git
11+
branch = pr/msquic

CMakeLists.txt

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,8 @@ else()
100100
set(QUIC_CXX_FLAGS "${QUIC_COMMON_FLAGS} --std=c++17 -g -Wno-reorder -Wno-sign-compare -Wno-format")
101101
endif()
102102

103+
include_directories(${CMAKE_SOURCE_DIR}/inc)
104+
103105
if(QUIC_TLS STREQUAL "openssl")
104106
# Configure and build OpenSSL.
105107
add_custom_command(
@@ -116,7 +118,13 @@ if(QUIC_TLS STREQUAL "openssl")
116118
DEPENDS ${CMAKE_SOURCE_DIR}/bld/openssl/lib/libssl.so)
117119
endif()
118120

119-
include_directories(${CMAKE_SOURCE_DIR}/inc)
121+
if (QUIC_TLS STREQUAL "mitls")
122+
# Build Everest.
123+
add_subdirectory(submodules/everest/msquic/msvc/kremlib)
124+
add_subdirectory(submodules/everest/msquic/msvc/evercrypt)
125+
add_subdirectory(submodules/everest/msquic/msvc/mitls)
126+
add_subdirectory(submodules/everest/msquic/msvc/quiccrypto)
127+
endif()
120128

121129
# Product code
122130
add_subdirectory(core)

azure-pipelines.yml

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,22 +10,32 @@ strategy:
1010
platform: 'Linux-Stub'
1111
imageName: 'ubuntu-latest'
1212
cmakeArgs: '-g ''Linux Makefiles'' -DQUIC_TLS=stub -DQUIC_ENABLE_LOGGING=off'
13-
testCmd: 'bash ./.azure/run_linux.sh'
13+
testCmd: 'bash ./.azure/test_linux.sh ''*'''
14+
linux-stub-sanitize:
15+
platform: 'Linux-Stub-Sanitize'
16+
imageName: 'ubuntu-latest'
17+
cmakeArgs: '-g ''Linux Makefiles'' -DQUIC_TLS=stub -DQUIC_ENABLE_LOGGING=off -DQUIC_SANITIZE_ADDRESS=on'
18+
testCmd: 'bash ./.azure/test_linux.sh AppData/WithSendArgs2.SendLarge/0'
1419
linux-openssl:
1520
platform: 'Linux-OpenSSL'
1621
imageName: 'ubuntu-latest'
1722
cmakeArgs: '-g ''Linux Makefiles'' -DQUIC_TLS=openssl -DQUIC_ENABLE_LOGGING=off'
18-
testCmd: 'bash ./.azure/run_linux.sh'
23+
testCmd: 'bash ./.azure/test_linux.sh ''*'''
1924
windows-x64-stub:
2025
platform: 'Windows-x64-Stub'
2126
imageName: 'windows-latest'
2227
cmakeArgs: '-g ''Visual Studio 16 2019'' -A x64 -DQUIC_TLS=stub'
23-
testCmd: '.\.azure\run_windows.cmd'
28+
testCmd: '.\.azure\test_windows.cmd *'
29+
windows-x64-mitls:
30+
platform: 'Windows-x64-miTLS'
31+
imageName: 'windows-latest'
32+
cmakeArgs: '-g ''Visual Studio 16 2019'' -A x64 -DQUIC_TLS=mitls'
33+
testCmd: '.\.azure\test_windows.cmd *'
2434
windows-x64-schannel:
2535
platform: 'Windows-x64-Schannel'
2636
imageName: 'windows-latest'
2737
cmakeArgs: '-g ''Visual Studio 16 2019'' -A x64 -DQUIC_TLS=schannel'
28-
testCmd: 'echo Not supported yet'
38+
testCmd: '.\.azure\test_windows.cmd ParameterValidation.*'
2939

3040
pool:
3141
vmImage: $(imageName)

docs/BUILD.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ reg add "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\SecurityProviders\S
4444
- To decode the `quic.etl` file, run **TODO**
4545

4646
## Building on Linux (or [WSL](https://docs.microsoft.com/en-us/windows/wsl/wsl2-install))
47-
- Install tooling (WSL2 or Ubuntu)
47+
- Install tooling
4848
- `sudo apt-get install cmake`
4949
- `sudo apt-get install build-essentials`
5050
- Run `mkdir bld && cd bld`

inc/quic_trace.h

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -374,9 +374,8 @@ QuicSysLogWrite(
374374
QUIC_WRITE_EVENT(QUIC_TRACE_LEVEL_ERROR, "[ tls][%p] ERROR, %s", Connection, ErrStr)
375375
#define EventWriteQuicTlsErrorStatus(Connection, Status, ErrStr) \
376376
QUIC_WRITE_EVENT(QUIC_TRACE_LEVEL_ERROR, "[ tls][%p] ERROR, %u, %s", Connection, Status, ErrStr)
377-
378-
#define EventWriteMiTLSTrace(Message) \
379-
QUIC_WRITE_EVENT(QUIC_TRACE_LEVEL_ERROR, "[mitls] %s", Message)
377+
#define EventWriteQuicTlsMessage(Connection, Message) \
378+
QUIC_WRITE_EVENT(QUIC_TRACE_LEVEL_VERBOSE, "[ tls][%p] %s", Connection, Message)
380379

381380
#define EventWriteQuicDatapathSendTo(Binding, TotalSize, BufferCount, SegmentSize, RemoteAddrLen, RemoteAddr) \
382381
QUIC_WRITE_EVENT(QUIC_TRACE_LEVEL_VERBOSE, "[ udp][%p] Send %u bytes in %u buffers (segment=%u) Dst=TODO", Binding, TotalSize, BufferCount, SegmentSize)

manifest/MsQuicEtw.man

Lines changed: 16 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -732,6 +732,16 @@
732732
name="Connection"
733733
/>
734734
</template>
735+
<template tid="tid_CONN_MESSAGE">
736+
<data
737+
inType="win:Pointer"
738+
name="Connection"
739+
/>
740+
<data
741+
inType="win:AnsiString"
742+
name="Message"
743+
/>
744+
</template>
735745
<template tid="tid_CONN_UINT32">
736746
<data
737747
inType="win:Pointer"
@@ -2539,11 +2549,11 @@
25392549
<event
25402550
keywords="ut:TLS"
25412551
level="win:Verbose"
2542-
message="$(string.Etw.miTLS)"
2552+
message="$(string.Etw.TlsMessage)"
25432553
opcode="win:Info"
2544-
symbol="MiTLSTrace"
2545-
template="tid_MESSAGE"
2546-
value="9215"
2554+
symbol="QuicTlsMessage"
2555+
template="tid_CONN_MESSAGE"
2556+
value="8194"
25472557
/>
25482558
<!-- 9216 - 10239 | Datapath Events -->
25492559
<event
@@ -3093,8 +3103,8 @@
30933103
value="[ tls][%1] ERROR, %2, %3."
30943104
/>
30953105
<string
3096-
id="Etw.miTLS"
3097-
value="[mitls] %1"
3106+
id="Etw.TlsMessage"
3107+
value="[ tls] %1"
30983108
/>
30993109
<string
31003110
id="Etw.DatapathSendTo"

platform/CMakeLists.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ elseif(QUIC_TLS STREQUAL "openssl")
2828
elseif(QUIC_TLS STREQUAL "mitls")
2929
message(STATUS "Configuring for miTLS")
3030
set(SOURCES ${SOURCES} cert_capi.c selfsign_capi.c tls_mitls.c)
31+
include_directories(${CMAKE_SOURCE_DIR}/submodules/everest/msquic/msvc/include)
3132
else()
3233
message(STATUS "Configuring for stub TLS")
3334
set(SOURCES ${SOURCES} cert_stub.c selfsign_stub.c tls_stub.c)
@@ -46,4 +47,6 @@ if(QUIC_TLS STREQUAL "openssl")
4647
target_link_libraries(platform
4748
${CMAKE_SOURCE_DIR}/bld/openssl/lib/libcrypto.so
4849
${CMAKE_SOURCE_DIR}/bld/openssl/lib/libssl.so)
50+
elseif(QUIC_TLS STREQUAL "mitls")
51+
target_link_libraries(platform kremlib evercrypt mitls quiccrypto)
4952
endif()

platform/platform_internal.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,9 @@ typedef struct QUIC_PLATFORM {
5353
#include <ws2tcpip.h>
5454
#include <mswsock.h>
5555
#include <mstcpip.h>
56+
#if DBG
57+
#include <crtdbg.h>
58+
#endif
5659

5760
#define QUIC_BASE_REG_PATH "System\\CurrentControlSet\\Services\\MsQuic\\Parameters\\"
5861

0 commit comments

Comments
 (0)