@@ -264,6 +264,10 @@ pub fn m1_retrieval_attack(oxide: &mut OxideRuntime, ap_mac: &MacAddress) -> Res
264264 return Ok ( ( ) ) ;
265265 }
266266
267+ if !ap_data. auth_sequence . cts ( ) {
268+ return Ok ( ( ) ) ;
269+ }
270+
267271 // Make an authentication frame (no_ack), so we don't over-send.
268272 // This will flip between sending params and not sending, hopefully one of them works.
269273 let frx = if oxide. counters . seq2 % 2 == 0 {
@@ -285,7 +289,7 @@ pub fn m1_retrieval_attack(oxide: &mut OxideRuntime, ap_mac: &MacAddress) -> Res
285289 ap_data. interactions += 1 ;
286290 oxide. status_log . add_message ( StatusMessage :: new (
287291 MessageType :: Info ,
288- format ! ( "M1 Retrieval - sent authentication [{}]" , ap_mac) ,
292+ format ! ( "M1 Retrieval - Sent Authentication Req [{}]" , ap_mac) ,
289293 ) ) ;
290294
291295 Ok ( ( ) )
@@ -297,10 +301,12 @@ pub fn m1_retrieval_attack_phase_2(
297301 client_mac : & MacAddress ,
298302 oxide : & mut OxideRuntime ,
299303) -> Result < ( ) , String > {
304+ // Return if PMKID is disabled
300305 if oxide. config . disable_pmkid {
301306 return Ok ( ( ) ) ;
302307 }
303308
309+ // Return if no-transmit is on
304310 if oxide. config . notx {
305311 return Ok ( ( ) ) ;
306312 }
@@ -309,30 +315,23 @@ pub fn m1_retrieval_attack_phase_2(
309315 let ap_data = if let Some ( ap) = oxide. access_points . get_device ( ap_mac) {
310316 ap
311317 } else {
312- oxide. status_log . add_message ( StatusMessage :: new (
313- MessageType :: Info ,
314- format ! ( "M1 Retrieval - no AP [{}]" , ap_mac) ,
315- ) ) ;
316318 return Ok ( ( ) ) ;
317319 } ;
318320
319321 if !oxide. target_data . targets . is_target ( ap_data) {
320- oxide. status_log . add_message ( StatusMessage :: new (
321- MessageType :: Info ,
322- format ! ( "M1 Retrieval - not a target? [{}]" , ap_mac) ,
323- ) ) ;
324322 return Ok ( ( ) ) ;
325323 }
326324
327325 if oxide. target_data . whitelist . is_whitelisted ( ap_data) {
328- oxide. status_log . add_message ( StatusMessage :: new (
329- MessageType :: Info ,
330- format ! ( "M1 Retrieval - is whitelisted? [{}]" , ap_mac) ,
331- ) ) ;
332326 return Ok ( ( ) ) ;
333327 }
334328
335- if oxide. handshake_storage . has_m1_for_ap ( ap_mac) {
329+ // if we already have a PMKID, return
330+ if ap_data. has_pmkid {
331+ return Ok ( ( ) ) ;
332+ }
333+
334+ if !ap_data. auth_sequence . cts ( ) {
336335 return Ok ( ( ) ) ;
337336 }
338337
@@ -341,6 +340,7 @@ pub fn m1_retrieval_attack_phase_2(
341340 } else {
342341 RsnCipherSuite :: CCMP
343342 } ;
343+
344344 let gs: RsnCipherSuite = if ap_data. information . gs_tkip . is_some_and ( |f| f) {
345345 RsnCipherSuite :: TKIP
346346 } else {
@@ -361,7 +361,7 @@ pub fn m1_retrieval_attack_phase_2(
361361 ap_data. interactions += 1 ;
362362 oxide. status_log . add_message ( StatusMessage :: new (
363363 MessageType :: Info ,
364- format ! ( "M1 Retrieval - sent association [{}]" , ap_mac) ,
364+ format ! ( "M1 Retrieval - Sent Association Req [{}]" , ap_mac) ,
365365 ) ) ;
366366
367367 Ok ( ( ) )
0 commit comments