SHOW:
|
|
- or go back to the newest paste.
1 | diff -rup orig/src/argsparser.c new/src/argsparser.c | |
2 | --- orig/src/argsparser.c 2015-06-06 23:29:28.000000000 -0400 | |
3 | +++ new/src/argsparser.c 2015-06-19 19:43:00.035723311 -0400 | |
4 | @@ -41,7 +41,7 @@ int process_arguments(int argc, char **a | |
5 | int long_opt_index = 0; | |
6 | char bssid[MAC_ADDR_LEN] = { 0 }; | |
7 | char mac[MAC_ADDR_LEN] = { 0 }; | |
8 | - char *short_options = "W:K:b:e:m:i:t:d:c:T:x:r:g:l:o:p:s:C:1:2:ZaA5ELfnqvDShwXNPH0"; | |
9 | + char *short_options = "W:K:b:e:m:i:t:d:c:T:x:r:g:l:o:p:s:C:1:2:ZaA5ELfnqvDShwXNPH0B"; | |
10 | struct option long_options[] = { | |
11 | { "generate-pin", required_argument, NULL, 'W' }, | |
12 | { "stop-in-m1", no_argument, NULL, '0' }, | |
13 | @@ -80,8 +80,9 @@ int process_arguments(int argc, char **a | |
14 | { "win7", no_argument, NULL, 'w' }, | |
15 | { "exhaustive", no_argument, NULL, 'X' }, | |
16 | { "help", no_argument, NULL, 'h' }, | |
17 | - { "pixiedust-loop", no_argument, NULL, 'P' }, | |
18 | - { "pixiedust-log", no_argument, NULL, 'H' }, | |
19 | + { "pixiedust-loop", no_argument, NULL, 'P' }, | |
20 | + { "pixiedust-log", no_argument, NULL, 'H' }, | |
21 | + { "empty-string-pin", no_argument, NULL, 'B' }, | |
22 | { 0, 0, 0, 0 } | |
23 | }; | |
24 | ||
25 | @@ -215,12 +216,15 @@ int process_arguments(int argc, char **a | |
26 | case 'N': | |
27 | set_oo_send_nack(0); | |
28 | break; | |
29 | - case 'P': | |
30 | + case 'P': | |
31 | set_pixie_loop(1); | |
32 | break; | |
33 | - case 'H': | |
34 | + case 'H': | |
35 | set_pixie_log(1); | |
36 | break; | |
37 | + case 'B': | |
38 | + set_empty_string_pin(1); | |
39 | + break; | |
40 | default: | |
41 | ret_val = EXIT_FAILURE; | |
42 | } | |
43 | @@ -256,6 +260,7 @@ void init_default_settings(void) | |
44 | set_stop_in_m1(0); | |
45 | set_op_gen_pin(0); | |
46 | set_exhaustive(0); | |
47 | + set_empty_string_pin(0); | |
48 | } | |
49 | ||
50 | /* Parses the recurring delay optarg */ | |
51 | Only in new/src: argsparser.c~ | |
52 | diff -rup orig/src/globule.c new/src/globule.c | |
53 | --- orig/src/globule.c 2015-06-06 23:29:28.000000000 -0400 | |
54 | +++ new/src/globule.c 2015-06-19 19:25:30.875689503 -0400 | |
55 | @@ -272,6 +272,16 @@ int get_pixie_log() | |
56 | return globule->pixie_log; | |
57 | } | |
58 | ||
59 | +int get_empty_string_pin() | |
60 | +{ | |
61 | + return globule->empty_string_pin; | |
62 | +} | |
63 | + | |
64 | +void set_empty_string_pin(int value) | |
65 | +{ | |
66 | + globule->empty_string_pin = value; | |
67 | +} | |
68 | + | |
69 | void set_max_num_probes(int value) | |
70 | { | |
71 | globule->max_num_probes = value; | |
72 | diff -rup orig/src/globule.h new/src/globule.h | |
73 | --- orig/src/globule.h 2015-06-06 23:29:28.000000000 -0400 | |
74 | +++ new/src/globule.h 2015-06-19 19:24:23.091687318 -0400 | |
75 | @@ -40,6 +40,9 @@ struct globals | |
76 | { | |
77 | int pixie_loop; /* Loops through up to M4 */ | |
78 | int pixie_log; /* Logs PixieDust hashes to executing directory */ | |
79 | + | |
80 | + int empty_string_pin; /* Use an empty string as the pin */ | |
81 | + | |
82 | int last_wps_state; /* Holds the previous WPS state as stored in wps->state */ | |
83 | ||
84 | int p1_index; /* Index into p1 array for building WPS pins */ | |
85 | @@ -262,6 +265,6 @@ int get_pixie_loop(); | |
86 | void set_pixie_log(int value); | |
87 | int get_pixie_log(); | |
88 | void set_stop_in_m1(int index); | |
89 | - | |
90 | +int get_empty_string_pin(); | |
91 | ||
92 | #endif | |
93 | diff -rup orig/src/pins.c new/src/pins.c | |
94 | --- orig/src/pins.c 2015-06-06 23:29:28.000000000 -0400 | |
95 | +++ new/src/pins.c 2015-06-19 19:36:54.419711529 -0400 | |
96 | @@ -107,12 +107,17 @@ char *build_next_pin() | |
97 | pin = build_wps_pin(); | |
98 | if(pin) | |
99 | { | |
100 | + if (get_empty_string_pin()) | |
101 | + { | |
102 | + wps_registrar_add_pin(wps->wps->registrar, NULL, "lalalalalala" , 0 , 0); | |
103 | + } | |
104 | /* Add the new pin */ | |
105 | - if(wps_registrar_add_pin(wps->wps->registrar, NULL, (const u8 *) pin, PIN_SIZE, 0) != 0) | |
106 | + else if(wps_registrar_add_pin(wps->wps->registrar, NULL, (const u8 *) pin, PIN_SIZE , 0) != 0) | |
107 | { | |
108 | free(pin); | |
109 | pin = NULL; | |
110 | } | |
111 | + | |
112 | } | |
113 | ||
114 | return pin; |