* roottypes.cs: Rename from tree.cs.
[mono.git] / mcs / class / Mono.Security / Mono.Security.X509 / X509Chain.cs
index f8035e6c661f23cf97c32ff1da0dd960658d43a5..027005ca2cb8c5d5220f0b74fd87327ba6eb2336 100644 (file)
@@ -124,16 +124,14 @@ namespace Mono.Security.X509 {
                {
                        _status = X509ChainStatusFlags.NoError;
                        if (_chain == null) {
-                               // chain not supplied - we must built it ourselve
+                               // chain not supplied - we must build it ourselve
                                _chain = new X509CertificateCollection ();
                                X509Certificate x = leaf;
-                               X509Certificate tmp = null;
+                               X509Certificate tmp = x;
                                while ((x != null) && (!x.IsSelfSigned)) {
-                                       tmp = FindCertificateParent (x);
-                                       if (x != null) {
-                                               _chain.Add (x);
-                                               x = tmp;        // last valid
-                                       }
+                                       tmp = x; // last valid
+                                       _chain.Add (x);
+                                       x = FindCertificateParent (x);
                                }
                                // find a trusted root
                                _root = FindCertificateRoot (tmp);