Bug 178796: change the way we generate the new salt so that we are cross-plat.
This commit is contained in:
parent
6a642cfabb
commit
119e217e4b
@ -1,3 +1,8 @@
|
|||||||
|
--------------------------------------------------------------------
|
||||||
|
Thursday May 25 16:15:53 MST 2006 - jnorman@novell.com
|
||||||
|
- Bug 178796: change the way we generate the new salt so that
|
||||||
|
we are cross-plat.
|
||||||
|
|
||||||
--------------------------------------------------------------------
|
--------------------------------------------------------------------
|
||||||
Thursday May 25 09:21:53 MST 2006 - cmashayekhi@novell.com
|
Thursday May 25 09:21:53 MST 2006 - cmashayekhi@novell.com
|
||||||
- casa-gnome-keyring.h was cleaned up.
|
- casa-gnome-keyring.h was cleaned up.
|
||||||
|
@ -144,10 +144,12 @@ namespace sscs.crypto {
|
|||||||
|
|
||||||
// iterate thru each character, creating a new Random,
|
// iterate thru each character, creating a new Random,
|
||||||
// getting 2 bytes from each, until our salt buffer is full.
|
// getting 2 bytes from each, until our salt buffer is full.
|
||||||
for (int i = 0; i < password.Length; i++)
|
for (int i = 0; i < password.Length;)
|
||||||
{
|
{
|
||||||
FastRandom ranNum = new FastRandom((password[i].ToString().GetHashCode()) * (j+1));
|
char letter = password[i];
|
||||||
|
int iLetter = (int)letter;
|
||||||
|
|
||||||
|
FastRandom ranNum = new FastRandom(iLetter * (j+1));
|
||||||
byte[] temp = new byte[2];
|
byte[] temp = new byte[2];
|
||||||
ranNum.NextBytes(temp);
|
ranNum.NextBytes(temp);
|
||||||
|
|
||||||
@ -161,11 +163,15 @@ namespace sscs.crypto {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
i++;
|
||||||
|
|
||||||
// reset i if at end of password
|
// reset i if at end of password
|
||||||
if ((i + 1) == password.Length)
|
if ((i + 1) > password.Length)
|
||||||
{
|
{
|
||||||
i = 0;
|
i = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return buffer;
|
return buffer;
|
||||||
|
Loading…
Reference in New Issue
Block a user