RFR: 8243585: AlgorithmChecker::check throws confusing exception when it rejects the signer key [v3]
Sean Mullan
mullan at openjdk.java.net
Thu Oct 21 13:50:12 UTC 2021
On Thu, 21 Oct 2021 13:03:04 GMT, Weijun Wang <weijun at openjdk.org> wrote:
>> Ok, will remove. But I will keep this method separate since, unlike the ctor it needs to check if `trustedPubKey` is `null` before setting the `prevPubKey`.
>
> OK, but in the ctor `trustedPubKey` is also null.
True, but that's because none of the fields are set yet, so it feels odd for the ctor to check if the field is null when it is always true, even if it is a different method. What if I create a separate method `setTrustAnchor(TrustAnchor)` which the ctor calls, and then change `trySetTrustAnchor` to:
if (this.trustedPubKey == null) {
setTrustAnchor(anchor);
}
-------------
PR: https://git.openjdk.java.net/jdk/pull/5928
More information about the security-dev
mailing list