aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/includes/crypto/driver/bcrypt_2y.php
diff options
context:
space:
mode:
authorMarc Alexander <admin@m-a-styles.de>2013-06-15 10:11:05 +0200
committerMarc Alexander <admin@m-a-styles.de>2013-09-14 13:51:24 +0200
commit78a83691738a2bcd0e6cb27b5dcbda8809a5d615 (patch)
treef438df5cf1b3cad319b5ad98ef32a60a7995f07b /phpBB/includes/crypto/driver/bcrypt_2y.php
parent31d2a8ef05ecd6b3f086230d95c0ae10d4f09474 (diff)
downloadforums-78a83691738a2bcd0e6cb27b5dcbda8809a5d615.tar
forums-78a83691738a2bcd0e6cb27b5dcbda8809a5d615.tar.gz
forums-78a83691738a2bcd0e6cb27b5dcbda8809a5d615.tar.bz2
forums-78a83691738a2bcd0e6cb27b5dcbda8809a5d615.tar.xz
forums-78a83691738a2bcd0e6cb27b5dcbda8809a5d615.zip
[feature/passwords] Add basic bcrypt drivers for $2a$ & $2y$ prefix
The $2a$ prefix is the basic implementation with the $2y$ prefix extending that class. However, the default hashes for phpBB should be generated with $2y$ unless the PHP version is older than 5.3.7. PHPBB3-11610
Diffstat (limited to 'phpBB/includes/crypto/driver/bcrypt_2y.php')
-rw-r--r--phpBB/includes/crypto/driver/bcrypt_2y.php48
1 files changed, 48 insertions, 0 deletions
diff --git a/phpBB/includes/crypto/driver/bcrypt_2y.php b/phpBB/includes/crypto/driver/bcrypt_2y.php
new file mode 100644
index 0000000000..8bce171a25
--- /dev/null
+++ b/phpBB/includes/crypto/driver/bcrypt_2y.php
@@ -0,0 +1,48 @@
+<?php
+/**
+*
+* @package phpBB3
+* @copyright (c) 2013 phpBB Group
+* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2
+*
+*/
+
+/**
+* @ignore
+*/
+if (!defined('IN_PHPBB'))
+{
+ exit;
+}
+
+/**
+* @package crypto
+*/
+class phpbb_crypto_driver_bcrypt_2y extends phpbb_crypto_driver_bcrypt
+{
+ const PREFIX = '$2y$';
+
+ /**
+ * @inheritdoc
+ */
+ public function get_prefix()
+ {
+ return self::PREFIX;
+ }
+
+ /**
+ * @inheritdoc
+ */
+ public function get_type()
+ {
+ return get_class($this);
+ }
+
+ /**
+ * @inheritdoc
+ */
+ public function is_supported()
+ {
+ return (version_compare(PHP_VERSION, '5.3.7', '<')) ? false : true;
+ }
+}