commit b10e23817772351e462f50aa40d87b48fecd8587
Author: magnum <magnum>
Date:   Fri Jul 1 12:48:50 2011 +0200

    john-1.7.7-jumbo-6-jimfpatch-4.diff applied

diff --git a/src/DOMINOSEC_fmt.c b/src/DOMINOSEC_fmt.c
index 1a5feff..dd93955 100644
--- a/src/DOMINOSEC_fmt.c
+++ b/src/DOMINOSEC_fmt.c
@@ -84,7 +84,7 @@ static const char *hex_table[] = {
 	"F8", "F9", "FA", "FB",	"FC", "FD", "FE", "FF"
 };
 
-static const char lotus_magic_table[] = {
+static const unsigned char lotus_magic_table[] = {
 	0xbd, 0x56, 0xea, 0xf2, 0xa2, 0xf1, 0xac, 0x2a,
 	0xb0, 0x93, 0xd1, 0x9c, 0x1b, 0x33, 0xfd, 0xd0,
 	0x30, 0x04, 0xb6, 0xdc, 0x7d, 0xdf, 0x32, 0x4b,
diff --git a/src/Makefile b/src/Makefile
index 5b2edfc..281416f 100644
--- a/src/Makefile
+++ b/src/Makefile
@@ -32,17 +32,29 @@ OMPFLAGS =
 # icc with OpenMP (for make target linux-x86-64-icc)
 #OMPFLAGS = -openmp
 
-CFLAGS = -c -Wall -O2 -fomit-frame-pointer -I/usr/local/include $(OMPFLAGS)
-# -DHAVE_OPENSSL_SHA256
+# comment out next 2 lines if you have OpenSSL problems linking in these 2 formats (hmailserver, SybaseASE)
+HMAIL_SYBASE_OBJS = hmailserver_fmt.o SybaseASE_fmt.o
+HMAIL_SYBASE = -DHAVE_OPENSSL_SHA256
+
+# comment out next 6 lines if you have OpenSSL problems linking in these 3 formats (SSH, RAR, PDF)
+SSH_PDF_RAR_OBJS = ssh_fmt.o ssh2john.o pdf_fmt.o pdf2john.o pdfcrack_common.o pdfcrack_md5.o pdfparser.o pdfcrack.o pdfcrack_rc4.o rar_fmt.o rar2john.o
+SSH_PDF_RAR_EXE = ../run/ssh2john ../run/pdf2john ../run/rar2john
+SSH_PDF_RAR_COM = ../run/ssh2john.com ../run/pdf2john.com ../run/rar2john.com
+SSH_PDF_RAR_WIN32 = ../run/ssh2john.exe ../run/pdf2john.exe ../run/rar2john.exe
+SSH_PDF_RAR = -DHAVE_SSH_PDF_RAR
+SSLLIB = -lssl
+
+CFLAGS = -c -Wall -O2 -fomit-frame-pointer -I/usr/local/include $(OMPFLAGS) $(HMAIL_SYBASE) $(SSH_PDF_RAR)
 # -DHAVE_SKEY
 ASFLAGS = -c $(OMPFLAGS)
-LDFLAGS = -s -L/usr/local/lib -L/usr/local/ssl/lib -lcrypto -lssl -lm $(OMPFLAGS)
+LDFLAGS = -s -L/usr/local/lib -L/usr/local/ssl/lib -lcrypto $(SSLLIB) -lm $(OMPFLAGS)
 # -lskey
 LDFLAGS_SOLARIS = -lrt -lnsl -lsocket
 LDFLAGS_MKV = -s -lm
 OPT_NORMAL = -funroll-loops
 OPT_INLINE = -finline-functions
 
+
 JOHN_OBJS = \
 	$(MPIOBJ) \
 	DES_fmt.o DES_std.o DES_bs.o DES_bs_b.o \
@@ -99,12 +111,9 @@ JOHN_OBJS = \
 	phpassMD5_fmt.o \
 	md5_gen_fmt.o md5_gen_parser.o md5_gen_preloads.o md5_gen_utils.o \
 	DMD5_fmt.o \
-	hmailserver_fmt.o \
-	SybaseASE_fmt.o \
+	$(HMAIL_SYBASE_OBJS) \
 	SKEY_fmt.o \
-	ssh_fmt.o ssh2john.o \
-	pdf_fmt.o pdf2john.o pdfcrack_common.o pdfcrack_md5.o pdfparser.o pdfcrack.o pdfcrack_rc4.o \
-	rar_fmt.o rar2john.o \
+	$(SSH_PDF_RAR_OBJS) \
 	dummy.o \
 	batch.o bench.o charset.o common.o compiler.o config.o cracker.o \
 	crc32.o external.o formats.o getopt.o idle.o inc.o john.o list.o \
@@ -145,22 +154,22 @@ GENMKVPWD_OBJS = \
 	genmkvpwd.o mkvlib.o memory.o miscnl.o
 
 PROJ = ../run/john ../run/unshadow ../run/unafs ../run/unique ../run/undrop \
-	../run/ssh2john ../run/pdf2john ../run/rar2john \
+	$(SSH_PDF_RAR_EXE) \
 	../run/genmkvpwd ../run/mkvcalcproba ../run/calc_stat \
 	../run/tgtsnarf
 PROJ_DOS = ../run/john.bin ../run/john.com \
 	../run/unshadow.com ../run/unafs.com ../run/unique.com \
 	../run/undrop.com \
-	../run/ssh2john.com ../run/pdf2john.com ../run/rar2john.com
+	$(SSH_PDF_RAR_COM)
 PROJ_WIN32 = ../run/john.exe \
 	../run/unshadow.exe ../run/unafs.exe ../run/unique.exe \
 	../run/undrop.exe \
-	../run/ssh2john.exe ../run/pdf2john.exe ../run/rar2john.exe \
+	$(SSH_PDF_RAR_WIN32) \
 	../run/genmkvpwd.exe ../run/mkvcalcproba.exe ../run/calc_stat.exe
 PROJ_WIN32_MINGW = ../run/john-mingw.exe \
 	../run/unshadow.exe ../run/unafs.exe ../run/unique.exe \
 	../run/undrop.exe \
-	../run/ssh2john.exe ../run/pdf2john.exe ../run/rar2john.exe \
+	$(SSH_PDF_RAR_WIN32) \
 	../run/genmkvpwd.exe ../run/mkvcalcproba.exe ../run/calc_stat.exe
 
 default:
@@ -1061,7 +1070,7 @@ john.com: john.asm
 # this comment should stay for a jumbo or 2, to make sure this does not break
 # other peoples cygwin builds.
 #	$(LD) $(JOHN_OBJS) -lkernel32 -lcrypto -o ../run/john.exe
-	
+
 ../run/john.exe: $(JOHN_OBJS)
 	$(LD) $(JOHN_OBJS) $(LDFLAGS) -lkernel32 -o ../run/john.exe
 	strip ../run/john.exe
diff --git a/src/john.c b/src/john.c
index e36df5e..7953c22 100644
--- a/src/john.c
+++ b/src/john.c
@@ -117,9 +117,11 @@ extern struct fmt_main fmt_SybaseASE;
 extern struct fmt_main fmt_SKEY;
 #endif
 
+#ifdef HAVE_SSH_PDF_RAR
 extern struct fmt_main fmt_ssh;
 extern struct fmt_main fmt_pdf;
 extern struct fmt_main rar_fmt;
+#endif
 
 extern int unique(int argc, char **argv);
 extern int unshadow(int argc, char **argv);
@@ -224,9 +226,11 @@ static void john_register_all(void)
 	john_register_one(&fmt_SKEY);
 #endif
 
+#ifdef HAVE_SSH_PDF_RAR
 	john_register_one(&fmt_ssh);
 	john_register_one(&fmt_pdf);
 	john_register_one(&rar_fmt);
+#endif
 
 	john_register_one(&fmt_dummy);
 
@@ -631,6 +635,7 @@ int main(int argc, char **argv)
 	if (!strcmp(name, "undrop"))
                return undrop(argc, argv);
 
+#ifdef HAVE_SSH_PDF_RAR
  	if (!strcmp(name, "ssh2john"))
 		return ssh2john(argc, argv);
 
@@ -639,6 +644,7 @@ int main(int argc, char **argv)
 
 	if (!strcmp(name, "rar2john"))
 		return rar2john(argc, argv);
+#endif
 
 #ifdef HAVE_MPI
 	mpi_setup(argc, argv);
diff --git a/src/lotus5_fmt.c b/src/lotus5_fmt.c
index a2814f2..1f4b2c6 100644
--- a/src/lotus5_fmt.c
+++ b/src/lotus5_fmt.c
@@ -29,7 +29,7 @@ static struct fmt_tests tests[] = {
   {NULL}
 };
 
-static const char lotus_magic_table[256] = {
+static const unsigned char lotus_magic_table[256] = {
   0xbd, 0x56, 0xea, 0xf2, 0xa2, 0xf1, 0xac, 0x2a,
   0xb0, 0x93, 0xd1, 0x9c, 0x1b, 0x33, 0xfd, 0xd0,
   0x30, 0x04, 0xb6, 0xdc, 0x7d, 0xdf, 0x32, 0x4b,
diff --git a/src/sapB_fmt.c b/src/sapB_fmt.c
index d3af0af..a486a93 100644
--- a/src/sapB_fmt.c
+++ b/src/sapB_fmt.c
@@ -29,7 +29,7 @@ unsigned char transtable[TRANSTABLE_LENGTH]=
  0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF };
 
 #define BCODE_ARRAY_LENGTH 3*16
-char bcodeArr[BCODE_ARRAY_LENGTH]=
+unsigned char bcodeArr[BCODE_ARRAY_LENGTH]=
 {0x14,0x77,0xF3,0xD4,0xBB,0x71,0x23,0xD0,0x03,0xFF,0x47,0x93,0x55,0xAA,0x66,0x91,
 0xF2,0x88,0x6B,0x99,0xBF,0xCB,0x32,0x1A,0x19,0xD9,0xA7,0x82,0x22,0x49,0xA2,0x51,
 0xE2,0xB7,0x33,0x71,0x8B,0x9F,0x5D,0x01,0x44,0x70,0xAE,0x11,0xEF,0x28,0xF0,0x0D};
