RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 820278 - smbk5pwd module computes invalid NT and LM hashes
Summary: smbk5pwd module computes invalid NT and LM hashes
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: openldap
Version: 6.2
Hardware: x86_64
OS: Linux
urgent
high
Target Milestone: rc
: ---
Assignee: Jan Vcelak
QA Contact: David Spurek
URL:
Whiteboard:
Depends On:
Blocks: 782183 840699 841560 844428
TreeView+ depends on / blocked
 
Reported: 2012-05-09 14:03 UTC by Michael Starling
Modified: 2018-11-28 21:22 UTC (History)
8 users (show)

Fixed In Version: openldap-2.4.23-27.el6
Doc Type: Bug Fix
Doc Text:
When the smbk5pwd overlay was enabled in an OpenLDAP server, and a user changed their password, the Microsoft NT LAN Manager (NTLM) and Microsoft LAN Manager (LM) hashes were not computed correctly. This led to the sambaLMPassword and sambaNTPassword attributes being updated with incorrect values, preventing the user logging in using a Windows-based client or a Samba client. With this update, the smbk5pwd overlay is linked against OpenSSL. As such, the NTLM and LM hashes are computed correctly, and password changes work as expected when using smbk5pwd.
Clone Of:
: 841560 (view as bug list)
Environment:
Last Closed: 2013-02-21 09:45:45 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2013:0364 0 normal SHIPPED_LIVE openldap bug fix and enhancement update 2013-02-20 20:52:54 UTC

Description Michael Starling 2012-05-09 14:03:14 UTC
Description of problem:
With the smbk5pwd module loaded in slapd.conf, pam_password exop enabled in pam_ldap.conf and ldap password sync = only in smb.conf the exop operation takes place with the passwd,ldappasswd or smbpasswd command but the HASHES in the sambaLMPassword sambaNTPassword fields are not properly updated so subsequent authentication requests fail. On the same machine with smbldap-tools installed the smbldap-passwd binary updates the fields properly and authentication works. It's also worth noting that if I perform the exop with passwd,ldappasswd or smbpasswd after setting the password with smbldap-passwd and authentication is known to be working authentication then fails and I can't use the old password set by smbldap-passwd anymore so this proves the sambaLMPassword sambaNTPassword fields are getting updated.

Version-Release number of selected component (if applicable):
Tested on:
openldap-servers-2.4.23-20.el6.x86_64.rpm
openldap-servers-2.4.23-15.el6.x86_64.rpm

How reproducible:


Steps to Reproduce:
1. run passwd or ldappasswd or smbpassword "username"
2. watch the MOD take place in the slapd log
3. Try to authenticate from a windows client (Logon failure, unknown username or password)
  
Actual results:
BAD
sambaLMPassword: 010000006f7f00000d00000000000000
sambaNTPassword: 0009001c6f7f00000009001c6f7f0000



Expected results:
GOOD
sambaLMPassword: 78bccaee08c90e29aad3b435b51404ee
sambaNTPassword: f9e37e83b83c47a93c2f09f66408631b

Additional info:

I experienced this with openldap-2.4.23-20 and downgraded to openldap-2.4.23-15 and the same problem persisted. it wasn't until I downgraded to openldap-2.4.19-15 did smbk5pwd work as expected. The smbk5pwd module has worked great for us in RHEL 5.x with openldap 2.3x for many years so I was surprised to see this broken in 6.2.

Comment 2 RHEL Program Management 2012-05-14 04:04:27 UTC
This request was not resolved in time for the current release.
Red Hat invites you to ask your support representative to
propose this request, if still desired, for consideration in
the next release of Red Hat Enterprise Linux.

Comment 3 Michael Starling 2012-05-15 17:46:14 UTC
Are you telling me this is a known issue and is fixed in RHEL 6.3?

Comment 4 Isaac Wilson 2012-06-17 20:55:14 UTC
I downloaded the source for openldap 2.4.23-20 and compiled it and the smbk5pwd module under RHEL 6.2 (64-bit); I got the same result the original poster described.

When examining the source code I noticed that if neither the HAVE_OPENSSL nor the HAVE_GNUTLS flags were set, the NT and LM hashes would be created from whatever garbage was in the hbuf variable and NOT from the received password.

Once I modified the smbk5pwd Makefile to define the HAVE_OPENSSL flag and recompiled, the module now generates the NT and LM hashes correctly.

Comment 12 Karel Srot 2012-07-27 07:56:54 UTC
Hi Jan,
could we have any issues with linking smbk5pwd against openssl?

Comment 14 Jan Vcelak 2012-07-27 16:32:05 UTC
(In reply to comment #12)
> Hi Jan,
> could we have any issues with linking smbk5pwd against openssl?

I do not think so. It works just fine in Fedora, and the patch can be backported very easily.

Jan

Comment 21 Jan Vcelak 2012-07-31 09:15:26 UTC
    Technical note added. If any revisions are required, please edit the "Technical Notes" field
    accordingly. All revisions will be proofread by the Engineering Content Services team.
    
    New Contents:
- openldap-server with smbk5pwd overlay enabled, user performs password change
- NTLM and LM hashes are not computed, uninitialized memory is used instead, sambaLMPassword and sambaNTPasswords attributes are updated with incorrect values
- smbk5pwd module is now linked to OpenSSL library
- NTLM and LM hashes are computed correctly from the new password being set, sambaLMPassword and sambaNTPasswords attributes are updated correctly

Comment 24 Murray McAllister 2012-08-13 04:40:51 UTC
    Technical note updated. If any revisions are required, please edit the "Technical Notes" field
    accordingly. All revisions will be proofread by the Engineering Content Services team.
    
    Diffed Contents:
@@ -1,4 +1,3 @@
-- openldap-server with smbk5pwd overlay enabled, user performs password change
+When the smbk5pwd overlay was enabled in an OpenLDAP server, and a user changed their password, the Microsoft NT LAN Manager (NTLM) and Microsoft LAN Manager (LM) hashes were not computed correctly. This led to the sambaLMPassword and sambaNTPassword attributes being updated with incorrect values, preventing the user logging in using a Windows-based client or a Samba client.
-- NTLM and LM hashes are not computed, uninitialized memory is used instead, sambaLMPassword and sambaNTPasswords attributes are updated with incorrect values
+
-- smbk5pwd module is now linked to OpenSSL library
+With this update, the smbk5pwd overlay is linked against OpenSSL. As such, the NTLM and LM hashes are computed correctly, and password changes work as expected when using smbk5pwd.-- NTLM and LM hashes are computed correctly from the new password being set, sambaLMPassword and sambaNTPasswords attributes are updated correctly

Comment 28 errata-xmlrpc 2013-02-21 09:45:45 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

http://rhn.redhat.com/errata/RHBA-2013-0364.html


Note You need to log in before you can comment on or make changes to this bug.