[
https://issues.apache.org/jira/browse/KNOX-3421?focusedWorklogId=1037040&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-1037040
]
ASF GitHub Bot logged work on KNOX-3421:
----------------------------------------
Author: ASF GitHub Bot
Created on: 21/Aug/26 13:41
Start Date: 21/Aug/26 13:41
Worklog Time Spent: 10m
Work Description: moresandeep commented on code in PR #1353:
URL: https://github.com/apache/knox/pull/1353#discussion_r3830659185
##########
gateway-provider-security-shiro/src/main/java/org/apache/knox/gateway/shirorealm/KnoxLdapRealm.java:
##########
@@ -744,16 +752,15 @@ protected String getUserDn( final String principal )
throws IllegalArgumentExcep
@Override
protected AuthenticationInfo createAuthenticationInfo(AuthenticationToken
token, Object ldapPrincipal, Object ldapCredentials, LdapContext ldapContext)
throws NamingException {
- HashRequest.Builder builder = new HashRequest.Builder();
- Hash credentialsHash =
hashService.computeHash(builder.setSource(token.getCredentials()).setAlgorithmName(HASHING_ALGORITHM).build());
- return new SimpleAuthenticationInfo(token.getPrincipal(),
credentialsHash.toHex(), credentialsHash.getSalt(), getName());
+ final ByteSource credentialsSalt = new
SecureRandomNumberGenerator().nextBytes();
+ final SimpleHash credentialsHash = new SimpleHash(HASHING_ALGORITHM,
token.getCredentials(), credentialsSalt, HASHING_ITERATIONS);
+ return new SimpleAuthenticationInfo(token.getPrincipal(),
credentialsHash.toHex(), credentialsSalt, getName());
}
- private static String expandTemplate(final String template, final Matcher
input) {
- return expandTemplate(template, input, false);
- }
+ /** How a substituted template value must be escaped for its target context.
*/
+ private enum EscapeMode { NONE, FILTER, DN }
Review Comment:
You are right, that is clearer way.
Issue Time Tracking
-------------------
Worklog Id: (was: 1037040)
Time Spent: 50m (was: 40m)
> Upgrade Shiro to 2.2.1
> ----------------------
>
> Key: KNOX-3421
> URL: https://issues.apache.org/jira/browse/KNOX-3421
> Project: Apache Knox
> Issue Type: Bug
> Reporter: Sandeep More
> Assignee: Sandeep More
> Priority: Major
> Time Spent: 50m
> Remaining Estimate: 0h
>
> Housekeeping upgrades to a maintained version.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)