Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Fix some lengths in crypt()
- Use salt_len_in instead of strlen(salt) or PHP_MAX_SALT_LEN, otherwise too
- much memory will be allocated.
- sha512 has a 86 character checksum, not 43. That probably was a copy&paste
- from the sha256 code which indeed has 43.
- The allocation also were using sizeof(char *) instead of sizeof(char), thus
- allocating 4 or 8 times as much memory as necessary.
- The memset 0 call was using PHP_MAX_SALT_LEN which can be smaller then the
- output buffer and thus not zeroing out everything. Use the size of the
- output buffer (needed) instead.
Add Comment
Please, Sign In to add comment