mirror of
https://github.com/mfontanini/libtins
synced 2026-01-29 04:54:28 +01:00
Both of WPA2Decrypter::add_supplicant_data overloads work.
This commit is contained in:
@@ -252,8 +252,8 @@ void WPA2Decrypter::add_supplicant_data(const std::string &psk, const std::strin
|
||||
void WPA2Decrypter::add_supplicant_data(const std::string &psk, const std::string &ssid,
|
||||
const address_type &addr)
|
||||
{
|
||||
// ADD CODE PLX
|
||||
add_supplicant_data(psk, ssid);
|
||||
add_access_point(ssid, addr);
|
||||
}
|
||||
|
||||
void WPA2Decrypter::add_access_point(const std::string &ssid, const address_type &addr) {
|
||||
|
||||
@@ -67,3 +67,20 @@ TEST_F(WPA2DecryptTest, DecryptUsingBeacon) {
|
||||
ASSERT_FALSE(decrypter.decrypt(radio));
|
||||
}
|
||||
}
|
||||
|
||||
TEST_F(WPA2DecryptTest, DecryptWithoutUsingBeacon) {
|
||||
Crypto::WPA2Decrypter decrypter;
|
||||
decrypter.add_supplicant_data("Induction", "Coherer", "00:0c:41:82:b2:55");
|
||||
for(size_t i = 1; i < 7; ++i) {
|
||||
RadioTap radio(packets[i], packets_size[i]);
|
||||
if(i > 4) {
|
||||
ASSERT_TRUE(decrypter.decrypt(radio));
|
||||
if(i == 5)
|
||||
check_packet5(radio);
|
||||
else
|
||||
check_packet6(radio);
|
||||
}
|
||||
else
|
||||
ASSERT_FALSE(decrypter.decrypt(radio));
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user