mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/OATHAuth
synced 2024-11-24 00:05:24 +00:00
MWCryptRand::generate() is deprecated
Change-Id: I7cd7a145265abe1bcb036c9b7d34201729b569b8
This commit is contained in:
parent
f6181cf82d
commit
a4f0de6b8d
|
@ -49,7 +49,7 @@ class OATHAuthKey {
|
|||
*/
|
||||
public static function newFromRandom() {
|
||||
$object = new self(
|
||||
Base32::encode( MWCryptRand::generate( 10 ) ),
|
||||
Base32::encode( random_bytes( 10 ) ),
|
||||
[]
|
||||
);
|
||||
|
||||
|
@ -168,7 +168,7 @@ class OATHAuthKey {
|
|||
public function regenerateScratchTokens() {
|
||||
$scratchTokens = [];
|
||||
for ( $i = 0; $i < 5; $i++ ) {
|
||||
$scratchTokens[] = Base32::encode( MWCryptRand::generate( 10 ) );
|
||||
$scratchTokens[] = Base32::encode( random_bytes( 10 ) );
|
||||
}
|
||||
$this->scratchTokens = $scratchTokens;
|
||||
}
|
||||
|
|
|
@ -95,7 +95,7 @@ class OATHAuthUtils {
|
|||
* @return string $hmac.$iv.$ciphertext, each component b64 encoded
|
||||
*/
|
||||
private static function seal( $data, $encKey, $hmacKey ) {
|
||||
$iv = MWCryptRand::generate( 16 );
|
||||
$iv = random_bytes( 16 );
|
||||
$ciphertext = openssl_encrypt(
|
||||
$data,
|
||||
'aes-256-ctr',
|
||||
|
|
Loading…
Reference in a new issue