Openwall GNU/*/Linux - a small security-enhanced Linux distro for servers
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Date: Sat, 3 Feb 2007 14:47:23 +0300
From: Solar Designer <>
Subject: Re:  Re: Mac OS X 10.4 Hashes..

> Solar Designer <solar@...> writes:
> > Apparently, this one works for salted SHA-1 hashes as used on OS X:
> > 
> >

On Wed, Jan 31, 2007 at 08:30:27PM +0000, Matt D. wrote:
> Does anyone know of an update to this patch for support in Linux?

I did not.  But I've just made one for you - it's attached (to be
applied on top of the above patch).  The problem was not with Linux vs.
OS X, but rather with the original patch not supporting little-endian
architectures such as x86.  It worked on Linux/SPARC just fine, which
I've used to identify where things went wrong on x86.  It is likely that
64-bit architectures will require even further fixups to this patch; I
haven't bothered to test that yet.

Alexander Peslyak <solar at>
GPG key ID: 5B341F15  fp: B3FB 63F4 D7A3 BCCC 6F6E  FC55 A2FC 027C 5B34 1F15 - bringing security into open computing environments

Was I helpful?  Please give your feedback here:

diff -ur john-1.7-saltsha1/src/saltSHA1_fmt.c john-1.7/src/saltSHA1_fmt.c
--- john-1.7-saltsha1/src/saltSHA1_fmt.c	Sat Feb  3 14:37:20 2007
+++ john-1.7/src/saltSHA1_fmt.c	Sat Feb  3 14:36:35 2007
@@ -13,6 +13,7 @@
 #include "common.h"
 #include "formats.h"
 #include "sha.h"
+#include "sha_locl.h"
 #define FORMAT_LABEL			"salt-sha1"
 #define FORMAT_NAME			"Salt SHA1"
@@ -60,6 +61,9 @@
 static void saltsha1_set_salt(void *salt) 
 	sscanf(salt, "%08X", &crypt_salt);
+	Endian_Reverse32(crypt_salt);
 static void saltsha1_init(void)
diff -ur john-1.7-saltsha1/src/sha1.c john-1.7/src/sha1.c
--- john-1.7-saltsha1/src/sha1.c	Sat Feb  3 14:37:20 2007
+++ john-1.7/src/sha1.c	Sat Feb  3 14:35:41 2007
@@ -63,6 +63,13 @@
 #include "sha.h"
 #include "sha_locl.h"
+#include "arch.h"
+#define L_ENDIAN
+#define B_ENDIAN
 char *SHA1_version="SHA1 part of SSLeay 0.8.2b 08-Jan-1998";
 /* Implemented from SHA-1 document - The Secure Hash Algorithm

To unsubscribe, e-mail and reply
to the automated confirmation request that will be sent to you.

Powered by blists - more mailing lists

Your e-mail address:

Powered by Openwall GNU/*/Linux - Powered by OpenVZ