From f51c9ed2abe5c68211bb3736be5f70b1fe2c9ec0 Mon Sep 17 00:00:00 2001 From: M.Gergo Date: Fri, 8 Mar 2019 21:20:34 +0100 Subject: további rendrakás --- .../McryptPseudoRandomStringGenerator.php | 68 -------------- .../OpenSslPseudoRandomStringGenerator.php | 67 -------------- .../PseudoRandomStringGeneratorFactory.php | 101 --------------------- .../PseudoRandomStringGeneratorInterface.php | 45 --------- .../PseudoRandomStringGeneratorTrait.php | 58 ------------ .../RandomBytesPseudoRandomStringGenerator.php | 59 ------------ .../UrandomPseudoRandomStringGenerator.php | 89 ------------------ 7 files changed, 487 deletions(-) delete mode 100644 mayor-orig/www/include/share/facebook/PseudoRandomString/McryptPseudoRandomStringGenerator.php delete mode 100644 mayor-orig/www/include/share/facebook/PseudoRandomString/OpenSslPseudoRandomStringGenerator.php delete mode 100644 mayor-orig/www/include/share/facebook/PseudoRandomString/PseudoRandomStringGeneratorFactory.php delete mode 100644 mayor-orig/www/include/share/facebook/PseudoRandomString/PseudoRandomStringGeneratorInterface.php delete mode 100644 mayor-orig/www/include/share/facebook/PseudoRandomString/PseudoRandomStringGeneratorTrait.php delete mode 100644 mayor-orig/www/include/share/facebook/PseudoRandomString/RandomBytesPseudoRandomStringGenerator.php delete mode 100644 mayor-orig/www/include/share/facebook/PseudoRandomString/UrandomPseudoRandomStringGenerator.php (limited to 'mayor-orig/www/include/share/facebook/PseudoRandomString') diff --git a/mayor-orig/www/include/share/facebook/PseudoRandomString/McryptPseudoRandomStringGenerator.php b/mayor-orig/www/include/share/facebook/PseudoRandomString/McryptPseudoRandomStringGenerator.php deleted file mode 100644 index bf573745..00000000 --- a/mayor-orig/www/include/share/facebook/PseudoRandomString/McryptPseudoRandomStringGenerator.php +++ /dev/null @@ -1,68 +0,0 @@ -validateLength($length); - - $binaryString = mcrypt_create_iv($length, MCRYPT_DEV_URANDOM); - - if ($binaryString === false) { - throw new FacebookSDKException( - static::ERROR_MESSAGE . - 'mcrypt_create_iv() returned an error.' - ); - } - - return $this->binToHex($binaryString, $length); - } -} diff --git a/mayor-orig/www/include/share/facebook/PseudoRandomString/OpenSslPseudoRandomStringGenerator.php b/mayor-orig/www/include/share/facebook/PseudoRandomString/OpenSslPseudoRandomStringGenerator.php deleted file mode 100644 index 4b4276dc..00000000 --- a/mayor-orig/www/include/share/facebook/PseudoRandomString/OpenSslPseudoRandomStringGenerator.php +++ /dev/null @@ -1,67 +0,0 @@ -validateLength($length); - - $wasCryptographicallyStrong = false; - $binaryString = openssl_random_pseudo_bytes($length, $wasCryptographicallyStrong); - - if ($binaryString === false) { - throw new FacebookSDKException(static::ERROR_MESSAGE . 'openssl_random_pseudo_bytes() returned an unknown error.'); - } - - if ($wasCryptographicallyStrong !== true) { - throw new FacebookSDKException(static::ERROR_MESSAGE . 'openssl_random_pseudo_bytes() returned a pseudo-random string but it was not cryptographically secure and cannot be used.'); - } - - return $this->binToHex($binaryString, $length); - } -} diff --git a/mayor-orig/www/include/share/facebook/PseudoRandomString/PseudoRandomStringGeneratorFactory.php b/mayor-orig/www/include/share/facebook/PseudoRandomString/PseudoRandomStringGeneratorFactory.php deleted file mode 100644 index 412f4813..00000000 --- a/mayor-orig/www/include/share/facebook/PseudoRandomString/PseudoRandomStringGeneratorFactory.php +++ /dev/null @@ -1,101 +0,0 @@ -validateLength($length); - - return $this->binToHex(random_bytes($length), $length); - } -} diff --git a/mayor-orig/www/include/share/facebook/PseudoRandomString/UrandomPseudoRandomStringGenerator.php b/mayor-orig/www/include/share/facebook/PseudoRandomString/UrandomPseudoRandomStringGenerator.php deleted file mode 100644 index 5ab434e6..00000000 --- a/mayor-orig/www/include/share/facebook/PseudoRandomString/UrandomPseudoRandomStringGenerator.php +++ /dev/null @@ -1,89 +0,0 @@ -validateLength($length); - - $stream = fopen('/dev/urandom', 'rb'); - if (!is_resource($stream)) { - throw new FacebookSDKException( - static::ERROR_MESSAGE . - 'Unable to open stream to /dev/urandom.' - ); - } - - if (!defined('HHVM_VERSION')) { - stream_set_read_buffer($stream, 0); - } - - $binaryString = fread($stream, $length); - fclose($stream); - - if (!$binaryString) { - throw new FacebookSDKException( - static::ERROR_MESSAGE . - 'Stream to /dev/urandom returned no data.' - ); - } - - return $this->binToHex($binaryString, $length); - } -} -- cgit v1.2.3