Use enums to describe target WPS state.
To avoid confusion about wps = True/False/None. Came about because of #130
This commit is contained in:
@@ -97,6 +97,10 @@ class Color(object):
|
||||
'''Prints an exception. Includes stack trace if necessary.'''
|
||||
Color.pl('\n{!} {R}Error: {O}%s' % str(exception))
|
||||
|
||||
# Don't dump trace for the "no targets found" case.
|
||||
if 'No targets found' in str(exception):
|
||||
return
|
||||
|
||||
from ..config import Configuration
|
||||
if Configuration.verbose > 0 or Configuration.print_stack_traces:
|
||||
Color.pl('\n{!} {O}Full stack trace below')
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
from ..util.color import Color
|
||||
from ..tools.airodump import Airodump
|
||||
from ..util.input import raw_input, xrange
|
||||
from ..model.target import Target
|
||||
from ..model.target import Target, WPSState
|
||||
from ..config import Configuration
|
||||
|
||||
from time import sleep, time
|
||||
@@ -88,7 +88,7 @@ class Scanner(object):
|
||||
return False # No specific target from user.
|
||||
|
||||
for target in self.targets:
|
||||
if Configuration.wps_only and target.wps == False:
|
||||
if Configuration.wps_only and target.wps not in [WPSState.UNLOCKED, WPSState.LOCKED]:
|
||||
continue
|
||||
if bssid and target.bssid and bssid.lower() == target.bssid.lower():
|
||||
self.target = target
|
||||
|
||||
Reference in New Issue
Block a user