Rename unsecure to insecure.
MODIFY
WalletWasabi.Tests/UnitTests/Crypto/RandomTests.cs
WalletWasabi.Tests/UnitTests/Crypto/RandomTests.cs
@@ -33,12 +33,12 @@ namespace WalletWasabi.Tests.UnitTests.Crypto
var pseudoSet = new HashSet<byte[]>();
var secureSet = new HashSet<byte[]>();
var count = 100;
- IWasabiRandom unsecureRandom = new UnsecureRandom();
+ IWasabiRandom insecureRandom = new InsecureRandom();
using var secureRandomToDispose = new SecureRandom();
IWasabiRandom secureRandom = secureRandomToDispose;
for (int i = 0; i < count; i++)
{
- pseudoSet.Add(unsecureRandom.GetBytes(10));
+ pseudoSet.Add(insecureRandom.GetBytes(10));
secureSet.Add(secureRandom.GetBytes(10));
}
Assert.Equal(count, pseudoSet.Count);
@@ -51,7 +51,7 @@ namespace WalletWasabi.Tests.UnitTests.Crypto
var randoms = new List<IWasabiRandom>
{
new SecureRandom(),
- new UnsecureRandom(),
+ new InsecureRandom(),
new MockRandom()
};
@@ -90,7 +90,7 @@ namespace WalletWasabi.Tests.UnitTests.Crypto
var randoms = new List<IWasabiRandom>
{
new SecureRandom(),
- new UnsecureRandom()
+ new InsecureRandom()
};
foreach (var random in randoms)

MODIFY
WalletWasabi.Tests/UnitTests/IoTests.cs
WalletWasabi.Tests/UnitTests/IoTests.cs
@@ -24,7 +24,7 @@ namespace WalletWasabi.Tests.UnitTests
List<string> lines = new List<string>();
for (int i = 0; i < 1000; i++)
{
- string line = (new UnsecureRandom() as IWasabiRandom).GetString(100, Characters.AlphaNumeric);
+ string line = (new InsecureRandom() as IWasabiRandom).GetString(100, Characters.AlphaNumeric);
lines.Add(line);
}

MODIFY
WalletWasabi.Tests/UnitTests/KeyManagementTests.cs
WalletWasabi.Tests/UnitTests/KeyManagementTests.cs
@@ -124,7 +124,7 @@ namespace WalletWasabi.Tests.UnitTests
for (int i = 0; i < 1000; i++)
{
var isInternal = random.Next(2) == 0;
- var label = (new WalletWasabi.Crypto.Randomness.UnsecureRandom() as IWasabiRandom).GetString(21, Characters.AlphaNumeric);
+ var label = (new InsecureRandom() as IWasabiRandom).GetString(21, Characters.AlphaNumeric);
var keyState = (KeyState)random.Next(3);
manager.GenerateNewKey(label, keyState, isInternal, toFile: false);
}
@@ -157,7 +157,7 @@ namespace WalletWasabi.Tests.UnitTests
for (int i = 0; i < 1000; i++)
{
var isInternal = random.Next(2) == 0;
- var label = (new WalletWasabi.Crypto.Randomness.UnsecureRandom() as IWasabiRandom).GetString(21, Characters.AlphaNumeric);
+ var label = (new WalletWasabi.Crypto.Randomness.InsecureRandom() as IWasabiRandom).GetString(21, Characters.AlphaNumeric);
var keyState = (KeyState)random.Next(3);
var generatedKey = manager.GenerateNewKey(label, keyState, isInternal);

MODIFY
WalletWasabi.Tests/UnitTests/PasswordTests.cs
WalletWasabi.Tests/UnitTests/PasswordTests.cs
@@ -59,13 +59,13 @@ namespace WalletWasabi.Tests.UnitTests
PasswordHelper.GetMasterExtKey(keyManager, original, out _);
// This should not throw format exception but pw is not correct.
- Assert.Throws<SecurityException>(() => PasswordHelper.GetMasterExtKey(keyManager, (new UnsecureRandom() as IWasabiRandom).GetString(PasswordHelper.MaxPasswordLength, Characters.AlphaNumeric), out _));
+ Assert.Throws<SecurityException>(() => PasswordHelper.GetMasterExtKey(keyManager, (new InsecureRandom() as IWasabiRandom).GetString(PasswordHelper.MaxPasswordLength, Characters.AlphaNumeric), out _));
// Password should be formatted, before entering here.
- Assert.Throws<FormatException>(() => PasswordHelper.GetMasterExtKey(keyManager, (new UnsecureRandom() as IWasabiRandom).GetString(PasswordHelper.MaxPasswordLength + 1, Characters.AlphaNumeric), out _));
+ Assert.Throws<FormatException>(() => PasswordHelper.GetMasterExtKey(keyManager, (new InsecureRandom() as IWasabiRandom).GetString(PasswordHelper.MaxPasswordLength + 1, Characters.AlphaNumeric), out _));
// Too long password with extra spaces.
- var badPassword = $" {(new UnsecureRandom() as IWasabiRandom).GetString(PasswordHelper.MaxPasswordLength + 1, Characters.AlphaNumeric)} ";
+ var badPassword = $" {(new InsecureRandom() as IWasabiRandom).GetString(PasswordHelper.MaxPasswordLength + 1, Characters.AlphaNumeric)} ";
// Password should be formatted, before entering here.
Assert.Throws<FormatException>(() => PasswordHelper.GetMasterExtKey(keyManager, badPassword, out _));

RENAME
WalletWasabi/Crypto/Randomness/UnsecureRandom.cs
WalletWasabi/Crypto/Randomness/InsecureRandom.cs
@@ -4,9 +4,9 @@ using System.Text;
namespace WalletWasabi.Crypto.Randomness
{
- public class UnsecureRandom : IWasabiRandom
+ public class InsecureRandom : IWasabiRandom
{
- public UnsecureRandom()
+ public InsecureRandom()
{
Random = new Random();
}

MODIFY
WalletWasabi/TorSocks5/TorSocks5Client.cs
WalletWasabi/TorSocks5/TorSocks5Client.cs
@@ -121,7 +121,7 @@ namespace WalletWasabi.TorSocks5
/// </summary>
internal async Task HandshakeAsync(bool isolateStream = true)
{
- await HandshakeAsync(isolateStream ? (new UnsecureRandom() as IWasabiRandom).GetString(21, Characters.CapitalAlphaNumeric) : "").ConfigureAwait(false);
+ await HandshakeAsync(isolateStream ? (new InsecureRandom() as IWasabiRandom).GetString(21, Characters.CapitalAlphaNumeric) : "").ConfigureAwait(false);
}
/// <summary>

Rename unsecure to insecure.