Skip to content

Add support for WPA2 in PayloadGenerator #494

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Apr 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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