[kismac] [binaervarianz] r158 - in trunk: KisMAC.xcodeproj Sources/Controller Sources/Core

  • From: svn@xxxxxxxxxxxxxxxx
  • To: kismac@xxxxxxxxxxxxx
  • Date: Sat, 22 Jul 2006 08:43:34 +0200

Author: gkruse
Date: 2006-07-22 08:43:30 +0200 (Sat, 22 Jul 2006)
New Revision: 158

Modified:
   trunk/KisMAC.xcodeproj/project.pbxproj
   trunk/Sources/Controller/GrowlController.h
   trunk/Sources/Controller/GrowlController.m
   trunk/Sources/Core/WaveClient.m
   trunk/Sources/Core/WaveNet.mm
Log:
WPA Auth packet growl notifications by themacuser

Modified: trunk/KisMAC.xcodeproj/project.pbxproj
===================================================================
--- trunk/KisMAC.xcodeproj/project.pbxproj      2006-07-18 14:17:25 UTC (rev 
157)
+++ trunk/KisMAC.xcodeproj/project.pbxproj      2006-07-22 06:43:30 UTC (rev 
158)
@@ -470,6 +470,9 @@
                6C1D31C009F37BC70005A9F8 /* PrefsAdvanced.h in Headers */ = 
{isa = PBXBuildFile; fileRef = 6C1D31BE09F37BC70005A9F8 /* PrefsAdvanced.h */; 
};
                6C1D31C109F37BC70005A9F8 /* PrefsAdvanced.m in Sources */ = 
{isa = PBXBuildFile; fileRef = 6C1D31BF09F37BC70005A9F8 /* PrefsAdvanced.m */; 
};
                6C1D31C409F37BE10005A9F8 /* PrefsAdvanced.nib in Resources */ = 
{isa = PBXBuildFile; fileRef = 6C1D31C209F37BE10005A9F8 /* PrefsAdvanced.nib 
*/; };
+               6C541AAB0A72002F00B58A95 /* growl-ap-revealed.png in Resources 
*/ = {isa = PBXBuildFile; fileRef = 6C541AA80A72002F00B58A95 /* 
growl-ap-revealed.png */; };
+               6C541AAC0A72003000B58A95 /* growl-wpa-challenge.png in 
Resources */ = {isa = PBXBuildFile; fileRef = 6C541AA90A72002F00B58A95 /* 
growl-wpa-challenge.png */; };
+               6C541AAD0A72003000B58A95 /* growl-wpa-response.png in Resources 
*/ = {isa = PBXBuildFile; fileRef = 6C541AAA0A72002F00B58A95 /* 
growl-wpa-response.png */; };
                6CA3BCCB09B2A58F00DCB407 /* Accelerate.framework in Frameworks 
*/ = {isa = PBXBuildFile; fileRef = 6CA3BCCA09B2A58F00DCB407 /* 
Accelerate.framework */; };
                87CEBA8209AEF03700AEB0B8 /* GrowlController.h in Headers */ = 
{isa = PBXBuildFile; fileRef = 87CEBA8009AEF03700AEB0B8 /* GrowlController.h 
*/; };
                87CEBA8309AEF03700AEB0B8 /* GrowlController.m in Sources */ = 
{isa = PBXBuildFile; fileRef = 87CEBA8109AEF03700AEB0B8 /* GrowlController.m 
*/; };
@@ -814,6 +817,9 @@
                6C1D31BF09F37BC70005A9F8 /* PrefsAdvanced.m */ = {isa = 
PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.objc; 
path = PrefsAdvanced.m; sourceTree = "<group>"; };
                6C1D31C309F37BE10005A9F8 /* English */ = {isa = 
PBXFileReference; lastKnownFileType = wrapper.nib; name = English; path = 
Resources/Nibs/English.lproj/PrefsAdvanced.nib; sourceTree = SOURCE_ROOT; };
                6C1D31C509F37BF40005A9F8 /* Spanish */ = {isa = 
PBXFileReference; lastKnownFileType = wrapper.nib; name = Spanish; path = 
Resources/Nibs/Spanish.lproj/PrefsAdvanced.nib; sourceTree = SOURCE_ROOT; };
+               6C541AA80A72002F00B58A95 /* growl-ap-revealed.png */ = {isa = 
PBXFileReference; lastKnownFileType = image.png; path = 
"growl-ap-revealed.png"; sourceTree = "<group>"; };
+               6C541AA90A72002F00B58A95 /* growl-wpa-challenge.png */ = {isa = 
PBXFileReference; lastKnownFileType = image.png; path = 
"growl-wpa-challenge.png"; sourceTree = "<group>"; };
+               6C541AAA0A72002F00B58A95 /* growl-wpa-response.png */ = {isa = 
PBXFileReference; lastKnownFileType = image.png; path = 
"growl-wpa-response.png"; sourceTree = "<group>"; };
                6CA3BCCA09B2A58F00DCB407 /* Accelerate.framework */ = {isa = 
PBXFileReference; lastKnownFileType = wrapper.framework; name = 
Accelerate.framework; path = /System/Library/Frameworks/Accelerate.framework; 
sourceTree = "<absolute>"; };
                87CEBA8009AEF03700AEB0B8 /* GrowlController.h */ = {isa = 
PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = 
GrowlController.h; sourceTree = "<group>"; };
                87CEBA8109AEF03700AEB0B8 /* GrowlController.m */ = {isa = 
PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.objc; 
path = GrowlController.m; sourceTree = "<group>"; };
@@ -937,6 +943,9 @@
                0035333206A5DD5700AB4577 /* Icons */ = {
                        isa = PBXGroup;
                        children = (
+                               6C541AA80A72002F00B58A95 /* 
growl-ap-revealed.png */,
+                               6C541AA90A72002F00B58A95 /* 
growl-wpa-challenge.png */,
+                               6C541AAA0A72002F00B58A95 /* 
growl-wpa-response.png */,
                                00D566B209C74A8200FB787B /* growl-leap.png */,
                                00D566B309C74A8200FB787B /* growl-noenc.png */,
                                00D566B409C74A8200FB787B /* growl-probe.png */,
@@ -1821,6 +1830,9 @@
                                00D566BA09C74A8200FB787B /* growl-wep.png in 
Resources */,
                                00D566BB09C74A8200FB787B /* growl-wpa.png in 
Resources */,
                                6C1D31C409F37BE10005A9F8 /* PrefsAdvanced.nib 
in Resources */,
+                               6C541AAB0A72002F00B58A95 /* 
growl-ap-revealed.png in Resources */,
+                               6C541AAC0A72003000B58A95 /* 
growl-wpa-challenge.png in Resources */,
+                               6C541AAD0A72003000B58A95 /* 
growl-wpa-response.png in Resources */,
                        );
                        runOnlyForDeploymentPostprocessing = 0;
                };

Modified: trunk/Sources/Controller/GrowlController.h
===================================================================
--- trunk/Sources/Controller/GrowlController.h  2006-07-18 14:17:25 UTC (rev 
157)
+++ trunk/Sources/Controller/GrowlController.h  2006-07-22 06:43:30 UTC (rev 
158)
@@ -37,4 +37,7 @@
 + (void)notifyGrowlProbeRequest:(NSString *)notname BSSID:(NSString *)BSSID 
signal:(int)signal;
 + (void)notifyGrowlStartScan;
 + (void)notifyGrowlStopScan;
++ (void)notifyGrowlWPAChallenge:(NSString *)notname mac:(NSString *)mac 
bssid:(NSString *)bssid;
++ (void)notifyGrowlWPAResponse:(NSString *)notname mac:(NSString *)mac 
bssid:(NSString *)bssid;
++ (void)notifyGrowlSSIDRevealed:(NSString *)notname BSSID:(NSString *)BSSID 
SSID:(NSString *)SSID;
 @end

Modified: trunk/Sources/Controller/GrowlController.m
===================================================================
--- trunk/Sources/Controller/GrowlController.m  2006-07-18 14:17:25 UTC (rev 
157)
+++ trunk/Sources/Controller/GrowlController.m  2006-07-22 06:43:30 UTC (rev 
158)
@@ -146,7 +146,42 @@
           clickContext:nil];
 }
 
++ (void)notifyGrowlWPAChallenge:(NSString *)notname mac:(NSString *)mac 
bssid:(NSString *)bssid
+{
+       [GrowlApplicationBridge
+       notifyWithTitle:@"KisMAC"
+               description:[NSString stringWithFormat:@"WPA Challenge 
received:\nMAC: %@\nBSSID: %@",mac,bssid]
+   notificationName:@"WPA Challenge/Response"
+                  iconData:[NSData dataWithData:[[NSImage 
imageNamed:@"growl-wpa-challenge"] TIFFRepresentation]]
+                  priority:0
+                  isSticky:NO
+          clickContext:nil];
+}
 
++ (void)notifyGrowlWPAResponse:(NSString *)notname mac:(NSString *)mac 
bssid:(NSString *)bssid
+{
+       [GrowlApplicationBridge
+       notifyWithTitle:@"KisMAC"
+               description:[NSString stringWithFormat:@"WPA Response 
received:\nMAC: %@\nBSSID: %@",mac,bssid]
+   notificationName:@"WPA Challenge/Response"
+                  iconData:[NSData dataWithData:[[NSImage 
imageNamed:@"growl-wpa-response"] TIFFRepresentation]]
+                  priority:0
+                  isSticky:NO
+          clickContext:nil];
+}
+
++ (void)notifyGrowlSSIDRevealed:(NSString *)notname BSSID:(NSString *)BSSID 
SSID:(NSString *)SSID
+{
+       [GrowlApplicationBridge
+       notifyWithTitle:@"KisMAC"
+               description:[NSString stringWithFormat:@"Hidden SSID 
Revealed:\nSSID: %@\nBSSID: %@",SSID,BSSID]
+   notificationName:@"Hidden SSID Revealed"
+                  iconData:[NSData dataWithData:[[NSImage 
imageNamed:@"growl-ap-revealed"] TIFFRepresentation]]
+                  priority:0
+                  isSticky:NO
+          clickContext:nil];
+}
+
 #pragma mark Growl Methods
 
 - (NSString *)applicationNameForGrowl {
@@ -154,8 +189,8 @@
 }
 
 - (NSDictionary *)registrationDictionaryForGrowl {
-       NSArray *allNotifications = [NSArray arrayWithObjects:@"Scan 
Started/Stopped",@"Open Network Found",@"Closed Network Found",@"Probe Request 
Recieved",nil];
-       NSArray *defaultNotifications = [NSArray arrayWithObjects:@"Scan 
Started/Stopped",@"Open Network Found",@"Closed Network Found",nil];
+       NSArray *allNotifications = [NSArray arrayWithObjects:@"Scan 
Started/Stopped",@"Open Network Found",@"Closed Network Found",@"Probe Request 
Recieved",@"WPA Challenge/Response",@"Hidden SSID Revealed",nil];
+       NSArray *defaultNotifications = [NSArray arrayWithObjects:@"Scan 
Started/Stopped",@"Open Network Found",@"Closed Network Found",@"WPA 
Challenge/Response",@"Hidden SSID Revealed",nil];
        NSDictionary *registrationDict = [NSDictionary 
dictionaryWithObjectsAndKeys:allNotifications, GROWL_NOTIFICATIONS_ALL, 
defaultNotifications, GROWL_NOTIFICATIONS_DEFAULT, nil];
        return registrationDict;
 }

Modified: trunk/Sources/Core/WaveClient.m
===================================================================
--- trunk/Sources/Core/WaveClient.m     2006-07-18 14:17:25 UTC (rev 157)
+++ trunk/Sources/Core/WaveClient.m     2006-07-22 06:43:30 UTC (rev 158)
@@ -26,6 +26,7 @@
 #import "WaveClient.h"
 #import "WaveHelper.h"
 #import "WPA.h"
+#import "GrowlController.h"
 
 @implementation WaveClient
 
@@ -123,10 +124,12 @@
         switch ([w wpaCopyNonce:nonce]) {
             case wpaNonceANonce:
                 NSLog(@"Detected WPA challenge for %@!", _ID);
+                               [GrowlController notifyGrowlWPAChallenge:@"" 
mac:_ID bssid:[w BSSIDString]];
                 [WaveHelper secureReplace:&_aNonce withObject:[NSData 
dataWithBytes:nonce length:WPA_NONCE_LENGTH]];
                 break;
             case wpaNonceSNonce:
                 NSLog(@"Detected WPA response for %@!", _ID);
+                               [GrowlController notifyGrowlWPAResponse:@"" 
mac:_ID bssid:[w BSSIDString]];
                 [WaveHelper secureReplace:&_sNonce withObject:[NSData 
dataWithBytes:nonce length:WPA_NONCE_LENGTH]];
                 break;
             case wpaNonceNone:

Modified: trunk/Sources/Core/WaveNet.mm
===================================================================
--- trunk/Sources/Core/WaveNet.mm       2006-07-18 14:17:25 UTC (rev 157)
+++ trunk/Sources/Core/WaveNet.mm       2006-07-22 06:43:30 UTC (rev 158)
@@ -606,8 +606,12 @@
        if (isHidden) {
                if (_SSID!=Nil) return; //we might have the real ssid already
                [WaveHelper secureReplace:&_SSID withObject:@""];
+               NSLog(@"_ssid = %@, newSSID=%@, isHidden = %i, 
updatedSSID=%i",_SSID,newSSID, isHidden, updatedSSID);
        } else {
                [WaveHelper secureReplace:&_SSID withObject:newSSID];
+               if (updatedSSID) {
+                       [GrowlController notifyGrowlSSIDRevealed:@"" 
BSSID:_BSSID SSID:newSSID];
+               }
        }
 
        [_netView setName:_SSID];


Other related posts:

  • » [kismac] [binaervarianz] r158 - in trunk: KisMAC.xcodeproj Sources/Controller Sources/Core