commit 5b3281807dc56ef25b832e82859d7f307d5d311e
parent 2029f63035e9d71dcdbb9a56253844b7ca109a8d
Author: Michael Savage <mikejsavage@gmail.com>
Date: Fri, 16 Dec 2011 15:23:47 +0000
Clarify why the salt malloc size is what it is
For some definition of "clarify"
Diffstat:
1 file changed, 1 insertion(+), 0 deletions(-)
diff --git a/src/luabcrypt.c b/src/luabcrypt.c
@@ -29,6 +29,7 @@ static int luabcrypt_gensalt( lua_State *L )
{
u_int8_t log_rounds = luaL_checkinteger( L, 1 );
+ // because the OpenBSD implementation says so
char *salt = malloc( 7 + ( BCRYPT_MAXSALT * 4 + 2 ) / 3 + 1 );
bcrypt_gensalt( log_rounds, salt );