Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 7 additions & 4 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,14 @@
*.sam

*.o
*.a
*.exe
*.dSYM
.DS_Store
*.pyc

Makefile.dep

Makefile
john-local.conf

Expand Down Expand Up @@ -72,8 +75,11 @@ run/vncpcap2john
run/wpapcap2john
run/zip2john

.deps
.deps/

src/.gdbinit
src/mbedtls/aes.a
src/.plugin_fmt_list
src/arch.h
src/all_tests.lst
src/autoconfig-stamp-h
Expand All @@ -93,9 +99,6 @@ src/fmt_registers.h
src/generic.h
src/john_build_rule.h
src/memdbg_defines.h
src/secp256k1/secp256k1.a
src/ed25519-donna/ed25519-donna.a
src/poly1305-donna/poly1305-donna.a
src/stamp-h1
src/version.h
src/version.h.new
Expand Down
445 changes: 82 additions & 363 deletions src/Makefile.in

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion src/Makefile.legacy
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ JOHN_OBJS = \
lzma/LzmaDec.o lzma/Lzma2Dec.o lzma/Bra.o lzma/Bra86.o lzma/BraIA64.o lzma/CpuArch.o lzma/Delta.o \
unique.o gpg2john.o \
showformats.o \
color.o
color.o sm3.o

OCL_OBJS = opencl_common.o opencl_autotune.o bt.o bt_hash_type_64.o bt_hash_type_128.o bt_hash_type_192.o bt_twister.o

Expand Down
2 changes: 1 addition & 1 deletion src/argon2_fmt_plug.c
Original file line number Diff line number Diff line change
Expand Up @@ -503,4 +503,4 @@ struct fmt_main fmt_argon2 = {
}
};

#endif
#endif /* plugin stanza */
2 changes: 1 addition & 1 deletion src/axcrypt_fmt_plug.c
Original file line number Diff line number Diff line change
Expand Up @@ -346,4 +346,4 @@ struct fmt_main fmt_axcrypt =
}
};

#endif
#endif /* plugin stanza */
132 changes: 60 additions & 72 deletions src/configure
Original file line number Diff line number Diff line change
Expand Up @@ -625,9 +625,6 @@ ac_includes_default="\

ac_subst_vars='LTLIBOBJS
HOST_OS
PLUGFORMATS_DEPS
OPENCL_PLUGFORMATS_OBJS
PLUGFORMATS_OBJS
M4_INCLUDES
HAVE_LIBFUZZER
HAVE_FUZZ
Expand Down Expand Up @@ -680,6 +677,7 @@ ifGNUmake
SED
GREP
LN_S
DEPFLAGS
O_DEBUG
OPT_INLINE_FLAGS
OPT_NORMAL_FLAGS
Expand Down Expand Up @@ -754,7 +752,6 @@ enable_asan
enable_ubsan
enable_ubsantrap
enable_simd
enable_plugin_dependencies
enable_werror
enable_openmp_for_fast_formats
enable_mpi
Expand Down Expand Up @@ -1383,9 +1380,6 @@ Optional Features:
--disable-simd, --enable-simd=foo
* Build forcing SIMD logic to be disabled, or force
use of "foo" for SIMD (eg. --enable-simd=altivec)
--disable-plugin-dependencies
Do not create best-effort Makefile dependencies for
plugins
--enable-werror Treat warnings as errors
--enable-openmp-for-fast-formats
Enable OpenMP for fast formats (usually a bad idea -
Expand Down Expand Up @@ -3461,13 +3455,6 @@ else
simd=yes
fi

# Check whether --enable-plugin-dependencies was given.
if test "${enable_plugin_dependencies+set}" = set; then :
enableval=$enable_plugin_dependencies; plug_deps=$enableval
else
plug_deps=yes
fi


# Check whether --enable-werror was given.
if test "${enable_werror+set}" = set; then :
Expand Down Expand Up @@ -6023,6 +6010,65 @@ See \`config.log' for more details" "$LINENO" 5; }
LDFLAGS=${LDFLAGS_BAK}
fi

CFLAGS_EX=""
if test 1 -gt 0; then :
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports -MMD -MP -MF conftest.d" >&5
$as_echo_n "checking if $CC supports -MMD -MP -MF conftest.d... " >&6; }
fi
ac_ext=c
ac_cpp='$CPP $CPPFLAGS'
ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
ac_compiler_gnu=$ac_cv_c_compiler_gnu

ac_saved_cflags="$CFLAGS"
CFLAGS="-Werror -MMD -MP -MF conftest.d"
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */

int
main ()
{

;
return 0;
}
_ACEOF
if ac_fn_c_try_compile "$LINENO"; then :
if test "1" -gt 0; then :
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
$as_echo "yes" >&6; }
fi
CFLAGS_EX="$CFLAGS_EX -MMD -MP -MF conftest.d"

else
if test 1 -gt 0; then :
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
$as_echo "no" >&6; }
fi
if test "1" = 2; then :
as_fn_error $? "Not supported by compiler" "$LINENO" 5
fi

fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
CFLAGS="$ac_saved_cflags"
ac_ext=c
ac_cpp='$CPP $CPPFLAGS'
ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
ac_compiler_gnu=$ac_cv_c_compiler_gnu


if test "x${CFLAGS_EX}" != x ; then
if test $(grep -Ec "conftest.o: +conftest.c" conftest.d) = 1; then
DEPFLAGS='-MMD -MP -MF $(DEPDIR)/$(notdir $*).d'

else
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: Unexpected conftest.d content, disabling auto dependency generation" >&5
$as_echo "Unexpected conftest.d content, disabling auto dependency generation" >&6; }
fi
fi

CFLAGS_EX=""
if test 1 -gt 0; then :
Expand Down Expand Up @@ -16559,27 +16605,6 @@ if test x$with_flock != xno; then
fi


if test x$using_cl = xyes ; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: creating *_plug.c and OpenCL object rules" >&5
$as_echo "$as_me: creating *_plug.c and OpenCL object rules" >&6;}
else
{ $as_echo "$as_me:${as_lineno-$LINENO}: creating *_plug.c rules" >&5
$as_echo "$as_me: creating *_plug.c rules" >&6;}
fi
if test "`echo *_plug.c`" != "*_plug.c"; then
PLUGFORMATS_OBJS=`echo *_plug.c | sed 's/opencl[A-Za-z0-9_\-]*\.c //g;s/\.c/.o/g'`

OPENCL_PLUGFORMATS_OBJS=`echo opencl*_plug.c | sed 's/\.c/.o/g'`

if test "x$plug_deps" = xyes -a "x$PERL" != x ; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: creating Makefile dependencies" >&5
$as_echo "$as_me: creating Makefile dependencies" >&6;}

PLUGFORMATS_DEPS=`$PERL ./plugin_deps.pl 2>/dev/null *_plug.c`

fi
fi

{ $as_echo "$as_me:${as_lineno-$LINENO}: creating ./john_build_rule.h" >&5
$as_echo "$as_me: creating ./john_build_rule.h" >&6;}
echo "#define JOHN_BLD \"${host_os} ${CPU_BIT_STR}-bit${using_x32} ${host_cpu} ${SIMD_NAME} AC\"" > john_build_rule.h
Expand Down Expand Up @@ -17967,43 +17992,6 @@ fi

CFLAGS_EXTRA=$CFLAGS_EXTRA_BACKUP

{ $as_echo "$as_me:${as_lineno-$LINENO}: creating ./fmt_externs.h" >&5
$as_echo "$as_me: creating ./fmt_externs.h" >&6;}
rm -f fmt_externs.h

CFLAGS_EX2=
if test "x$simd" = xno ; then
CFLAGS_EX2=-DJOHN_NO_SIMD
fi

if test "`echo *_fmt_plug.c`" != "*_fmt_plug.c"; then
$CPP -P -DAC_BUILT $CFLAGS_EX2 $CPPFLAGS $CPU_BEST_FLAGS $CFLAGS $HAVE_OPENCL $CFLAGS_EXTRA $OPENMP_CFLAGS $OPENSSL_CFLAGS -DFMT_EXTERNS_H *_fmt_plug.c | LC_ALL=C $GREP "extern struct fmt_main" | LC_ALL=C $SORT -f > fmt_externs.h
fi
if test -f fmt_externs.h -a ! -s fmt_externs.h; then
cp Makefile.stub Makefile
as_fn_error $? "The build of fmt_externs.h failed. Can not continue!" "$LINENO" 5
fi
if test ! -f fmt_externs.h; then
echo >fmt_externs.h
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: creating ./fmt_registers.h" >&5
$as_echo "$as_me: creating ./fmt_registers.h" >&6;}
rm -f fmt_registers.h
if test "`echo *_fmt_plug.c`" != "*_fmt_plug.c"; then
$CPP -P -DAC_BUILT $CFLAGS_EX2 $CPPFLAGS $CPU_BEST_FLAGS $CFLAGS $CFLAGS_EXTRA $OPENMP_CFLAGS $OPENSSL_CFLAGS -DFMT_REGISTERS_H *_fmt_plug.c | LC_ALL=C $GREP "john_register_one" | LC_ALL=C $SORT -f > fmt_registers.h
fi
if test -f fmt_registers.h -a ! -s fmt_registers.h; then
cp Makefile.stub Makefile
as_fn_error $? "The build of fmt_registers.h failed. Can not continue!" "$LINENO" 5
fi
if test ! -f fmt_registers.h; then
echo >fmt_registers.h
fi

if test "`echo opencl_*_fmt_plug.c`" != "opencl_*_fmt_plug.c"; then
$CPP -P -DAC_BUILT $CFLAGS_EX2 $CPPFLAGS $CPU_BEST_FLAGS $CFLAGS $HAVE_OPENCL $CFLAGS_EXTRA $OPENMP_CFLAGS $OPENSSL_CFLAGS -DFMT_REGISTERS_H opencl_*_fmt_plug.c | LC_ALL=C $GREP "john_register_one" | LC_ALL=C $SORT -f >> fmt_registers.h
fi


if test "x$ac_cv_prog_c_openmp" != x -a "x$enable_openmp" != xno -a "x$ac_cv_prog_c_openmp" != xunsupported ; then
if test "x$ompfast" = "xyes"; then
Expand Down
79 changes: 10 additions & 69 deletions src/configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,6 @@ AC_ARG_ENABLE([asan], [AS_HELP_STRING([--enable-asan], [* Build with AddressSani
AC_ARG_ENABLE([ubsan], [AS_HELP_STRING([--enable-ubsan], [* Build with UndefinedBehaviorSanitizer])], [ubsan=$enableval], [ubsan=no])
AC_ARG_ENABLE([ubsantrap], [AS_HELP_STRING([--enable-ubsantrap], [* Build with UndefinedBehaviorSanitizer, crashes on failure])], [ubsantrap=$enableval], [ubsantrap=no])
AC_ARG_ENABLE([simd], [AS_HELP_STRING([--disable-simd, --enable-simd=foo], [* Build forcing SIMD logic to be disabled, or force use of "foo" for SIMD (eg. --enable-simd=altivec)])], [simd=$enableval], [simd=yes])
AC_ARG_ENABLE([plugin-dependencies], [AS_HELP_STRING([--disable-plugin-dependencies], [Do not create best-effort Makefile dependencies for plugins])], [plug_deps=$enableval], [plug_deps=yes])

AC_ARG_ENABLE([werror], [AS_HELP_STRING([--enable-werror], [Treat warnings as errors])], [werror=$enableval], [werror=no])

Expand Down Expand Up @@ -227,6 +226,16 @@ if test "x$ubsantrap" = xyes ; then
LDFLAGS=${LDFLAGS_BAK}
fi

dnl Enable auto dependency generation if supported by the compiler
CFLAGS_EX=""
JTR_FLAG_CHECK([-MMD -MP -MF conftest.d], 1)
if test "x${CFLAGS_EX}" != x ; then
if test $(grep -Ec "conftest.o: +conftest.c" conftest.d) = 1; then
AC_SUBST([DEPFLAGS],['-MMD -MP -MF $(DEPDIR)/$(notdir $*).d'])
else
AC_MSG_RESULT([Unexpected conftest.d content, disabling auto dependency generation])
fi
fi

dnl now fill out CFLAGS
CFLAGS_EX=""
Expand Down Expand Up @@ -1037,30 +1046,6 @@ dnl AC_DEFINE([DYNAMIC_DISABLED], 1, [Disables Dynamic format completely])
dnl fi
dnl fi

dnl ======================================================================
dnl Code to create @PLUGFORMATS_OBJS@ and
dnl john_buildrule.h moved from Makefile.in to here.
dnl don't build opencl_*plug.c unless an opencl build
dnl ======================================================================
if test x$using_cl = xyes ; then
AC_MSG_NOTICE([creating *_plug.c and OpenCL object rules])
else
AC_MSG_NOTICE([creating *_plug.c rules])
fi
if test "`echo *_plug.c`" != "*_plug.c"; then
AC_SUBST([PLUGFORMATS_OBJS],[`echo *_plug.c | sed 's/opencl[[A-Za-z0-9_\-]]*\.c //g;s/\.c/.o/g'`])
AC_SUBST([OPENCL_PLUGFORMATS_OBJS],[`echo opencl*_plug.c | sed 's/\.c/.o/g'`])
if test "x$plug_deps" = xyes -a "x$PERL" != x ; then
AC_MSG_NOTICE([creating Makefile dependencies])

dnl The "plugin_deps.pl" script isn't clever enough to detect when
dnl #include statements are ifdef'ed out, so we direct the warnings
dnl to /dev/null. The mbedTLS directory has lots of inactive code
dnl which otherwise triggering warnings for "missing" files.
AC_SUBST([PLUGFORMATS_DEPS],[`$PERL ./plugin_deps.pl 2>/dev/null *_plug.c`])
fi
fi

AC_MSG_NOTICE([creating ./john_build_rule.h])
echo "#define JOHN_BLD \"${host_os} ${CPU_BIT_STR}-bit${using_x32} ${host_cpu} ${SIMD_NAME} AC\"" > john_build_rule.h

Expand All @@ -1082,50 +1067,6 @@ AC_OUTPUT(,echo "timestamp from configure.in" > autoconfig-stamp-h)

CFLAGS_EXTRA=$CFLAGS_EXTRA_BACKUP

dnl ======================================================================
dnl Create fmt_externs.h and fmt_registers.h
dnl This needs arch.h to be linked so can't happen before
dnl AC_OUTPUT
dnl ======================================================================
AC_MSG_NOTICE([creating ./fmt_externs.h])
rm -f fmt_externs.h

CFLAGS_EX2=
if test "x$simd" = xno ; then
CFLAGS_EX2=-DJOHN_NO_SIMD
fi

if test "`echo *_fmt_plug.c`" != "*_fmt_plug.c"; then
$CPP -P -DAC_BUILT $CFLAGS_EX2 $CPPFLAGS $CPU_BEST_FLAGS $CFLAGS $HAVE_OPENCL $CFLAGS_EXTRA $OPENMP_CFLAGS $OPENSSL_CFLAGS -DFMT_EXTERNS_H *_fmt_plug.c | LC_ALL=C $GREP "extern struct fmt_main" | LC_ALL=C $SORT -f > fmt_externs.h
fi
dnl if the file was not created, then bail.
if test -f fmt_externs.h -a ! -s fmt_externs.h; then
cp Makefile.stub Makefile
AC_MSG_ERROR([The build of fmt_externs.h failed. Can not continue!])
fi
dnl if file does not exist, then create a blank one (i.e. no *_plug.c files)
if test ! -f fmt_externs.h; then
echo >fmt_externs.h
fi
AC_MSG_NOTICE([creating ./fmt_registers.h])
rm -f fmt_registers.h
if test "`echo *_fmt_plug.c`" != "*_fmt_plug.c"; then
$CPP -P -DAC_BUILT $CFLAGS_EX2 $CPPFLAGS $CPU_BEST_FLAGS $CFLAGS $CFLAGS_EXTRA $OPENMP_CFLAGS $OPENSSL_CFLAGS -DFMT_REGISTERS_H *_fmt_plug.c | LC_ALL=C $GREP "john_register_one" | LC_ALL=C $SORT -f > fmt_registers.h
fi
dnl if the file was not created, then bail.
if test -f fmt_registers.h -a ! -s fmt_registers.h; then
cp Makefile.stub Makefile
AC_MSG_ERROR([The build of fmt_registers.h failed. Can not continue!])
fi
dnl if file does not exist, then create a blank one (i.e. no *_plug.c files)
if test ! -f fmt_registers.h; then
echo >fmt_registers.h
fi

if test "`echo opencl_*_fmt_plug.c`" != "opencl_*_fmt_plug.c"; then
$CPP -P -DAC_BUILT $CFLAGS_EX2 $CPPFLAGS $CPU_BEST_FLAGS $CFLAGS $HAVE_OPENCL $CFLAGS_EXTRA $OPENMP_CFLAGS $OPENSSL_CFLAGS -DFMT_REGISTERS_H opencl_*_fmt_plug.c | LC_ALL=C $GREP "john_register_one" | LC_ALL=C $SORT -f >> fmt_registers.h
fi

dnl ======================================================================
dnl ONLY _COSMETICAL_ OUTPUT STUFF BELOW THIS LINE
dnl ======================================================================
Expand Down
2 changes: 1 addition & 1 deletion src/cq_fmt_plug.c
Original file line number Diff line number Diff line change
Expand Up @@ -526,4 +526,4 @@ struct fmt_main fmt_cq = {
}
};

#endif
#endif /* plugin stanza */
2 changes: 1 addition & 1 deletion src/dahua_fmt_plug.c
Original file line number Diff line number Diff line change
Expand Up @@ -263,4 +263,4 @@ struct fmt_main fmt_dahua = {
}
};

#endif
#endif /* plugin stanza */
2 changes: 1 addition & 1 deletion src/eigrp_fmt_plug.c
Original file line number Diff line number Diff line change
Expand Up @@ -382,4 +382,4 @@ struct fmt_main fmt_eigrp = {
}
};

#endif
#endif /* plugin stanza */
2 changes: 1 addition & 1 deletion src/hsrp_fmt_plug.c
Original file line number Diff line number Diff line change
Expand Up @@ -302,4 +302,4 @@ struct fmt_main fmt_hsrp = {
}
};

#endif
#endif /* plugin stanza */
2 changes: 1 addition & 1 deletion src/krb5_asrep_fmt_plug.c
Original file line number Diff line number Diff line change
Expand Up @@ -403,5 +403,5 @@ struct fmt_main fmt_krb5asrep = {
}
};

#endif
#endif /* plugin stanza */
#endif /* HAVE_LIBCRYPTO */
2 changes: 1 addition & 1 deletion src/krb5_tgs_fmt_plug.c
Original file line number Diff line number Diff line change
Expand Up @@ -249,4 +249,4 @@ struct fmt_main fmt_krb5tgs = {
}
};

#endif
#endif /* plugin stanza */
2 changes: 1 addition & 1 deletion src/krb5_tgsrep_fmt_plug.c
Original file line number Diff line number Diff line change
Expand Up @@ -258,5 +258,5 @@ struct fmt_main fmt_krb5tgs_aes = {
}
};

#endif
#endif /* plugin stanza */
#endif /* HAVE_LIBCRYPTO */
Loading