Adding support starent attribute encoding and decoding#30
Open
dc8-metaswitch wants to merge 3 commits intoctran:masterfrom
Open
Adding support starent attribute encoding and decoding#30dc8-metaswitch wants to merge 3 commits intoctran:masterfrom
dc8-metaswitch wants to merge 3 commits intoctran:masterfrom
Conversation
added 3 commits
December 9, 2019 08:46
…te Radius attribute length. It now supports encoding and decoding of radius packet has 2 bytes radius attribute length. The library has also been tested well with starent radius dictionary (2 byte attribute length). modified: src/main/java/org/tinyradius/attribute/RadiusAttribute.java modified: src/main/java/org/tinyradius/attribute/VendorSpecificAttribute.java modified: src/main/java/org/tinyradius/dictionary/AttributeType.java modified: src/main/java/org/tinyradius/packet/RadiusPacket.java
ctran
requested changes
Dec 11, 2019
| if (attributeType < 0 || attributeType > 255) | ||
| throw new IllegalArgumentException("attribute type invalid: " + attributeType); | ||
| // Vendor specific attribute has values > 255 and < 1 | ||
| /*if (attributeType < 0 || attributeType > 255) |
Owner
There was a problem hiding this comment.
I'd prefer you remove the commented out code, not sure what is the purpose to leave it as commented out.
| * @return attribute | ||
| */ | ||
| public byte[] write2ByteAttribute() { | ||
| if (getAttributeType() == -1) |
| attr[2] = (byte) (data_length >> 8 & 0x0ff); | ||
| attr[3] = (byte) (data_length & 0x0ff); | ||
| System.arraycopy(attributeData, 0, attr, 4, attributeData.length); | ||
| return attr; |
Owner
There was a problem hiding this comment.
I would like to see a unit test to verify previous and modified behavior?
This was referenced Oct 27, 2021
Closed
67019ad to
5526820
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Starent radius packet attribute length is 2 byte. While testing with decoding and encoding starent radius attribute, tinyradius was going infinite loop during decoding and failed to encode in case length more than 255. With this changes it now handles starent radius dictionary.