From 4cb8d7836c7910432bccfee7959e3e833c6e19b1 Mon Sep 17 00:00:00 2001 From: JP Dillingham Date: Wed, 20 Oct 2021 20:59:01 -0500 Subject: set minimum jwt key length to 16 --- src/slskd/Options.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/slskd/Options.cs b/src/slskd/Options.cs index e172db41..3bc4903f 100644 --- a/src/slskd/Options.cs +++ b/src/slskd/Options.cs @@ -752,7 +752,7 @@ namespace slskd [Argument(default, "jwt-key")] [EnvironmentVariable("JWT_KEY")] [Description("JWT signing key")] - [StringLength(255, MinimumLength = 1)] + [StringLength(255, MinimumLength = 16)] [RequiresRestart] public string Key { get; private set; } = Guid.NewGuid().ToString(); -- cgit v1.2.3 From 8cb9c8de52b65207ef35236c2c7d0de6f28ec082 Mon Sep 17 00:00:00 2001 From: JP Dillingham Date: Wed, 20 Oct 2021 20:59:42 -0500 Subject: remove pbkdf2 of jwt key --- src/slskd/Startup.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/slskd/Startup.cs b/src/slskd/Startup.cs index 322d8ed8..0ac5c437 100644 --- a/src/slskd/Startup.cs +++ b/src/slskd/Startup.cs @@ -20,6 +20,7 @@ namespace slskd using System; using System.IO; using System.Linq; + using System.Text; using System.Text.Json.Serialization; using System.Threading.Tasks; using Microsoft.AspNetCore.Authentication.JwtBearer; @@ -36,7 +37,6 @@ namespace slskd using Serilog; using slskd.Authentication; using slskd.Core.API; - using slskd.Cryptography; using slskd.Integrations.FTP; using slskd.Integrations.Pushbullet; using slskd.Messaging; @@ -71,7 +71,7 @@ namespace slskd ContentPath = Path.GetFullPath(OptionsAtStartup.Web.ContentPath); - JwtSigningKey = new SymmetricSecurityKey(Pbkdf2.GetKey(OptionsAtStartup.Web.Authentication.Jwt.Key)); + JwtSigningKey = new SymmetricSecurityKey(Encoding.UTF8.GetBytes(OptionsAtStartup.Web.Authentication.Jwt.Key)); } private IConfiguration Configuration { get; } -- cgit v1.2.3