You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@directory.apache.org by pl...@apache.org on 2016/07/06 02:52:01 UTC

[4/7] directory-kerby git commit: Another NPE fix if it fails to load the PKINIT trust anchor

Another NPE fix if it fails to load the PKINIT trust anchor


Project: http://git-wip-us.apache.org/repos/asf/directory-kerby/repo
Commit: http://git-wip-us.apache.org/repos/asf/directory-kerby/commit/35fb465a
Tree: http://git-wip-us.apache.org/repos/asf/directory-kerby/tree/35fb465a
Diff: http://git-wip-us.apache.org/repos/asf/directory-kerby/diff/35fb465a

Branch: refs/heads/kadmin-remote
Commit: 35fb465a7b6d63e1ba4e886f162b1b1cddd677a7
Parents: 36ed64d
Author: Colm O hEigeartaigh <co...@apache.org>
Authored: Tue Jul 5 12:34:18 2016 +0100
Committer: Colm O hEigeartaigh <co...@apache.org>
Committed: Tue Jul 5 12:34:18 2016 +0100

----------------------------------------------------------------------
 .../kerberos/kerb/client/preauth/pkinit/PkinitPreauth.java     | 6 ++++++
 1 file changed, 6 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/directory-kerby/blob/35fb465a/kerby-kerb/kerb-client/src/main/java/org/apache/kerby/kerberos/kerb/client/preauth/pkinit/PkinitPreauth.java
----------------------------------------------------------------------
diff --git a/kerby-kerb/kerb-client/src/main/java/org/apache/kerby/kerberos/kerb/client/preauth/pkinit/PkinitPreauth.java b/kerby-kerb/kerb-client/src/main/java/org/apache/kerby/kerberos/kerb/client/preauth/pkinit/PkinitPreauth.java
index 9a15c4e..9b37eb2 100644
--- a/kerby-kerb/kerb-client/src/main/java/org/apache/kerby/kerberos/kerb/client/preauth/pkinit/PkinitPreauth.java
+++ b/kerby-kerb/kerb-client/src/main/java/org/apache/kerby/kerberos/kerb/client/preauth/pkinit/PkinitPreauth.java
@@ -363,6 +363,12 @@ public class PkinitPreauth extends AbstractPreauthPlugin {
             } catch (KrbException e) {
                 e.printStackTrace();
             }
+            
+            if (x509Certificate == null) {
+                LOG.error("Failed to load PKINIT anchor");
+                throw new KrbException("Failed to load PKINIT anchor");
+            }
+            
             Certificate archorCertificate = PkinitCrypto.changeToCertificate(x509Certificate);
 
             CertificateSet certificateSet = signedData.getCertificates();