From c435e2cb9c2aa02315e5ca5df9515b056dc681e8 Mon Sep 17 00:00:00 2001 From: Remigiusz Janeczek Date: Wed, 2 Dec 2020 09:14:51 +0100 Subject: [OOM CERT-SERVICE-CLIENT] Fix null pointer when sans empty Issue-ID: OOM-2632 Signed-off-by: Remigiusz Janeczek Change-Id: I5e05eb2923b96313cb1d37eb844862289d6acae1 --- .../java/org/onap/oom/certservice/client/certification/CsrFactory.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'certServiceClient/src/main') diff --git a/certServiceClient/src/main/java/org/onap/oom/certservice/client/certification/CsrFactory.java b/certServiceClient/src/main/java/org/onap/oom/certservice/client/certification/CsrFactory.java index 1215e699..4612854d 100644 --- a/certServiceClient/src/main/java/org/onap/oom/certservice/client/certification/CsrFactory.java +++ b/certServiceClient/src/main/java/org/onap/oom/certservice/client/certification/CsrFactory.java @@ -34,6 +34,7 @@ import java.util.List; import java.util.Optional; import java.util.stream.Collectors; import javax.security.auth.x500.X500Principal; +import org.apache.commons.collections.CollectionUtils; import org.bouncycastle.asn1.pkcs.PKCSObjectIdentifiers; import org.bouncycastle.asn1.x509.Extension; import org.bouncycastle.asn1.x509.Extensions; @@ -98,7 +99,7 @@ public class CsrFactory { JcaPKCS10CertificationRequestBuilder builder = new JcaPKCS10CertificationRequestBuilder(subject, keyPair.getPublic()); - if (!configuration.getSans().isEmpty()) { + if (!CollectionUtils.isEmpty(configuration.getSans())) { builder.addAttribute(PKCSObjectIdentifiers.pkcs_9_at_extensionRequest, generateSansExtension()); } -- cgit 1.2.3-korg