1
0
mirror of https://github.com/openwall/crypt_blowfish.git synced 2025-04-18 09:24:02 +03:00

68 Commits

Author SHA1 Message Date
Solar Designer
3354bb81ee Added OpenBSD 5.5+ "$2b$" prefix support to crypt_blowfish (same as "$2y$")
CVS-ID: README 1.10
CVS-ID: crypt.3 1.10
CVS-ID: crypt_blowfish.c 1.31
CVS-ID: wrapper.c 1.23
CRYPT_BLOWFISH_1_3 Owl-3_1-release
2014-07-07 19:19:04 +04:00
Solar Designer
c98a6fa2d0 Typo fix in a comment: s/prefer refer/please refer/
CVS-ID: crypt_blowfish.c 1.30
2011-07-17 21:35:35 +04:00
Solar Designer
3953978bd7 Added a patch for glibc 2.13 and 2.14.
CVS-ID: README 1.9
CVS-ID: glibc-2.14-crypt.diff 1.1
CRYPT_BLOWFISH_1_2
2011-07-17 01:48:45 +04:00
Solar Designer
d97efe878c Added fallbacks to a permissive license. Made other minor edits to comments
and the documentation.

CVS-ID: Makefile 1.7
CVS-ID: README 1.8
CVS-ID: crypt.3 1.9
CVS-ID: crypt.h 1.2
CVS-ID: crypt_blowfish.c 1.29
CVS-ID: crypt_blowfish.h 1.4
CVS-ID: crypt_gensalt.c 1.6
CVS-ID: crypt_gensalt.h 1.3
CVS-ID: ow-crypt.h 1.3
CVS-ID: wrapper.c 1.22
CVS-ID: x86.S 1.9
2011-07-16 19:16:39 +04:00
Solar Designer
12660c4c13 Documented the "$2x$" and "$2y$" prefixes.
CVS-ID: crypt.3 1.8
2011-07-16 18:40:10 +04:00
Solar Designer
9e13bb6822 In the BF_set_key() test, check the actual values of two elements of the
expanded key arrays.  (Previously, the test only made sure the safety bit was
flipped between "$2a$" and "$2y$".)

CVS-ID: crypt_blowfish.c 1.28
2011-07-16 17:35:18 +04:00
Solar Designer
ca16f08f6f Dropped the memset() that cleaned the self-test's buffer because the
self-test's BF_crypt() call leaves plenty of evidence of what hash type we were
testing deeper on the stack anyway.

CVS-ID: crypt_blowfish.c 1.27
2011-07-08 12:28:43 +04:00
Solar Designer
a06d664acc Also test BF_set_key()'s safety measure with $2a$.
CVS-ID: crypt_blowfish.c 1.26
2011-07-08 12:15:45 +04:00
Solar Designer
f521c287a3 Combined the self-test buffers into a struct.
CVS-ID: crypt_blowfish.c 1.25
2011-07-08 11:48:41 +04:00
Solar Designer
d10f805bc5 Re-worked the quick self-test such that it also tests $2y$ when that is the
requested prefix.

CVS-ID: crypt_blowfish.c 1.24
2011-07-08 11:40:49 +04:00
Solar Designer
df4a3ce0b4 Explicitly test crypt_rn() as well, not just via crypt_ra() like we were
testing it before.

CVS-ID: wrapper.c 1.21
2011-07-08 08:36:58 +04:00
Solar Designer
72bcfac387 Added tests of crypt() and crypt_ra() on setting strings that don't include
full hashes and on incorrect setting strings.

CVS-ID: wrapper.c 1.20
2011-07-08 08:17:37 +04:00
Solar Designer
ab1d6c4ec1 Removed the BF_CLEAN #define, which is no longer used since last commit.
CVS-ID: x86.S 1.8
2011-07-08 06:44:07 +04:00
Solar Designer
ea0ae6ff34 Made the runtime self-test mandatory, and thus dropped the explicit cleanups.
CVS-ID: crypt_blowfish.c 1.23
CVS-ID: x86.S 1.7
2011-07-08 06:38:30 +04:00
Solar Designer
ce3cb0e3dd Preserve the requested prefix in bcrypt's crypt_gensalt*(), which was
temporarily not the case in the previous (unreleased) revision of the code.
Thanks to Ludwig Nussel for reporting the problem with mkpasswd that this
caused.  http://www.openwall.com/lists/oss-security/2011/07/07/8

CVS-ID: crypt_blowfish.c 1.22
CVS-ID: crypt_blowfish.h 1.3
CVS-ID: crypt_gensalt.c 1.5
CVS-ID: crypt_gensalt.h 1.2
CVS-ID: wrapper.c 1.19
2011-07-08 05:52:10 +04:00
Solar Designer
bb8151bd84 In a comment in BF_set_key(), refer to char numbers starting with 1, not 0.
CVS-ID: crypt_blowfish.c 1.21
2011-07-08 05:38:04 +04:00
Solar Designer
85cc577834 With "$2a$", deviate from the correct algorithm when necessary to prevent easy
collisions with multiple hashes produced by the sign extension buggy algorithm.

CVS-ID: crypt_blowfish.c 1.20
CVS-ID: wrapper.c 1.18
2011-07-07 00:15:03 +04:00
Solar Designer
a37a09f27b Added support for the new "$2y$" prefix indicating known correct bcrypt
algorithm.  (Unfortunately, "$2a$" doesn't actually mean that.)

CVS-ID: crypt_blowfish.c 1.19
CVS-ID: wrapper.c 1.17
2011-07-06 19:22:38 +04:00
Solar Designer
2d6695a1c7 Reduced code size by using the same BF_body() instance twice instead of
including BF_body() twice.

CVS-ID: crypt_blowfish.c 1.18
2011-07-06 18:36:56 +04:00
Solar Designer
e2199a4091 Moved a portion of the crypt(3) output buffer safety code from wrapper.c to
crypt_blowfish.c such that it protects potential applications that use
crypt_blowfish directly, yet fail to check the return value for NULL.

CVS-ID: crypt_blowfish.c 1.17
CVS-ID: crypt_blowfish.h 1.2
CVS-ID: wrapper.c 1.16
2011-07-06 17:56:42 +04:00
Solar Designer
0e35c6af5d Added many extra -W flags (enable more gcc warnings).
CVS-ID: Makefile 1.6
2011-07-06 17:10:47 +04:00
Solar Designer
77cdbfc007 Added a gcc 3 -Wshadow fix (the warning was spurious, not reported by gcc 4
anymore).

CVS-ID: wrapper.c 1.15
2011-07-06 17:07:51 +04:00
Solar Designer
dd6de99deb Fixed a couple of previously missed casts to non-const, added a gcc 3 -Wshadow
fix (the warning was spurious, not reported by gcc 4 anymore).

CVS-ID: crypt_blowfish.c 1.16
2011-07-06 17:07:25 +04:00
Solar Designer
b50364909b Dropped the unused __fcrypt() function definition. It matched glibc
crypt-entry.c's, but that one was unused as well, and neither was compiled in
when building the code as part of glibc.

CVS-ID: wrapper.c 1.14
2011-07-06 16:52:32 +04:00
Solar Designer
d82ee95a5f Moved some extern's from wrapper.c to crypt_blowfish.h and crypt_gensalt.h and
included those in the corresponding C files such that the compiler checks
whether the prototypes match the actual definitions.

CVS-ID: Makefile 1.5
CVS-ID: crypt_blowfish.c 1.15
CVS-ID: crypt_blowfish.h 1.1
CVS-ID: crypt_gensalt.c 1.4
CVS-ID: crypt_gensalt.h 1.1
CVS-ID: wrapper.c 1.13
2011-07-06 16:29:04 +04:00
Solar Designer
32c690c43a In the quick self-test, specify the output buffer as being of exactly the
required size.

CVS-ID: crypt_blowfish.c 1.14
2011-07-06 16:02:07 +04:00
Solar Designer
3f270f488d Removed the __CONST macro in favor of const in C files and __const in the
header file (consistent with glibc's, usable with "gcc -ansi" even with old
versions of gcc).

CVS-ID: crypt_blowfish.c 1.13
CVS-ID: crypt_gensalt.c 1.3
CVS-ID: ow-crypt.h 1.2
CVS-ID: wrapper.c 1.12
2011-07-06 15:56:35 +04:00
Solar Designer
7a63d1e306 Added "(void) signum;" to handle_timer() to suppress "gcc -W" warning:
wrapper.c: In function 'handle_timer':
wrapper.c:340:30: warning: unused parameter 'signum'

CVS-ID: wrapper.c 1.11
2011-07-06 15:12:21 +04:00
Solar Designer
cb3503e9be -Wcast-qual fixes from Ludwig Nussel
CVS-ID: crypt_blowfish.c 1.12
2011-07-06 15:08:46 +04:00
Solar Designer
51b5544f3e Documented the performance impact of quick self-test.
CVS-ID: PERFORMANCE 1.6
2011-06-21 16:09:20 +04:00
Solar Designer
da08a76f47 Added a quick self-test invoked on every use.
CVS-ID: crypt_blowfish.c 1.11
2011-06-21 16:01:42 +04:00
Solar Designer
3fa91ad24b Added 8-bit test vectors for both "$2a$" and "$2x$" (sign extension bug).
CVS-ID: wrapper.c 1.10
2011-06-21 13:48:48 +04:00
Solar Designer
8d75a54b0c Fixed the sign extension bug in BF_set_key(), but added the ability to
deliberately re-enable the bug via the "$2x$" prefix for backwards
compatibility.

CVS-ID: crypt_blowfish.c 1.10
2011-06-21 13:47:44 +04:00
Solar Designer
c89e9a861b Corrected the reference to a patch provided in the package: we're actually
providing a patch for glibc 2.3.6, not 2.3.2 anymore.

CVS-ID: README 1.7
Owl-3_0-release
2010-03-30 00:07:06 +04:00
Solar Designer
f78f67b7fb Added .section .note.GNU-stack to crypt_blowfish's x86.S
CVS-ID: x86.S 1.6
2010-02-20 14:34:50 +03:00
Solar Designer
b8fde6dd4a crypt_blowfish 1.0.4:
Corrected the sanity check of the "setting" string in _crypt_blowfish_rn() to
reject iteration counts encoded as 36 through 39.  Previously, these would be
misinterpreted as being the same as 04 through 07.  This was reported to us by
Joey Smith.

CVS-ID: crypt_blowfish.c 1.9
2010-02-19 09:27:29 +03:00
Dmitry V. Levin
06e7dce865 Make crypt_blowfish buildable by modern gcc compilers by moving
fcrypt weak alias definition from crypt-entry.c to wrapper.c

CVS-ID: glibc-2.1.3-crypt.diff 1.2
CVS-ID: glibc-2.3.6-crypt.diff 1.1
CVS-ID: wrapper.c 1.9
2008-07-17 03:08:21 +04:00
Solar Designer
cfc65834ec In crypt_blowfish, enable BF_SCALE on x86-64 for better performance.
CVS-ID: crypt_blowfish.c 1.8
2006-05-23 03:57:44 +04:00
Solar Designer
df3522f0b5 Fixed a compiler warning on systems where ptrdiff_t is not int.
CVS-ID: wrapper.c 1.8
2006-03-05 17:28:35 +03:00
Solar Designer
b27fcb24be Separate sentences with two spaces in comments.
CVS-ID: crypt_blowfish.c 1.7
CVS-ID: wrapper.c 1.7
2006-03-05 16:51:09 +03:00
Solar Designer
f55c48af66 Use sysconf(_SC_CLK_TCK) instead of CLK_TCK when _SC_CLK_TCK is known to
be available or CLK_TCK is not.  This change only affects -DTEST builds.

CVS-ID: wrapper.c 1.6
2006-03-05 16:45:28 +03:00
Solar Designer
848be062b0 crypt_blowfish 1.0:
Corrected a bug in the way salts for extended DES-based and for MD5-based
hashes are generated; thanks to Marko Kreen for discovering this.

CVS-ID: crypt_gensalt.c 1.2
CRYPT_BLOWFISH_1_0 Owl-2_0-release
2006-01-02 22:24:50 +03:00
Solar Designer
768c7adb27 The patch is known to be good for glibc 2.3.6 as well.
CVS-ID: README 1.6
2006-01-02 22:04:19 +03:00
Solar Designer
3c3becce05 "there're" -> "there are"
CVS-ID: crypt.3 1.7
2005-12-18 19:37:14 +03:00
Solar Designer
9f6f798d53 $Id$ -> $Owl$
CVS-ID: LINKS 1.4
CVS-ID: PERFORMANCE 1.5
CVS-ID: README 1.5
2005-11-16 16:09:47 +03:00
Solar Designer
a34648c141 NetBSD got bcrypt, too. (Finally.)
CVS-ID: crypt.3 1.6
2005-02-22 15:47:33 +03:00
Solar Designer
643c421926 Noted that phk's MD5-based and bcrypt hashes are supported on Solaris 10.
CVS-ID: crypt.3 1.5
2005-02-22 15:30:04 +03:00
Solar Designer
da93962d78 English grammar: do use serial commas.
http://dictionary.reference.com/help/faq/language/c/comma.html
http://www.getitwriteonline.com/archive/020204.htm

CVS-ID: crypt.3 1.4
2005-02-22 15:03:51 +03:00
Solar Designer
68eab444f8 Mention Solaris 10's crypt_gensalt(3C).
CVS-ID: crypt.3 1.3
2005-02-22 14:23:51 +03:00
Solar Designer
43ffc8e540 crypt_blowfish 0.4.7:
#include <time.h> in wrapper.c's self-test code - for CLK_TCK.

Don't include "-c" in CFLAGS.

CVS-ID: Makefile 1.4
CVS-ID: wrapper.c 1.5
2005-02-09 01:05:11 +03:00