Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
jobily
Runtime
提交
2a2ae309
R
Runtime
项目概览
jobily
/
Runtime
大约 1 年 前同步成功
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
R
Runtime
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
未验证
提交
2a2ae309
编写于
9月 14, 2023
作者:
C
Carlos Sánchez López
提交者:
GitHub
9月 14, 2023
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #91956 from vseanreesermsft/internal-merge-8.0-2023-09-12-1259
Merging internal commits for release/8.0
上级
18ac0088
ac803971
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
66 addition
and
2 deletion
+66
-2
eng/Versions.props
eng/Versions.props
+1
-1
src/libraries/Common/src/System/Net/Http/X509ResourceClient.cs
...ibraries/Common/src/System/Net/Http/X509ResourceClient.cs
+25
-1
src/libraries/System.Security.Cryptography/tests/X509Certificates/RevocationTests/AiaTests.cs
...graphy/tests/X509Certificates/RevocationTests/AiaTests.cs
+40
-0
未找到文件。
eng/Versions.props
浏览文件 @
2a2ae309
...
...
@@ -163,7 +163,7 @@
<optimizationlinuxarm64MIBCRuntimeVersion>1.0.0-prerelease.23462.6</optimizationlinuxarm64MIBCRuntimeVersion>
<optimizationPGOCoreCLRVersion>1.0.0-prerelease.23462.6</optimizationPGOCoreCLRVersion>
<!-- Not auto-updated. -->
<MicrosoftDiaSymReaderNativeVersion>16.11.2
7-beta1.23180.1
</MicrosoftDiaSymReaderNativeVersion>
<MicrosoftDiaSymReaderNativeVersion>16.11.2
9-beta1.23404.4
</MicrosoftDiaSymReaderNativeVersion>
<SystemCommandLineVersion>2.0.0-beta4.23307.1</SystemCommandLineVersion>
<TraceEventVersion>3.0.3</TraceEventVersion>
<NETStandardLibraryRefVersion>2.1.0</NETStandardLibraryRefVersion>
...
...
src/libraries/Common/src/System/Net/Http/X509ResourceClient.cs
浏览文件 @
2a2ae309
...
...
@@ -12,6 +12,9 @@ namespace System.Net.Http
{
internal
static
partial
class
X509ResourceClient
{
private
const
long
DefaultAiaDownloadLimit
=
100
*
1024
*
1024
;
private
static
long
AiaDownloadLimit
{
get
;
}
=
GetValue
(
"System.Security.Cryptography.AiaDownloadLimit"
,
DefaultAiaDownloadLimit
);
private
static
readonly
Func
<
string
,
CancellationToken
,
bool
,
Task
<
byte
[]?>>?
s_downloadBytes
=
CreateDownloadBytesFunc
();
static
partial
void
ReportNoClient
();
...
...
@@ -111,6 +114,7 @@ internal static partial class X509ResourceClient
ConstructorInfo
?
httpRequestMessageCtor
=
httpRequestMessageType
.
GetConstructor
(
Type
.
EmptyTypes
);
MethodInfo
?
sendMethod
=
httpClientType
.
GetMethod
(
"Send"
,
new
Type
[]
{
httpRequestMessageType
,
typeof
(
CancellationToken
)
});
MethodInfo
?
sendAsyncMethod
=
httpClientType
.
GetMethod
(
"SendAsync"
,
new
Type
[]
{
httpRequestMessageType
,
typeof
(
CancellationToken
)
});
PropertyInfo
?
maxResponseContentBufferSizeProp
=
httpClientType
.
GetProperty
(
"MaxResponseContentBufferSize"
);
PropertyInfo
?
responseContentProp
=
httpResponseMessageType
.
GetProperty
(
"Content"
);
PropertyInfo
?
responseStatusCodeProp
=
httpResponseMessageType
.
GetProperty
(
"StatusCode"
);
PropertyInfo
?
responseHeadersProp
=
httpResponseMessageType
.
GetProperty
(
"Headers"
);
...
...
@@ -121,7 +125,7 @@ internal static partial class X509ResourceClient
if
(
socketsHttpHandlerCtor
==
null
||
pooledConnectionIdleTimeoutProp
==
null
||
allowAutoRedirectProp
==
null
||
httpClientCtor
==
null
||
requestUriProp
==
null
||
httpRequestMessageCtor
==
null
||
sendMethod
==
null
||
sendAsyncMethod
==
null
||
sendMethod
==
null
||
sendAsyncMethod
==
null
||
maxResponseContentBufferSizeProp
==
null
||
responseContentProp
==
null
||
responseStatusCodeProp
==
null
||
responseHeadersProp
==
null
||
responseHeadersLocationProp
==
null
||
readAsStreamMethod
==
null
||
taskOfHttpResponseMessageResultProp
==
null
)
...
...
@@ -145,6 +149,7 @@ internal static partial class X509ResourceClient
pooledConnectionIdleTimeoutProp
.
SetValue
(
socketsHttpHandler
,
TimeSpan
.
FromSeconds
(
PooledConnectionIdleTimeoutSeconds
));
allowAutoRedirectProp
.
SetValue
(
socketsHttpHandler
,
false
);
object
?
httpClient
=
httpClientCtor
.
Invoke
(
new
object
?[]
{
socketsHttpHandler
});
maxResponseContentBufferSizeProp
.
SetValue
(
httpClient
,
AiaDownloadLimit
);
return
async
(
string
uriString
,
CancellationToken
cancellationToken
,
bool
async
)
=>
{
...
...
@@ -302,5 +307,24 @@ private static bool IsAllowedScheme(string scheme)
{
return
string
.
Equals
(
scheme
,
"http"
,
StringComparison
.
OrdinalIgnoreCase
);
}
private
static
long
GetValue
(
string
name
,
long
defaultValue
)
{
object
?
data
=
AppContext
.
GetData
(
name
);
if
(
data
is
null
)
{
return
defaultValue
;
}
try
{
return
Convert
.
ToInt64
(
data
);
}
catch
{
return
defaultValue
;
}
}
}
}
src/libraries/System.Security.Cryptography/tests/X509Certificates/RevocationTests/AiaTests.cs
浏览文件 @
2a2ae309
...
...
@@ -3,6 +3,7 @@
using
System.Linq
;
using
System.Security.Cryptography.X509Certificates.Tests.Common
;
using
Microsoft.DotNet.RemoteExecutor
;
using
Test.Cryptography
;
using
Xunit
;
...
...
@@ -178,5 +179,44 @@ public static void DisableAiaOptionWorks()
});
}
}
[
ActiveIssue
(
"https://github.com/dotnet/runtime/issues/57506"
,
typeof
(
PlatformDetection
),
nameof
(
PlatformDetection
.
IsMonoRuntime
),
nameof
(
PlatformDetection
.
IsMariner
))]
[
PlatformSpecific
(
TestPlatforms
.
Linux
)]
[
ConditionalFact
(
typeof
(
RemoteExecutor
),
nameof
(
RemoteExecutor
.
IsSupported
))]
public
static
void
AiaIgnoresCertOverLimit
()
{
RemoteExecutor
.
Invoke
(()
=>
{
AppContext
.
SetData
(
"System.Security.Cryptography.AiaDownloadLimit"
,
100
);
CertificateAuthority
.
BuildPrivatePki
(
PkiOptions
.
AllRevocation
,
out
RevocationResponder
responder
,
out
CertificateAuthority
root
,
out
CertificateAuthority
intermediate
,
out
X509Certificate2
endEntity
,
pkiOptionsInSubject
:
false
,
testName
:
Guid
.
NewGuid
().
ToString
());
using
(
responder
)
using
(
root
)
using
(
intermediate
)
using
(
endEntity
)
using
(
X509Certificate2
rootCert
=
root
.
CloneIssuerCert
())
{
responder
.
AiaResponseKind
=
AiaResponseKind
.
Cert
;
using
(
ChainHolder
holder
=
new
ChainHolder
())
{
X509Chain
chain
=
holder
.
Chain
;
chain
.
ChainPolicy
.
CustomTrustStore
.
Add
(
rootCert
);
chain
.
ChainPolicy
.
TrustMode
=
X509ChainTrustMode
.
CustomRootTrust
;
chain
.
ChainPolicy
.
VerificationTime
=
endEntity
.
NotBefore
.
AddMinutes
(
1
);
chain
.
ChainPolicy
.
UrlRetrievalTimeout
=
DynamicRevocationTests
.
s_urlRetrievalLimit
;
Assert
.
False
(
chain
.
Build
(
endEntity
));
}
}
}).
Dispose
();
}
}
}
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录