Skip to content

Commit 583728e

Browse files
captainsafiaKeegan Caruso
and
Keegan Caruso
authored
Update Wilson7 branch (#49491)
* SymmetricSecurityKey needs 32 bytes * Update source-build-externals dependencies --------- Co-authored-by: Keegan Caruso <[email protected]>
1 parent 4501b82 commit 583728e

File tree

6 files changed

+11
-8
lines changed

6 files changed

+11
-8
lines changed

eng/Version.Details.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -185,9 +185,9 @@
185185
<Uri>https://github.com/dotnet/runtime</Uri>
186186
<Sha>5d54b08d5fc40d0b1c156f430a487a94c1e34f79</Sha>
187187
</Dependency>
188-
<Dependency Name="Microsoft.SourceBuild.Intermediate.source-build-externals" Version="8.0.0-alpha.1.23329.1">
188+
<Dependency Name="Microsoft.SourceBuild.Intermediate.source-build-externals" Version="8.0.0-alpha.1.23368.1">
189189
<Uri>https://github.com/dotnet/source-build-externals</Uri>
190-
<Sha>ac076c101e6fe5e8fbfbd0a0ab878bd3313d9138</Sha>
190+
<Sha>844e2cd86e7525d7eb32358e63a0c554187eb26b</Sha>
191191
<SourceBuild RepoName="source-build-externals" ManagedOnly="true" />
192192
</Dependency>
193193
<Dependency Name="Microsoft.SourceBuild.Intermediate.symreader" Version="2.0.0-beta-23228-03">

eng/Versions.props

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,7 @@
163163
<!-- Packages from dotnet/source-link -->
164164
<MicrosoftSourceLinkGitHubVersion>8.0.0-beta.23328.1</MicrosoftSourceLinkGitHubVersion>
165165
<!-- Packages from dotnet/source-build-externals -->
166-
<MicrosoftSourceBuildIntermediatesourcebuildexternalsVersion>8.0.0-alpha.1.23329.1</MicrosoftSourceBuildIntermediatesourcebuildexternalsVersion>
166+
<MicrosoftSourceBuildIntermediatesourcebuildexternalsVersion>8.0.0-alpha.1.23368.1</MicrosoftSourceBuildIntermediatesourcebuildexternalsVersion>
167167
<!-- Packages from dotnet/source-build-reference-packages -->
168168
<MicrosoftSourceBuildIntermediatesourcebuildreferencepackagesVersion>8.0.0-alpha.1.23356.4</MicrosoftSourceBuildIntermediatesourcebuildreferencepackagesVersion>
169169
<!-- Packages from dotnet/symreader -->

src/SignalR/clients/csharp/Client/test/FunctionalTests/Startup.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
using System.IdentityModel.Tokens.Jwt;
66
using System.IO;
77
using System.Security.Claims;
8+
using System.Security.Cryptography;
89
using Microsoft.AspNetCore.Authentication.JwtBearer;
910
using Microsoft.AspNetCore.Authentication.Negotiate;
1011
using Microsoft.AspNetCore.Authorization;
@@ -21,7 +22,7 @@ namespace Microsoft.AspNetCore.SignalR.Client.FunctionalTests;
2122

2223
public class Startup
2324
{
24-
private readonly SymmetricSecurityKey SecurityKey = new SymmetricSecurityKey(Guid.NewGuid().ToByteArray());
25+
private readonly SymmetricSecurityKey SecurityKey = new SymmetricSecurityKey(SHA256.HashData(Guid.NewGuid().ToByteArray()));
2526
private readonly JwtSecurityTokenHandler JwtTokenHandler = new JwtSecurityTokenHandler();
2627

2728
public void ConfigureServices(IServiceCollection services)

src/SignalR/clients/ts/FunctionalTests/Startup.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
using System.IdentityModel.Tokens.Jwt;
66
using System.Reflection;
77
using System.Security.Claims;
8+
using System.Security.Cryptography;
89
using Microsoft.AspNetCore.Authentication.JwtBearer;
910
using Microsoft.AspNetCore.DataProtection;
1011
using Microsoft.AspNetCore.Http.Connections;
@@ -19,7 +20,7 @@ namespace FunctionalTests;
1920

2021
public class Startup
2122
{
22-
private readonly SymmetricSecurityKey SecurityKey = new SymmetricSecurityKey(Guid.NewGuid().ToByteArray());
23+
private readonly SymmetricSecurityKey SecurityKey = new SymmetricSecurityKey(SHA256.HashData(Guid.NewGuid().ToByteArray()));
2324
private readonly JwtSecurityTokenHandler JwtTokenHandler = new JwtSecurityTokenHandler();
2425

2526
private int _numRedirects;

src/SignalR/common/Http.Connections/test/HttpConnectionDispatcherTests.cs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
using System.Net.Http;
1111
using System.Net.WebSockets;
1212
using System.Security.Claims;
13+
using System.Security.Cryptography;
1314
using System.Security.Principal;
1415
using System.Text;
1516
using Microsoft.AspNetCore.Authentication;
@@ -2988,7 +2989,7 @@ public async Task ConnectionClosedRequestedTriggeredOnAuthExpiration()
29882989
[InlineData(HttpTransportType.WebSockets)]
29892990
public async Task AuthenticationExpirationSetOnAuthenticatedConnectionWithJWT(HttpTransportType transportType)
29902991
{
2991-
SymmetricSecurityKey SecurityKey = new SymmetricSecurityKey(Guid.NewGuid().ToByteArray());
2992+
SymmetricSecurityKey SecurityKey = new SymmetricSecurityKey(SHA256.HashData(Guid.NewGuid().ToByteArray()));
29922993
JwtSecurityTokenHandler JwtTokenHandler = new JwtSecurityTokenHandler();
29932994

29942995
using var host = CreateHost(services =>
@@ -3150,7 +3151,7 @@ public async Task AuthenticationExpirationSetOnAuthenticatedConnectionWithCookie
31503151
[InlineData(HttpTransportType.WebSockets)]
31513152
public async Task AuthenticationExpirationUsesCorrectScheme(HttpTransportType transportType)
31523153
{
3153-
var SecurityKey = new SymmetricSecurityKey(Guid.NewGuid().ToByteArray());
3154+
var SecurityKey = new SymmetricSecurityKey(SHA256.HashData(Guid.NewGuid().ToByteArray()));
31543155
var JwtTokenHandler = new JwtSecurityTokenHandler();
31553156

31563157
using var host = CreateHost(services =>

src/SignalR/samples/JwtSample/Startup.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ namespace JwtSample;
1111

1212
public class Startup
1313
{
14-
private readonly SymmetricSecurityKey SecurityKey = new SymmetricSecurityKey(RandomNumberGenerator.GetBytes(16));
14+
private readonly SymmetricSecurityKey SecurityKey = new SymmetricSecurityKey(RandomNumberGenerator.GetBytes(32));
1515
private readonly JwtSecurityTokenHandler JwtTokenHandler = new JwtSecurityTokenHandler();
1616

1717
public void ConfigureServices(IServiceCollection services)

0 commit comments

Comments
 (0)