From 72b9ed98fbc6ec41997a09bb81928b4e39ccbc7e Mon Sep 17 00:00:00 2001 From: Durand Fabrice Date: Sat, 28 Dec 2024 22:32:30 -0500 Subject: [PATCH] Adapt the code for the new freeradius version --- lib/pf/Switch/Ruckus/SmartZone.pm | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/lib/pf/Switch/Ruckus/SmartZone.pm b/lib/pf/Switch/Ruckus/SmartZone.pm index 9ff7e5be745..0c88c68a4ab 100644 --- a/lib/pf/Switch/Ruckus/SmartZone.pm +++ b/lib/pf/Switch/Ruckus/SmartZone.pm @@ -325,7 +325,6 @@ sub generate_dpsk_attribute_value { return "0x00".$hash; } - sub find_user_by_psk { my ($self, $radius_request, $args) = @_; my $pid; @@ -335,11 +334,11 @@ sub find_user_by_psk { } my $ssid = $radius_request->{'Ruckus-Wlan-Name'}; - my $bssid = pack("H*", pf::util::wpa::strip_hex_prefix($radius_request->{"Ruckus-BSSID"})); + my $bssid = pack("H*", sprintf("%v02x", $radius_request->{"Ruckus-BSSID"}) =~ s/\.//rg); my $username = pack("H*", $radius_request->{'User-Name'}); - my $anonce = pack('H*', pf::util::wpa::strip_hex_prefix($radius_request->{'Ruckus-DPSK-Anonce'})); - my $snonce = pf::util::wpa::snonce_from_eapol_key_frame(pack("H*", pf::util::wpa::strip_hex_prefix($radius_request->{"Ruckus-DPSK-EAPOL-Key-Frame"}))); - my $eapol_key_frame = pack("H*", pf::util::wpa::strip_hex_prefix($radius_request->{"Ruckus-DPSK-EAPOL-Key-Frame"})); + my $anonce = pack('H*', sprintf("%v02x",$radius_request->{'Ruckus-DPSK-Anonce'}) =~ s/\.//rg); + my $snonce = pf::util::wpa::snonce_from_eapol_key_frame(pack("H*",sprintf("%v02x",$radius_request->{"Ruckus-DPSK-EAPOL-Key-Frame"}) =~ s/\.//rg)); + my $eapol_key_frame = pack("H*", sprintf("%v02x",$radius_request->{"Ruckus-DPSK-EAPOL-Key-Frame"}) =~ s/\.//rg); my $cache = $self->cache; # Try first the pid of the mac address if (exists $args->{'owner'} && $args->{'owner'}->{'pid'} ne "" && exists $args->{'owner'}->{'psk'} && defined $args->{'owner'}->{'psk'} && $args->{'owner'}->{'psk'} ne "") {