Follow @Openwall on Twitter for new release announcements and other news
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date: Fri, 11 May 2012 04:13:34 +0400
From: Solar Designer <solar@...nwall.com>
To: john-dev@...ts.openwall.com
Subject: compiling multiple external modes for --list=ext-* (was: bash auto-completion for john)

magnum -

On Fri, May 11, 2012 at 12:46:46AM +0200, magnum wrote:
> @@ -940,7 +940,9 @@ void c_execute_fast(void *addr)
>  #endif
>                 int op = 0;
> 
> -               assert(c_op_return != &&op_return); /* Don't do this
> twice */
> +               /* Needed for -list option */
> +               if (c_op_return == &&op_return) return;
> +               //assert(c_op_return != &&op_return); /* Don't do this
> twice */

This is mostly OK, but it prevents certain bugs from being detected.

> It seems OK here, but I thought you need to have a look at it cause I
> don't really understand what's happening.

Yes, thanks for asking.

c_compile() calls c_execute_fast(NULL) to initialize the global c_op_*
and c_ops[] to point to c_execute_fast's labels.  This code has to be
inside c_execute_fast() because the labels are local to it, yet their
addresses need to be put into the generated code by the compiler.  Since
c_execute_fast() is fairly performance-critical, I did not want to
introduce a separate out-of-band parameter to indicate this invocation
mode, but instead I reused the otherwise-impossible value of NULL.
The assert() was there such that if c_execute_fast() is called with NULL
other than from c_compile() because of a bug in the other caller, we'd
get the assertion failure rather than silently incur a performance
penalty (if the called external function is non-critical to program
operation) or have the program crash or misbehave later.

> BTW, for licensing these
> patches, I'm still waiting for a standard text for licensing
> contributions to Openwall with right to sublicense.

Yes, I remember that this is a task for me.

For now, please mark those edited files as having your changes.
Something like "with changes in -jumbo, by JimF and magnum" as already
seen in rules.c.  Otherwise your edited files say they're by me, which
is no longer entirely true.

Alexander

Powered by blists - more mailing lists

Confused about mailing lists and their use? Read about mailing lists on Wikipedia and check out these guidelines on proper formatting of your messages.