Bug 181442 - dovecot does not recognise 'SHA' digests when authenticating
Summary: dovecot does not recognise 'SHA' digests when authenticating
Alias: None
Product: Red Hat Enterprise Linux 4
Classification: Red Hat
Component: dovecot   
(Show other bugs)
Version: 4.0
Hardware: i386 Linux
Target Milestone: ---
: ---
Assignee: Petr Rockai
QA Contact:
Depends On:
Blocks: 181409 181448
TreeView+ depends on / blocked
Reported: 2006-02-14 05:20 UTC by Matthew Sage
Modified: 2007-11-30 22:07 UTC (History)
0 users

Fixed In Version: RHBA-2006-0439
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2006-08-10 21:37:15 UTC
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

External Trackers
Tracker ID Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2006:0439 normal SHIPPED_LIVE dovecot bug fix update 2006-08-09 04:00:00 UTC

Description Matthew Sage 2006-02-14 05:20:55 UTC
From Bugzilla Helper:
User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.12) Gecko/20050922 Fedora/1.0.7-1.1.fc3 Firefox/1.0.7

Description of problem:
When authenticating against some LDAP directories, the directories send back the userPassword attribute in a SHA1 digest but reports that the digest is 'SHA'.  Dovecot does not deal with this.

Version-Release number of selected component (if applicable):

How reproducible:

Steps to Reproduce:
1. Setup dovecot to authenticate against an LDAP directory that uses a 'SHA' digest.

Actual Results:  The logs report...

Feb  7 14:30:29 servern dovecot-auth: ldap(acct_name): Unknown password scheme SHA

Expected Results:  dovecot should recognise SHA as being SHA1

Additional info:

I propose the following patch to fix the problem:

diff -cr dovecot-0.99.11/src/auth/password-scheme.c dovecot-0.99.11-working/src/auth/password-scheme.c
*** dovecot-0.99.11/src/auth/password-scheme.c  2004-07-31 09:54:06.000000000 +1000
--- dovecot-0.99.11-working/src/auth/password-scheme.c  2006-02-08 08:57:07.630970000 +1100
*** 48,54 ****
                return strcasecmp(str, password) == 0;
!       if (strcasecmp(scheme, "SHA1") == 0) {
                unsigned char sha1_digest[SHA_DIGEST_LENGTH];
                string_t *str;

--- 48,54 ----
                return strcasecmp(str, password) == 0;
!       if ((strcasecmp(scheme, "SHA1") == 0) || (strcasecmp(scheme, "SHA") == 0)) {
                unsigned char sha1_digest[SHA_DIGEST_LENGTH];
                string_t *str;

This deals with 'SHA' hashes in a way consistent with the more recent releases of dovecot.

Comment 8 Red Hat Bugzilla 2006-08-10 21:37:16 UTC
An advisory has been issued which should help the problem
described in this bug report. This report is therefore being
closed with a resolution of ERRATA. For more information
on the solution and/or where to find the updated files,
please follow the link below. You may reopen this bug report
if the solution does not work for you.


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