mike-jumper commented on a change in pull request #437: GUACAMOLE-769: Polish 
the RADIUS challenge box
URL: https://github.com/apache/guacamole-client/pull/437#discussion_r312757230
 
 

 ##########
 File path: 
extensions/guacamole-auth-radius/src/main/java/org/apache/guacamole/auth/radius/AuthenticationProviderService.java
 ##########
 @@ -97,13 +106,17 @@ private CredentialsInfo getRadiusChallenge(RadiusPacket 
challengePacket) {
         }
 
         // We have the required attributes - convert to strings and then 
generate the additional login box/field
-        String replyMsg = replyAttr.toString();
+        logger.debug("Received challenge: {}", replyAttr.toString());
+        String replyMsg = replyAttr.toString().split(" = ", 2)[1];
 
 Review comment:
   Checking the source of `RadiusAttribute`, [the `toString()` 
function](https://github.com/coova/jradius/blob/master/core/src/main/java/net/jradius/packet/attribute/RadiusAttribute.java#L155-L158)
 says:
   
   ```java
   public String toString()
   {
       return attributeName + " " + Operator.operatorToString(attributeOp) + " 
" + attributeValue.toString();
   }
   ```
   
   with `attributeValue` being exposed through 
[`getValue()`](https://github.com/coova/jradius/blob/4ee91e33fa155843fe428559d81f036051d30515/core/src/main/java/net/jradius/packet/attribute/RadiusAttribute.java#L94-L97):
   
   ```java
   public AttributeValue getValue()
   {
       return attributeValue;
   }
   ```
   
   From the above, it looks like calling `replyAttr.toString()` and splitting 
that to obtain the value is equivalent to `replyAttr.getValue().toString()` 
(the value used in the `logger.debug()` call), with the latter avoiding the 
back-and-forth conversion and assumption of the contents of `attributeOp`.
   
   Is this not the case?

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to