From commits-return-12774-apmail-apr-commits-archive=apr.apache.org@apr.apache.org Sat Feb 23 12:25:00 2013 Return-Path: X-Original-To: apmail-apr-commits-archive@www.apache.org Delivered-To: apmail-apr-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 66368EC0F for ; Sat, 23 Feb 2013 12:25:00 +0000 (UTC) Received: (qmail 88199 invoked by uid 500); 23 Feb 2013 12:25:00 -0000 Delivered-To: apmail-apr-commits-archive@apr.apache.org Received: (qmail 88099 invoked by uid 500); 23 Feb 2013 12:24:59 -0000 Mailing-List: contact commits-help@apr.apache.org; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: Reply-To: dev@apr.apache.org List-Id: Delivered-To: mailing list commits@apr.apache.org Received: (qmail 88083 invoked by uid 99); 23 Feb 2013 12:24:59 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 23 Feb 2013 12:24:59 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 23 Feb 2013 12:24:57 +0000 Received: from eris.apache.org (localhost [127.0.0.1]) by eris.apache.org (Postfix) with ESMTP id B7E492388980; Sat, 23 Feb 2013 12:24:37 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r1449309 - in /apr/apr-util/branches/1.5.x: ./ CHANGES crypto/apr_passwd.c Date: Sat, 23 Feb 2013 12:24:37 -0000 To: commits@apr.apache.org From: rjung@apache.org X-Mailer: svnmailer-1.0.8-patched Message-Id: <20130223122437.B7E492388980@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: rjung Date: Sat Feb 23 12:24:37 2013 New Revision: 1449309 URL: http://svn.apache.org/r1449309 Log: Fix password validation failure for all crypt and crypt_r based algorithms. PR: 54603 Submitted by: Harvey Eneman Backport of r1449308 from trunk. Modified: apr/apr-util/branches/1.5.x/ (props changed) apr/apr-util/branches/1.5.x/CHANGES apr/apr-util/branches/1.5.x/crypto/apr_passwd.c Propchange: apr/apr-util/branches/1.5.x/ ------------------------------------------------------------------------------ Merged /apr/apr/trunk:r1449308 Modified: apr/apr-util/branches/1.5.x/CHANGES URL: http://svn.apache.org/viewvc/apr/apr-util/branches/1.5.x/CHANGES?rev=1449309&r1=1449308&r2=1449309&view=diff ============================================================================== --- apr/apr-util/branches/1.5.x/CHANGES [utf-8] (original) +++ apr/apr-util/branches/1.5.x/CHANGES [utf-8] Sat Feb 23 12:24:37 2013 @@ -1,6 +1,9 @@ -*- coding: utf-8 -*- Changes with APR-util 1.5.2 + *) Fix password validation failure for all crypt and crypt_r based + algorithms. PR 54603. [Harvey Eneman ] + *) Fix syntax error in crypto/apr_passwd.c on non-glibc systems. PR 54275. [Stefan Fritsch] Modified: apr/apr-util/branches/1.5.x/crypto/apr_passwd.c URL: http://svn.apache.org/viewvc/apr/apr-util/branches/1.5.x/crypto/apr_passwd.c?rev=1449309&r1=1449308&r2=1449309&view=diff ============================================================================== --- apr/apr-util/branches/1.5.x/crypto/apr_passwd.c (original) +++ apr/apr-util/branches/1.5.x/crypto/apr_passwd.c Sat Feb 23 12:24:37 2013 @@ -77,19 +77,18 @@ APU_DECLARE(apr_status_t) apr_password_v #if !defined(WIN32) && !defined(BEOS) && !defined(NETWARE) char *crypt_pw; #endif - if (hash[0] == '$') { - if (hash[1] == '2' && (hash[2] == 'a' || hash[2] == 'y') - && hash[3] == '$') - { - if (_crypt_blowfish_rn(passwd, hash, sample, sizeof(sample)) == NULL) - return APR_FROM_OS_ERROR(errno); - } - else if (!strncmp(hash, apr1_id, strlen(apr1_id))) { - /* - * The hash was created using our custom algorithm. - */ - apr_md5_encode(passwd, hash, sample, sizeof(sample)); - } + if (hash[0] == '$' + && hash[1] == '2' + && (hash[2] == 'a' || hash[2] == 'y') + && hash[3] == '$') { + if (_crypt_blowfish_rn(passwd, hash, sample, sizeof(sample)) == NULL) + return APR_FROM_OS_ERROR(errno); + } + else if (!strncmp(hash, apr1_id, strlen(apr1_id))) { + /* + * The hash was created using our custom algorithm. + */ + apr_md5_encode(passwd, hash, sample, sizeof(sample)); } else if (!strncmp(hash, APR_SHA1PW_ID, APR_SHA1PW_IDLEN)) { apr_sha1_base64(passwd, (int)strlen(passwd), sample);