[prev in list] [next in list] [prev in thread] [next in thread] 

List:       openjdk-security-dev
Subject:    Re: RFR 8231950: keytool -ext camel-case shorthand not working
From:       Sean Mullan <sean.mullan () oracle ! com>
Date:       2019-10-31 17:06:37
Message-ID: ebc95a54-5e3e-f8b3-01dc-12a8099adc75 () oracle ! com
[Download RAW message or body]

Looks good to me.

--Sean

On 10/13/19 4:27 AM, Weijun Wang wrote:
> Please take a review at
> 
> http://cr.openjdk.java.net/~weijun/8231950/webrev.00/
> 
> Before this fix, the oneOf(s,list) method compares s to each item of the list in a \
> case-insensitive way, and if there are multiple matches, it errors out saying input \
> is ambiguous. The comparison looks like 
> item.toLowerCase().startsWith(s.toLowerCase()) || \
> item.toCamelCase().equalsIgnoreCase(s) 
> Here, "howAreYou".toCamelCase() == "hAY".
> 
> This means "de" or "dE" would match both "decipherOnly" and "dataEncipherment", and \
> thus treated ambiguous. 
> After this fix, the comparison is broken into 2 steps. If there is a single \
> case-sensitive match, it's returned. Otherwise, fallback to case-insensitive. This \
> means "de" would match "decipherOnly" and "dE" would match "dataEncipherment". This \
> is a behavior change but all working cases still work, it's only those ambiguous \
> cases are clean now. 
> Also, in order to deal with the case that one option starts with another option, \
> I've added an exact match at the beginning. 
> Precisely, the steps are now
> 
> item.equals(s)
> item.startsWith(s) || item.toCamelCase().equals(s)
> item.toLowerCase().startsWith(s.toLowerCase()) || \
> item.toCamelCase().equalsIgnoreCase(s) 
> A new test is added. An existing test is modified, where ambiguous case becomes not \
> now. 
> Thanks,
> Max
> 


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic