1 回答
TA贡献1862条经验 获得超6个赞
reasons_mask: 此变量包含到目前为止处理的 CRL 和增量 CRL 支持的一组撤销原因。
interim_reasons_mask: 这包含当前正在处理的 CRL 或 delta CRL 支持的一组撤销原因。
据我所知,此处理的目的是收集 CRL 以支持尽可能多的撤销原因。因此,如果当前 CRL 支持任何先前 CRL 不支持的任何撤销原因,它只会将当前 CRL 添加到列表中。
如果您reasons_mask
包含所有内容true
,那么之前的 CRL 已经涵盖了所有撤销原因,或者没有给出它支持的特定撤销原因导致设置特殊值all-reasons
(所有标志为真),这意味着不需要涵盖进一步的撤销原因,因此它不会进一步检查。
sun.security.provider.certpath.DistributionPointFetcher.java
...
// compute interim reasons mask
boolean[] interimReasonsMask = new boolean[9];
ReasonFlags reasons = null;
if (idpExt != null) {
reasons = (ReasonFlags) idpExt.get(IssuingDistributionPointExtension.REASONS);
}
boolean[] pointReasonFlags = point.getReasonFlags();
if (reasons != null) {
if (pointReasonFlags != null) {
// set interim reasons mask to the intersection of
// reasons in the DP and onlySomeReasons in the IDP
boolean[] idpReasonFlags = reasons.getFlags();
for (int i = 0; i < interimReasonsMask.length; i++) {
interimReasonsMask[i] = (i < idpReasonFlags.length && idpReasonFlags[i])
&& (i < pointReasonFlags.length && pointReasonFlags[i]);
}
} else {
// set interim reasons mask to the value of
// onlySomeReasons in the IDP (and clone it since we may
// modify it)
interimReasonsMask = reasons.getFlags().clone();
}
} else if (idpExt == null || reasons == null) {
if (pointReasonFlags != null) {
// set interim reasons mask to the value of DP reasons
interimReasonsMask = pointReasonFlags.clone();
} else {
// set interim reasons mask to the special value all-reasons
Arrays.fill(interimReasonsMask, true); // ### SEE HERE ###
}
}
// verify that interim reasons mask includes one or more reasons
// not included in the reasons mask
boolean oneOrMore = false;
for (int i = 0; i < interimReasonsMask.length && !oneOrMore; i++) {
if (interimReasonsMask[i] && !(i < reasonsMask.length && reasonsMask[i])) {
oneOrMore = true;
}
}
if (!oneOrMore) {
return false;
}
...
添加回答
举报