#230 Disable TLS token binding pending updates

This commit is contained in:
Chris R 2016-08-19 10:19:33 -07:00
parent e39ea62808
commit 9f1476aea8
4 changed files with 16 additions and 12 deletions

View File

@ -40,7 +40,7 @@ namespace Microsoft.AspNetCore.Server.WebListener
IHttpResponseFeature, IHttpResponseFeature,
IHttpSendFileFeature, IHttpSendFileFeature,
ITlsConnectionFeature, ITlsConnectionFeature,
ITlsTokenBindingFeature, // ITlsTokenBindingFeature, TODO: https://github.com/aspnet/WebListener/issues/231
IHttpBufferingFeature, IHttpBufferingFeature,
IHttpRequestLifetimeFeature, IHttpRequestLifetimeFeature,
IHttpWebSocketFeature, IHttpWebSocketFeature,
@ -328,7 +328,7 @@ namespace Microsoft.AspNetCore.Server.WebListener
{ {
return Request.IsHttps ? this : null; return Request.IsHttps ? this : null;
} }
/* TODO: https://github.com/aspnet/WebListener/issues/231
byte[] ITlsTokenBindingFeature.GetProvidedTokenBindingId() byte[] ITlsTokenBindingFeature.GetProvidedTokenBindingId()
{ {
return Request.GetProvidedTokenBindingId(); return Request.GetProvidedTokenBindingId();
@ -343,7 +343,7 @@ namespace Microsoft.AspNetCore.Server.WebListener
{ {
return Request.IsHttps ? this : null; return Request.IsHttps ? this : null;
} }
*/
void IHttpBufferingFeature.DisableRequestBuffering() void IHttpBufferingFeature.DisableRequestBuffering()
{ {
// There is no request buffering. // There is no request buffering.

View File

@ -34,7 +34,7 @@ namespace Microsoft.AspNetCore.Server.WebListener
{ typeof(IHttpResponseFeature), _identityFunc }, { typeof(IHttpResponseFeature), _identityFunc },
{ typeof(IHttpSendFileFeature), _identityFunc }, { typeof(IHttpSendFileFeature), _identityFunc },
{ typeof(ITlsConnectionFeature), ctx => ctx.GetTlsConnectionFeature() }, { typeof(ITlsConnectionFeature), ctx => ctx.GetTlsConnectionFeature() },
{ typeof(ITlsTokenBindingFeature), ctx => ctx.GetTlsTokenBindingFeature() }, // { typeof(ITlsTokenBindingFeature), ctx => ctx.GetTlsTokenBindingFeature() }, TODO: https://github.com/aspnet/WebListener/issues/231
{ typeof(IHttpBufferingFeature), _identityFunc }, { typeof(IHttpBufferingFeature), _identityFunc },
{ typeof(IHttpRequestLifetimeFeature), _identityFunc }, { typeof(IHttpRequestLifetimeFeature), _identityFunc },
{ typeof(IHttpUpgradeFeature), _identityFunc }, { typeof(IHttpUpgradeFeature), _identityFunc },

View File

@ -25,6 +25,7 @@ namespace Microsoft.Net.Http.Server
/// <summary> /// <summary>
/// Contains helpers for dealing with TLS token binding. /// Contains helpers for dealing with TLS token binding.
/// </summary> /// </summary>
// TODO: https://github.com/aspnet/WebListener/issues/231
internal unsafe static class TokenBindingUtil internal unsafe static class TokenBindingUtil
{ {
private static byte[] ExtractIdentifierBlob(TOKENBINDING_RESULT_DATA* pTokenBindingResultData) private static byte[] ExtractIdentifierBlob(TOKENBINDING_RESULT_DATA* pTokenBindingResultData)

View File

@ -38,8 +38,9 @@ namespace Microsoft.Net.Http.Server
private NativeRequestContext _nativeRequestContext; private NativeRequestContext _nativeRequestContext;
private X509Certificate2 _clientCert; private X509Certificate2 _clientCert;
private byte[] _providedTokenBindingId; // TODO: https://github.com/aspnet/WebListener/issues/231
private byte[] _referredTokenBindingId; // private byte[] _providedTokenBindingId;
// private byte[] _referredTokenBindingId;
private BoundaryType _contentBoundaryType; private BoundaryType _contentBoundaryType;
private long? _contentLength; private long? _contentLength;
@ -125,7 +126,7 @@ namespace Microsoft.Net.Http.Server
var requestV2 = (HttpApi.HTTP_REQUEST_V2*)memoryBlob.RequestBlob; var requestV2 = (HttpApi.HTTP_REQUEST_V2*)memoryBlob.RequestBlob;
User = AuthenticationManager.GetUser(requestV2->pRequestInfo, requestV2->RequestInfoCount); User = AuthenticationManager.GetUser(requestV2->pRequestInfo, requestV2->RequestInfoCount);
GetTlsTokenBindingInfo(); // GetTlsTokenBindingInfo(); TODO: https://github.com/aspnet/WebListener/issues/231
// Finished directly accessing the HTTP_REQUEST structure. // Finished directly accessing the HTTP_REQUEST structure.
_nativeRequestContext.ReleasePins(); _nativeRequestContext.ReleasePins();
@ -328,17 +329,17 @@ namespace Microsoft.Net.Http.Server
} }
return _clientCert; return _clientCert;
} }
/* TODO: https://github.com/aspnet/WebListener/issues/231
public byte[] GetProvidedTokenBindingId() private byte[] GetProvidedTokenBindingId()
{ {
return _providedTokenBindingId; return _providedTokenBindingId;
} }
public byte[] GetReferredTokenBindingId() private byte[] GetReferredTokenBindingId()
{ {
return _referredTokenBindingId; return _referredTokenBindingId;
} }
*/
// Only call from the constructor so we can directly access the native request blob. // Only call from the constructor so we can directly access the native request blob.
// This requires Windows 10 and the following reg key: // This requires Windows 10 and the following reg key:
// Set Key: HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\HTTP\Parameters to Value: EnableSslTokenBinding = 1 [DWORD] // Set Key: HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\HTTP\Parameters to Value: EnableSslTokenBinding = 1 [DWORD]
@ -347,6 +348,8 @@ namespace Microsoft.Net.Http.Server
// Value: "iexplore.exe"=dword:0x00000001 // Value: "iexplore.exe"=dword:0x00000001
// Key: HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Internet Explorer\Main\FeatureControl\FEATURE_ENABLE_TOKEN_BINDING // Key: HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Internet Explorer\Main\FeatureControl\FEATURE_ENABLE_TOKEN_BINDING
// Value: "iexplore.exe"=dword:00000001 // Value: "iexplore.exe"=dword:00000001
// TODO: https://github.com/aspnet/WebListener/issues/231
/*
private unsafe void GetTlsTokenBindingInfo() private unsafe void GetTlsTokenBindingInfo()
{ {
var nativeRequest = (HttpApi.HTTP_REQUEST_V2*)_nativeRequestContext.RequestBlob; var nativeRequest = (HttpApi.HTTP_REQUEST_V2*)_nativeRequestContext.RequestBlob;
@ -360,7 +363,7 @@ namespace Microsoft.Net.Http.Server
} }
} }
} }
*/
// should only be called from RequestContext // should only be called from RequestContext
internal void Dispose() internal void Dispose()
{ {