directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cohei...@apache.org
Subject [4/6] directory-kerby git commit: Another NPE fix if it fails to load the PKINIT trust anchor
Date Tue, 05 Jul 2016 14:07:27 GMT
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/trunk
Commit: 35fb465a7b6d63e1ba4e886f162b1b1cddd677a7
Parents: 36ed64d
Author: Colm O hEigeartaigh <coheigea@apache.org>
Authored: Tue Jul 5 12:34:18 2016 +0100
Committer: Colm O hEigeartaigh <coheigea@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();


Mime
View raw message