- Change Loporrit Branding to CLUBPENGUIN
- Update submodules - Update to latest Penumbra API
This commit is contained in:
@@ -14,12 +14,12 @@ public sealed class RemoteConfigurationService
|
||||
{
|
||||
private readonly static Dictionary<string, string> ConfigPublicKeys = new(StringComparer.Ordinal)
|
||||
{
|
||||
{ "4D6633E0", "GWRoAiXP9lcn9/34wGgziYcqQH8f6zWtZrRyp66Ekso=" },
|
||||
{ "3PC5J4C4", "rhUOaY2Y7doUY0GDmOEgM5CoyzxLqCjOpsdO6O+rTjE=" },
|
||||
};
|
||||
|
||||
private readonly static string[] ConfigSources = [
|
||||
"https://plugin.lop-sync.com/config/config.json",
|
||||
"https://plugin.lop-sync.net/config/config.json",
|
||||
"https://clubpenguin.drgn.rocks/config.json",
|
||||
"https://clubpenguin.drgn.rocks/config.json",
|
||||
];
|
||||
|
||||
private readonly ILogger<RemoteConfigurationService> _logger;
|
||||
@@ -172,6 +172,12 @@ public sealed class RemoteConfigurationService
|
||||
byte[] pub = Convert.FromBase64String(pubKey);
|
||||
return Ed25519.Verify(sig, msg, pub);
|
||||
}
|
||||
|
||||
private static byte[] SignForMe(string message, ulong ts, byte[] privKey)
|
||||
{
|
||||
byte[] msg = [.. BitConverter.GetBytes(ts), .. Encoding.UTF8.GetBytes(message)];
|
||||
return Ed25519.Sign(msg, privKey);
|
||||
}
|
||||
|
||||
private void LoadConfig(JsonObject jsonDoc)
|
||||
{
|
||||
@@ -185,6 +191,7 @@ public sealed class RemoteConfigurationService
|
||||
|
||||
var signatures = jsonDoc["sig"]!.AsObject();
|
||||
var configString = jsonDoc["config"]!.GetValue<string>();
|
||||
|
||||
bool verified = signatures.Any(sig =>
|
||||
ConfigPublicKeys.TryGetValue(sig.Key, out var pubKey) &&
|
||||
VerifySignature(configString, ts, sig.Value!.GetValue<string>(), pubKey));
|
||||
|
||||
Reference in New Issue
Block a user