summary refs log tree commit diff
path: root/crypto/src/pkix/PkixCertPathValidator.cs
diff options
context:
space:
mode:
Diffstat (limited to 'crypto/src/pkix/PkixCertPathValidator.cs')
-rw-r--r--crypto/src/pkix/PkixCertPathValidator.cs11
1 files changed, 7 insertions, 4 deletions
diff --git a/crypto/src/pkix/PkixCertPathValidator.cs b/crypto/src/pkix/PkixCertPathValidator.cs
index 82b5aa0e5..89b3a57fe 100644
--- a/crypto/src/pkix/PkixCertPathValidator.cs
+++ b/crypto/src/pkix/PkixCertPathValidator.cs
@@ -426,15 +426,18 @@ namespace Org.BouncyCastle.Pkix
 
         internal static void CheckCertificate(X509Certificate cert)
         {
-            // TODO What check is this method trying to achieve?
+            Exception cause = null;
             try
             {
-                TbsCertificateStructure.GetInstance(cert.CertificateStructure.TbsCertificate);
+                if (cert.TbsCertificate != null)
+                    return;
             }
-            catch (CertificateEncodingException e)
+            catch (Exception e)
             {
-                throw new Exception("unable to process TBSCertificate", e);
+                cause = e;
             }
+
+            throw new Exception("unable to process TBSCertificate", cause);
         }
     }
 }