coldfusion - Hashed password sometimes longer than 128 characters -


i'm having weird security-related problem, lately i've been getting regular intermittent errors when trying insert hashed passwords in sql server database field that's nvarchar(130):

<cfqueryparam value="#hashpass#" cfsqltype="cf_sql_char" maxlength="130"> 

the hashpass variable set thus:

<cfset hashpass =  hash(arguments.password & getsalt.user_salt, "sha-512")> 

wondering how it's possible sha-512 hash longer 128 characters, when documentation says should 128 exactly? here's coldfusion 10 error:

[macromedia][sqlserver jdbc driver][sqlserver]string or binary data truncated.

it seems error issue @ database level, coldfusion not failing maxlength check on cfqueryparam tag , allowing query executed. tested trying pass string exceeds length specified in maxlength attribute (on cf10) , error:

the cause of output exception that:  coldfusion.tagext.sql.queryparamtag$invaliddataexception:  invalid data value this-is-a-string-that-is-too-long exceeds maxlength setting 10..` 

as adam cameron mentioned in comments question, seems different field in query throwing error.

as hashed password 128 chars long - there reason why validating 130 chars?


Comments

Popular posts from this blog

angularjs - ADAL JS Angular- WebAPI add a new role claim to the token -

php - CakePHP HttpSockets send array of paramms -

node.js - Using Node without global install -