Skip to content

Commit

Permalink
Merge pull request #494 from Shane32/wpa2
Browse files Browse the repository at this point in the history
Add support for WPA2 in PayloadGenerator
  • Loading branch information
codebude authored Apr 17, 2024
2 parents 56ace43 + f0a7865 commit 5f9f437
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 1 deletion.
3 changes: 2 additions & 1 deletion QRCoder/PayloadGenerator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,8 @@ public enum Authentication
{
WEP,
WPA,
nopass
nopass,
WPA2
}
}

Expand Down
13 changes: 13 additions & 0 deletions QRCoderTests/PayloadGeneratorTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -317,6 +317,19 @@ public void wifi_should_build_wpa()
generator.ToString().ShouldBe($"WIFI:T:WPA;S:MyWiFiSSID;P:7heP4assw0rd;;");
}

[Fact]
[Category("PayloadGenerator/WiFi")]
public void wifi_should_build_wpa2()
{
var ssid = "MyWiFiSSID";
var password = "7heP4assw0rd";
var authmode = PayloadGenerator.WiFi.Authentication.WPA2;
var hideSSID = false;

var generator = new PayloadGenerator.WiFi(ssid, password, authmode, hideSSID);

generator.ToString().ShouldBe($"WIFI:T:WPA2;S:MyWiFiSSID;P:7heP4assw0rd;;");
}

[Fact]
[Category("PayloadGenerator/WiFi")]
Expand Down

0 comments on commit 5f9f437

Please sign in to comment.