Skip to content
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

Error in decoding PAP password when length > 16 #782

Open
trekkete opened this issue Mar 23, 2023 · 0 comments
Open

Error in decoding PAP password when length > 16 #782

trekkete opened this issue Mar 23, 2023 · 0 comments

Comments

@trekkete
Copy link

Describe the bug
The issue is on the tinyradius library, tag 1.1.4_v2. I set my password to 32 character and receive an exception:

Caused by: java.lang.IllegalArgumentException: 32 > 16
        at java.base/java.util.Arrays.copyOfRange(Arrays.java:4029)
        at keycloak.plugins.radius//org.tinyradius.packet.AccessRequest.decodePapPassword(AccessRequest.java:345)

Expected behavior
The password should be of any size.

Desktop (please complete the following information):

  • OS: Arch Linux
  • Software: OpenVPN

Additional context
I encounter this problem when trying to activate my VPN.
The plugin answers with an AUTH FAILED, but looking at logs, we receive the exception I posted before.

We think we have identified the bug at line 345 of AccessRequest.java:

in particular this line

ciphertext = Arrays.copyOfRange(encryptedPass, i, 16);

should be

ciphertext = Arrays.copyOfRange(encryptedPass, i, i + 16);

otherwise when the passowrd length is > 16, the second parameter becomes greater that the last and copyOfRange fails.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant