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

QUIC Configuration Interface #777

Merged
merged 123 commits into from
Sep 29, 2020
Merged
Show file tree
Hide file tree
Changes from 120 commits
Commits
Show all changes
123 commits
Select commit Hold shift + click to select a range
4de3141
WIP
nibanks Aug 13, 2020
787d787
WIP
nibanks Aug 14, 2020
9eb6e86
Merge branch 'master' into nibanks/configuration
nibanks Aug 17, 2020
191809b
WIP
nibanks Aug 17, 2020
8b31d1c
Merge branch 'master' into nibanks/configuration
nibanks Aug 19, 2020
1e4eb85
WIP
nibanks Aug 20, 2020
e055dd9
Merge branch 'master' into nibanks/configuration
nibanks Aug 21, 2020
7ce17de
Nits and comments
nibanks Aug 21, 2020
3b70206
Merge branch 'main' into nibanks/configuration
nibanks Aug 24, 2020
70dd5a2
Merge branch 'main' into nibanks/configuration
nibanks Aug 26, 2020
bc16e5b
More WIP
nibanks Aug 26, 2020
0c1974d
WIP
nibanks Aug 26, 2020
c251fc5
Update sample
nibanks Aug 27, 2020
5dd50ea
Merge branch 'main' into nibanks/configuration
nibanks Sep 1, 2020
274e662
Sample cleanup
nibanks Sep 1, 2020
eb360b0
Sidecar changes
nibanks Sep 1, 2020
778d759
WIP
nibanks Sep 1, 2020
248e307
Merge branch 'main' into nibanks/configuration
nibanks Sep 2, 2020
7f92823
WIP
nibanks Sep 2, 2020
e54111d
Merge branch 'main' into nibanks/configuration
nibanks Sep 7, 2020
9845c7a
WIP
nibanks Sep 7, 2020
89e9d80
Merge branch 'main' into nibanks/configuration
nibanks Sep 8, 2020
c0cd62f
Fix sample
nibanks Sep 8, 2020
30bd8f4
WIP
nibanks Sep 9, 2020
c02f260
WIP
nibanks Sep 9, 2020
7bc3e1b
Fix schannel compiler errors
nibanks Sep 9, 2020
1efacac
Update sample
nibanks Sep 9, 2020
a8c19f3
Merge branch 'main' into nibanks/configuration
nibanks Sep 9, 2020
87c305e
Fixes
nibanks Sep 9, 2020
22742dc
Remove declarations
nibanks Sep 10, 2020
f2e429c
Core compiling
nibanks Sep 11, 2020
390bbce
Fix Perf
nibanks Sep 11, 2020
51e5205
Merge branch 'main' into nibanks/configuration
nibanks Sep 11, 2020
f90c95a
Fix interop client
nibanks Sep 11, 2020
ae1dc7a
Fix interop server
nibanks Sep 11, 2020
a878c58
More
nibanks Sep 11, 2020
798bcc2
wip
nibanks Sep 12, 2020
723ce5d
Tools and perf compile
nibanks Sep 14, 2020
659e7a3
Merge branch 'main' into nibanks/configuration
nibanks Sep 14, 2020
61527eb
Merge branch 'main' into nibanks/configuration
nibanks Sep 15, 2020
3b5c63e
WIP
nibanks Sep 15, 2020
b6baa16
Merge branch 'main' into nibanks/configuration
nibanks Sep 16, 2020
e580ef3
Merge branch 'main' into nibanks/configuration
nibanks Sep 16, 2020
d628303
Fix eventtest
nibanks Sep 16, 2020
7cbe24f
Merge branch 'main' into nibanks/configuration
nibanks Sep 17, 2020
8dde5fd
WIP
nibanks Sep 17, 2020
297f3fd
Building
nibanks Sep 17, 2020
fa85131
Some fixes
nibanks Sep 17, 2020
6f59db2
Fixes
nibanks Sep 17, 2020
c4171a5
More fixes
nibanks Sep 17, 2020
6530b1e
Update sidecar
thhous-msft Sep 17, 2020
0663745
Fake SAL
nibanks Sep 17, 2020
637cfea
Update clog manifest again
thhous-msft Sep 17, 2020
1c5460a
Merge branch 'nibanks/configuration' of https://github.com/microsoft/…
thhous-msft Sep 17, 2020
b1d8193
Merge branch 'main' into nibanks/configuration
nibanks Sep 18, 2020
8970b3d
Fixes
nibanks Sep 18, 2020
7b269f8
Remove static
nibanks Sep 18, 2020
cc40657
WIP
nibanks Sep 18, 2020
990b12f
Finish up miTLS
nibanks Sep 18, 2020
0df64a2
WIP
nibanks Sep 18, 2020
4d30851
Test code compile
nibanks Sep 18, 2020
2e07f83
Indicate received resumption ticket up to client app.
anrossi Sep 18, 2020
b562cbb
Merge branch 'nibanks/configuration' of https://github.com/microsoft/…
anrossi Sep 18, 2020
c74814f
Set resumption ticket on client, down to crypto later.
anrossi Sep 19, 2020
17ad43b
Put lengths first in tickets, then data.
anrossi Sep 19, 2020
f580355
Few build errors
nibanks Sep 19, 2020
7b90555
Stub build error
nibanks Sep 19, 2020
2542992
More fixes
nibanks Sep 19, 2020
329bf2f
More fixes
nibanks Sep 19, 2020
c52f155
Few more linux build errors
nibanks Sep 19, 2020
898ac1a
Few more fixes
nibanks Sep 19, 2020
7c23fc6
Fix build and some tests
nibanks Sep 20, 2020
4160975
More fixes
nibanks Sep 20, 2020
063fcd8
More WIP
nibanks Sep 21, 2020
785e662
Merge branch 'main' into nibanks/configuration
nibanks Sep 21, 2020
40cb4c5
Fix compile error
nibanks Sep 21, 2020
04780a8
More fixes
nibanks Sep 21, 2020
aaf2f10
Fix reentrant library call deadlock
thhous-msft Sep 21, 2020
493cb52
0-RTT fixes
nibanks Sep 22, 2020
a70ec4c
Fix ticket corruption bug.
anrossi Sep 22, 2020
bf709e5
More Fixes
nibanks Sep 22, 2020
f3ec963
Some more fixes
nibanks Sep 22, 2020
e6215a7
Correctly access Quic Version in tickets, and use the correct version.
anrossi Sep 23, 2020
4ce87c8
Minor stuff
nibanks Sep 23, 2020
cf51437
Fixes
nibanks Sep 23, 2020
a550206
Merge branch 'nibanks/configuration' of https://github.com/microsoft/…
nibanks Sep 23, 2020
2238485
Fix Linux build
nibanks Sep 23, 2020
df651ea
MORE!!!!!
nibanks Sep 23, 2020
bed8c2b
Oops
nibanks Sep 23, 2020
64dfc49
Fix arm build
nibanks Sep 23, 2020
49c7672
Merge branch 'main' into nibanks/configuration
nibanks Sep 23, 2020
8b548e8
Debugger Extension fixes
nibanks Sep 23, 2020
b32f9bb
Refactor ticket encoding/parsing and add a simple test.
anrossi Sep 24, 2020
e212b21
Fix SAL annotations and add comments in header.
anrossi Sep 24, 2020
de7e0d5
Fix more CodeQL issues and add more tests.
anrossi Sep 24, 2020
6c9976c
Fix SAL build breaks.
anrossi Sep 24, 2020
57b77be
Fix more SAL breaks.
anrossi Sep 24, 2020
d45f724
Fix event
nibanks Sep 24, 2020
03c777c
Merge branch 'nibanks/configuration' of https://github.com/microsoft/…
nibanks Sep 24, 2020
b874039
Fix SAL
nibanks Sep 24, 2020
8add2c9
WIP
nibanks Sep 24, 2020
7f37f03
Merge branch 'main' into nibanks/configuration
nibanks Sep 24, 2020
9b31c57
WIP
nibanks Sep 24, 2020
60c55a6
Merge branch 'main' into nibanks/configuration
nibanks Sep 25, 2020
88fa7ec
Windows builds and schannel tests pass
nibanks Sep 25, 2020
e256b96
Fixes
nibanks Sep 25, 2020
4a2af3d
Fixes
nibanks Sep 25, 2020
9f55b19
Fix SAL
nibanks Sep 25, 2020
6b85992
Fix crash
nibanks Sep 25, 2020
0918bf1
Driver fixes
nibanks Sep 25, 2020
6cd0917
reenable kernel perf
nibanks Sep 25, 2020
9770ef5
New PGO files
nibanks Sep 26, 2020
86f4e6b
kernel uses async always
nibanks Sep 27, 2020
95fc176
Fix flags
nibanks Sep 27, 2020
618063b
More cleanup in schannel
nibanks Sep 28, 2020
22cab1c
Fix kernel mode
nibanks Sep 28, 2020
444e851
Merge branch 'main' into nibanks/configuration
nibanks Sep 28, 2020
7c226d4
Fix sidecar
nibanks Sep 28, 2020
a791e42
Fix send buffering copy/paste bug
nibanks Sep 28, 2020
8167cb1
Merge branch 'main' into nibanks/configuration
nibanks Sep 28, 2020
65c7a0b
Fix stateless worker assignment
nibanks Sep 29, 2020
1a8ddb9
Fix a few zero mem
nibanks Sep 29, 2020
f8d9d56
Merge branch 'main' into nibanks/configuration
nibanks Sep 29, 2020
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
16 changes: 4 additions & 12 deletions docs/API.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,7 @@ The API supports both server and client applications. All functionality is expos

[**Registration**](#registration) – Manages the execution context for all child objects. An app may open multiple registrations but ideally should only open one.

[**Security Configuration**](#security-configuration) – Abstracts the configuration for the TLS component. This primarily consists of a certificate that is used for authentication. The app may create as many of these as necessary.

[**Session**](#session) – Abstracts several different session-layer concepts: TLS Session Resumption, Application Layer Protocol Negotiation (ALPN) and platform specifics (such as Server Silo and Network Compartment ID on Windows). The app may create as many of these as necessary.
[**Configuration**](#configuration) – Abstracts the configuration for a connection. TODO

[**Listener**](#listener) – Server side only, this object provides the interface for an app to accept incoming connections from clients. Once the connection has been accepted, it is independent of the listener. The app may create as many of these as necessary.

Expand Down Expand Up @@ -88,17 +86,11 @@ Generally, each app only needs a single registration. The registration represent

A registration is created by calling [RegistrationOpen](api/RegistrationOpen.md) and deleted by calling [RegistrationClose](api/RegistrationClose.md).

## Security Configuration

Currently only used on the server side, the security configuration (AKA security config) abstracts a server certificate (and other configuration) used by a [listener](#listener) to accept an incoming connection request.

A security config is created by calling [SecConfigCreate](api/SecConfigCreate.md) and deleted by calling [SecConfigDelete](api/SecConfigDelete.md).

## Session
## Configuration

An app must create a session before it can create any listeners or connections. Each session maintains certain transport and platform state common to all child handles. Primarily, this consists of the ALPN string used for the connection handshakes and TLS state used for session resumption. On Windows platforms it also inherits the Silo and Network Compartment ID from the thread that creates it.
TODO

A session is created by calling [SessionOpen](api/SessionOpen.md) and deleted by calling [SessionClose](api/SessionClose.md). [SessionClose](api/SessionClose.md) **will block** on all oustanding connections. Therefore do not call it on any MsQuic event callback, as it will likely create a deadlock.
A configuration is created by calling [ConfigurationOpen](api/ConfigurationOpen.md) and deleted by calling [ConfigurationClose](api/ConfigurationClose.md).

## Listener

Expand Down
29 changes: 29 additions & 0 deletions docs/api/ConfigurationClose.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
ConfigurationClose function
======

Deletes an existing security configuration.

# Syntax

```C
typedef
_IRQL_requires_max_(PASSIVE_LEVEL)
void
(QUIC_API * QUIC_CONFIGURATION_CLOSE_FN)(
_In_ _Pre_defensive_ __drv_freesMem(Mem)
HQUIC Configuration
);
```

# Parameters

**TODO**

# Remarks

**TODO**

# See Also

[ConfigurationOpen](ConfigurationOpen.md)<br>
[ConfigurationLoadCredential](ConfigurationLoadCredential.md)<br>
29 changes: 29 additions & 0 deletions docs/api/ConfigurationLoadCredential.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
ConfigurationLoadCredential function
======

Deletes an existing configuration.

# Syntax

```C
typedef
_IRQL_requires_max_(PASSIVE_LEVEL)
QUIC_STATUS
(QUIC_API * QUIC_CONFIGURATION_LOAD_CREDENTIAL_FN)(
_In_ _Pre_defensive_ HQUIC Configuration,
_In_ _Pre_defensive_ const QUIC_CREDENTIAL_CONFIG* CredConfig
);
```

# Parameters

**TODO**

# Remarks

**TODO**

# See Also

[ConfigurationOpen](ConfigurationOpen.md)<br>
[ConfigurationClose](ConfigurationClose.md)<br>
45 changes: 45 additions & 0 deletions docs/api/ConfigurationOpen.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
ConfigurationOpen function
======

Creates a new configuration.

# Syntax

```C
typedef
_IRQL_requires_max_(PASSIVE_LEVEL)
QUIC_STATUS
(QUIC_API * QUIC_CONFIGURATION_OPEN_FN)(
_In_ _Pre_defensive_ HQUIC Registration,
_In_reads_(AlpnBufferCount) _Pre_defensive_
const QUIC_BUFFER* const AlpnBuffers,
_In_range_(>, 0) uint32_t AlpnBufferCount,
_In_reads_bytes_opt_(SettingsSize)
const QUIC_SETTINGS* Settings,
_In_ uint32_t SettingsSize,
_In_opt_ void* Context,
_Outptr_ _At_(*Configuration, __drv_allocatesMem(Mem)) _Pre_defensive_
HQUIC* Configuration
);
```

# Parameters

`Registration`

The valid handle to an open registration object.

**TODO**

# Return Value

The function returns a [QUIC_STATUS](QUIC_STATUS.md). The app may use `QUIC_FAILED` or `QUIC_SUCCEEDED` to determine if the function failed or succeeded.

# Remarks

**TODO**

# See Also

[ConfigurationClose](ConfigurationClose.md)<br>
[ConfigurationLoadCredential](ConfigurationLoadCredential.md)<br>
11 changes: 8 additions & 3 deletions docs/api/ConnectionOpen.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@ typedef
_IRQL_requires_max_(DISPATCH_LEVEL)
QUIC_STATUS
(QUIC_API * QUIC_CONNECTION_OPEN_FN)(
_In_ _Pre_defensive_ HQUIC Session,
_In_ _Pre_defensive_ HQUIC Registration,
_In_ _Pre_defensive_ HQUIC Configuration,
_In_ _Pre_defensive_ QUIC_CONNECTION_CALLBACK_HANDLER Handler,
_In_opt_ void* Context,
_Outptr_ _At_(*Connection, __drv_allocatesMem(Mem)) _Pre_defensive_
Expand All @@ -20,9 +21,13 @@ QUIC_STATUS

# Parameters

`Session`
`Registration`

The valid handle to an open session object.
The valid handle to an open registration object.

`Configuration`

The valid handle to an open configuration object.

`Handler`

Expand Down
2 changes: 1 addition & 1 deletion docs/api/GetContext.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ void*

`Handle`

The valid handle to any API object. This includes handles to registration, session, listener, connection and stream objects.
The valid handle to any API object. This includes handles to registration, configuration, listener, connection and stream objects.

# Return Value

Expand Down
2 changes: 1 addition & 1 deletion docs/api/GetParam.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ QUIC_STATUS

`Handle`

The valid handle to any API object. This includes handles to registration, session, listener, connection and stream objects. For `Level` equal to `QUIC_PARAM_LEVEL_GLOBAL`, this parameter must be `NULL`.
The valid handle to any API object. This includes handles to registration, configuration, listener, connection and stream objects. For `Level` equal to `QUIC_PARAM_LEVEL_GLOBAL`, this parameter must be `NULL`.

`Level`

Expand Down
2 changes: 1 addition & 1 deletion docs/api/ListenerOpen.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ typedef
_IRQL_requires_max_(PASSIVE_LEVEL)
QUIC_STATUS
(QUIC_API * QUIC_LISTENER_OPEN_FN)(
_In_ _Pre_defensive_ HQUIC Session,
_In_ _Pre_defensive_ HQUIC Registration,
_In_ _Pre_defensive_ QUIC_LISTENER_CALLBACK_HANDLER Handler,
_In_opt_ void* Context,
_Outptr_ _At_(*Listener, __drv_allocatesMem(Mem)) _Pre_defensive_
Expand Down
3 changes: 3 additions & 0 deletions docs/api/ListenerStart.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@ _IRQL_requires_max_(PASSIVE_LEVEL)
QUIC_STATUS
(QUIC_API * QUIC_LISTENER_START_FN)(
_In_ _Pre_defensive_ HQUIC Listener,
_In_reads_(AlpnBufferCount) _Pre_defensive_
const QUIC_BUFFER* const AlpnBuffers,
_In_range_(>, 0) uint32_t AlpnBufferCount,
_In_opt_ const QUIC_ADDR* LocalAddress
);
```
Expand Down
32 changes: 14 additions & 18 deletions docs/api/QUIC_API_TABLE.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,12 @@ typedef struct QUIC_API_TABLE {

QUIC_REGISTRATION_OPEN_FN RegistrationOpen;
QUIC_REGISTRATION_CLOSE_FN RegistrationClose;
QUIC_REGISTRATION_SHUTDOWN_FN RegistrationShutdown;

QUIC_SEC_CONFIG_CREATE_FN SecConfigCreate;
QUIC_SEC_CONFIG_DELETE_FN SecConfigDelete;

QUIC_SESSION_OPEN_FN SessionOpen;
QUIC_SESSION_CLOSE_FN SessionClose;
QUIC_SESSION_SHUTDOWN_FN SessionShutdown;
QUIC_CONFIGURATION_OPEN_FN ConfigurationOpen;
QUIC_CONFIGURATION_CLOSE_FN ConfigurationClose;
QUIC_CONFIGURATION_LOAD_CREDENTIAL_FN
ConfigurationLoadCredential;

QUIC_LISTENER_OPEN_FN ListenerOpen;
QUIC_LISTENER_CLOSE_FN ListenerClose;
Expand All @@ -34,6 +33,7 @@ typedef struct QUIC_API_TABLE {
QUIC_CONNECTION_CLOSE_FN ConnectionClose;
QUIC_CONNECTION_SHUTDOWN_FN ConnectionShutdown;
QUIC_CONNECTION_START_FN ConnectionStart;
QUIC_CONNECTION_SEND_RESUMPTION_FN ConnectionSendResumptionTicket;

QUIC_STREAM_OPEN_FN StreamOpen;
QUIC_STREAM_CLOSE_FN StreamClose;
Expand Down Expand Up @@ -78,25 +78,21 @@ See [RegistrationOpen](RegistrationOpen.md)

See [RegistrationClose](RegistrationClose.md)

`SecConfigCreate`

See [SecConfigCreate](SecConfigCreate.md)

`SecConfigDelete`
`RegistrationShutdown`

See [SecConfigDelete](SecConfigDelete.md)
See [RegistrationShutdown](RegistrationShutdown.md)

`SessionOpen`
`ConfigurationOpen`

See [SessionOpen](SessionOpen.md)
See [ConfigurationOpen](ConfigurationOpen.md)

`SessionClose`
`ConfigurationClose`

See [SessionClose](SessionClose.md)
See [ConfigurationClose](ConfigurationClose.md)

`SessionShutdown`
`ConfigurationLoadCredential`

See [SessionShutdown](SessionShutdown.md)
See [ConfigurationLoadCredential](ConfigurationLoadCredential.md)

`ListenerOpen`

Expand Down
2 changes: 1 addition & 1 deletion docs/api/RegistrationClose.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ A registration handle from a previous call to [RegistrationOpen](RegistrationOpe

# Remarks

The application **must** close/delete all child security configurations and session objects before closing the registration. This call **will block** on those outstanding objects being cleaned up. Do no call it on any MsQuic event callback, or it will deadlock.
The application **must** close/delete all child configurations and connection objects before closing the registration. This call **will block** on those outstanding objects being cleaned up. Do no call it on any MsQuic event callback, or it will deadlock.

# See Also

Expand Down
Original file line number Diff line number Diff line change
@@ -1,26 +1,26 @@
SessionShutdown function
RegistrationShutdown function
======

Starts the shutdown process for all connections in the session.
Starts the shutdown process for all connections in the registration.

# Syntax

```C
typedef
_IRQL_requires_max_(PASSIVE_LEVEL)
_IRQL_requires_max_(DISPATCH_LEVEL)
void
(QUIC_API * QUIC_SESSION_SHUTDOWN_FN)(
_In_ _Pre_defensive_ HQUIC Session,
(QUIC_API * QUIC_REGISTRATION_SHUTDOWN_FN)(
_In_ _Pre_defensive_ HQUIC Registration,
_In_ QUIC_CONNECTION_SHUTDOWN_FLAGS Flags,
_In_ _Pre_defensive_ QUIC_UINT62 ErrorCode // Application defined error code
);
```

# Parameters

`Session`
`Registration`

The valid handle to an open session object.
The valid handle to an open registration object.

`Flags`

Expand All @@ -41,6 +41,6 @@ The 62-bit error code to indicate to the peer as the reason for the shutdown.

# See Also

[SessionOpen](SessionOpen.md)<br>
[SessionClose](SessionClose.md)<br>
[RegistrationOpen](RegistrationOpen.md)<br>
[RegistrationClose](RegistrationClose.md)<br>
[ConnectionShutdown](ConnectionShutdown.md)<br>
67 changes: 0 additions & 67 deletions docs/api/SecConfigCreate.md

This file was deleted.