Java: Improved the query for disabled certificate revocation checking

- Added a taint propagation step for List.of() methods
- Added a testcase with one of the List.of() method
- Simplified conditions
- Fixed typos
This commit is contained in:
Artem Smotrakov
2020-06-22 18:16:07 +03:00
parent 06e3f101ce
commit a2fa03e4f5
4 changed files with 36 additions and 9 deletions

View File

@@ -47,7 +47,7 @@ public class DisabledRevocationChecking {
validator.validate(certPath, params);
}
public void testSettingRevocationCheckerWithList(KeyStore cacerts, CertPath certPath) throws Exception {
public void testSettingRevocationCheckerWithAddingToArrayList(KeyStore cacerts, CertPath certPath) throws Exception {
CertPathValidator validator = CertPathValidator.getInstance("PKIX");
PKIXParameters params = new PKIXParameters(cacerts);
params.setRevocationEnabled(false);
@@ -58,6 +58,16 @@ public class DisabledRevocationChecking {
validator.validate(certPath, params);
}
public void testSettingRevocationCheckerWithListOf(KeyStore cacerts, CertPath certPath) throws Exception {
CertPathValidator validator = CertPathValidator.getInstance("PKIX");
PKIXParameters params = new PKIXParameters(cacerts);
params.setRevocationEnabled(false);
PKIXRevocationChecker checker = (PKIXRevocationChecker) validator.getRevocationChecker();
List<PKIXCertPathChecker> checkers = List.of(checker);
params.setCertPathCheckers(checkers);
validator.validate(certPath, params);
}
public void testAddingRevocationChecker(KeyStore cacerts, CertPath certPath) throws Exception {
CertPathValidator validator = CertPathValidator.getInstance("PKIX");
PKIXParameters params = new PKIXParameters(cacerts);