CRM_Core_Key - Strengthen signature algorithm
authorTim Otten <totten@civicrm.org>
Mon, 6 Apr 2020 08:07:12 +0000 (01:07 -0700)
committerSeamus Lee <seamuslee001@gmail.com>
Wed, 19 Aug 2020 06:16:45 +0000 (16:16 +1000)
commitc9a7484e9d58ed6317f25c2412be72a54d9312bc
tree66ef4503ae01d6304169e139d41a9460ff471072
parent92a8ec76be683d3511a76b6a8dc095cc5138cd47
CRM_Core_Key - Strengthen signature algorithm

This alters the qfKey signature algorithm, with a few aims:

1.  If someone wants to perform a brute-force to figure the per-session
    private-key, we want it go slow.  Therefore, use a slower hash (ie
    HMAC-SHA256 instead of MD5).

2.  If someone performs a timing attack aimed at figuring a passable qfKey,
    the execution-time for `validate()` should not provide any hints.

3.  If someone finds a way to manipulate one of the constituent parts
    ($sessionID, $name, $privateKey), we want it to be hard to create a
    collsion. So... (a) Use HMAC instead of a vanilla hash. (b) Use delimiters
    between the data sections ($sessionID, $name).
CRM/Core/Key.php