Skip to content

Commit bf6155b

Browse files
committed
Missing check_if_radius_request_psk_matches function in Ruckus Unleashed
switch module
1 parent 4a9e8d8 commit bf6155b

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

lib/pf/Switch/Ruckus/Unleashed.pm

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -134,6 +134,26 @@ sub find_user_by_psk {
134134
return $pid;
135135
}
136136

137+
sub check_if_radius_request_psk_matches {
138+
my ($cache, $radius_request, $psk, $ssid, $bssid, $username, $anonce, $snonce, $eapol_key_frame) = @_;
139+
140+
my $pmk = $cache->compute(
141+
"Ruckus::Unleashed::check_if_radius_request_psk_matches::PMK::$ssid+$psk",
142+
{expires_in => '1 month', expires_variance => '.20'},
143+
sub { pf::util::wpa::calculate_pmk($ssid, $psk) },
144+
);
145+
146+
return pf::util::wpa::match_mic(
147+
pf::util::wpa::calculate_ptk(
148+
$pmk,
149+
$bssid,
150+
$username,
151+
$anonce,
152+
$snonce,
153+
),
154+
$eapol_key_frame,
155+
);
156+
}
137157

138158
=back
139159

0 commit comments

Comments
 (0)