Fix after renames in SharpAESCrypt
This commit is contained in:
@@ -96,7 +96,7 @@ public static partial class Command
|
||||
{
|
||||
using var ms = new MemoryStream();
|
||||
using var fs = File.OpenRead(rtcfg.Configuration.ConfigFiles.GpgKeyfile);
|
||||
SharpAESCrypt.SharpAESCrypt.Decrypt(rtcfg.KeyfilePassword, fs, ms);
|
||||
SharpAESCrypt.AESCrypt.Decrypt(rtcfg.KeyfilePassword, fs, ms);
|
||||
var parts = System.Text.Encoding.UTF8.GetString(ms.ToArray()).Split('\n', 2, StringSplitOptions.RemoveEmptyEntries);
|
||||
return (parts[0], parts[1]);
|
||||
}
|
||||
|
||||
@@ -1027,14 +1027,14 @@ public static partial class Command
|
||||
{
|
||||
using var ms = new MemoryStream();
|
||||
using var fs = File.OpenRead(keyfile);
|
||||
SharpAESCrypt.SharpAESCrypt.Decrypt(password, fs, ms);
|
||||
SharpAESCrypt.AESCrypt.Decrypt(password, fs, ms);
|
||||
|
||||
var rsa = RSA.Create();
|
||||
rsa.FromXmlString(System.Text.Encoding.UTF8.GetString(ms.ToArray()));
|
||||
|
||||
return rsa;
|
||||
}
|
||||
catch (SharpAESCrypt.SharpAESCrypt.WrongPasswordException)
|
||||
catch (SharpAESCrypt.WrongPasswordException)
|
||||
{
|
||||
if (!askForNewPassword)
|
||||
throw;
|
||||
|
||||
@@ -57,7 +57,7 @@ public static class Command
|
||||
var newkey = RSA.Create(2048).ToXmlString(true);
|
||||
using (var fs = File.OpenWrite(keyfile.FullName))
|
||||
using (var ms = new MemoryStream(System.Text.Encoding.UTF8.GetBytes(newkey)))
|
||||
SharpAESCrypt.SharpAESCrypt.Encrypt(keyfilePassword, ms, fs);
|
||||
SharpAESCrypt.AESCrypt.Encrypt(keyfilePassword, ms, fs);
|
||||
|
||||
Console.WriteLine($"Keyfile created at {keyfile.FullName}");
|
||||
}, passwordOption, keyfileArgument);
|
||||
|
||||
@@ -34,7 +34,7 @@ public static class EncryptionHelper
|
||||
{
|
||||
using var ms = new MemoryStream();
|
||||
using var fs = File.OpenRead(passwordfile);
|
||||
SharpAESCrypt.SharpAESCrypt.Decrypt(password, fs, ms);
|
||||
SharpAESCrypt.AESCrypt.Decrypt(password, fs, ms);
|
||||
|
||||
return Encoding.UTF8.GetString(ms.ToArray());
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user