From ff18da20982b399ab936b4c77b7d4987719e9c86 Mon Sep 17 00:00:00 2001 From: Tides Date: Tue, 5 Mar 2024 18:53:02 -0500 Subject: [PATCH] Cleanup --- Obsidian.ConsoleApp/Obsidian.ConsoleApp.csproj | 10 +++++++++- .../Plugins/PluginProviders/PackedPluginProvider.cs | 10 ++-------- Obsidian/Utilities/ServerConfiguration.cs | 2 +- SamplePlugin/SamplePlugin.csproj | 2 +- 4 files changed, 13 insertions(+), 11 deletions(-) diff --git a/Obsidian.ConsoleApp/Obsidian.ConsoleApp.csproj b/Obsidian.ConsoleApp/Obsidian.ConsoleApp.csproj index b3ccf86ef..42dd32019 100644 --- a/Obsidian.ConsoleApp/Obsidian.ConsoleApp.csproj +++ b/Obsidian.ConsoleApp/Obsidian.ConsoleApp.csproj @@ -9,6 +9,12 @@ en + + + + + + @@ -18,7 +24,9 @@ - + + PreserveNewest + diff --git a/Obsidian/Plugins/PluginProviders/PackedPluginProvider.cs b/Obsidian/Plugins/PluginProviders/PackedPluginProvider.cs index b2e148a6c..daf2e97a3 100644 --- a/Obsidian/Plugins/PluginProviders/PackedPluginProvider.cs +++ b/Obsidian/Plugins/PluginProviders/PackedPluginProvider.cs @@ -1,9 +1,6 @@ using Microsoft.Extensions.Logging; using Obsidian.API.Plugins; using Org.BouncyCastle.Crypto; -using Org.BouncyCastle.Crypto.Utilities; -using Org.BouncyCastle.Pqc.Crypto.SphincsPlus; -using Org.BouncyCastle.Security; using System.Collections.Frozen; using System.IO; using System.Reflection; @@ -13,9 +10,6 @@ namespace Obsidian.Plugins.PluginProviders; public sealed class PackedPluginProvider(PluginManager pluginManager, ILogger logger) { - private const int SignatureLength = 384; - private const int HashLength = 20; - private readonly PluginManager pluginManager = pluginManager; private readonly ILogger logger = logger; @@ -31,8 +25,8 @@ public sealed class PackedPluginProvider(PluginManager pluginManager, ILogger lo //TODO save api version somewhere var apiVersion = reader.ReadString(); - var hash = reader.ReadBytes(HashLength); - var signature = reader.ReadBytes(SignatureLength); + var hash = reader.ReadBytes(SHA384.HashSizeInBytes); + var signature = reader.ReadBytes(SHA384.HashSizeInBits); var dataLength = reader.ReadInt32(); var curPos = fs.Position; diff --git a/Obsidian/Utilities/ServerConfiguration.cs b/Obsidian/Utilities/ServerConfiguration.cs index 5d9ad9d10..6cc49c0f4 100644 --- a/Obsidian/Utilities/ServerConfiguration.cs +++ b/Obsidian/Utilities/ServerConfiguration.cs @@ -19,7 +19,7 @@ public sealed class ServerConfiguration : IServerConfiguration public bool AllowOperatorRequests { get; set; } = true; - public bool AllowUntrustedPlugins { get; set; } = true; + public bool AllowUntrustedPlugins { get; set; } /// /// If true, each login/client gets a random username where multiple connections from the same host will be allowed. diff --git a/SamplePlugin/SamplePlugin.csproj b/SamplePlugin/SamplePlugin.csproj index f72d43113..74c2718ab 100644 --- a/SamplePlugin/SamplePlugin.csproj +++ b/SamplePlugin/SamplePlugin.csproj @@ -21,7 +21,7 @@ runtime - +