version 1.6, 2007/01/17 23:24:22 |
version 1.7, 2009/01/18 12:15:27 |
Line 162 __gensalt_sha1(char *salt, size_t saltsi |
|
Line 162 __gensalt_sha1(char *salt, size_t saltsi |
|
* The salt can be up to 64 bytes, but 8 |
* The salt can be up to 64 bytes, but 8 |
* is considered enough for now. |
* is considered enough for now. |
*/ |
*/ |
if (n + 9 >= saltsiz) |
if ((size_t)n + 9 >= saltsiz) |
return 0; |
return 0; |
__crypt_to64(&salt[n], arc4random(), 4); |
__crypt_to64(&salt[n], arc4random(), 4); |
__crypt_to64(&salt[n + 4], arc4random(), 4); |
__crypt_to64(&salt[n + 4], arc4random(), 4); |