Rename CreateRandomPassword to CreateWeakSecret, to underscore it's nowhere near random
This commit is contained in:
@@ -74,7 +74,7 @@ namespace Swarmops.Logic.Communications.Payload
|
||||
|
||||
if (body.Contains ("[RandomPassword]"))
|
||||
{
|
||||
string randomPassword = Authentication.CreateRandomPassword (24);
|
||||
string randomPassword = Authentication.CreateWeakSecret (24);
|
||||
person.SetPassword (randomPassword);
|
||||
body = body.Replace ("[RandomPassword]", randomPassword);
|
||||
}
|
||||
|
||||
@@ -239,7 +239,7 @@ namespace Swarmops.Logic.Financial
|
||||
dueDate,
|
||||
budget.Identity, customerName, invoiceAddressPaper,
|
||||
invoiceAddressMail, currency.Identity, string.Empty, domestic,
|
||||
Authentication.CreateRandomPassword (6), theirReference));
|
||||
Authentication.CreateWeakSecret (6), theirReference));
|
||||
|
||||
// Set reference
|
||||
|
||||
|
||||
@@ -39,7 +39,7 @@ namespace Swarmops.Logic.Governance
|
||||
FromIdentity (SwarmDb.GetDatabaseForWriting()
|
||||
.CreateInternalPollVote (poll.Identity, voteGeography.Identity,
|
||||
Authentication.
|
||||
CreateRandomPassword (12)));
|
||||
CreateWeakSecret (12)));
|
||||
}
|
||||
|
||||
public void AddDetail (int position, MeetingElectionCandidate candidate)
|
||||
|
||||
@@ -116,7 +116,7 @@ namespace Swarmops.Logic.Security
|
||||
}
|
||||
|
||||
|
||||
public static string CreateRandomPassword (int length)
|
||||
public static string CreateWeakSecret (int length)
|
||||
{
|
||||
string allowedChars = "ABCDEFHJKMNPQRTUVWXYZ23456789";
|
||||
char[] chars = new char[length];
|
||||
@@ -295,7 +295,7 @@ namespace Swarmops.Logic.Security
|
||||
return null;
|
||||
}
|
||||
|
||||
string passwordTicket = CreateRandomPassword (EmailVerificationTicketLength);
|
||||
string passwordTicket = CreateWeakSecret (EmailVerificationTicketLength);
|
||||
|
||||
foreach (Person p in candidatePeople)
|
||||
{
|
||||
@@ -359,7 +359,7 @@ namespace Swarmops.Logic.Security
|
||||
|
||||
public static void RequestMembershipConfirmation (Person p, string URL)
|
||||
{
|
||||
string passwordTicket = CreateRandomPassword (EmailVerificationTicketLength);
|
||||
string passwordTicket = CreateWeakSecret (EmailVerificationTicketLength);
|
||||
|
||||
string encodedPasswordTicket = SHA1.Hash (passwordTicket);
|
||||
p.ResetPasswordTicket = encodedPasswordTicket + ";" + DateTime.Now.ToString ("yyyy-MM-dd HH:mm:ss");
|
||||
|
||||
@@ -80,7 +80,7 @@ namespace Swarmops.Logic.Support
|
||||
|
||||
public static string GeneratePassword (int length)
|
||||
{
|
||||
return Authentication.CreateRandomPassword (length);
|
||||
return Authentication.CreateWeakSecret (length);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -78,7 +78,7 @@ namespace Swarmops.Logic.Swarm
|
||||
|
||||
private static string CreateRandomCode (int length)
|
||||
{
|
||||
return Authentication.CreateRandomPassword (length);
|
||||
return Authentication.CreateWeakSecret (length);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -69,7 +69,7 @@ namespace Swarmops.Frontend.Pages.v5.Public
|
||||
|
||||
// this.LanguageSelector.LanguageChanged += new EventHandler(LanguageSelector_LanguageChanged);
|
||||
|
||||
this.TextRandomDbLabel.Text = Authentication.CreateRandomPassword (5);
|
||||
this.TextRandomDbLabel.Text = Authentication.CreateWeakSecret (5);
|
||||
|
||||
Localize();
|
||||
}
|
||||
@@ -122,7 +122,7 @@ namespace Swarmops.Frontend.Pages.v5.Public
|
||||
|
||||
if (string.IsNullOrEmpty (random))
|
||||
{
|
||||
random = Authentication.CreateRandomPassword (5);
|
||||
random = Authentication.CreateWeakSecret (5);
|
||||
}
|
||||
|
||||
SwarmDb.Credentials rootCredentials = new SwarmDb.Credentials ("mysql",
|
||||
|
||||
Reference in New Issue
Block a user