Removed dead code

This commit is contained in:
Alex Bilbie 2017-07-01 18:22:51 +01:00
parent e1ef133067
commit f5c3ba0b24

View File

@ -322,20 +322,6 @@ class AuthCodeGrant extends AbstractAuthorizeGrant
'code_challenge_method ' => $authorizationRequest->getCodeChallengeMethod(), 'code_challenge_method ' => $authorizationRequest->getCodeChallengeMethod(),
]; ];
if ($this->encryptionKey === null) {
// Add padding to vary the length of the payload
$payload['_padding'] = base64_encode(random_bytes(mt_rand(8, 256)));
// Shuffle the payload so that the structure is no longer know and obvious
$keys = array_keys($payload);
shuffle($keys);
$shuffledPayload = [];
foreach ($keys as $key) {
$shuffledPayload[$key] = $payload[$key];
}
} else {
$shuffledPayload = $payload;
}
$response = new RedirectResponse(); $response = new RedirectResponse();
$response->setRedirectUri( $response->setRedirectUri(
$this->makeRedirectUri( $this->makeRedirectUri(
@ -343,7 +329,7 @@ class AuthCodeGrant extends AbstractAuthorizeGrant
[ [
'code' => $this->encrypt( 'code' => $this->encrypt(
json_encode( json_encode(
$shuffledPayload $payload
) )
), ),
'state' => $authorizationRequest->getState(), 'state' => $authorizationRequest->getState(),