Skip to content

Commit e77935e

Browse files
committed
Map out relationships with .NET types
1 parent c30022b commit e77935e

File tree

1 file changed

+92
-0
lines changed

1 file changed

+92
-0
lines changed

TLS.md

Lines changed: 92 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,92 @@
1+
## Mapping to .NET types
2+
3+
### `SslStream`
4+
5+
| Member | WASI equivalent |
6+
|------------------------------------|--|
7+
| `CheckCertRevocationStatus` | ⛔ Not supported. Can be faked to return `false`. |
8+
| `CipherAlgorithm` | ⛔ Not supported. |
9+
| `CipherStrength` | ⛔ Not supported. |
10+
| `HashAlgorithm` | ⛔ Not supported. |
11+
| `HashStrength` | ⛔ Not supported. |
12+
| `IsAuthenticated` |`true` after the `connected`/`accepted` suspension occurred. |
13+
| `IsEncrypted` | ✅ Alias for `IsAuthenticated` |
14+
| `IsMutuallyAuthenticated` | ✅ Check that the connection `IsAuthenticated`, and that both `client-identity` and `server-identity` are not null. |
15+
| `IsServer` | ✅ To be maintained in userland |
16+
| `IsSigned` | ✅ Alias for `IsAuthenticated` |
17+
| `KeyExchangeAlgorithm` | ⛔ Not supported. |
18+
| `KeyExchangeStrength` | ⛔ Not supported. |
19+
| `LocalCertificate` |`tls-client::client-identity` / `tls-server::server-identity` |
20+
| `NegotiatedApplicationProtocol` |`tls-client::alpn-id` / `tls-server::alpn-id` |
21+
| `NegotiatedCipherSuite` | ⛔ Not supported. |
22+
| `RemoteCertificate` |`tls-client::server-identity` / `tls-server::client-identity` |
23+
| `SslProtocol` |`protocol-version` of the `tls-client/server` |
24+
| `TargetHostName` |`server-name` of the `tls-client/server` |
25+
| `TransportContext` | ❔ Unknown |
26+
| `AuthenticateAsClient`, `AuthenticateAsClientAsync`, `BeginAuthenticateAsClient`, `EndAuthenticateAsClient` | ✅ Construct `tls-client`, configure it (see `SslClientAuthenticationOptions` table below), and call `resume`. |
27+
| `AuthenticateAsServer`, `AuthenticateAsServerAsync`, `BeginAuthenticateAsServer`, `EndAuthenticateAsServer` | ✅ Construct `tls-server`, configure it (see `SslServerAuthenticationOptions` table below), and call `resume`. For the `ServerOptionsSelectionCallback` overload, enable `client-hello` suspension (see `SslClientHelloInfo` table below). |
28+
| `NegotiateClientCertificateAsync` | ⛔ Not supported. |
29+
| `Read`, `ReadAsync`, `BeginRead`, `EndRead`, `ReadByte`, `ReadAtLeast`, `ReadAtLeastAsync`, `ReadExactly`, `ReadExactlyAsync` |`private-input::read` |
30+
| `Write`, `WriteAsync`, `BeginWrite`, `EndWrite`, `WriteByte` |`private-output::write` |
31+
| `CopyTo`, `CopyToAsync` | ✅ Currently implemented in user space. Could be specialized as `output-stream::splice` in case both sides are WASI streams. |
32+
| `Flush`, `FlushAsync` |`private-output::flush` |
33+
| `Dispose`, `DisposeAsync`, `Close`, `Finalize`, `ShutdownAsync` | ✅ Fully flush and drop the `private-output` |
34+
| `CanRead` | ✅ Implemented in user space |
35+
| `ReadTimeout` | ✅ Implemented in user space |
36+
| `CanWrite` | ✅ Implemented in user space |
37+
| `WriteTimeout` | ✅ Implemented in user space |
38+
| `CanTimeout` | ✅ Implemented in user space |
39+
| `Position` | ✅ Implemented in user space |
40+
| `InnerStream` | ✅ Implemented in user space |
41+
| `LeaveInnerStreamOpen` | ✅ Implemented in user space |
42+
| `CanSeek` | ✅ Not applicable to network streams. `false` |
43+
| `Seek` | ✅ Not applicable to network streams. `throw new NotSupportedException()` |
44+
| `Length` | ✅ Not applicable to network streams. `throw new NotSupportedException()` |
45+
| `SetLength` | ✅ Not applicable to network streams. `throw new NotSupportedException()` |
46+
| `ToString`, `Equals`, `GetHashCode`, `GetLifetimeService`, `GetType`, `InitializeLifetimeService`, `MemberwiseClone`, `ObjectInvariant`, `CreateObjRef`, `CreateWaitHandle` | ✅ Generic .NET methods. Not specific to TLS. Implemented in user space |
47+
48+
49+
### `SslClientAuthenticationOptions`
50+
51+
| Member | WASI equivalent |
52+
|---------------------------------------|--|
53+
| `AllowRenegotiation` | ⛔ Not supported. |
54+
| `AllowTlsResume` | ⛔ Not supported. |
55+
| `ApplicationProtocols` |`tls-client::configure-alpn-ids` |
56+
| `CertificateChainPolicy` | ❔ Unknown |
57+
| `CertificateRevocationCheckMode` | ⛔ Not supported. Or effectively: only `NoCheck` is supported. |
58+
| `CipherSuitesPolicy` | ⛔ Not supported. Or effectively: only `null` (== OS default) is supported. |
59+
| `ClientCertificateContext` | ❔ Unknown |
60+
| `ClientCertificates` |`tls-client::configure-identities` |
61+
| `EnabledSslProtocols` | ⛔ Not supported. Or effectively: only `None` (== OS default) is supported. |
62+
| `EncryptionPolicy` | ⛔ (Obsolete) Not supported. Or effectively: only `RequireEncryption` is supported. |
63+
| `LocalCertificateSelectionCallback` | ✅ Enable `select-client-identity` suspension, while suspended call `tls-client::configure-identities`, and then `resume` |
64+
| `RemoteCertificateValidationCallback` | ✅ Enable `verify-server-identity` suspension, perform validation and then either `resume` or abort the connection. |
65+
| `TargetHost` | ✅ The `server-name` parameter of the `tls-client` constructor. |
66+
67+
68+
### `SslServerAuthenticationOptions`
69+
70+
| Member | WASI equivalent |
71+
|---------------------------------------|--|
72+
| `AllowRenegotiation` | ⛔ Not supported. |
73+
| `AllowTlsResume` | ⛔ Not supported. |
74+
| `ApplicationProtocols` |`tls-server::configure-alpn-ids` |
75+
| `CertificateChainPolicy` | ❔ Unknown |
76+
| `CertificateRevocationCheckMode` | ⛔ Not supported. Or effectively: only `NoCheck` is supported. |
77+
| `CipherSuitesPolicy` | ⛔ Not supported. Or effectively: only `null` (== OS default) is supported. |
78+
| `ClientCertificateRequired` | ⛔ Not supported. |
79+
| `EnabledSslProtocols` | ⛔ Not supported. Or effectively: only `None` (== OS default) is supported. |
80+
| `EncryptionPolicy` | ⛔ (Obsolete) Not supported. Or effectively: only `RequireEncryption` is supported. |
81+
| `RemoteCertificateValidationCallback` | ✅ Enable `verify-client-identity` suspension, perform validation and then either `resume` or abort the connection. |
82+
| `ServerCertificate` |`tls-server::configure-identities` |
83+
| `ServerCertificateContext` | ❔ Unknown |
84+
| `ServerCertificateSelectionCallback` | ✅ Enable `client-hello` suspension, while suspended call `tls-server::configure-identities`, and then `resume` |
85+
86+
87+
### `SslClientHelloInfo`
88+
89+
| Member | WASI equivalent |
90+
|----------------|--|
91+
| `ServerName` |`server-suspension::requested-server-name` |
92+
| `SslProtocols` |`server-suspension::requested-protocol-versions` |

0 commit comments

Comments
 (0)