RFR: 8154015 Apply algorithm constraints to timestamped code

Sean Mullan sean.mullan at oracle.com
Fri Jul 1 19:39:49 UTC 2016

Looks good, just one comment below ...

On 06/30/2016 05:31 PM, Anthony Scarpino wrote:
> Unless otherwise specified below, it was accepted..
> http://cr.openjdk.java.net/~ascarpino/8154015/webrev.02/
> Tony

>> PKIX.java:
>> 107                 this.params = ((PKIXTimestampParameters)
>> params).getPKIXBuilderParameters();
>> Shouldn't this be:
>> this.params = (PKIXBuilderParameters) params;
> The passed in params doesn't itself contain the original
> PKIXBuilderParamters data.  It's the wrapper with an internal
> PKIXBuilderParameter object it holds the data.
> getPKIXBuilderParameters() passes the orignal PKIXBuilderParameters object.
> Without it being setup this way I don't see how I can get and set the
> timestamp.

Right, you still need to get the timestamp, but all the other methods in 
params are overidden and just call through to the wrapped object, so it 
seems like you can still do this:

if (params instanceof PKIXTimestampParameters) {
     timestamp = ((PKIXTimestampParameters) params).getTimestamp();
     this.params = (PKIXBuilderParameters) params;

and then you don't need the getPKIXBuilderParameters() method.


More information about the security-dev mailing list