Openwall GNU/*/Linux 3.0 - a small security-enhanced Linux distro for servers
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date: Tue, 13 Sep 2011 03:01:10 +0400
From: Solar Designer <solar@...nwall.com>
To: john-users@...ts.openwall.com
Subject: Re: External filter question

Pablo -

On Tue, Sep 13, 2011 at 02:41:34AM +0400, Solar Designer wrote:
> On Tue, Sep 13, 2011 at 12:11:50AM +0200, Pablo Fernandez wrote:
> > I guess that, when you said I need to make ext_globals an array, you meant "an 
> > array of structs", right?
> 
> Yes.  If you like to discuss this sub-topic further, please start a new
> thread on the john-dev list, e.g. "variable exports to external mode".

Actually, no need to discuss this - it was so trivial to implement that
I just did, see patch attached.  And it remains a -users topic because
the patch is ready for use.  (A development detail, though: I recalled
incorrectly, ext_globals is a linked list, not an array.)

Alexander

diff -urp john-1.7.8/run/john.conf john-1.7.8-external-events/run/john.conf
--- john-1.7.8/run/john.conf	2011-05-23 01:19:14 +0000
+++ john-1.7.8-external-events/run/john.conf	2011-09-12 22:55:06 +0000
@@ -1244,3 +1244,10 @@ void filter()
 	word[i--] = 0;
 	word[i] = map2[(o & 0xfff) + (e >> 12)];
 }
+
+[List.External:TestAbort]
+void filter()
+{
+	if (word[0] == 'a')
+		event_pending = event_abort = 1;
+}
diff -urp john-1.7.8/src/external.c john-1.7.8-external-events/src/external.c
--- john-1.7.8/src/external.c	2006-02-27 03:58:02 +0000
+++ john-1.7.8-external-events/src/external.c	2011-09-12 22:51:24 +0000
@@ -12,6 +12,7 @@
 #include "compiler.h"
 #include "loader.h"
 #include "logger.h"
+#include "signals.h"
 #include "status.h"
 #include "recovery.h"
 #include "config.h"
@@ -24,8 +25,20 @@ char *ext_mode = NULL;
 
 static c_int ext_word[PLAINTEXT_BUFFER_SIZE];
 
-static struct c_ident ext_globals = {
+static struct c_ident ext_event_pending = {
 	NULL,
+	"event_pending",
+	(int *)&event_pending
+};
+
+static struct c_ident ext_event_abort = {
+	&ext_event_pending,
+	"event_abort",
+	(int *)&event_abort
+};
+
+static struct c_ident ext_globals = {
+	&ext_event_abort,
 	"word",
 	ext_word
 };

Powered by blists - more mailing lists

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