aboutsummaryrefslogtreecommitdiffstats
path: root/src/slskd/Program.cs
diff options
context:
space:
mode:
authorJP Dillingham <jp@dillingham.me>2024-03-04 07:12:01 -0600
committerGitHub <noreply@github.com>2024-03-04 07:12:01 -0600
commit3af712067a03640fd251f804ca532bd4cd5f7b10 (patch)
tree5e0ce1932f9d959b17d49fbc0a32b27434f13419 /src/slskd/Program.cs
parentb39be34b05d6dd8e8d57e06512263d30634b9e1a (diff)
parent264019f11042fbffd789560635bf8943d4de9aa2 (diff)
downloadslskd-3af712067a03640fd251f804ca532bd4cd5f7b10.tar.gz
Merge branch 'master' into chore/codestyle
Diffstat (limited to 'src/slskd/Program.cs')
-rw-r--r--src/slskd/Program.cs11
1 files changed, 1 insertions, 10 deletions
diff --git a/src/slskd/Program.cs b/src/slskd/Program.cs
index ad50dccd..d7f6caca 100644
--- a/src/slskd/Program.cs
+++ b/src/slskd/Program.cs
@@ -634,16 +634,7 @@ namespace slskd
services.AddDataProtection()
.PersistKeysToFileSystem(new DirectoryInfo(Path.Combine(DataDirectory, "misc", ".DataProtection-Keys")));
- var adjustedJwtKey = OptionsAtStartup.Web.Authentication.Jwt.Key;
-
- // the JWT key must be at least 256 bits in length, due to the HMACSHA256 algorithm being used for signing.
- if (adjustedJwtKey.Length < 32)
- {
- adjustedJwtKey = adjustedJwtKey.PadRight(32, ' ');
- Log.Warning("The configured JWT signing key is less than the required 32 characters and has been padded with spaces to make up the difference. The minimum length will be raised from 16 to 32 in a future release, and this will become an error.");
- }
-
- var jwtSigningKey = new SymmetricSecurityKey(Encoding.UTF8.GetBytes(adjustedJwtKey));
+ var jwtSigningKey = new SymmetricSecurityKey(Encoding.UTF8.GetBytes(OptionsAtStartup.Web.Authentication.Jwt.Key));
services.AddSingleton(jwtSigningKey);
services.AddSingleton<ISecurityService, SecurityService>();