Skip to content

Commit

Permalink
#307 removed support for LM hashes
Browse files Browse the repository at this point in the history
  • Loading branch information
gruberroland committed Mar 22, 2024
1 parent 5a1e058 commit 37e31e4
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 442 deletions.
1 change: 1 addition & 0 deletions lam/HISTORY
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
June 2024 8.8
- PHP 8.1 or higher required
- Samba 3: dropped support for LM password hashes (307)


16.03.2024 8.7
Expand Down
21 changes: 1 addition & 20 deletions lam/lib/account.inc
Original file line number Diff line number Diff line change
Expand Up @@ -124,35 +124,16 @@ function smbflag($input) {
return $flag . "]";
}

/**
* Generates the LM hash of a password.
*
* @param string password original password
* @return string password hash
*/
function lmPassword($password) {
// Needed to calculate Samba passwords
include_once(__DIR__ . "/createntlm.inc");
// get hash
$hash = new smbHash();
return $hash->lmhash($password);
}

/**
* Generates the NT hash of a password.
*
* @param string password original password
* @return string password hash
*/
function ntPassword($password) {
// Needed to calculate Samba passwords
include_once(__DIR__ . "/createntlm.inc");
// get hash
$hash = new smbHash();
return $hash->nthash($password);
return strtoupper(hash('md4', convertUtf8ToUtf16Le($password)));
}


/**
* Returns the hash value of a plain text password.
* @see getSupportedHashTypes()
Expand Down
Loading

0 comments on commit 37e31e4

Please sign in to comment.