From cf6cad9a48766d14058859e59de1281c01643629 Mon Sep 17 00:00:00 2001 From: Laurent Peuch Date: Mon, 5 Dec 2016 15:35:53 +0100 Subject: [PATCH] [fix] nullpointerexception in CA.java\n\nAccording to the decompilation of prod this is what is missing in prod. --- src/main/java/be/neutrinet/ispng/vpn/ca/CA.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/main/java/be/neutrinet/ispng/vpn/ca/CA.java b/src/main/java/be/neutrinet/ispng/vpn/ca/CA.java index e0d5f3c..393d29e 100644 --- a/src/main/java/be/neutrinet/ispng/vpn/ca/CA.java +++ b/src/main/java/be/neutrinet/ispng/vpn/ca/CA.java @@ -7,6 +7,7 @@ import org.bouncycastle.asn1.x500.X500Name; import org.bouncycastle.asn1.x509.*; import org.bouncycastle.cert.X509CertificateHolder; import org.bouncycastle.cert.X509v3CertificateBuilder; +import org.bouncycastle.cert.bc.BcX509ExtensionUtils; import org.bouncycastle.cert.jcajce.JcaX509CertificateHolder; import org.bouncycastle.crypto.util.PrivateKeyFactory; import org.bouncycastle.openssl.jcajce.JcaPEMWriter; @@ -89,7 +90,8 @@ public class CA { certgen.addExtension(Extension.extendedKeyUsage, false, eku); // Identifiers - SubjectKeyIdentifier subjectKeyIdentifier = SubjectKeyIdentifier.getInstance(csr.getSubjectPublicKeyInfo()); + BcX509ExtensionUtils extensionUtils = new BcX509ExtensionUtils(); + org.bouncycastle.asn1.x509.SubjectKeyIdentifier subjectKeyIdentifier = extensionUtils.createSubjectKeyIdentifier(csr.getSubjectPublicKeyInfo()); AuthorityKeyIdentifier authorityKeyIdentifier = new AuthorityKeyIdentifier(new GeneralNames (new GeneralName(issuer)), caCert.getSerialNumber()); -- GitLab