{"action":"created","issue":{"url":"https://api.github.com/repos/chrsmith/reaver-wps/issues/148","labels_url":"https://api.github.com/repos/chrsmith/reaver-wps/issues/148/labels{/name}","comments_url":"https://api.github.com/repos/chrsmith/reaver-wps/issues/148/comments","events_url":"https://api.github.com/repos/chrsmith/reaver-wps/issues/148/events","html_url":"https://github.com/chrsmith/reaver-wps/issues/148","id":59191943,"number":148,"title":"Failure if packets are retransmitted by the AP","user":{"login":"GoogleCodeExporter","id":9614759,"avatar_url":"https://avatars.githubusercontent.com/u/9614759?v=3","gravatar_id":"","url":"https://api.github.com/users/GoogleCodeExporter","html_url":"https://github.com/GoogleCodeExporter","followers_url":"https://api.github.com/users/GoogleCodeExporter/followers","following_url":"https://api.github.com/users/GoogleCodeExporter/following{/other_user}","gists_url":"https://api.github.com/users/GoogleCodeExporter/gists{/gist_id}","starred_url":"https://api.github.com/users/GoogleCodeExporter/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/GoogleCodeExporter/subscriptions","organizations_url":"https://api.github.com/users/GoogleCodeExporter/orgs","repos_url":"https://api.github.com/users/GoogleCodeExporter/repos","events_url":"https://api.github.com/users/GoogleCodeExporter/events{/privacy}","received_events_url":"https://api.github.com/users/GoogleCodeExporter/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/chrsmith/reaver-wps/labels/auto-migrated","name":"auto-migrated","color":"ededed"},{"url":"https://api.github.com/repos/chrsmith/reaver-wps/labels/Priority-Medium","name":"Priority-Medium","color":"ededed"},{"url":"https://api.github.com/repos/chrsmith/reaver-wps/labels/Type-Defect","name":"Type-Defect","color":"ededed"}],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2015-02-27T05:24:22Z","updated_at":"2015-02-27T05:24:23Z","closed_at":"2015-02-27T05:24:23Z","body":"```\nWhen the AP retransmit the M1, M3 or M5 messages, and one of this \nretransmissions is received after sending the answer (M2, M4 or M6), reaver \nthinks it is an error, and sends an WSC_NACK, terminating the handshake.\n\nI have suffered this, and commenting in exchange.c the \"else\" part on case M1, \nM3 and M5 of the \"switch\" around line 100, solved the issue. This way, it does \nnot send WSC_NACK when receiving that retransmissions out of time.\n\nI cannot upload a capture here, it says \"Issue attachment storage quota \nexceeded\", so I have uploaded it to cloudshark.org. You can see it on \nhttp://www.cloudshark.org/captures/f31b9e1c527f\nThere are lots of retransmissions (due to not very good signal), some of them \nout of order (M3 received after M4 sent). This capture was done after \ncommenting the elses mentioned above.\n```\n\nOriginal issue reported on code.google.com by `a123a654...@gmail.com` on 17 Jan 2012 at 4:04"},"comment":{"url":"https://api.github.com/repos/chrsmith/reaver-wps/issues/comments/76337541","html_url":"https://github.com/chrsmith/reaver-wps/issues/148#issuecomment-76337541","issue_url":"https://api.github.com/repos/chrsmith/reaver-wps/issues/148","id":76337541,"user":{"login":"GoogleCodeExporter","id":9614759,"avatar_url":"https://avatars.githubusercontent.com/u/9614759?v=3","gravatar_id":"","url":"https://api.github.com/users/GoogleCodeExporter","html_url":"https://github.com/GoogleCodeExporter","followers_url":"https://api.github.com/users/GoogleCodeExporter/followers","following_url":"https://api.github.com/users/GoogleCodeExporter/following{/other_user}","gists_url":"https://api.github.com/users/GoogleCodeExporter/gists{/gist_id}","starred_url":"https://api.github.com/users/GoogleCodeExporter/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/GoogleCodeExporter/subscriptions","organizations_url":"https://api.github.com/users/GoogleCodeExporter/orgs","repos_url":"https://api.github.com/users/GoogleCodeExporter/repos","events_url":"https://api.github.com/users/GoogleCodeExporter/events{/privacy}","received_events_url":"https://api.github.com/users/GoogleCodeExporter/received_events","type":"User","site_admin":false},"created_at":"2015-02-27T05:24:23Z","updated_at":"2015-02-27T05:24:23Z","body":"```\nRemoving just the else statements shouldn't cause any errors, but...\n\nIn most cases if Reaver's state machine and the AP's state machine get out of \nsync, Reaver has two choices:\n\n1) Let the connection timeout (can take a few seconds or a few minutes)\n2) Explicitly terminate the connection and try again\n\nUsually #2 is obviously faster. In your case though, the AP is acting a bit \nstrangely. Most APs will send an M1 packet, then wait a few seconds for an M2 \nresponse before re-transmitting the M1 packet. In your case the AP is \nessentially flooding you with M1 packets until it sees an M2, then flooding you \nwith M3 packets until it sees an M4, etc, etc. So even though no one is out of \nsync, Reaver sees multiple M1s and assumes that something is wrong.\n\nI will put an option in Reaver to tell it to not NACK repeated packets so that \nsituations like this can be handled properly.\n```\n\nOriginal comment by `cheff...@tacnetsol.com` on 17 Jan 2012 at 9:19"}}