Add HKDF as a fast, random number source
authorcsteipp <csteipp@wikimedia.org>
Tue, 3 Jun 2014 18:15:36 +0000 (11:15 -0700)
committercsteipp <csteipp@wikimedia.org>
Mon, 9 Jun 2014 18:32:26 +0000 (11:32 -0700)
commitaf66c04d39ad96a0563b7e9fdf3c20b29c0c1a9f
treec8f21f2e190074d40812ca876f2f3beecdea9a07
parentda4442cd74403ee8e33cb67033605898cbcae5ba
Add HKDF as a fast, random number source

This adds an RFC 5869 compatible library for quickly generating
cryptographically secure random keys/numbers. An attacker should be
unable to predict the next number generated, as long as the secret
key (set to wgSecretKey if not explicitly defined for a wiki) remains
secret.

In my testing, this is generating random numbers about 7x faster than
MWCryptRand for 32 hex characters, and shouldn't drain openssl's
entropy source.

This will hopefully speed up maintenance tasks that require secure
random numbers, such as resetting login token, and wrapping user's
passwords in a new format.

Change-Id: I437d9aec0122a0533b0d8723fe8a8624898af909
RELEASE-NOTES-1.24
includes/AutoLoader.php
includes/DefaultSettings.php
includes/utils/MWCryptHKDF.php [new file with mode: 0644]
tests/phpunit/includes/utils/MWCryptHKDFTest.php [new file with mode: 0644]