Skip to content

Commit

Permalink
Fixed generate_dpsk_attribute_value for Ruckus Unleashed Unbound DPSK
Browse files Browse the repository at this point in the history
  • Loading branch information
fdurand committed Jan 22, 2025
1 parent 010d071 commit 8fdb882
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions lib/pf/Switch/Ruckus/Unleashed.pm
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,23 @@ sub returnRadiusAccessAccept {
return [$status, %$radius_reply_ref];
}

=head2 generate_dpsk_attribute_value
Generates the RADIUS attribute value for Ruckus-DPSK given an SSID name and the passphrase
=cut

sub generate_dpsk_attribute_value {
my ($self, $ssid, $dpsk) = @_;

my $pbkdf2 = Crypt::PBKDF2->new(
iterations => 4096,
output_len => 32,
);

my $hash = $pbkdf2->PBKDF2_hex($ssid, $dpsk);
return "0x".$hash;
}

sub find_user_by_psk {
my ($self, $radius_request, $args) = @_;
Expand Down

0 comments on commit 8fdb882

Please sign in to comment.