{
_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);