Skip to content
Permalink
Browse files

Fix that `Security::randomBytes()` is not a "readable" string for aut…

…hentication string (use `bin2hex`)
  • Loading branch information...
TheFRedFox committed Jul 26, 2016
1 parent adf7320 commit 823bf26ffaad1fbc4bbf939c3b3f628753fbcfa8
Showing with 2 additions and 2 deletions.
  1. +2 −2 src/Network/Http/Auth/Oauth.php
@@ -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',
@@ -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',

0 comments on commit 823bf26

Please sign in to comment.
You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.