svn commit: r284483 - head/secure/lib/libcrypt
Allan Jude
allanjude at FreeBSD.org
Tue Jun 16 23:57:30 UTC 2015
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;
More information about the svn-src-head
mailing list