{"action":"created","comment":{"url":"https://api.github.com/repos/dotnet/corefx/pulls/comments/58095554","id":58095554,"diff_hunk":"@@ -264,5 +264,39 @@ public static void SafeX509ChainHandle_InvalidHandle_StaticObject()\n \n             Assert.Same(firstCall, secondCall);\n         }\n+\n+        [Fact]\n+        [OuterLoop( /* May require using the network, to download CRLs and intermediates */)]\n+        public static void VerifyWithRevocation()\n+        {\n+            using (var cert = new X509Certificate2(Path.Combine(\"TestData\", \"MS.cer\")))\n+            using (var chain = new X509Chain())\n+            {\n+                chain.ChainPolicy.VerificationFlags =\n+                    X509VerificationFlags.AllowUnknownCertificateAuthority;\n+\n+                chain.ChainPolicy.VerificationTime = cert.NotBefore.AddHours(2);\n+                chain.ChainPolicy.RevocationMode = X509RevocationMode.Online;\n+                chain.ChainPolicy.RevocationFlag = X509RevocationFlag.EntireChain;\n+\n+                bool valid = chain.Build(cert);\n+                Assert.True(valid, \"Chain Built Validly\");\n+\n+                // Since the network was enabled, we should get the whole chain.\n+                Assert.Equal(3, chain.ChainElements.Count);\n+\n+                Assert.Equal(0, chain.ChainElements[0].ChainElementStatus.Length);\n+                Assert.Equal(0, chain.ChainElements[1].ChainElementStatus.Length);\n+\n+                X509ChainStatus[] rootElementStatus = chain.ChainElements[2].ChainElementStatus;\n+                Assert.InRange(rootElementStatus.Length, 0, 1);","path":"src/System.Security.Cryptography.X509Certificates/tests/ChainTests.cs","position":null,"original_position":29,"commit_id":"a8d5f01cacc85f84f60a769cde01eb07d87fc641","original_commit_id":"345c87713cff63bbb93c068ec11da3dfa22cab74","user":{"login":"bartonjs","id":10642668,"avatar_url":"https://avatars.githubusercontent.com/u/10642668?v=3","gravatar_id":"","url":"https://api.github.com/users/bartonjs","html_url":"https://github.com/bartonjs","followers_url":"https://api.github.com/users/bartonjs/followers","following_url":"https://api.github.com/users/bartonjs/following{/other_user}","gists_url":"https://api.github.com/users/bartonjs/gists{/gist_id}","starred_url":"https://api.github.com/users/bartonjs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bartonjs/subscriptions","organizations_url":"https://api.github.com/users/bartonjs/orgs","repos_url":"https://api.github.com/users/bartonjs/repos","events_url":"https://api.github.com/users/bartonjs/events{/privacy}","received_events_url":"https://api.github.com/users/bartonjs/received_events","type":"User","site_admin":false},"body":"Moved the comment out of the if, and restructured this bit slightly.","created_at":"2016-03-31T17:39:53Z","updated_at":"2016-03-31T17:39:53Z","html_url":"https://github.com/dotnet/corefx/pull/7366#discussion_r58095554","pull_request_url":"https://api.github.com/repos/dotnet/corefx/pulls/7366","_links":{"self":{"href":"https://api.github.com/repos/dotnet/corefx/pulls/comments/58095554"},"html":{"href":"https://github.com/dotnet/corefx/pull/7366#discussion_r58095554"},"pull_request":{"href":"https://api.github.com/repos/dotnet/corefx/pulls/7366"}}},"pull_request":{"url":"https://api.github.com/repos/dotnet/corefx/pulls/7366","id":64708246,"html_url":"https://github.com/dotnet/corefx/pull/7366","diff_url":"https://github.com/dotnet/corefx/pull/7366.diff","patch_url":"https://github.com/dotnet/corefx/pull/7366.patch","issue_url":"https://api.github.com/repos/dotnet/corefx/issues/7366","number":7366,"state":"open","locked":false,"title":"Add a test for X509Chain.Build with X509RevocationMode.Online","user":{"login":"bartonjs","id":10642668,"avatar_url":"https://avatars.githubusercontent.com/u/10642668?v=3","gravatar_id":"","url":"https://api.github.com/users/bartonjs","html_url":"https://github.com/bartonjs","followers_url":"https://api.github.com/users/bartonjs/followers","following_url":"https://api.github.com/users/bartonjs/following{/other_user}","gists_url":"https://api.github.com/users/bartonjs/gists{/gist_id}","starred_url":"https://api.github.com/users/bartonjs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bartonjs/subscriptions","organizations_url":"https://api.github.com/users/bartonjs/orgs","repos_url":"https://api.github.com/users/bartonjs/repos","events_url":"https://api.github.com/users/bartonjs/events{/privacy}","received_events_url":"https://api.github.com/users/bartonjs/received_events","type":"User","site_admin":false},"body":"This was identified as a coverage delta from ToF (#6454).  During the development of the test it discovered an inconsistency in X509Chain between Windows and Unix regarding not-yet-valid CRLs.  Since that inconsistency resulted in X509Chain.Build returning `true` (success) on Windows but `false` (failure) on Unix for the same inputs it is also changed in this PR.\r\n\r\ncc: @stephentoub @AtsushiKan @morganbr \r\n\r\n### Add an Online revocation mode test\r\n\r\nThis test may result in contacting the network to download a CRL, or\r\nintermediate certificates, so it is being confined to OuterLoop.\r\n\r\nThis doesn't test that revocation actually works.  Unfortunately that is hard to\r\nbuild into a unit test due to the non-constant nature of time: once a certificate\r\nhas gone out of validity a CA has no obligation (other than their own policy)\r\nto keep a revoked certificate on the CRL.\r\n\r\nThe best way to write such a test is to use a live source of truth for a revoked\r\ncertificate; but the notion of \"live\" is subject to change.\r\n\r\nAn alternate mechanism would be to create a private CA with an\r\nunfathomably large expiration time, issue and subsequently revoke a\r\ncertificate, and use that certificate, CA, and published CDP as a controlled\r\nportion of the test.  Such an infrastructure dependency is beyond the scope\r\nof this change (and would still fail for very old snapshots given enough time).\r\n\r\n### Make Unix X509Chain match Windows behaviors on NotYetValid CRLs\r\n\r\nWindows X509Chain reports no error when the cached-or-downloaded CRL\r\nhas a thisUpdate value in the future (as compared to the VerificationTime value).\r\nUnix X509Chain did report this as an error, because OpenSSL emits it as a chain\r\nprocessing error.\r\n\r\nThe solution is simply to ignore X509_V_CRL_NOT_YET_VALID, and let other\r\npotential issues continue to be raised.","created_at":"2016-03-30T22:32:35Z","updated_at":"2016-03-31T17:39:53Z","closed_at":null,"merged_at":null,"merge_commit_sha":"201eddd0843044f9725751d0cef79fcf26232703","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/dotnet/corefx/pulls/7366/commits","review_comments_url":"https://api.github.com/repos/dotnet/corefx/pulls/7366/comments","review_comment_url":"https://api.github.com/repos/dotnet/corefx/pulls/comments{/number}","comments_url":"https://api.github.com/repos/dotnet/corefx/issues/7366/comments","statuses_url":"https://api.github.com/repos/dotnet/corefx/statuses/a8d5f01cacc85f84f60a769cde01eb07d87fc641","head":{"label":"bartonjs:x509chain_revocation_tests","ref":"x509chain_revocation_tests","sha":"a8d5f01cacc85f84f60a769cde01eb07d87fc641","user":{"login":"bartonjs","id":10642668,"avatar_url":"https://avatars.githubusercontent.com/u/10642668?v=3","gravatar_id":"","url":"https://api.github.com/users/bartonjs","html_url":"https://github.com/bartonjs","followers_url":"https://api.github.com/users/bartonjs/followers","following_url":"https://api.github.com/users/bartonjs/following{/other_user}","gists_url":"https://api.github.com/users/bartonjs/gists{/gist_id}","starred_url":"https://api.github.com/users/bartonjs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bartonjs/subscriptions","organizations_url":"https://api.github.com/users/bartonjs/orgs","repos_url":"https://api.github.com/users/bartonjs/repos","events_url":"https://api.github.com/users/bartonjs/events{/privacy}","received_events_url":"https://api.github.com/users/bartonjs/received_events","type":"User","site_admin":false},"repo":{"id":29888389,"name":"corefx","full_name":"bartonjs/corefx","owner":{"login":"bartonjs","id":10642668,"avatar_url":"https://avatars.githubusercontent.com/u/10642668?v=3","gravatar_id":"","url":"https://api.github.com/users/bartonjs","html_url":"https://github.com/bartonjs","followers_url":"https://api.github.com/users/bartonjs/followers","following_url":"https://api.github.com/users/bartonjs/following{/other_user}","gists_url":"https://api.github.com/users/bartonjs/gists{/gist_id}","starred_url":"https://api.github.com/users/bartonjs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bartonjs/subscriptions","organizations_url":"https://api.github.com/users/bartonjs/orgs","repos_url":"https://api.github.com/users/bartonjs/repos","events_url":"https://api.github.com/users/bartonjs/events{/privacy}","received_events_url":"https://api.github.com/users/bartonjs/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/bartonjs/corefx","description":"This repository contains the foundational libraries that make up the .NET Core development stack.","fork":true,"url":"https://api.github.com/repos/bartonjs/corefx","forks_url":"https://api.github.com/repos/bartonjs/corefx/forks","keys_url":"https://api.github.com/repos/bartonjs/corefx/keys{/key_id}","collaborators_url":"https://api.github.com/repos/bartonjs/corefx/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/bartonjs/corefx/teams","hooks_url":"https://api.github.com/repos/bartonjs/corefx/hooks","issue_events_url":"https://api.github.com/repos/bartonjs/corefx/issues/events{/number}","events_url":"https://api.github.com/repos/bartonjs/corefx/events","assignees_url":"https://api.github.com/repos/bartonjs/corefx/assignees{/user}","branches_url":"https://api.github.com/repos/bartonjs/corefx/branches{/branch}","tags_url":"https://api.github.com/repos/bartonjs/corefx/tags","blobs_url":"https://api.github.com/repos/bartonjs/corefx/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/bartonjs/corefx/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/bartonjs/corefx/git/refs{/sha}","trees_url":"https://api.github.com/repos/bartonjs/corefx/git/trees{/sha}","statuses_url":"https://api.github.com/repos/bartonjs/corefx/statuses/{sha}","languages_url":"https://api.github.com/repos/bartonjs/corefx/languages","stargazers_url":"https://api.github.com/repos/bartonjs/corefx/stargazers","contributors_url":"https://api.github.com/repos/bartonjs/corefx/contributors","subscribers_url":"https://api.github.com/repos/bartonjs/corefx/subscribers","subscription_url":"https://api.github.com/repos/bartonjs/corefx/subscription","commits_url":"https://api.github.com/repos/bartonjs/corefx/commits{/sha}","git_commits_url":"https://api.github.com/repos/bartonjs/corefx/git/commits{/sha}","comments_url":"https://api.github.com/repos/bartonjs/corefx/comments{/number}","issue_comment_url":"https://api.github.com/repos/bartonjs/corefx/issues/comments{/number}","contents_url":"https://api.github.com/repos/bartonjs/corefx/contents/{+path}","compare_url":"https://api.github.com/repos/bartonjs/corefx/compare/{base}...{head}","merges_url":"https://api.github.com/repos/bartonjs/corefx/merges","archive_url":"https://api.github.com/repos/bartonjs/corefx/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/bartonjs/corefx/downloads","issues_url":"https://api.github.com/repos/bartonjs/corefx/issues{/number}","pulls_url":"https://api.github.com/repos/bartonjs/corefx/pulls{/number}","milestones_url":"https://api.github.com/repos/bartonjs/corefx/milestones{/number}","notifications_url":"https://api.github.com/repos/bartonjs/corefx/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/bartonjs/corefx/labels{/name}","releases_url":"https://api.github.com/repos/bartonjs/corefx/releases{/id}","deployments_url":"https://api.github.com/repos/bartonjs/corefx/deployments","created_at":"2015-01-26T23:55:53Z","updated_at":"2016-01-18T16:14:34Z","pushed_at":"2016-03-31T17:38:13Z","git_url":"git://github.com/bartonjs/corefx.git","ssh_url":"git@github.com:bartonjs/corefx.git","clone_url":"https://github.com/bartonjs/corefx.git","svn_url":"https://github.com/bartonjs/corefx","homepage":"","size":61013,"stargazers_count":0,"watchers_count":0,"language":"C#","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"dotnet:master","ref":"master","sha":"61bb1b9ef016e76cfffdd3f4f5da9c65a65aa95b","user":{"login":"dotnet","id":9141961,"avatar_url":"https://avatars.githubusercontent.com/u/9141961?v=3","gravatar_id":"","url":"https://api.github.com/users/dotnet","html_url":"https://github.com/dotnet","followers_url":"https://api.github.com/users/dotnet/followers","following_url":"https://api.github.com/users/dotnet/following{/other_user}","gists_url":"https://api.github.com/users/dotnet/gists{/gist_id}","starred_url":"https://api.github.com/users/dotnet/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dotnet/subscriptions","organizations_url":"https://api.github.com/users/dotnet/orgs","repos_url":"https://api.github.com/users/dotnet/repos","events_url":"https://api.github.com/users/dotnet/events{/privacy}","received_events_url":"https://api.github.com/users/dotnet/received_events","type":"Organization","site_admin":false},"repo":{"id":26295345,"name":"corefx","full_name":"dotnet/corefx","owner":{"login":"dotnet","id":9141961,"avatar_url":"https://avatars.githubusercontent.com/u/9141961?v=3","gravatar_id":"","url":"https://api.github.com/users/dotnet","html_url":"https://github.com/dotnet","followers_url":"https://api.github.com/users/dotnet/followers","following_url":"https://api.github.com/users/dotnet/following{/other_user}","gists_url":"https://api.github.com/users/dotnet/gists{/gist_id}","starred_url":"https://api.github.com/users/dotnet/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dotnet/subscriptions","organizations_url":"https://api.github.com/users/dotnet/orgs","repos_url":"https://api.github.com/users/dotnet/repos","events_url":"https://api.github.com/users/dotnet/events{/privacy}","received_events_url":"https://api.github.com/users/dotnet/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/dotnet/corefx","description":"This repo contains the .NET Core foundational libraries, called CoreFX. It includes classes for collections, file systems, console, XML, async and many others.","fork":false,"url":"https://api.github.com/repos/dotnet/corefx","forks_url":"https://api.github.com/repos/dotnet/corefx/forks","keys_url":"https://api.github.com/repos/dotnet/corefx/keys{/key_id}","collaborators_url":"https://api.github.com/repos/dotnet/corefx/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/dotnet/corefx/teams","hooks_url":"https://api.github.com/repos/dotnet/corefx/hooks","issue_events_url":"https://api.github.com/repos/dotnet/corefx/issues/events{/number}","events_url":"https://api.github.com/repos/dotnet/corefx/events","assignees_url":"https://api.github.com/repos/dotnet/corefx/assignees{/user}","branches_url":"https://api.github.com/repos/dotnet/corefx/branches{/branch}","tags_url":"https://api.github.com/repos/dotnet/corefx/tags","blobs_url":"https://api.github.com/repos/dotnet/corefx/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/dotnet/corefx/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/dotnet/corefx/git/refs{/sha}","trees_url":"https://api.github.com/repos/dotnet/corefx/git/trees{/sha}","statuses_url":"https://api.github.com/repos/dotnet/corefx/statuses/{sha}","languages_url":"https://api.github.com/repos/dotnet/corefx/languages","stargazers_url":"https://api.github.com/repos/dotnet/corefx/stargazers","contributors_url":"https://api.github.com/repos/dotnet/corefx/contributors","subscribers_url":"https://api.github.com/repos/dotnet/corefx/subscribers","subscription_url":"https://api.github.com/repos/dotnet/corefx/subscription","commits_url":"https://api.github.com/repos/dotnet/corefx/commits{/sha}","git_commits_url":"https://api.github.com/repos/dotnet/corefx/git/commits{/sha}","comments_url":"https://api.github.com/repos/dotnet/corefx/comments{/number}","issue_comment_url":"https://api.github.com/repos/dotnet/corefx/issues/comments{/number}","contents_url":"https://api.github.com/repos/dotnet/corefx/contents/{+path}","compare_url":"https://api.github.com/repos/dotnet/corefx/compare/{base}...{head}","merges_url":"https://api.github.com/repos/dotnet/corefx/merges","archive_url":"https://api.github.com/repos/dotnet/corefx/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/dotnet/corefx/downloads","issues_url":"https://api.github.com/repos/dotnet/corefx/issues{/number}","pulls_url":"https://api.github.com/repos/dotnet/corefx/pulls{/number}","milestones_url":"https://api.github.com/repos/dotnet/corefx/milestones{/number}","notifications_url":"https://api.github.com/repos/dotnet/corefx/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/dotnet/corefx/labels{/name}","releases_url":"https://api.github.com/repos/dotnet/corefx/releases{/id}","deployments_url":"https://api.github.com/repos/dotnet/corefx/deployments","created_at":"2014-11-06T23:42:48Z","updated_at":"2016-03-31T17:29:47Z","pushed_at":"2016-03-31T17:38:14Z","git_url":"git://github.com/dotnet/corefx.git","ssh_url":"git@github.com:dotnet/corefx.git","clone_url":"https://github.com/dotnet/corefx.git","svn_url":"https://github.com/dotnet/corefx","homepage":"http://dotnet.github.io/","size":83842,"stargazers_count":9402,"watchers_count":9402,"language":"C#","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":2212,"mirror_url":null,"open_issues_count":938,"forks":2212,"open_issues":938,"watchers":9402,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/dotnet/corefx/pulls/7366"},"html":{"href":"https://github.com/dotnet/corefx/pull/7366"},"issue":{"href":"https://api.github.com/repos/dotnet/corefx/issues/7366"},"comments":{"href":"https://api.github.com/repos/dotnet/corefx/issues/7366/comments"},"review_comments":{"href":"https://api.github.com/repos/dotnet/corefx/pulls/7366/comments"},"review_comment":{"href":"https://api.github.com/repos/dotnet/corefx/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/dotnet/corefx/pulls/7366/commits"},"statuses":{"href":"https://api.github.com/repos/dotnet/corefx/statuses/a8d5f01cacc85f84f60a769cde01eb07d87fc641"}}}}