Bug #2278

"Password hashing weakness in DF" (Matthias Schmidt)

Added by robin.carey1 over 2 years ago. Updated about 2 years ago.

Status:ClosedStart date:
Priority:NormalDue date:
Assignee:-% Done:

0%

Category:-
Target version:-

Description

Further to the email posted by Matthias Schmidt to DragonFly users list
(17/01/2012):

I had a look at (GitWeb) the source code:

lib/libcrypt/crypt-sha256.c

and

lib/libcrypt/crypt-sha512.c

Both of those C files have bugs in them: "crypt-sha256.c:":

....
/* Then the magic string */
SHA256_Update(&ctx, magic, sizeof(magic));
....

Should be strlen(magic) instead of sizeof(magic).
-----

And practically the same bug in: "crypt-sha512.c":

....
/* Then the magic string */
SHA512_Update(&ctx, magic, sizeof(magic));
.....

Should be strlen(magic) instead of sizeof(magic).
------

There might be other bugs - I didn't really check for any .....

--
Sincerely,

Robin Carey BSc

History

#1 Updated by sjg about 2 years ago

  • Status changed from New to Closed

I have deprecated that code, but the bugs will have to stick around until we tear it out to ensure peoples passwords keep working.

#2 Updated by dillon about 2 years ago

:Issue #2278 has been reported by Robin Carey.
:
:----------------------------------------
:Bug #2278: "Password hashing weakness in DF" (Matthias Schmidt)
:http://bugs.dragonflybsd.org/issues/2278

After some coordination on IRC, Sam committed the linux sha256 and
sha512 code ($5$ and $6$) and set the default to the new sha512
code. The broken sha256/512 code ($3$ and $4$) is still present
in order to properly decrypt any passwords using the broken hash,
but can no longer be used to encrypt new passwords.

-Matt

Also available in: Atom PDF