From owner-svn-src-all@FreeBSD.ORG Tue Jun 16 23:57:29 2015 Return-Path: Delivered-To: svn-src-all@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id EA9C1DC2; Tue, 16 Jun 2015 23:57:29 +0000 (UTC) (envelope-from allanjude@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D896C832; Tue, 16 Jun 2015 23:57:29 +0000 (UTC) (envelope-from allanjude@FreeBSD.org) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t5GNvTQ2087830; Tue, 16 Jun 2015 23:57:29 GMT (envelope-from allanjude@FreeBSD.org) Received: (from allanjude@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t5GNvTb5087829; Tue, 16 Jun 2015 23:57:29 GMT (envelope-from allanjude@FreeBSD.org) Message-Id: <201506162357.t5GNvTb5087829@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: allanjude set sender to allanjude@FreeBSD.org using -f From: Allan Jude Date: Tue, 16 Jun 2015 23:57:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r284483 - head/secure/lib/libcrypt X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 16 Jun 2015 23:57:30 -0000 Author: allanjude (doc committer) Date: Tue Jun 16 23:57:29 2015 New Revision: 284483 URL: https://svnweb.freebsd.org/changeset/base/284483 Log: Add compatibility with $2y$ bcrypt hashes crypt_blowfish and many implementations based on it (Apache, PHP, PostgreSQL) implemented $2y$ before OpenBSD went with $2b$. This changes marks them as equivalent. http://www.openwall.com/lists/announce/2011/07/17/1 This change is required for applications that use the base crypt() implementation (including nginx) to be able to validate $2y$ hashes Reviewed by: eadler Approved by: delphij MFC after: 1 week Relnotes: yes Sponsored by: ScaleEngine Inc. Differential Revision: https://reviews.freebsd.org/D2742 Modified: head/secure/lib/libcrypt/crypt-blowfish.c Modified: head/secure/lib/libcrypt/crypt-blowfish.c ============================================================================== --- head/secure/lib/libcrypt/crypt-blowfish.c Tue Jun 16 23:38:44 2015 (r284482) +++ head/secure/lib/libcrypt/crypt-blowfish.c Tue Jun 16 23:57:29 2015 (r284483) @@ -167,6 +167,9 @@ crypt_blowfish(const char *key, const ch switch (salt[1]) { case 'a': /* 'ab' should not yield the same as 'abab' */ case 'b': /* cap input length at 72 bytes */ + case 'y': /* same as 'b', for compatibility + * with openwall crypt_blowfish + */ minr = salt[1]; salt++; break;