since we already had realtek parallelized, let's do the same for
ralink too.
this commit is the result of a collaborative effort between
@wiire-a and myself.
The output has been shrunk to fit in 80 columns. To do so the colon ':'
has been removed as a byte separator. Moreover, some names (mostly the
keys), have been shortened. The WPS pin tag has been left unchanged
(except for a couple of spaces in between).
All the other information is still printed on stderr. The idea to print
them on separate streams was to make it easier from wrappers to get the
version discarding all the other information, however this was never the
case until now.
The variable 'i' was of type uint_fast8_t which most compiler typedef as
unsigned char or uint8_t which both (in C99) can hold a number between 0
and 255. This could cause an integer overflow when seed was found in
mode 3 but the the program was unsuccessful to recover the PIN within
the first 255 tries of the first time window set in the future.
This bug was introduced when the constant MODE3_TRIES was increased to
10 minutes (60 * 10 = 600 which is > 255) in commit (d3e4aab).
Removed all the code non relevant for the current implementation. This
should make a noticeable difference in speed and possibly allow the
compiler to optimize even more.
This option is used to optionally decrypt ES-1 directly from M5, when
the Enrollee proves to the Registrar to know the PIN. As of right now it
must be used in conjunction with -7. With the introduction of this new
option, the display of ES-2 (and ES-1 when -5 is supplied) has been
added to the output.
DESTDIR gets only used in the install target, so prefix doesn't get
cluttered and can be used internally to reference file dependencies.
e.g. if for example a DB would be used, the filename to the DB could
be passed in CPPFLAGS like "-DDBPATH=$(PREFIX)/share/pixiewps.db".
this doesn't happen at the moment, but it's good practice to follow
the conventions.
additionally, remove the "rm" command in the install target - running
`make install` should never ever delete files from user's prefix.
toolchains from https://sourceforge.net/projects/mingw-w64/ don't
define PTHREAD_STACK_MIN, and when using pthread_attr_t fail due to
internal bugs in their atomics implementation:
__buildlogicali(_InterlockedAnd, __LONG32, and)
mingw32/include/psdk_inc/intrin-impl.h:977:1:
error: static declaration of '_InterlockedAnd' follows non-static declaration
OTOH, they implement pthread support without the need of external DLL's,
so using them might be preferable.
This option is used to decrypt the field encrypted settings in M7, which
contains the wireless configuration of the AP. This option exploits a
misconfigured crypto library that always generates the same random
number, resulting in always generating the same static Private key (and
Public key). Hence, Diffie-Hellman encryption can be broken and the
passphrase recovered by anyone passively sniffing the air.
GLIBC defaults to giving new threads an insanely huge 8MB stack each, which
causes unnecessary memory waste. we set it to a conservative 64KB, even though
we need less than 1KB ourselves, to give sufficient leeway to buffers used
by libc itself when calling out to some of its functions.