summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--inc/PassHash.class.php15
-rw-r--r--lib/plugins/config/settings/config.metadata.php2
2 files changed, 16 insertions, 1 deletions
diff --git a/inc/PassHash.class.php b/inc/PassHash.class.php
index 31493c022..c13cf4a54 100644
--- a/inc/PassHash.class.php
+++ b/inc/PassHash.class.php
@@ -50,6 +50,9 @@ class PassHash {
}elseif(substr($hash,0,6) == '{SSHA}'){
$method = 'ssha';
$salt = substr(base64_decode(substr($hash, 6)),20);
+ }elseif(substr($hash,0,6) == '{SMD5}'){
+ $method = 'smd6';
+ $salt = substr(base64_decode(substr($hash, 6)),16);
}elseif($len == 32){
$method = 'md5';
}elseif($len == 40){
@@ -130,6 +133,18 @@ class PassHash {
}
}
+
+ /**
+ * Password hashing method 'smd6'
+ *
+ * Uses salted MD5 hashs. Salt is 8 bytes long. Yes, really 8 bytes...
+ */
+ public function hash_smd6($clear, $salt=null){
+ $this->init_salt($salt,8);
+ return "{SMD5}".base64_encode(md5($clear.$salt, true).$salt);
+ }
+
+
/**
* Password hashing method 'apr1'
*
diff --git a/lib/plugins/config/settings/config.metadata.php b/lib/plugins/config/settings/config.metadata.php
index 5f2c32ea7..c943a2fad 100644
--- a/lib/plugins/config/settings/config.metadata.php
+++ b/lib/plugins/config/settings/config.metadata.php
@@ -123,7 +123,7 @@ $meta['_authentication'] = array('fieldset');
$meta['useacl'] = array('onoff');
$meta['autopasswd'] = array('onoff');
$meta['authtype'] = array('authtype');
-$meta['passcrypt'] = array('multichoice','_choices' => array('smd5','md5','apr1','sha1','ssha','crypt','mysql','my411','kmd5','pmd5','hmd5'));
+$meta['passcrypt'] = array('multichoice','_choices' => array('smd5','smd6','md5','apr1','sha1','ssha','crypt','mysql','my411','kmd5','pmd5','hmd5'));
$meta['defaultgroup']= array('string');
$meta['superuser'] = array('string');
$meta['manager'] = array('string');