Openwall GNU/*/Linux - a small security-enhanced Linux distro for servers
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date: Fri, 2 Aug 2013 04:38:15 +0400
From: Aleksey Cherepanov <aleksey.4erepanov@...il.com>
To: john-dev@...ts.openwall.com
Cc: Dhiru Kholia <dhiru.kholia@...il.com>
Subject: Re: patch: add --skip-self-tests option

On Fri, Aug 02, 2013 at 04:33:36AM +0400, Aleksey Cherepanov wrote:
> Please push attached patch into the repo.

Ah, I forgot it. Sorry.

Thanks!

-- 
Regards,
Aleksey Cherepanov

>From 1fe6c063357ec0f0e9be1ad8c8ddacfbc057934c Mon Sep 17 00:00:00 2001
From: Aleksey Cherepanov <aleksey.4erepanov@...il.com>
Date: Fri, 2 Aug 2013 04:30:58 +0400
Subject: [PATCH] add --skip-self-tests option

---
 doc/OPTIONS   |    7 +++++++
 src/formats.c |    5 ++++-
 src/options.c |    2 ++
 src/options.h |    2 ++
 4 files changed, 15 insertions(+), 1 deletion(-)

diff --git a/doc/OPTIONS b/doc/OPTIONS
index 515501d..86970ac 100644
--- a/doc/OPTIONS
+++ b/doc/OPTIONS
@@ -427,6 +427,13 @@ Make John more verbose, or less verbose. Default level is 3. For example,
 level 2 will mute the extra messages (device, work sizes etc) printed by
 OpenCL formats and level 1 will mute printing of cracked passwords to screen.
 
+--skip-self-tests		skip self tests
+
+Tells John to skip self tests. Basic integrity checks will be done but hashes
+from test vector will not be cracked. This option is useful to run many small
+attacks in a row against slow hashes. Usually it is not needed. It affects
+--test option: --skip-self-tests and --test together perform only benchmarks.
+
 --list=WHAT			list capabilities
 
 This option can be used to gain information about what rules, modes etc are
diff --git a/src/formats.c b/src/formats.c
index 952cb95..e23c47a 100644
--- a/src/formats.c
+++ b/src/formats.c
@@ -172,6 +172,9 @@ static char *fmt_self_test_body(struct fmt_main *format,
 		return NULL;
 #endif
 
+	if (options.flags & FLG_NOTESTS)
+		return NULL;
+
 	if (format->params.plaintext_length < 1 ||
 	    format->params.plaintext_length > PLAINTEXT_BUFFER_SIZE - 3)
 		return "plaintext_length";
@@ -353,7 +356,7 @@ static char *fmt_self_test_body(struct fmt_main *format,
 /* change the next line to #if 0 to temp stop doing validity checks.
  * this should almost NEVER be done.  However, I have done it when
  * trying new code out in a format, and before it was totally working
- * just to check the speed of the changes, to determine it it was
+ * just to check the speed of the changes, to determine if it was
  * good  enough to continue to fully implement, or if the changes
  * were not making any difference.
  */
diff --git a/src/options.c b/src/options.c
index ac147ba..a46c8b6 100644
--- a/src/options.c
+++ b/src/options.c
@@ -178,6 +178,7 @@ static struct opt_entry opt_list[] = {
 	{"request-vectorize", FLG_VECTORIZE, FLG_VECTORIZE, 0, FLG_SCALAR},
 	{"request-scalar", FLG_SCALAR, FLG_SCALAR, 0, FLG_VECTORIZE},
 #endif
+	{"skip-self-tests", FLG_NOTESTS, FLG_NOTESTS},
 	{NULL}
 };
 
@@ -346,6 +347,7 @@ void opt_print_hidden_usage(void)
 	puts("--mkv-stats=FILE          \"Markov\" stats file (see doc/MARKOV)");
 	puts("--reject-printable        reject printable binaries");
 	puts("--verbosity=N             change verbosity (1-5, default 3)");
+	puts("--skip-self-tests         skip self tests");
 #ifdef HAVE_DL
 	puts("--plugin=NAME[,..]        load this (these) dynamic plugin(s)");
 #endif
diff --git a/src/options.h b/src/options.h
index 4f67b3d..293ce7b 100644
--- a/src/options.h
+++ b/src/options.h
@@ -129,6 +129,8 @@
 #define FLG_SCALAR			0x0000020000000000ULL
 /* Reject printable binaries */
 #define FLG_REJECT_PRINTABLE		0x0000040000000000ULL
+/* Skip self tests */
+#define FLG_NOTESTS			0x0000080000000000ULL
 
 /*
  * Structure with option flags and all the parameters.
-- 
1.7.10.4


Powered by blists - more mailing lists

Your e-mail address:

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