diff --git a/external/test-runtime/XUnit.Runtime.depproj b/external/test-runtime/XUnit.Runtime.depproj index 862d48eb1289..e47d7ae633cc 100644 --- a/external/test-runtime/XUnit.Runtime.depproj +++ b/external/test-runtime/XUnit.Runtime.depproj @@ -78,7 +78,7 @@ 1.0.2-prerelease - 1.0.0-prerelease + 1.0.7 1.0.7 diff --git a/src/Common/tests/System/Net/Configuration.Certificates.cs b/src/Common/tests/System/Net/Configuration.Certificates.cs index 340792634202..dbe69c51d223 100644 --- a/src/Common/tests/System/Net/Configuration.Certificates.cs +++ b/src/Common/tests/System/Net/Configuration.Certificates.cs @@ -16,8 +16,8 @@ public static partial class Configuration { public static partial class Certificates { - private const string CertificatePassword = "testcertificate"; - private const string TestDataFolder = "TestData"; + private const string CertificatePassword = "PLACEHOLDER"; + private const string TestDataFolder = "TestDataCertificates"; private static readonly Mutex m; private const int MutexTimeout = 120 * 1000; diff --git a/src/Common/tests/System/Net/Prerequisites/Deployment/setup_certificates.ps1 b/src/Common/tests/System/Net/Prerequisites/Deployment/setup_certificates.ps1 deleted file mode 100644 index ec7ed4bee100..000000000000 --- a/src/Common/tests/System/Net/Prerequisites/Deployment/setup_certificates.ps1 +++ /dev/null @@ -1,129 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. -# See the LICENSE file in the project root for more information. - -#Requires -RunAsAdministrator - -# Certificate configuration - -$script:testDataUri = "https://github.com/dotnet/corefx-testdata/archive/master.zip" -$script:testData = "corefx-testdata" -$script:certificatePath = "$($script:testData)\corefx-testdata-master\System.Net.TestData" - -$script:clientPrivateKeyPath = Join-Path $script:certificatePath "testclient1_at_contoso.com.pfx" -$script:clientPrivateKeyPassword = "testcertificate" - -$script:serverPrivateKeyPath = Join-Path $script:certificatePath "contoso.com.pfx" -$script:serverPrivateKeyPassword = "testcertificate" - -Function GetFullPath($relativePath) -{ - return (Get-Item $relativePath).FullName -} - -Function DeleteTestData -{ - if (Test-Path $script:testData) - { - rmdir $script:testData -Recurse -Force - } - - del ($testData + ".zip") -ErrorAction SilentlyContinue -} - -Function DownloadTestData -{ - DeleteTestData - DownloadFile $script:testDataUri ($testData + ".zip") - Expand-Archive ($testData + ".zip") -} - -Function LoadCertificateAndRoot($fileName, $password) -{ - $privateCerts = New-Object System.Security.Cryptography.X509Certificates.X509Certificate2Collection - $fullPath = GetFullPath $fileName - - $privateCerts.Import($fullPath, $password, ("MachineKeySet", "PersistKeySet", "Exportable")) - - $privateKeyCert = $null - foreach ($cert in $privateCerts) - { - if ($privateKeyCert -eq $null -and $cert.HasPrivateKey) - { - $privateKeyCert = $cert - } - } - - $rootCACert = $privateCerts | where {$_.Subject -eq $privateKeyCert.Issuer} - - return ($privateKeyCert, $rootCACert) -} - -Function AddCertificateToStore($certificate, $storeName, $storeLocation) -{ - $rootStore = New-Object System.Security.Cryptography.X509Certificates.X509Store($storeName, $storeLocation) - $rootStore.Open("ReadWrite") - $rootStore.Add($certificate) - $rootStore.Close() -} - -Function InstallCertificates($fileName, $password) -{ - Write-Host "Acquiring test data." - DownloadTestData - - Write-Host "Adding certificates" - ($private, $root) = LoadCertificateAndRoot $fileName $password - - Write-Host -ForegroundColor DarkGray "`tAdding root certificate: $($root.Subject)" - AddCertificateToStore $root "Root" "LocalMachine" - - Write-Host -ForegroundColor DarkGray "`tAdding private key certificate: $($private.Subject)" - AddCertificateToStore $private "My" "LocalMachine" - - Write-Host "Removing temporary files" - DeleteTestData -} - -Function InstallClientCertificates -{ - Write-Host -ForegroundColor Cyan "Installing Client Certificates" - InstallCertificates $script:clientPrivateKeyPath $script:clientPrivateKeyPassword -} - -Function InstallServerCertificates -{ - Write-Host -ForegroundColor Cyan "Installing Server Certificates" - InstallCertificates $script:serverPrivateKeyPath $script:serverPrivateKeyPassword -} - -Function GetServerCertificate -{ - return dir Cert:\LocalMachine\My | where { $_.DnsNameList | where{$_.Punycode -eq $script:iisServerFQDN} } -} - -Function RemoveCertificates($filename, $password) -{ - Write-Host "Acquiring test data." - DownloadTestData - ($private, $root) = LoadCertificateAndRoot $fileName $password - - Write-Host -ForegroundColor DarkGray "`tRemoving root certificate: $($root.Subject)" - dir Cert:\LocalMachine\Root | where {$_.Subject -eq $root.Subject} | foreach { rm (Join-Path Cert:\LocalMachine\Root $_.Thumbprint) } - Write-Host -ForegroundColor DarkGray "`tRemoving private key certificate: $($private.Subject)" - dir Cert:\LocalMachine\My | where {$_.Subject -eq $private.Subject} | foreach { rm (Join-Path Cert:\LocalMachine\My $_.Thumbprint) -DeleteKey } - - DeleteTestData -} - -Function RemoveClientCertificates -{ - Write-Host -ForegroundColor Cyan "Removing Client Certificates" - RemoveCertificates $script:clientPrivateKeyPath $script:clientPrivateKeyPassword -} - -Function RemoveServerCertificates -{ - Write-Host -ForegroundColor Cyan "Removing Server Certificates" - RemoveCertificates $script:serverPrivateKeyPath $script:serverPrivateKeyPassword -} \ No newline at end of file diff --git a/src/System.Data.Common/tests/System/Data/Common/DbConnectionStringBuilderTest.cs b/src/System.Data.Common/tests/System/Data/Common/DbConnectionStringBuilderTest.cs index a703b498eb56..717a122452a4 100644 --- a/src/System.Data.Common/tests/System/Data/Common/DbConnectionStringBuilderTest.cs +++ b/src/System.Data.Common/tests/System/Data/Common/DbConnectionStringBuilderTest.cs @@ -1867,12 +1867,12 @@ public void EmbeddedCharTest1() sb["Data Source"] = "testdb"; sb["User ID"] = "someuser"; - sb["Password"] = "abcdef"; - Assert.Equal("Data Source=testdb;User ID=someuser;Password=abcdef", + sb["Password"] = "PLACEHOLDER"; + Assert.Equal("Data Source=testdb;User ID=someuser;Password=PLACEHOLDER", sb.ConnectionString); - sb["Password"] = "abcdef#"; - Assert.Equal("Data Source=testdb;User ID=someuser;Password=abcdef#", + sb["Password"] = "PLACEHOLDER#"; + Assert.Equal("Data Source=testdb;User ID=someuser;Password=PLACEHOLDER#", sb.ConnectionString); // an embedded single-quote value will result in the value being delimieted with double quotes @@ -1893,39 +1893,39 @@ public void EmbeddedCharTest1() sb.ConnectionString); sb = new DbConnectionStringBuilder(); - sb["PASSWORD"] = "abcdef1"; + sb["PASSWORD"] = "PLACEHOLDERabcdef1"; sb["user id"] = "someuser"; sb["Data Source"] = "testdb"; - Assert.Equal("PASSWORD=abcdef1;user id=someuser;Data Source=testdb", + Assert.Equal("PASSWORD=PLACEHOLDERabcdef1;user id=someuser;Data Source=testdb", sb.ConnectionString); // case is preserved for a keyword that was added the first time sb = new DbConnectionStringBuilder(); - sb["PassWord"] = "abcdef2"; + sb["PassWord"] = "PLACEHOLDERabcdef2"; sb["uSER iD"] = "someuser"; sb["DaTa SoUrCe"] = "testdb"; - Assert.Equal("PassWord=abcdef2;uSER iD=someuser;DaTa SoUrCe=testdb", + Assert.Equal("PassWord=PLACEHOLDERabcdef2;uSER iD=someuser;DaTa SoUrCe=testdb", sb.ConnectionString); - sb["passWORD"] = "abc123"; - Assert.Equal("PassWord=abc123;uSER iD=someuser;DaTa SoUrCe=testdb", + sb["passWORD"] = "PLACEHOLDERabc123"; + Assert.Equal("PassWord=PLACEHOLDERabc123;uSER iD=someuser;DaTa SoUrCe=testdb", sb.ConnectionString); // embedded equal sign in the value will cause the value to be // delimited with double-quotes sb = new DbConnectionStringBuilder(); - sb["Password"] = "abc=def"; + sb["Password"] = "PLACEHOLDER=def"; sb["Data Source"] = "testdb"; sb["User ID"] = "someuser"; - Assert.Equal("Password=\"abc=def\";Data Source=testdb;User ID=someuser", + Assert.Equal("Password=\"PLACEHOLDER=def\";Data Source=testdb;User ID=someuser", sb.ConnectionString); // embedded semicolon in the value will cause the value to be // delimited with double-quotes sb = new DbConnectionStringBuilder(); - sb["Password"] = "abc;def"; + sb["Password"] = "PLACEHOLDER;def"; sb["Data Source"] = "testdb"; sb["User ID"] = "someuser"; - Assert.Equal("Password=\"abc;def\";Data Source=testdb;User ID=someuser", + Assert.Equal("Password=\"PLACEHOLDER;def\";Data Source=testdb;User ID=someuser", sb.ConnectionString); // more right parentheses then left parentheses - happily takes it @@ -2042,32 +2042,32 @@ public void EmbeddedCharTest3() DbConnectionStringBuilder sb; sb = new DbConnectionStringBuilder(); - sb.ConnectionString = "User ID=SCOTT;Password=TiGeR;Data Source=" + dataSource; + sb.ConnectionString = "User ID=SCOTT;Password=PLACEHOLDER;Data Source=" + dataSource; Assert.Equal(dataSource, sb["Data Source"]); Assert.Equal("SCOTT", sb["User ID"]); - Assert.Equal("TiGeR", sb["Password"]); + Assert.Equal("PLACEHOLDER", sb["Password"]); Assert.Equal( - "user id=SCOTT;password=TiGeR;data source=\"(DESCRIPTION=(ADDRESS=(PROTOCOL=" + + "user id=SCOTT;password=PLACEHOLDER;data source=\"(DESCRIPTION=(ADDRESS=(PROTOCOL=" + "TCP)(HOST=192.168.1.101)(PORT=1521))(CONNECT_DATA=(SERVER=DEDICATED)" + "(SERVICE_NAME=TESTDB)))\"", sb.ConnectionString); sb = new DbConnectionStringBuilder(false); - sb.ConnectionString = "User ID=SCOTT;Password=TiGeR;Data Source=" + dataSource; + sb.ConnectionString = "User ID=SCOTT;Password=PLACEHOLDER;Data Source=" + dataSource; Assert.Equal(dataSource, sb["Data Source"]); Assert.Equal("SCOTT", sb["User ID"]); - Assert.Equal("TiGeR", sb["Password"]); + Assert.Equal("PLACEHOLDER", sb["Password"]); Assert.Equal( - "user id=SCOTT;password=TiGeR;data source=\"(DESCRIPTION=(ADDRESS=(PROTOCOL=" + + "user id=SCOTT;password=PLACEHOLDER;data source=\"(DESCRIPTION=(ADDRESS=(PROTOCOL=" + "TCP)(HOST=192.168.1.101)(PORT=1521))(CONNECT_DATA=(SERVER=DEDICATED)" + "(SERVICE_NAME=TESTDB)))\"", sb.ConnectionString); sb = new DbConnectionStringBuilder(true); - sb.ConnectionString = "User ID=SCOTT;Password=TiGeR;Data Source=" + dataSource; + sb.ConnectionString = "User ID=SCOTT;Password=PLACEHOLDER;Data Source=" + dataSource; Assert.Equal(dataSource, sb["Data Source"]); Assert.Equal("SCOTT", sb["User ID"]); - Assert.Equal("TiGeR", sb["Password"]); + Assert.Equal("PLACEHOLDER", sb["Password"]); Assert.Equal( - "user id=SCOTT;password=TiGeR;data source=(DESCRIPTION=(ADDRESS=(PROTOCOL=" + + "user id=SCOTT;password=PLACEHOLDER;data source=(DESCRIPTION=(ADDRESS=(PROTOCOL=" + "TCP)(HOST=192.168.1.101)(PORT=1521))(CONNECT_DATA=(SERVER=DEDICATED)" + "(SERVICE_NAME=TESTDB)))", sb.ConnectionString); } @@ -2078,24 +2078,24 @@ public void EmbeddedCharTest4() DbConnectionStringBuilder sb; sb = new DbConnectionStringBuilder(); - sb.ConnectionString = "PassWord=abcdef2;uSER iD=someuser;DaTa SoUrCe=testdb"; + sb.ConnectionString = "PassWord=PLACEHOLDER;uSER iD=someuser;DaTa SoUrCe=testdb"; sb["Integrated Security"] = "False"; Assert.Equal( - "password=abcdef2;user id=someuser;data source=testdb;Integrated Security=False", + "password=PLACEHOLDER;user id=someuser;data source=testdb;Integrated Security=False", sb.ConnectionString); sb = new DbConnectionStringBuilder(false); - sb.ConnectionString = "PassWord=abcdef2;uSER iD=someuser;DaTa SoUrCe=testdb"; + sb.ConnectionString = "PassWord=PLACEHOLDER;uSER iD=someuser;DaTa SoUrCe=testdb"; sb["Integrated Security"] = "False"; Assert.Equal( - "password=abcdef2;user id=someuser;data source=testdb;Integrated Security=False", + "password=PLACEHOLDER;user id=someuser;data source=testdb;Integrated Security=False", sb.ConnectionString); sb = new DbConnectionStringBuilder(true); - sb.ConnectionString = "PassWord=abcdef2;uSER iD=someuser;DaTa SoUrCe=testdb"; + sb.ConnectionString = "PassWord=PLACEHOLDER;uSER iD=someuser;DaTa SoUrCe=testdb"; sb["Integrated Security"] = "False"; Assert.Equal( - "password=abcdef2;user id=someuser;data source=testdb;Integrated Security=False", + "password=PLACEHOLDER;user id=someuser;data source=testdb;Integrated Security=False", sb.ConnectionString); } diff --git a/src/System.Data.SqlClient/tests/Tools/TDS/TDS.Servers/TDSServerArguments.cs b/src/System.Data.SqlClient/tests/Tools/TDS/TDS.Servers/TDSServerArguments.cs index d47f45a8ee11..25fb64576c0a 100644 --- a/src/System.Data.SqlClient/tests/Tools/TDS/TDS.Servers/TDSServerArguments.cs +++ b/src/System.Data.SqlClient/tests/Tools/TDS/TDS.Servers/TDSServerArguments.cs @@ -88,7 +88,7 @@ public TDSServerArguments() // By Default SQL authentication will be used. FedAuthRequiredPreLoginOption = TdsPreLoginFedAuthRequiredOption.FedAuthNotRequired; - EncryptionCertificate = new X509Certificate2("TdsServerCertificate.pfx", "SecretPassword123456"); + EncryptionCertificate = new X509Certificate2("TdsServerCertificate.pfx", "PLACEHOLDER"); ServerPrincipalName = AzureADServicePrincipalName; StsUrl = AzureADProductionTokenEndpoint; diff --git a/src/System.Data.SqlClient/tests/Tools/TDS/TDS.Servers/TdsServerCertificate.pfx b/src/System.Data.SqlClient/tests/Tools/TDS/TDS.Servers/TdsServerCertificate.pfx index a5c48e2aee1f..8d4afef7d2a0 100644 Binary files a/src/System.Data.SqlClient/tests/Tools/TDS/TDS.Servers/TdsServerCertificate.pfx and b/src/System.Data.SqlClient/tests/Tools/TDS/TDS.Servers/TdsServerCertificate.pfx differ diff --git a/src/System.Net.Http/tests/FunctionalTests/HttpClientHandlerTest.cs b/src/System.Net.Http/tests/FunctionalTests/HttpClientHandlerTest.cs index 64fe199d081f..6eda11d3f4fe 100644 --- a/src/System.Net.Http/tests/FunctionalTests/HttpClientHandlerTest.cs +++ b/src/System.Net.Http/tests/FunctionalTests/HttpClientHandlerTest.cs @@ -713,7 +713,7 @@ public async Task GetAsync_ServerNeedsNonStandardAuthAndSetCredential_StatusCode await LoopbackServer.CreateServerAsync(async (server, url) => { HttpClientHandler handler = CreateHttpClientHandler(); - handler.Credentials = new NetworkCredential("unused", "unused"); + handler.Credentials = new NetworkCredential("unused", "PLACEHOLDER"); using (var client = new HttpClient(handler)) { Task getResponseTask = client.GetAsync(url); diff --git a/src/System.Net.Http/tests/FunctionalTests/System.Net.Http.Functional.Tests.csproj b/src/System.Net.Http/tests/FunctionalTests/System.Net.Http.Functional.Tests.csproj index b3b9d2437d8a..cf652fd574fa 100644 --- a/src/System.Net.Http/tests/FunctionalTests/System.Net.Http.Functional.Tests.csproj +++ b/src/System.Net.Http/tests/FunctionalTests/System.Net.Http.Functional.Tests.csproj @@ -156,7 +156,7 @@ - + diff --git a/src/System.Net.Http/tests/Performance/System.Net.Http.Performance.Tests.csproj b/src/System.Net.Http/tests/Performance/System.Net.Http.Performance.Tests.csproj index d2948218eabf..a8dc551f76e4 100644 --- a/src/System.Net.Http/tests/Performance/System.Net.Http.Performance.Tests.csproj +++ b/src/System.Net.Http/tests/Performance/System.Net.Http.Performance.Tests.csproj @@ -24,10 +24,10 @@ - + - \ No newline at end of file + diff --git a/src/System.Net.Http/tests/UnitTests/HttpEnvironmentProxyTest.cs b/src/System.Net.Http/tests/UnitTests/HttpEnvironmentProxyTest.cs index 34a555f9ae28..063c70fba0d6 100644 --- a/src/System.Net.Http/tests/UnitTests/HttpEnvironmentProxyTest.cs +++ b/src/System.Net.Http/tests/UnitTests/HttpEnvironmentProxyTest.cs @@ -158,7 +158,7 @@ public void HttpProxy_CredentialParsing_Basic() { IWebProxy p; - Environment.SetEnvironmentVariable("all_proxy", "http://foo:bar@1.1.1.1:3000"); + Environment.SetEnvironmentVariable("all_proxy", "http://foo:PLACEHOLDER@1.1.1.1:3000"); Assert.True(HttpEnvironmentProxy.TryCreate(out p)); Assert.NotNull(p); Assert.NotNull(p.Credentials); @@ -170,7 +170,7 @@ public void HttpProxy_CredentialParsing_Basic() Assert.NotNull(p.Credentials); // Use different user for http and https - Environment.SetEnvironmentVariable("https_proxy", "http://foo1:bar1@1.1.1.1:3000"); + Environment.SetEnvironmentVariable("https_proxy", "http://foo1:PLACEHOLDER@1.1.1.1:3000"); Assert.True(HttpEnvironmentProxy.TryCreate(out p)); Assert.NotNull(p); Uri u = p.GetProxy(fooHttp); @@ -193,7 +193,7 @@ public void HttpProxy_Exceptions_Match() IWebProxy p; Environment.SetEnvironmentVariable("no_proxy", ".test.com,, foo.com"); - Environment.SetEnvironmentVariable("all_proxy", "http://foo:bar@1.1.1.1:3000"); + Environment.SetEnvironmentVariable("all_proxy", "http://foo:PLACEHOLDER@1.1.1.1:3000"); Assert.True(HttpEnvironmentProxy.TryCreate(out p)); Assert.NotNull(p); diff --git a/src/System.Net.Security/tests/FunctionalTests/System.Net.Security.Tests.csproj b/src/System.Net.Security/tests/FunctionalTests/System.Net.Security.Tests.csproj index bdf707b62d15..d897b25b77d0 100644 --- a/src/System.Net.Security/tests/FunctionalTests/System.Net.Security.Tests.csproj +++ b/src/System.Net.Security/tests/FunctionalTests/System.Net.Security.Tests.csproj @@ -155,7 +155,7 @@ - + diff --git a/src/System.Net.WebSockets.Client/tests/ConnectTest.cs b/src/System.Net.WebSockets.Client/tests/ConnectTest.cs index c12a0ab7c924..64988e894bf9 100644 --- a/src/System.Net.WebSockets.Client/tests/ConnectTest.cs +++ b/src/System.Net.WebSockets.Client/tests/ConnectTest.cs @@ -230,7 +230,7 @@ await LoopbackServer.CreateClientAndServerAsync(async uri => using (var clientSocket = new ClientWebSocket()) using (var cts = new CancellationTokenSource(TimeOutMilliseconds)) { - clientSocket.Options.SetRequestHeader("Authorization", "AWS4-HMAC-SHA256 Credential= AKIAXXXXXXXXXXXYSZA /20190301/us-east-2/neptune-db/aws4_request, SignedHeaders=host;x-amz-date, Signature=b8155de54d9faab00000000000000000000000000a07e0d7dda49902e4d9202"); + clientSocket.Options.SetRequestHeader("Authorization", "AWS4-HMAC-SHA256 Credential=PLACEHOLDER /20190301/us-east-2/neptune-db/aws4_request, SignedHeaders=host;x-amz-date, Signature=b8155de54d9faab00000000000000000000000000a07e0d7dda49902e4d9202"); await clientSocket.ConnectAsync(uri, cts.Token); } }, server => server.AcceptConnectionAsync(async connection => diff --git a/src/System.Net.WebSockets.Client/tests/System.Net.WebSockets.Client.Tests.csproj b/src/System.Net.WebSockets.Client/tests/System.Net.WebSockets.Client.Tests.csproj index 4b57c19a4052..1a2165d1ba0a 100644 --- a/src/System.Net.WebSockets.Client/tests/System.Net.WebSockets.Client.Tests.csproj +++ b/src/System.Net.WebSockets.Client/tests/System.Net.WebSockets.Client.Tests.csproj @@ -63,7 +63,7 @@ - + - \ No newline at end of file + diff --git a/src/System.Private.Uri/tests/ExtendedFunctionalTests/UriRelativeResolutionTest.cs b/src/System.Private.Uri/tests/ExtendedFunctionalTests/UriRelativeResolutionTest.cs index a1d49da1010c..f62aa41963cd 100644 --- a/src/System.Private.Uri/tests/ExtendedFunctionalTests/UriRelativeResolutionTest.cs +++ b/src/System.Private.Uri/tests/ExtendedFunctionalTests/UriRelativeResolutionTest.cs @@ -14,7 +14,7 @@ public class UriRelativeResolutionTest { // See RFC 3986 Section 5.2.2 and 5.4 http://www.ietf.org/rfc/rfc3986.txt - private readonly Uri _fullBaseUri = new Uri("http://user:psw@host:9090/path1/path2/path3/fileA?query#fragment"); + private readonly Uri _fullBaseUri = new Uri("http://user:PLACEHOLDER@host:9090/path1/path2/path3/fileA?query#fragment"); [Fact] public void Uri_Relative_BaseVsAbsolute_ReturnsFullAbsolute() @@ -391,7 +391,7 @@ public void Uri_Relative_BaseVsSlashTrippleDotSlash_ReturnsSlashTrippleDotSlash( [Fact] public void Uri_Relative_BaseMadeRelativeToSamePath_ReturnsQueryAndFragment() { - Uri compareUri = new Uri("http://user:psw@host:9090/path1/path2/path3/fileA?AQuery#AFragment"); + Uri compareUri = new Uri("http://user:PLACEHOLDER@host:9090/path1/path2/path3/fileA?AQuery#AFragment"); Uri relative = _fullBaseUri.MakeRelativeUri(compareUri); String expectedResult = "?AQuery#AFragment"; // compareUri.GetParts(UriComponents.Query | UriComponents.Fragment,UriFormat.Unescaped); @@ -401,7 +401,7 @@ public void Uri_Relative_BaseMadeRelativeToSamePath_ReturnsQueryAndFragment() [Fact] public void Uri_Relative_BaseMadeRelativeToLastSlash_ReturnsDotSlashPlusQueryAndFragment() { - Uri compareUri = new Uri("http://user:psw@host:9090/path1/path2/path3/?AQuery#AFragment"); + Uri compareUri = new Uri("http://user:PLACEHOLDER@host:9090/path1/path2/path3/?AQuery#AFragment"); Uri relative = _fullBaseUri.MakeRelativeUri(compareUri); Uri reassembled = new Uri(_fullBaseUri, relative); // Symetric @@ -414,7 +414,7 @@ public void Uri_Relative_BaseMadeRelativeToLastSlash_ReturnsDotSlashPlusQueryAnd [Fact] public void Uri_Relative_BaseMadeRelativeToLastSlash_ReturnsDotSlash() { - Uri compareUri = new Uri("http://user:psw@host:9090/path1/path2/path3/"); + Uri compareUri = new Uri("http://user:PLACEHOLDER@host:9090/path1/path2/path3/"); Uri relative = _fullBaseUri.MakeRelativeUri(compareUri); Uri reassembled = new Uri(_fullBaseUri, relative); // Symetric @@ -426,7 +426,7 @@ public void Uri_Relative_BaseMadeRelativeToLastSlash_ReturnsDotSlash() [Fact] public void Uri_Relative_BaseMadeRelativeToLastSlashWithExtra_ReturnsDotSlashPlusQueryAndFragment() { - Uri compareUri = new Uri("http://user:psw@host:9090/path1/path2/path3/Path4/fileb?AQuery#AFragment"); + Uri compareUri = new Uri("http://user:PLACEHOLDER@host:9090/path1/path2/path3/Path4/fileb?AQuery#AFragment"); Uri relative = _fullBaseUri.MakeRelativeUri(compareUri); Uri reassembled = new Uri(_fullBaseUri, relative); // Symetric @@ -438,7 +438,7 @@ public void Uri_Relative_BaseMadeRelativeToLastSlashWithExtra_ReturnsDotSlashPlu [Fact] public void Uri_Relative_BaseMadeRelativeToSecondToLastSlash_ReturnsDoubleDotSlashPlusQueryAndFragment() { - Uri compareUri = new Uri("http://user:psw@host:9090/path1/path2/?AQuery#AFragment"); + Uri compareUri = new Uri("http://user:PLACEHOLDER@host:9090/path1/path2/?AQuery#AFragment"); Uri relative = _fullBaseUri.MakeRelativeUri(compareUri); Uri reassembled = new Uri(_fullBaseUri, relative); // Symetric @@ -450,7 +450,7 @@ public void Uri_Relative_BaseMadeRelativeToSecondToLastSlash_ReturnsDoubleDotSla [Fact] public void Uri_Relative_BaseMadeRelativeToThirdToLastSlash_ReturnsDoubleDoubleDotSlashPlusQueryAndFragment() { - Uri compareUri = new Uri("http://user:psw@host:9090/path1/?AQuery#AFragment"); + Uri compareUri = new Uri("http://user:PLACEHOLDER@host:9090/path1/?AQuery#AFragment"); Uri relative = _fullBaseUri.MakeRelativeUri(compareUri); Uri reassembled = new Uri(_fullBaseUri, relative); // Symetric @@ -462,7 +462,7 @@ public void Uri_Relative_BaseMadeRelativeToThirdToLastSlash_ReturnsDoubleDoubleD [Fact] public void Uri_Relative_BaseMadeRelativeToEmptyPath_ReturnsTrippleDoubleDotSlashPlusQueryAndFragment() { - Uri compareUri = new Uri("http://user:psw@host:9090/?AQuery#AFragment"); + Uri compareUri = new Uri("http://user:PLACEHOLDER@host:9090/?AQuery#AFragment"); Uri relative = _fullBaseUri.MakeRelativeUri(compareUri); Uri reassembled = new Uri(_fullBaseUri, relative); // Symetric diff --git a/src/System.Private.Uri/tests/FunctionalTests/UriBuilderRefreshTest.cs b/src/System.Private.Uri/tests/FunctionalTests/UriBuilderRefreshTest.cs index 5297577ff3e4..684f03286c82 100644 --- a/src/System.Private.Uri/tests/FunctionalTests/UriBuilderRefreshTest.cs +++ b/src/System.Private.Uri/tests/FunctionalTests/UriBuilderRefreshTest.cs @@ -8,7 +8,7 @@ namespace System.PrivateUri.Tests { public class UriBuilderRefreshTest { - private static Uri s_starterUri = new Uri("http://user:psw@host:9090/path/file.txt?query#fragment"); + private static Uri s_starterUri = new Uri("http://user:PLACEHOLDER@host:9090/path/file.txt?query#fragment"); [Fact] public void UriBuilder_ChangeScheme_Refreshed() diff --git a/src/System.Private.Uri/tests/FunctionalTests/UriBuilderTests.cs b/src/System.Private.Uri/tests/FunctionalTests/UriBuilderTests.cs index 31835a660234..510900f4fc34 100644 --- a/src/System.Private.Uri/tests/FunctionalTests/UriBuilderTests.cs +++ b/src/System.Private.Uri/tests/FunctionalTests/UriBuilderTests.cs @@ -217,7 +217,7 @@ public void UserName_Get_Set(string value, string expected) [InlineData(null, "")] public void Password_Get_Set(string value, string expected) { - var uriBuilder = new UriBuilder("http://userinfo1:userinfo2@domain/path?query#fragment"); + var uriBuilder = new UriBuilder("http://userinfo1:PLACEHOLDER@domain/path?query#fragment"); uriBuilder.Password = value; Assert.Equal(expected, uriBuilder.Password); diff --git a/src/System.Private.Uri/tests/FunctionalTests/UriRelativeResolutionTest.cs b/src/System.Private.Uri/tests/FunctionalTests/UriRelativeResolutionTest.cs index 12a9b2ac3f04..c8bd2a272202 100644 --- a/src/System.Private.Uri/tests/FunctionalTests/UriRelativeResolutionTest.cs +++ b/src/System.Private.Uri/tests/FunctionalTests/UriRelativeResolutionTest.cs @@ -17,10 +17,10 @@ public class UriRelativeResolutionTest { // See RFC 3986 Section 5.2.2 and 5.4 http://www.ietf.org/rfc/rfc3986.txt - private readonly Uri _fullBaseUri = new Uri("http://user:psw@host:9090/path1/path2/path3/fileA?query#fragment"); - private const string FullBaseUriGetLeftPart_Path = "http://user:psw@host:9090/path1/path2/path3/fileA"; - private const string FullBaseUriGetLeftPart_Authority = "http://user:psw@host:9090"; - private const string FullBaseUriGetLeftPart_Query = "http://user:psw@host:9090/path1/path2/path3/fileA?query"; + private readonly Uri _fullBaseUri = new Uri("http://user:PLACEHOLDER@host:9090/path1/path2/path3/fileA?query#fragment"); + private const string FullBaseUriGetLeftPart_Path = "http://user:PLACEHOLDER@host:9090/path1/path2/path3/fileA"; + private const string FullBaseUriGetLeftPart_Authority = "http://user:PLACEHOLDER@host:9090"; + private const string FullBaseUriGetLeftPart_Query = "http://user:PLACEHOLDER@host:9090/path1/path2/path3/fileA?query"; [Fact] public void Uri_Relative_BaseVsAbsolute_ReturnsFullAbsolute() @@ -535,7 +535,7 @@ public void Uri_Relative_BaseVsSlashTrippleDotSlash_ReturnsSlashTrippleDotSlash( [Fact] public void Uri_Relative_BaseMadeRelativeToSamePath_ReturnsQueryAndFragment() { - Uri compareUri = new Uri("http://user:psw@host:9090/path1/path2/path3/fileA?AQuery#AFragment"); + Uri compareUri = new Uri("http://user:PLACEHOLDER@host:9090/path1/path2/path3/fileA?AQuery#AFragment"); Uri relative = _fullBaseUri.MakeRelativeUri(compareUri); String expectedResult = "?AQuery#AFragment"; // compareUri.GetParts(UriComponents.Query | UriComponents.Fragment,UriFormat.Unescaped); @@ -545,7 +545,7 @@ public void Uri_Relative_BaseMadeRelativeToSamePath_ReturnsQueryAndFragment() [Fact] public void Uri_Relative_BaseMadeRelativeToLastSlash_ReturnsDotSlashPlusQueryAndFragment() { - Uri compareUri = new Uri("http://user:psw@host:9090/path1/path2/path3/?AQuery#AFragment"); + Uri compareUri = new Uri("http://user:PLACEHOLDER@host:9090/path1/path2/path3/?AQuery#AFragment"); Uri relative = _fullBaseUri.MakeRelativeUri(compareUri); Uri reassembled = new Uri(_fullBaseUri, relative); // Symetric @@ -558,7 +558,7 @@ public void Uri_Relative_BaseMadeRelativeToLastSlash_ReturnsDotSlashPlusQueryAnd [Fact] public void Uri_Relative_BaseMadeRelativeToLastSlash_ReturnsDotSlash() { - Uri compareUri = new Uri("http://user:psw@host:9090/path1/path2/path3/"); + Uri compareUri = new Uri("http://user:PLACEHOLDER@host:9090/path1/path2/path3/"); Uri relative = _fullBaseUri.MakeRelativeUri(compareUri); Uri reassembled = new Uri(_fullBaseUri, relative); // Symetric @@ -570,7 +570,7 @@ public void Uri_Relative_BaseMadeRelativeToLastSlash_ReturnsDotSlash() [Fact] public void Uri_Relative_BaseMadeRelativeToLastSlashWithExtra_ReturnsDotSlashPlusQueryAndFragment() { - Uri compareUri = new Uri("http://user:psw@host:9090/path1/path2/path3/Path4/fileb?AQuery#AFragment"); + Uri compareUri = new Uri("http://user:PLACEHOLDER@host:9090/path1/path2/path3/Path4/fileb?AQuery#AFragment"); Uri relative = _fullBaseUri.MakeRelativeUri(compareUri); Uri reassembled = new Uri(_fullBaseUri, relative); // Symetric @@ -582,7 +582,7 @@ public void Uri_Relative_BaseMadeRelativeToLastSlashWithExtra_ReturnsDotSlashPlu [Fact] public void Uri_Relative_BaseMadeRelativeToSecondToLastSlash_ReturnsDoubleDotSlashPlusQueryAndFragment() { - Uri compareUri = new Uri("http://user:psw@host:9090/path1/path2/?AQuery#AFragment"); + Uri compareUri = new Uri("http://user:PLACEHOLDER@host:9090/path1/path2/?AQuery#AFragment"); Uri relative = _fullBaseUri.MakeRelativeUri(compareUri); Uri reassembled = new Uri(_fullBaseUri, relative); // Symetric @@ -594,7 +594,7 @@ public void Uri_Relative_BaseMadeRelativeToSecondToLastSlash_ReturnsDoubleDotSla [Fact] public void Uri_Relative_BaseMadeRelativeToThirdToLastSlash_ReturnsDoubleDoubleDotSlashPlusQueryAndFragment() { - Uri compareUri = new Uri("http://user:psw@host:9090/path1/?AQuery#AFragment"); + Uri compareUri = new Uri("http://user:PLACEHOLDER@host:9090/path1/?AQuery#AFragment"); Uri relative = _fullBaseUri.MakeRelativeUri(compareUri); Uri reassembled = new Uri(_fullBaseUri, relative); // Symetric @@ -606,7 +606,7 @@ public void Uri_Relative_BaseMadeRelativeToThirdToLastSlash_ReturnsDoubleDoubleD [Fact] public void Uri_Relative_BaseMadeRelativeToEmptyPath_ReturnsTrippleDoubleDotSlashPlusQueryAndFragment() { - Uri compareUri = new Uri("http://user:psw@host:9090/?AQuery#AFragment"); + Uri compareUri = new Uri("http://user:PLACEHOLDER@host:9090/?AQuery#AFragment"); Uri relative = _fullBaseUri.MakeRelativeUri(compareUri); Uri reassembled = new Uri(_fullBaseUri, relative); // Symetric diff --git a/src/System.Runtime/tests/System/Uri.CreateStringTests.cs b/src/System.Runtime/tests/System/Uri.CreateStringTests.cs index bdc34d1e9e1d..aba3ce9db6b3 100644 --- a/src/System.Runtime/tests/System/Uri.CreateStringTests.cs +++ b/src/System.Runtime/tests/System/Uri.CreateStringTests.cs @@ -424,7 +424,7 @@ public static IEnumerable Scheme_Authority_TestData() yield return new object[] { "http://abc\u1234\u2345\u3456@host/", "http", "abc%E1%88%B4%E2%8D%85%E3%91%96", "host", UriHostNameType.Dns, 80, true, false }; yield return new object[] { "http://\u1234abc\u2345\u3456@host/", "http", "%E1%88%B4abc%E2%8D%85%E3%91%96", "host", UriHostNameType.Dns, 80, true, false }; yield return new object[] { "http://\u1234\u2345\u3456abc@host/", "http", "%E1%88%B4%E2%8D%85%E3%91%96abc", "host", UriHostNameType.Dns, 80, true, false }; - yield return new object[] { "http://userinfo!~+-_*()[]:;&$=123USERINFO@host/", "http", "userinfo!~+-_*()[]:;&$=123USERINFO", "host", UriHostNameType.Dns, 80, true, false }; + yield return new object[] { "http://userinfo!~+-_*()[]:;&$=123PLACEHOLDER@host/", "http", "userinfo!~+-_*()[]:;&$=123PLACEHOLDER", "host", UriHostNameType.Dns, 80, true, false }; yield return new object[] { "http://%68%65%6C%6C%6F@host/", "http", "hello", "host", UriHostNameType.Dns, 80, true, false }; yield return new object[] { @"http://£@host/", "http", "%C2%A3", "host", UriHostNameType.Dns, 80, true, false }; yield return new object[] { "http://\u1234@host/", "http", "%E1%88%B4", "host", UriHostNameType.Dns, 80, true, false }; diff --git a/src/System.Security.Cryptography.Algorithms/tests/Rfc2898Tests.cs b/src/System.Security.Cryptography.Algorithms/tests/Rfc2898Tests.cs index 1b240bf994f0..e3d85bed01a4 100644 --- a/src/System.Security.Cryptography.Algorithms/tests/Rfc2898Tests.cs +++ b/src/System.Security.Cryptography.Algorithms/tests/Rfc2898Tests.cs @@ -458,44 +458,44 @@ private static IEnumerable GetKnownValuesTestCases() { CaseName = "SHA256 alternate", HashAlgorithmName = "SHA256", - Password = "abcdefghij", + Password = "PLACEHOLDER", Salt = ascii.GetBytes("abcdefghij"), IterationCount = 1, AnswerHex = ( // T-Block 1 - "9545B9CCBF915299F09BC4E8922B34B042F32689C072539FAEA739FCA4E782" + + "9352784113E5E6DC21FC82ADA3A321D64962F760DF6EAA8E46CEEF4FAF6C6E" + // T-Block 2 - "27B792394D6C13DB121CD16683CD738CB1717C69B34EF2B29E32306D24FCDF"), + "EE6DB97E5852FC4C15FA7C52FACDEDE89B916BCC864028084A2CF0889F7F76"), }; yield return new KnownValuesTestCase { CaseName = "SHA384 alternate", HashAlgorithmName = "SHA384", - Password = "abcdefghij", + Password = "PLACEHOLDER", Salt = ascii.GetBytes("abcdefghij"), IterationCount = 1, AnswerHex = ( // T-Block 1 - "BB8CCC844224775A66E038E59B74B232232AE27C4BF9625BBF3E50317EDD9217BE7B7E07AA5697AF7D2617" + + "B9A10C6C82F36482D76C0C38C982C05F8BB21211ACBE1D1104B4F647DDEAEE179B92ACB0E00A304B791FD0" + // T-Block 2 - "AC02F63AA2B0EC9697B1801E70BD10A6B58CE5DE83DD18F4FFD2E8D9289716510AA0A170EF1D145F4B3247"), + "3C6A08364D0A47CD1F15E0E314800FF3AC9CF2E93B3F81A5EB67FE9F2FE6E86B0430B59902CCB5FD190E67"), }; yield return new KnownValuesTestCase { CaseName = "SHA512 alternate", HashAlgorithmName = "SHA512", - Password = "abcdefghij", + Password = "PLACEHOLDER", Salt = ascii.GetBytes("abcdefghij"), IterationCount = 1, AnswerHex = ( // T-Block 1 - "9D6E96B14A53207C759DBB456B2F038170AF03389096E6EEB2161B3868D3E5" + - "1265A25EF7D7433BF8718DB14F934B6054ACCEA283528AD11A669C7C85196F" + + "AD8CE08CFA8F932CF9FEDDCDB6E4BC6417D61F0465D408C0BFE9656E2C1C47" + + "1424537ADB2D9EBE4E4232F474EFEE2AF347F21A804F64CBC05474A6DCE0A5" + // T-Block 2 - "B5DFAA2185446D6218EBC2D4030A83A4353B302E698C8521B6B69F7D5612EF" + - "AF060798DF40183FE6B71F2D35C60FBE27DFE963EFEE52A5756323BA1A41F6"), + "078100F813C1F8388EC233C1397D5E18C6509B5483141EF836C15A34D6DC67" + + "A3C46A45798A2839CFD239749219E9F2EDAD3249EC8221AFB17C0028A4A0A5"), }; } diff --git a/src/System.Security.Cryptography.X509Certificates/tests/ExportTests.cs b/src/System.Security.Cryptography.X509Certificates/tests/ExportTests.cs index 24dfa156c5eb..49da45a565ef 100644 --- a/src/System.Security.Cryptography.X509Certificates/tests/ExportTests.cs +++ b/src/System.Security.Cryptography.X509Certificates/tests/ExportTests.cs @@ -68,7 +68,7 @@ public static void ExportAsPfx() [ActiveIssue(16705, TestPlatforms.OSX)] public static void ExportAsPfxWithPassword() { - const string password = "Cotton"; + const string password = "PLACEHOLDER"; using (X509Certificate2 c1 = new X509Certificate2(TestData.MsCertificate)) { @@ -87,7 +87,7 @@ public static void ExportAsPfxWithPassword() [ActiveIssue(16705, TestPlatforms.OSX)] public static void ExportAsPfxVerifyPassword() { - const string password = "Cotton"; + const string password = "PLACEHOLDER"; using (X509Certificate2 c1 = new X509Certificate2(TestData.MsCertificate)) { @@ -103,7 +103,7 @@ public static void ExportAsPfxWithPrivateKeyVerifyPassword() { Assert.True(cert.HasPrivateKey, "cert.HasPrivateKey"); - const string password = "Cotton"; + const string password = "PLACEHOLDER"; byte[] pfx = cert.Export(X509ContentType.Pkcs12, password); diff --git a/src/System.Security.Cryptography.Xml/tests/EncryptedXmlTest.cs b/src/System.Security.Cryptography.Xml/tests/EncryptedXmlTest.cs index b004fcd5e6d6..e38c8d132f20 100644 --- a/src/System.Security.Cryptography.Xml/tests/EncryptedXmlTest.cs +++ b/src/System.Security.Cryptography.Xml/tests/EncryptedXmlTest.cs @@ -143,9 +143,10 @@ public void Sample2() { using (Aes aes = Aes.Create()) { + byte[] keydata = Convert.FromBase64String("o/ilseZu+keLBBWGGPlUHweqxIPc4gzZEFWr2nBt640="); aes.Mode = CipherMode.CBC; aes.KeySize = 256; - aes.Key = Convert.FromBase64String("o/ilseZu+keLBBWGGPlUHweqxIPc4gzZEFWr2nBt640="); + aes.Key = keydata; aes.Padding = PaddingMode.Zeros; XmlDocument doc = new XmlDocument(); @@ -174,10 +175,11 @@ public void RoundtripSample1() using (Aes aes = Aes.Create()) { + byte[] keydata = Convert.FromBase64String("o/ilseZu+keLBBWGGPlUHweqxIPc4gzZEFWr2nBt640="); aes.Mode = CipherMode.CBC; aes.KeySize = 256; aes.IV = Convert.FromBase64String("pBUM5P03rZ6AE4ZK5EyBrw=="); - aes.Key = Convert.FromBase64String("o/ilseZu+keLBBWGGPlUHweqxIPc4gzZEFWr2nBt640="); + aes.Key = keydata; aes.Padding = PaddingMode.Zeros; EncryptedXml exml = new EncryptedXml();