[Non-ACR][SecureRepository] Get rid of quickly expiring certificates in tests 16/279316/2 tizen_5.5
authorKrzysztof Jackiewicz <k.jackiewicz@samsung.com>
Wed, 27 Jul 2022 15:03:00 +0000 (17:03 +0200)
committerKrzysztof Jackiewicz <k.jackiewicz@samsung.com>
Mon, 8 Aug 2022 07:59:42 +0000 (09:59 +0200)
- Replace third party certificates with manually created ones having long
  expiration periods.
- Keep only intermediate third party certificate for chain creation i and OCSP
  validation. Also replace it with another one having longer expiration period.
- Adjust tests where necessary.

Change-Id: I9a4c8aa888adce293e00105975624901bc013ac9

tct-suite-vs/Tizen.Securerepository.Tests/res/cert-im-for-ocsp-test.pem [deleted file]
tct-suite-vs/Tizen.Securerepository.Tests/res/cert-im.pem [new file with mode: 0644]
tct-suite-vs/Tizen.Securerepository.Tests/res/cert-leaf-for-ocsp-test.pem [deleted file]
tct-suite-vs/Tizen.Securerepository.Tests/res/test-cert-im.pem [new file with mode: 0644]
tct-suite-vs/Tizen.Securerepository.Tests/res/test-cert-leaf.pem [new file with mode: 0644]
tct-suite-vs/Tizen.Securerepository.Tests/res/test-cert-root.pem [new file with mode: 0644]
tct-suite-vs/Tizen.Securerepository.Tests/support/TestConfig.cs
tct-suite-vs/Tizen.Securerepository.Tests/testcase/TSCertificate.cs
tct-suite-vs/Tizen.Securerepository.Tests/testcase/TSCertificateManager.cs

diff --git a/tct-suite-vs/Tizen.Securerepository.Tests/res/cert-im-for-ocsp-test.pem b/tct-suite-vs/Tizen.Securerepository.Tests/res/cert-im-for-ocsp-test.pem
deleted file mode 100755 (executable)
index 4c2e0ae..0000000
+++ /dev/null
@@ -1,31 +0,0 @@
------BEGIN CERTIFICATE-----
-MIIFWjCCBEKgAwIBAgIQDxSWXyAgaZlP1ceseIlB4jANBgkqhkiG9w0BAQsFADBa
-MQswCQYDVQQGEwJJRTESMBAGA1UEChMJQmFsdGltb3JlMRMwEQYDVQQLEwpDeWJl
-clRydXN0MSIwIAYDVQQDExlCYWx0aW1vcmUgQ3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EFjAUBggrBgEFBQcDAQYI
-KwYBBQUHAwIwEgYDVR0TAQH/BAgwBgEB/wIBADA0BggrBgEFBQcBAQQoMCYwJAYI
-KwYBBQUHMAGGGGh0dHA6Ly9vY3NwLmRpZ2ljZXJ0LmNvbTA6BgNVHR8EMzAxMC+g
-LaArhilodHRwOi8vY3JsMy5kaWdpY2VydC5jb20vT21uaXJvb3QyMDI1LmNybDAq
-BgNVHSAEIzAhMAgGBmeBDAECATAIBgZngQwBAgIwCwYJKwYBBAGCNyoBMA0GCSqG
-SIb3DQEBCwUAA4IBAQCfK76SZ1vae4qt6P+dTQUO7bYNFUHR5hXcA2D59CJWnEj5
-na7aKzyowKvQupW4yMH9fGNxtsh6iJswRqOOfZYC4/giBO/gNsBvwr8uDW7t1nYo
-DYGHPpvnpxCM2mYfQFHq576/TmeYu1RZY29C4w8xYBlkAA8mDJfRhMCmehk7cN5F
-JtyWRj2cZj/hOoI45TYDBChXpOlLZKIYiG1giY16vhCRi6zmPzEwv+tk156N6cGS
-Vm44jTQ/rs1sa0JSYjzUaYngoFdZC4OfxnIkQvUIA4TOFmPzNPEFdjcZsgbeEz4T
-cGHTBPK4R28F44qIMCtHRV55VMX53ev6P3hRddJb
------END CERTIFICATE-----
diff --git a/tct-suite-vs/Tizen.Securerepository.Tests/res/cert-im.pem b/tct-suite-vs/Tizen.Securerepository.Tests/res/cert-im.pem
new file mode 100644 (file)
index 0000000..e5aa681
--- /dev/null
@@ -0,0 +1,31 @@
+-----BEGIN CERTIFICATE-----
+MIIFYjCCBEqgAwIBAgIQd70NbNs2+RrqIQ/E8FjTDTANBgkqhkiG9w0BAQsFADBX
+MQswCQYDVQQGEwJCRTEZMBcGA1UEChMQR2xvYmFsU2lnbiBudi1zYTEQMA4GA1UE
+CxMHUm9vdCBDQTEbMBkGA1UEAxMSR2xvYmFsU2lnbiBSb290IENBMB4XDTIwMDYx
+OTAwMDA0MloXDTI4MDEyODAwMDA0MlowRzELMAkGA1UEBhMCVVMxIjAg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uZ29vZy9nc3IxL2dzcjEuY3J0MDIGA1UdHwQrMCkwJ6Al
+oCOGIWh0dHA6Ly9jcmwucGtpLmdvb2cvZ3NyMS9nc3IxLmNybDA7BgNVHSAENDAy
+MAgGBmeBDAECATAIBgZngQwBAgIwDQYLKwYBBAHWeQIFAwIwDQYLKwYBBAHWeQIF
+AwMwDQYJKoZIhvcNAQELBQADggEBADSkHrEoo9C0dhemMXoh6dFSPsjbdBZBiLg9
+NR3t5P+T4Vxfq7vqfM/b5A3Ri1fyJm9bvhdGaJQ3b2t6yMAYN/olUazsaL+yyEn9
+WprKASOshIArAoyZl+tJaox118fessmXn1hIVw41oeQa1v1vg4Fv74zPl6/AhSrw
+9U5pCZEt4Wi4wStz6dTZ/CLANx8LZh1J7QJVj2fhMtfTJr9w4z30Z209fOU0iOMy
++qduBmpvvYuR7hZL6Dupszfnw0Skfths18dG9ZKb59UhvmaSGZRVbNQpsg3BZlvi
+d0lIKO2d1xozclOzgjXPYovJJIultzkMu34qQb9Sz/yilrbCgj8=
+-----END CERTIFICATE-----
\ No newline at end of file
diff --git a/tct-suite-vs/Tizen.Securerepository.Tests/res/cert-leaf-for-ocsp-test.pem b/tct-suite-vs/Tizen.Securerepository.Tests/res/cert-leaf-for-ocsp-test.pem
deleted file mode 100755 (executable)
index ae25d50..0000000
+++ /dev/null
@@ -1,74 +0,0 @@
------BEGIN CERTIFICATE-----
-MIINWDCCC0CgAwIBAgITEgAtFJyg3q6Puh27sQAAAC0UnDANBgkqhkiG9w0BAQsF
-ADBPMQswCQYDVQQGEwJVUzEeMBwGA1UEChMVTWljcm9zb2Z0IENvcnBvcmF0aW9u
-MSAwHgYDVQQDExdNaWNyb3NvZnQgUlNBIFRMUyBDQSAwMTAeFw0yMjA2MTAwMTE1
-NDFaFw0yMjEyMTAwMTE1NDFaMBcxFTATBgNVBAMTDHd3dy5iaW5nLmNvbTCCASIw
-DQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAL8sdZYQ+f3lROucT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pzbdQ2BXECzJ9WwxrThRJXZo9BOR
-WneHWxrOCzK3NWzJ
------END CERTIFICATE-----
diff --git a/tct-suite-vs/Tizen.Securerepository.Tests/res/test-cert-im.pem b/tct-suite-vs/Tizen.Securerepository.Tests/res/test-cert-im.pem
new file mode 100644 (file)
index 0000000..5c36e89
--- /dev/null
@@ -0,0 +1,22 @@
+-----BEGIN CERTIFICATE-----
+MIIDljCCAn6gAwIBAgICEAAwDQYJKoZIhvcNAQEFBQAwZjELMAkGA1UEBhMCQVUx
+EzARBgNVBAgMClNvbWUtU3RhdGUxDTALBgNVBAoMBEFDTUUxEDAOBgNVBAsMB1Rl
+c3RpbmcxITAfBgNVBAMMGFRlc3Qgcm9vdCBjYSBjZXJ0aWZpY2F0ZTAeFw0xNTAx
+MTYxNjQ1MzRaFw0zNTAxMTExNjQ1MzRaMGQxCzAJBgNVBAYTAkFVMRMwEQYDVQQI
+DApTb21lLVN0YXRlMQ0wCwYDVQQKDARBQ01FMRAwDgYDVQQLDAdUZXN0aW5nMR8w
+HQYDVQQDDBZUZXN0IElNIENBIGNlcnRpZmljYXRlMIIBIjANBgkqhkiG9w0BAQEF
+AAOCAQ8AMIIBCgKCAQEAzmBF78qClgoKfnLAncMXZwZ14TW+5kags1+QCYeg3c7j
+L9+RvDxIaX2tKf1sukJcwQfYqUlQkwt+58LMOb2ORtkpj8Or6WCWCZ0BzneT8ug7
+nxJT4m9+bohMF0JoKjjB2H4KNMHamLIwUxRKt6nyfk81kVhJOi2vzzxd+UCPi6Pc
+UAbJNH48eNgOIg55nyFovVzYj8GIo/9GvHJj83PPa/KlJZ+Z1qZASZZ/VYorplVT
+thsHXKfejhFy5YJ9t7n/vyAQsyBsagZsvX19xnH41fbYXHKf8UbXG23rNaZlchs6
+XJVLQdzOpj3WTj/lCocVHqLaZISLhNQ3aI7kUBUdiwIDAQABo1AwTjAdBgNVHQ4E
+FgQUoCYNaCBP4jl/3SYQuK8Ka+6i3QEwHwYDVR0jBBgwFoAUt6pkzFt1PZlfYRL/
+HGnufF4frdwwDAYDVR0TBAUwAwEB/zANBgkqhkiG9w0BAQUFAAOCAQEAjRzWiD97
+Htv4Kxpm3P+C+xP9AEteCJfO+7p8MWgtWEJOknJyt55zeKS2JwZIq57KcbqD8U7v
+vAUx1ymtUhlFPFd7J1mJ3pou+3aFYmGShYhGHpbrmUwjp7HVP588jrW1NoZVHdMc
+4OgJWFrViXeu9+maIcekjMB/+9Y0dUgQuK5ZuT5H/Jwet7Th/o9uufTUZjBzRvrB
+pbXgQpqgME2av4Q/6LuldPCTHLtWXgFUU2R+yCGmuGilvhFJnKoQryAbYnIQNWE8
+SLoHQ9s1i7Zyb7HU6UAaqMOz15LBkyAqtNyJcO2p7Q/p5YK0xfD4xisI5qXucqVm
+F2obL5qJSTN/RQ==
+-----END CERTIFICATE-----
\ No newline at end of file
diff --git a/tct-suite-vs/Tizen.Securerepository.Tests/res/test-cert-leaf.pem b/tct-suite-vs/Tizen.Securerepository.Tests/res/test-cert-leaf.pem
new file mode 100644 (file)
index 0000000..e78e449
--- /dev/null
@@ -0,0 +1,20 @@
+-----BEGIN CERTIFICATE-----
+MIIDOzCCAiMCAQEwDQYJKoZIhvcNAQEFBQAwZDELMAkGA1UEBhMCQVUxEzARBgNV
+BAgMClNvbWUtU3RhdGUxDTALBgNVBAoMBEFDTUUxEDAOBgNVBAsMB1Rlc3Rpbmcx
+HzAdBgNVBAMMFlRlc3QgSU0gQ0EgY2VydGlmaWNhdGUwHhcNMTUwMTE2MTY0ODE0
+WhcNMzUwMTExMTY0ODE0WjBjMQswCQYDVQQGEwJBVTETMBEGA1UECAwKU29tZS1T
+dGF0ZTENMAsGA1UECgwEQUNNRTEQMA4GA1UECwwHVGVzdGluZzEeMBwGA1UEAwwV
+VGVzdCBsZWFmIGNlcnRpZmljYXRlMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIB
+CgKCAQEAzTdDIa2tDmRxFnIgiG+mBz8GoSVODs0ImNQGbqj+pLhBOFRH8fsah4Jl
+z5YF9KwhMVLknnHGFLE/Nb7Ac35kEzhMQMpTRxohW83oxw3eZ8zN/FBoKqg4qHRq
+QR8kS10YXTgrBR0ex/Vp+OUKEw6h7yL2r4Tpvrn9/qHwsxtLxqWbDIVf1O9b1Lfc
+bllYMdmV5E62yN5tcwrDP8gvHjFnVeLzrG8wTpc9FR90/0Jkfp5jAJcArOBLrT0E
+4VRqs+4HuwT8jAwFAmNnc7IYX5qSjtSWkmmHe73K/lzB+OiI0JEc/3eWUTWqwTSk
+4tNCiQGBKJ39LXPTBBJdzmxVH7CUDQIDAQABMA0GCSqGSIb3DQEBBQUAA4IBAQAp
+UdDOGu3hNiG+Vn10aQ6B1ZmOj3t+45gUV3sC+y8hB8EK1g4P5Ke9bVDts0T5eOnj
+CSc+6VoND5O4adI0IFFRFljHNVnvjeosHfUZNnowsmA2ptQBtC1g5ZKRvKXlkC5/
+i5BGgRqPFA7y9WB9Y05MrJHf3E+Oz/RBsLeeNiNN+rF5X1vYExvGHpo0M0zS0ze9
+HtC0aOy8ocsTrQkf3ceHTAXx2i8ftoSSD4klojtWFpWMrNQa52F7wB9nU6FfKRuF
+Zj/T1JkYXKkEwZU6nAR2jdZp3EP9xj3o15V/tyFcXHx6l8NTxn4cJb+Xe4VquQJz
+6ON7PVe0ABN/AlwVQiFE
+-----END CERTIFICATE-----
\ No newline at end of file
diff --git a/tct-suite-vs/Tizen.Securerepository.Tests/res/test-cert-root.pem b/tct-suite-vs/Tizen.Securerepository.Tests/res/test-cert-root.pem
new file mode 100644 (file)
index 0000000..d6e1e80
--- /dev/null
@@ -0,0 +1,22 @@
+-----BEGIN CERTIFICATE-----
+MIIDnzCCAoegAwIBAgIJAMH/ADkC5YSTMA0GCSqGSIb3DQEBBQUAMGYxCzAJBgNV
+BAYTAkFVMRMwEQYDVQQIDApTb21lLVN0YXRlMQ0wCwYDVQQKDARBQ01FMRAwDgYD
+VQQLDAdUZXN0aW5nMSEwHwYDVQQDDBhUZXN0IHJ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rchGmyBK
+kOg11TpPdNDkhb1J4ZCh2gupDg==
+-----END CERTIFICATE-----
\ No newline at end of file
index 49aa66f..453294c 100755 (executable)
@@ -23,8 +23,10 @@ namespace Tizen.Security.SecureRepository.Tests
         private static TestConfig _instance = null;
         private static readonly object _padlock = new Object();
 
-        private string _cert_leaf;
         private string _cert_im;
+        private string _test_cert_leaf;
+        private string _test_cert_im;
+        private string _test_cert_root;
         private string _cert_invalid;
         private string _pkcs12;
         private string _pkcs12_invalid;
@@ -33,8 +35,10 @@ namespace Tizen.Security.SecureRepository.Tests
         {
             string resourcePath = application.DirectoryInfo.Resource;
 
-            _cert_leaf = resourcePath + "cert-leaf-for-ocsp-test.pem";
-            _cert_im = resourcePath + "cert-im-for-ocsp-test.pem";
+            _cert_im = resourcePath + "cert-im.pem";
+            _test_cert_leaf = resourcePath + "test-cert-leaf.pem";
+            _test_cert_im = resourcePath + "test-cert-im.pem";
+            _test_cert_root = resourcePath + "test-cert-root.pem";
             _cert_invalid = resourcePath + "invalid-cert.pem";
             _pkcs12 = resourcePath + "pkcs12.p12";
             _pkcs12_invalid = resourcePath + "invalid-pkcs12.p12";
@@ -53,14 +57,24 @@ namespace Tizen.Security.SecureRepository.Tests
             }
         }
 
-        public string CertLeafPath
+        public string CertIntermediatePath
         {
-            get { return _cert_leaf; }
+            get { return _cert_im; }
         }
 
-        public string CertIntermediatePath
+        public string TestCertLeafPath
         {
-            get { return _cert_im; }
+            get { return _test_cert_leaf; }
+        }
+
+        public string TestCertIntermediatePath
+        {
+            get { return _test_cert_im; }
+        }
+
+        public string TestCertRootPath
+        {
+            get { return _test_cert_root; }
         }
 
         public string CertInvalidPath
index 8a7db60..69fb91d 100755 (executable)
@@ -24,7 +24,7 @@ namespace Tizen.Security.SecureRepository.Tests
     [Description("Tizen.Security.SecureRepository.Certificate Tests")]
     public class CertificateTests
     {
-        private static string _certPath = TestUtils.TestConfig.CertLeafPath;
+        private static string _certPath = TestUtils.TestConfig.CertIntermediatePath;
 
         protected static Certificate LoadDefaultCert()
         {
index 9c5bf91..a68eb16 100755 (executable)
@@ -1,5 +1,5 @@
 /*
- *  Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+ *  Copyright (c) 2016 - 2021 Samsung Electronics Co., Ltd All Rights Reserved
  *
  *  Licensed under the Apache License, Version 2.0 (the "License");
  *  you may not use this file except in compliance with the License.
@@ -31,8 +31,10 @@ namespace Tizen.Security.SecureRepository.Tests
     {
         private static string[] _aliases = {"C#API_CERT_TEST", "C#API_CERT_TEST2"};
         private string _alias = _aliases[0];
-        private string _certPath = TestUtils.TestConfig.CertLeafPath;
-        private string _certIntermediatePath = TestUtils.TestConfig.CertIntermediatePath;
+        private string _certPath = TestUtils.TestConfig.CertIntermediatePath;
+        private string _testCertLeafPath = TestUtils.TestConfig.TestCertLeafPath;
+        private string _testCertImPath = TestUtils.TestConfig.TestCertIntermediatePath;
+        private string _testCertRootPath = TestUtils.TestConfig.TestCertRootPath;
 
         [Test]
         [Category("P1")]
@@ -274,7 +276,7 @@ namespace Tizen.Security.SecureRepository.Tests
 
         [Test]
         [Category("P1")]
-        [Description("Verifies and generate a certficate chain from a leaf certificate and an intermediate CA certificate and returns that chain")]
+        [Description("Verifies and generates a certficate chain from a leaf certificate and returns that chain")]
         [Property("SPEC", "Tizen.Security.SecureRepository.CertificateManager.GetCertificateChain M")]
         [Property("SPEC_URL", "-")]
         [Property("CRITERIA", "MR")]
@@ -287,18 +289,15 @@ namespace Tizen.Security.SecureRepository.Tests
              * 1. Load certificates to make chain
              */
             var certLeaf = Certificate.Load(_certPath);
-            var certIntermediate = Certificate.Load(_certIntermediatePath);
-            var untrustedCerts = new List<Certificate>();
-            untrustedCerts.Add(certIntermediate);
 
             /* TEST CODE */
-            var retval = CertificateManager.GetCertificateChain(certLeaf, untrustedCerts);
+            var retval = CertificateManager.GetCertificateChain(certLeaf, null);
             int size = 0;
             var enumerator = retval.GetEnumerator();
             while (enumerator.MoveNext())
                 ++size;
 
-            Assert.True(size == 3, "Invalid certificate chain size!");
+            Assert.True(size == 2, "Invalid certificate chain size!");
         }
 
         [Test]
@@ -330,7 +329,7 @@ namespace Tizen.Security.SecureRepository.Tests
              * PRECONDITION
              * 1. Load certificates to make chain
              */
-            var certLeaf = Certificate.Load(_certPath);
+            var certLeaf = Certificate.Load(_testCertLeafPath);
 
             /* TEST CODE */
             Assert.Throws<InvalidOperationException>(delegate {
@@ -352,14 +351,17 @@ namespace Tizen.Security.SecureRepository.Tests
              * PRECONDITION
              * 1. Load certificates to make chain
              */
-            var certLeaf = Certificate.Load(_certPath);
-            var certIntermediate = Certificate.Load(_certIntermediatePath);
+            var certLeaf = Certificate.Load(_testCertLeafPath);
+            var certIntermediate = Certificate.Load(_testCertImPath);
             var untrustedCerts = new List<Certificate>();
             untrustedCerts.Add(certIntermediate);
+            var certRoot = Certificate.Load(_testCertRootPath);
+            var trustedCerts = new List<Certificate>();
+            trustedCerts.Add(certRoot);
 
             /* TEST CODE */
             var retval = CertificateManager.GetCertificateChain(
-                certLeaf, untrustedCerts, null, true);
+                certLeaf, untrustedCerts, trustedCerts, false);
             int size = 0;
             var enumerator = retval.GetEnumerator();
             while (enumerator.MoveNext())
@@ -382,17 +384,20 @@ namespace Tizen.Security.SecureRepository.Tests
              * PRECONDITION
              * 1. Load valid leaf certificate
              * 2. Load valid untrusted certificates
+             * 3. Load valid trusted certificates
              */
-            var certLeaf = Certificate.Load(_certPath);
+            var certLeaf = Certificate.Load(_testCertLeafPath);
             var untrustedCerts = new List<Certificate>();
-            untrustedCerts.Add(Certificate.Load(_certIntermediatePath));
+            untrustedCerts.Add(Certificate.Load(_testCertImPath));
+            var trustedCerts = new List<Certificate>();
+            trustedCerts.Add(Certificate.Load(_testCertRootPath));
 
             /* TEST CODE */
             Assert.Throws<InvalidOperationException>(delegate {
-                CertificateManager.GetCertificateChain(certLeaf, null, null, true);
+                CertificateManager.GetCertificateChain(certLeaf, null, trustedCerts, false);
             });
             Assert.Throws<ArgumentNullException>(delegate {
-                CertificateManager.GetCertificateChain(null, untrustedCerts, null, true);
+                CertificateManager.GetCertificateChain(null, untrustedCerts, trustedCerts, false);
             });
         }
 
@@ -410,19 +415,21 @@ namespace Tizen.Security.SecureRepository.Tests
              * PRECONDITION
              * 1. Load certificates to make chain
              */
-            var certLeaf = Certificate.Load(_certPath);
+            var certLeaf = Certificate.Load(_testCertLeafPath);
             var untrustedCerts = new List<Certificate>();
-            untrustedCerts.Add(Certificate.Load(_certIntermediatePath));
+            untrustedCerts.Add(Certificate.Load(_testCertImPath));
+            var trustedCerts = new List<Certificate>();
+            trustedCerts.Add(Certificate.Load(_testCertRootPath));
 
             /* TEST CODE */
             Assert.Throws<InvalidOperationException>(delegate {
                 CertificateManager.GetCertificateChain(
-                    certLeaf, new List<Certificate>(), null, true);
+                    certLeaf, new List<Certificate>(), trustedCerts, false);
             });
             Assert.Throws<ArgumentException>(delegate {
                 CertificateManager.GetCertificateChain(
                     new Certificate(Util.GenerateRandom(2048), DataFormat.Pem),
-                    untrustedCerts, null, true);
+                    untrustedCerts, null, false);
             });
         }
 
@@ -438,21 +445,16 @@ namespace Tizen.Security.SecureRepository.Tests
             /*
              * PRECONDITION
              * 1. Load leaf certificate to check OCSP
-             * 2. Load intermediate certificate to make chain
-             * 3. Make chain
+             * 2. Make chain
              */
-            var certLeaf = Certificate.Load(_certPath);
-            var certIntermediate = Certificate.Load(_certIntermediatePath);
-            var untrustedCerts = new List<Certificate>();
-            untrustedCerts.Add(certIntermediate);
+            var cert = Certificate.Load(_certPath);
 
-            var retval = CertificateManager.GetCertificateChain(
-                certLeaf, untrustedCerts, null, true);
+            var retval = CertificateManager.GetCertificateChain(cert, null, null, true);
             int size = 0;
             var enumerator = retval.GetEnumerator();
             while (enumerator.MoveNext())
                 ++size;
-            Assert.True(size == 3, "Invalid certificate chain size!");
+            Assert.True(size == 2, "Invalid certificate chain size!");
 
             /* TEST CODE */
             var status = CertificateManager.CheckOcsp(retval);