"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "tests/phpunit/includes/session/SessionTest.php" between
mediawiki-1.31.1.tar.gz and mediawiki-1.32.0.tar.gz

About: MediaWiki is a wiki engine (the collaborative editing software that runs for e.g. Wikipedia, the free encyclopedia).

SessionTest.php  (mediawiki-1.31.1):SessionTest.php  (mediawiki-1.32.0)
skipping to change at line 361 skipping to change at line 361
$session->set( 'test', $encrypted . 'x' ); $session->set( 'test', $encrypted . 'x' );
$logger->setCollect( true ); $logger->setCollect( true );
$this->assertEquals( 'defaulted', $session->getSecret( 'test', 'd efaulted' ) ); $this->assertEquals( 'defaulted', $session->getSecret( 'test', 'd efaulted' ) );
$logger->setCollect( false ); $logger->setCollect( false );
$this->assertSame( [ $this->assertSame( [
[ LogLevel::WARNING, 'Sealed secret has been tampered wit h, aborting.' ] [ LogLevel::WARNING, 'Sealed secret has been tampered wit h, aborting.' ]
], $logger->getBuffer() ); ], $logger->getBuffer() );
$logger->clearBuffer(); $logger->clearBuffer();
// Unserializable data // Unserializable data
$iv = \MWCryptRand::generate( 16, true ); $iv = random_bytes( 16 );
list( $encKey, $hmacKey ) = TestingAccessWrapper::newFromObject( $session )->getSecretKeys(); list( $encKey, $hmacKey ) = TestingAccessWrapper::newFromObject( $session )->getSecretKeys();
$ciphertext = openssl_encrypt( 'foobar', 'aes-256-ctr', $encKey, OPENSSL_RAW_DATA, $iv ); $ciphertext = openssl_encrypt( 'foobar', 'aes-256-ctr', $encKey, OPENSSL_RAW_DATA, $iv );
$sealed = base64_encode( $iv ) . '.' . base64_encode( $ciphertext ); $sealed = base64_encode( $iv ) . '.' . base64_encode( $ciphertext );
$hmac = hash_hmac( 'sha256', $sealed, $hmacKey, true ); $hmac = hash_hmac( 'sha256', $sealed, $hmacKey, true );
$encrypted = base64_encode( $hmac ) . '.' . $sealed; $encrypted = base64_encode( $hmac ) . '.' . $sealed;
$session->set( 'test', $encrypted ); $session->set( 'test', $encrypted );
\Wikimedia\suppressWarnings(); \Wikimedia\suppressWarnings();
$this->assertEquals( 'defaulted', $session->getSecret( 'test', 'd efaulted' ) ); $this->assertEquals( 'defaulted', $session->getSecret( 'test', 'd efaulted' ) );
\Wikimedia\restoreWarnings(); \Wikimedia\restoreWarnings();
} }
 End of changes. 1 change blocks. 
1 lines changed or deleted 1 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)