Skip to content

Commit f9de0a7

Browse files
authored
Merge pull request #6 from filipw/bouncycastle-2.4.0
Upgraded to .NET 8.0 and BC 2.4.0
2 parents 06d627a + 11b9c45 commit f9de0a7

File tree

14 files changed

+93
-67
lines changed

14 files changed

+93
-67
lines changed

.github/workflows/dotnet.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ jobs:
1818
- name: Setup .NET
1919
uses: actions/setup-dotnet@v3
2020
with:
21-
dotnet-version: 7.0.x
21+
dotnet-version: 8.0.x
2222
- name: Restore dependencies
2323
run: dotnet restore
2424
- name: Build
@@ -35,7 +35,7 @@ jobs:
3535
- name: Setup .NET
3636
uses: actions/setup-dotnet@v3
3737
with:
38-
dotnet-version: 7.0.x
38+
dotnet-version: 8.0.x
3939
- name: Restore dependencies
4040
run: dotnet restore
4141
- name: Build & Pack

.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -396,3 +396,7 @@ FodyWeavers.xsd
396396

397397
# JetBrains Rider
398398
*.sln.iml
399+
.idea/.idea.Strathweb.Dilithium/.idea
400+
.idea
401+
.DS_Store
402+
samples/IdentityServer/keys

Directory.Build.props

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<Project>
22
<PropertyGroup>
3-
<Version>0.1.0</Version>
3+
<Version>0.2.0</Version>
44
<Deterministic>true</Deterministic>
55
<RepositoryUrl>https://github.com/filipw/Strathweb.Dilithium.git</RepositoryUrl>
66
<PackageTags>asp.net;security;post-quantum;dilithium;quantum;cryptography</PackageTags>

samples/ConsoleClient/ConsoleClient.csproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,14 @@
22

33
<PropertyGroup>
44
<OutputType>Exe</OutputType>
5-
<TargetFramework>net7.0</TargetFramework>
5+
<TargetFramework>net8.0</TargetFramework>
66
<ImplicitUsings>enable</ImplicitUsings>
77
<Nullable>enable</Nullable>
88
<IsPackable>false</IsPackable>
99
</PropertyGroup>
1010

1111
<ItemGroup>
12-
<PackageReference Include="identitymodel" Version="6.1.0" />
12+
<PackageReference Include="identitymodel" Version="7.0.0" />
1313
</ItemGroup>
1414

1515
</Project>

samples/IdentityServer/IdentityServer.csproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
<Project Sdk="Microsoft.NET.Sdk.Web">
22

33
<PropertyGroup>
4-
<TargetFramework>net7.0</TargetFramework>
4+
<TargetFramework>net8.0</TargetFramework>
55
<ImplicitUsings>enable</ImplicitUsings>
66
</PropertyGroup>
77

88
<ItemGroup>
9-
<PackageReference Include="Duende.IdentityServer" Version="6.2.0" />
9+
<PackageReference Include="Duende.IdentityServer" Version="7.0.6" />
1010
</ItemGroup>
1111

1212
<ItemGroup>

samples/SampleApi/SampleApi.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<Project Sdk="Microsoft.NET.Sdk.Web">
22

33
<PropertyGroup>
4-
<TargetFramework>net7.0</TargetFramework>
4+
<TargetFramework>net8.0</TargetFramework>
55
<Nullable>enable</Nullable>
66
<ImplicitUsings>enable</ImplicitUsings>
77
</PropertyGroup>

src/Strathweb.Dilithium.AspNetCore.Tests/Strathweb.Dilithium.AspNetCore.Tests.csproj

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
11
<Project Sdk="Microsoft.NET.Sdk.Web">
22

33
<PropertyGroup>
4-
<TargetFramework>net7.0</TargetFramework>
4+
<TargetFramework>net8.0</TargetFramework>
55
<ImplicitUsings>enable</ImplicitUsings>
66
<Nullable>enable</Nullable>
77
<IsTestProject>true</IsTestProject>
88
</PropertyGroup>
99

1010
<ItemGroup>
11-
<PackageReference Include="Microsoft.AspNetCore.Mvc.Testing" Version="7.0.10" />
12-
<PackageReference Include="Duende.IdentityServer" Version="6.2.0" />
13-
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.5.0" />
11+
<PackageReference Include="Microsoft.AspNetCore.Mvc.Testing" Version="8.0.8" />
12+
<PackageReference Include="Duende.IdentityServer" Version="7.0.6" />
13+
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.10.0" />
1414
<PackageReference Include="xunit" Version="2.4.2" />
1515
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.5">
1616
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
@@ -20,7 +20,7 @@
2020
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
2121
<PrivateAssets>all</PrivateAssets>
2222
</PackageReference>
23-
<PackageReference Include="identitymodel" Version="6.1.0" />
23+
<PackageReference Include="identitymodel" Version="7.0.0" />
2424
</ItemGroup>
2525

2626
<ItemGroup>

src/Strathweb.Dilithium.AspNetCore/DilithiumConfigurationExtensions.cs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
using System.IdentityModel.Tokens.Jwt;
22
using Microsoft.AspNetCore.Authentication.JwtBearer;
33
using Microsoft.Extensions.Caching.Memory;
4+
using Microsoft.IdentityModel.JsonWebTokens;
45
using Microsoft.IdentityModel.Protocols;
56
using Microsoft.IdentityModel.Protocols.OpenIdConnect;
67
using Microsoft.IdentityModel.Tokens;
@@ -33,7 +34,7 @@ private static void ConfigureDilithiumTokenSupportInternal(JwtBearerOptions opti
3334
var lweCryptoProvideFactory = new DilithiumCryptoProviderFactory();
3435
options.TokenValidationParameters.IssuerSigningKeyResolver = (_, securityToken, kid, tokenValidationParameters) =>
3536
{
36-
if (securityToken is not JwtSecurityToken _)
37+
if (securityToken is not JwtSecurityToken && securityToken is not JsonWebToken)
3738
{
3839
return Enumerable.Empty<SecurityKey>();
3940
}
@@ -50,7 +51,7 @@ private static void ConfigureDilithiumTokenSupportInternal(JwtBearerOptions opti
5051
}
5152

5253
var serverUrl = tokenValidationParameters.ValidIssuer ??
53-
tokenValidationParameters.ValidIssuers.FirstOrDefault() ?? options.Authority;
54+
tokenValidationParameters.ValidIssuers?.FirstOrDefault() ?? options.Authority;
5455

5556
if (serverUrl == null)
5657
throw new Exception(
Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22

33
<PropertyGroup>
4-
<TargetFramework>net7.0</TargetFramework>
4+
<TargetFramework>net8.0</TargetFramework>
55
<ImplicitUsings>enable</ImplicitUsings>
66
<Nullable>enable</Nullable>
77
</PropertyGroup>
@@ -11,11 +11,7 @@
1111
</ItemGroup>
1212

1313
<ItemGroup>
14-
<PackageReference Include="Microsoft.AspNetCore.Authentication.JwtBearer" Version="7.0.9" />
15-
16-
<!-- this reference below is not needed, but added to work around this lovely bug
17-
https://github.com/AzureAD/azure-activedirectory-identitymodel-extensions-for-dotnet/issues/1792 -->
18-
<PackageReference Include="System.IdentityModel.Tokens.Jwt " Version="6.32.1" />
14+
<PackageReference Include="Microsoft.AspNetCore.Authentication.JwtBearer" Version="8.0.8" />
1915
</ItemGroup>
2016

2117
</Project>
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22

33
<PropertyGroup>
4-
<TargetFramework>net7.0</TargetFramework>
4+
<TargetFramework>net8.0</TargetFramework>
55
<ImplicitUsings>enable</ImplicitUsings>
66
<Nullable>enable</Nullable>
77
</PropertyGroup>
@@ -11,7 +11,7 @@
1111
</ItemGroup>
1212

1313
<ItemGroup>
14-
<PackageReference Include="Duende.IdentityServer" Version="6.2.0" />
14+
<PackageReference Include="Duende.IdentityServer" Version="7.0.6" />
1515
</ItemGroup>
1616

1717
</Project>

0 commit comments

Comments
 (0)