the DN compare of bouncy castle utils throws and exception if the object

is null.  Added additional condition to the if statement to check null
status.
This commit is contained in:
Cyrus 2023-06-23 09:22:02 -04:00
parent e133b5040b
commit 57632e0923

View File

@ -117,7 +117,8 @@ public class SupplyChainValidationServiceImpl extends DefaultDbService<SupplyCha
HashSet<CertificateAuthorityCredential> caCreds = new HashSet<>(); HashSet<CertificateAuthorityCredential> caCreds = new HashSet<>();
for (CertificateAuthorityCredential cred : certAuthsWithMatchingIssuer) { for (CertificateAuthorityCredential cred : certAuthsWithMatchingIssuer) {
caCreds.add(cred); caCreds.add(cred);
if (!BouncyCastleUtils.x500NameCompare(cred.getHolderIssuer(), if ((cred.getHolderIssuer() != null && cred.getSubject() != null)
&& !BouncyCastleUtils.x500NameCompare(cred.getHolderIssuer(),
cred.getSubject())) { cred.getSubject())) {
caCreds.addAll(getCaChainRec(cred, queriedOrganizations)); caCreds.addAll(getCaChainRec(cred, queriedOrganizations));
} }