Skip to content

Commit

Permalink
Merge pull request #9179 from TheFRedFox/fix/rsa_sha1
Browse files Browse the repository at this point in the history
Oauth: Fix bug in default creation of nonce values
  • Loading branch information
markstory committed Jul 27, 2016
2 parents 8d33d02 + 823bf26 commit 9e9979d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/Network/Http/Auth/Oauth.php
Expand Up @@ -127,7 +127,7 @@ protected function _plaintext($request, $credentials)
*/
protected function _hmacSha1($request, $credentials)
{
$nonce = isset($credentials['nonce']) ? $credentials['nonce'] : Security::randomBytes(16);
$nonce = isset($credentials['nonce']) ? $credentials['nonce'] : bin2hex(Security::randomBytes(16));
$timestamp = isset($credentials['timestamp']) ? $credentials['timestamp'] : time();
$values = [
'oauth_version' => '1.0',
Expand Down Expand Up @@ -170,7 +170,7 @@ protected function _rsaSha1($request, $credentials)
throw new \RuntimeException('RSA-SHA1 signature method requires the OpenSSL extension.');
}

$nonce = isset($credentials['nonce']) ? $credentials['nonce'] : Security::randomBytes(16);
$nonce = isset($credentials['nonce']) ? $credentials['nonce'] : bin2hex(Security::randomBytes(16));
$timestamp = isset($credentials['timestamp']) ? $credentials['timestamp'] : time();
$values = [
'oauth_version' => '1.0',
Expand Down

0 comments on commit 9e9979d

Please sign in to comment.