{"action":"created","comment":{"url":"https://api.github.com/repos/dotnet/corefx/pulls/comments/39350374","id":39350374,"diff_hunk":"@@ -0,0 +1,873 @@\n+// Copyright (c) Microsoft. All rights reserved.\n+// Licensed under the MIT license. See LICENSE file in the project root for full license information.\n+\n+using System.Runtime.InteropServices;\n+using System.ComponentModel;\n+using System.Globalization;\n+using System.Net.Security;\n+\n+namespace System.Net\n+{\n+    internal static class SSPIWrapper\n+    {\n+        internal static SecurityPackageInfoClass[] EnumerateSecurityPackages(SSPIInterface SecModule)\n+        {\n+            GlobalLog.Enter(\"EnumerateSecurityPackages\");\n+            if (SecModule.SecurityPackages == null)\n+            {\n+                lock (SecModule)\n+                {\n+                    if (SecModule.SecurityPackages == null)\n+                    {\n+                        int moduleCount = 0;\n+                        SafeFreeContextBuffer arrayBaseHandle = null;\n+                        try\n+                        {\n+                            int errorCode = SecModule.EnumerateSecurityPackages(out moduleCount, out arrayBaseHandle);\n+                            GlobalLog.Print(\"SSPIWrapper::arrayBase: \" + (arrayBaseHandle.DangerousGetHandle().ToString(\"x\")));\n+                            if (errorCode != 0)\n+                            {\n+                                throw new Win32Exception(errorCode);\n+                            }\n+                            SecurityPackageInfoClass[] securityPackages = new SecurityPackageInfoClass[moduleCount];\n+                            if (Logging.On) Logging.PrintInfo(Logging.Web, SR.net_log_sspi_enumerating_security_packages);\n+                            int i;\n+                            for (i = 0; i < moduleCount; i++)\n+                            {\n+                                securityPackages[i] = new SecurityPackageInfoClass(arrayBaseHandle, i);\n+                                if (Logging.On) Logging.PrintInfo(Logging.Web, \"    \" + securityPackages[i].Name);\n+                            }\n+                            SecModule.SecurityPackages = securityPackages;\n+                        }\n+                        finally\n+                        {\n+                            if (arrayBaseHandle != null)\n+                            {\n+                                arrayBaseHandle.Dispose();\n+                            }\n+                        }\n+                    }\n+                }\n+            }\n+            GlobalLog.Leave(\"EnumerateSecurityPackages\");\n+            return SecModule.SecurityPackages;\n+        }\n+\n+        internal static SecurityPackageInfoClass GetVerifyPackageInfo(SSPIInterface secModule, string packageName)\n+        {\n+            return GetVerifyPackageInfo(secModule, packageName, false);\n+        }\n+\n+        internal static SecurityPackageInfoClass GetVerifyPackageInfo(SSPIInterface secModule, string packageName, bool throwIfMissing)\n+        {\n+            SecurityPackageInfoClass[] supportedSecurityPackages = EnumerateSecurityPackages(secModule);\n+            if (supportedSecurityPackages != null)\n+            {\n+                for (int i = 0; i < supportedSecurityPackages.Length; i++)\n+                {\n+                    if (string.Compare(supportedSecurityPackages[i].Name, packageName, StringComparison.OrdinalIgnoreCase) == 0)\n+                    {\n+                        return supportedSecurityPackages[i];\n+                    }\n+                }\n+            }\n+\n+            if (Logging.On) Logging.PrintInfo(Logging.Web, SR.Format(SR.net_log_sspi_security_package_not_found, packageName));","path":"src/System.Net.Security/src/System/Net/_SSPIWrapper.cs","position":75,"original_position":75,"commit_id":"7261d4b1ab0e6fee20585d58b2b9cc1b82db72c1","original_commit_id":"7261d4b1ab0e6fee20585d58b2b9cc1b82db72c1","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":"Style: Unbraced ifs should still have the body on the next line, indented.","created_at":"2015-09-13T18:27:53Z","updated_at":"2015-09-13T18:27:53Z","html_url":"https://github.com/dotnet/corefx/pull/3113#discussion_r39350374","pull_request_url":"https://api.github.com/repos/dotnet/corefx/pulls/3113","_links":{"self":{"href":"https://api.github.com/repos/dotnet/corefx/pulls/comments/39350374"},"html":{"href":"https://github.com/dotnet/corefx/pull/3113#discussion_r39350374"},"pull_request":{"href":"https://api.github.com/repos/dotnet/corefx/pulls/3113"}}},"pull_request":{"url":"https://api.github.com/repos/dotnet/corefx/pulls/3113","id":44380670,"html_url":"https://github.com/dotnet/corefx/pull/3113","diff_url":"https://github.com/dotnet/corefx/pull/3113.diff","patch_url":"https://github.com/dotnet/corefx/pull/3113.patch","issue_url":"https://api.github.com/repos/dotnet/corefx/issues/3113","number":3113,"state":"open","locked":false,"title":"Porting System.Net.Security","user":{"login":"CIPop","id":8635911,"avatar_url":"https://avatars.githubusercontent.com/u/8635911?v=3","gravatar_id":"","url":"https://api.github.com/users/CIPop","html_url":"https://github.com/CIPop","followers_url":"https://api.github.com/users/CIPop/followers","following_url":"https://api.github.com/users/CIPop/following{/other_user}","gists_url":"https://api.github.com/users/CIPop/gists{/gist_id}","starred_url":"https://api.github.com/users/CIPop/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/CIPop/subscriptions","organizations_url":"https://api.github.com/users/CIPop/orgs","repos_url":"https://api.github.com/users/CIPop/repos","events_url":"https://api.github.com/users/CIPop/events{/privacy}","received_events_url":"https://api.github.com/users/CIPop/received_events","type":"User","site_admin":false},"body":"Missing issues for TODO comments. Will create the tracking issue and update the code, author (dotnetbot) and reference the tracking issue.\r\n\r\n@davidsh @bartonjs @pgavlin @stephentoub @SidharthNabar  PTAL.\r\n","created_at":"2015-09-07T21:59:42Z","updated_at":"2015-09-13T18:27:53Z","closed_at":null,"merged_at":null,"merge_commit_sha":"81e2b5cdd0729b6afbf5fe219e07d9da34dbe61c","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/dotnet/corefx/pulls/3113/commits","review_comments_url":"https://api.github.com/repos/dotnet/corefx/pulls/3113/comments","review_comment_url":"https://api.github.com/repos/dotnet/corefx/pulls/comments{/number}","comments_url":"https://api.github.com/repos/dotnet/corefx/issues/3113/comments","statuses_url":"https://api.github.com/repos/dotnet/corefx/statuses/7261d4b1ab0e6fee20585d58b2b9cc1b82db72c1","head":{"label":"CIPop:SNSecurityPR","ref":"SNSecurityPR","sha":"7261d4b1ab0e6fee20585d58b2b9cc1b82db72c1","user":{"login":"CIPop","id":8635911,"avatar_url":"https://avatars.githubusercontent.com/u/8635911?v=3","gravatar_id":"","url":"https://api.github.com/users/CIPop","html_url":"https://github.com/CIPop","followers_url":"https://api.github.com/users/CIPop/followers","following_url":"https://api.github.com/users/CIPop/following{/other_user}","gists_url":"https://api.github.com/users/CIPop/gists{/gist_id}","starred_url":"https://api.github.com/users/CIPop/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/CIPop/subscriptions","organizations_url":"https://api.github.com/users/CIPop/orgs","repos_url":"https://api.github.com/users/CIPop/repos","events_url":"https://api.github.com/users/CIPop/events{/privacy}","received_events_url":"https://api.github.com/users/CIPop/received_events","type":"User","site_admin":false},"repo":{"id":37789108,"name":"corefx","full_name":"CIPop/corefx","owner":{"login":"CIPop","id":8635911,"avatar_url":"https://avatars.githubusercontent.com/u/8635911?v=3","gravatar_id":"","url":"https://api.github.com/users/CIPop","html_url":"https://github.com/CIPop","followers_url":"https://api.github.com/users/CIPop/followers","following_url":"https://api.github.com/users/CIPop/following{/other_user}","gists_url":"https://api.github.com/users/CIPop/gists{/gist_id}","starred_url":"https://api.github.com/users/CIPop/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/CIPop/subscriptions","organizations_url":"https://api.github.com/users/CIPop/orgs","repos_url":"https://api.github.com/users/CIPop/repos","events_url":"https://api.github.com/users/CIPop/events{/privacy}","received_events_url":"https://api.github.com/users/CIPop/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/CIPop/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":true,"url":"https://api.github.com/repos/CIPop/corefx","forks_url":"https://api.github.com/repos/CIPop/corefx/forks","keys_url":"https://api.github.com/repos/CIPop/corefx/keys{/key_id}","collaborators_url":"https://api.github.com/repos/CIPop/corefx/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/CIPop/corefx/teams","hooks_url":"https://api.github.com/repos/CIPop/corefx/hooks","issue_events_url":"https://api.github.com/repos/CIPop/corefx/issues/events{/number}","events_url":"https://api.github.com/repos/CIPop/corefx/events","assignees_url":"https://api.github.com/repos/CIPop/corefx/assignees{/user}","branches_url":"https://api.github.com/repos/CIPop/corefx/branches{/branch}","tags_url":"https://api.github.com/repos/CIPop/corefx/tags","blobs_url":"https://api.github.com/repos/CIPop/corefx/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/CIPop/corefx/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/CIPop/corefx/git/refs{/sha}","trees_url":"https://api.github.com/repos/CIPop/corefx/git/trees{/sha}","statuses_url":"https://api.github.com/repos/CIPop/corefx/statuses/{sha}","languages_url":"https://api.github.com/repos/CIPop/corefx/languages","stargazers_url":"https://api.github.com/repos/CIPop/corefx/stargazers","contributors_url":"https://api.github.com/repos/CIPop/corefx/contributors","subscribers_url":"https://api.github.com/repos/CIPop/corefx/subscribers","subscription_url":"https://api.github.com/repos/CIPop/corefx/subscription","commits_url":"https://api.github.com/repos/CIPop/corefx/commits{/sha}","git_commits_url":"https://api.github.com/repos/CIPop/corefx/git/commits{/sha}","comments_url":"https://api.github.com/repos/CIPop/corefx/comments{/number}","issue_comment_url":"https://api.github.com/repos/CIPop/corefx/issues/comments{/number}","contents_url":"https://api.github.com/repos/CIPop/corefx/contents/{+path}","compare_url":"https://api.github.com/repos/CIPop/corefx/compare/{base}...{head}","merges_url":"https://api.github.com/repos/CIPop/corefx/merges","archive_url":"https://api.github.com/repos/CIPop/corefx/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/CIPop/corefx/downloads","issues_url":"https://api.github.com/repos/CIPop/corefx/issues{/number}","pulls_url":"https://api.github.com/repos/CIPop/corefx/pulls{/number}","milestones_url":"https://api.github.com/repos/CIPop/corefx/milestones{/number}","notifications_url":"https://api.github.com/repos/CIPop/corefx/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/CIPop/corefx/labels{/name}","releases_url":"https://api.github.com/repos/CIPop/corefx/releases{/id}","created_at":"2015-06-20T23:04:57Z","updated_at":"2015-09-09T08:20:51Z","pushed_at":"2015-09-12T00:36:25Z","git_url":"git://github.com/CIPop/corefx.git","ssh_url":"git@github.com:CIPop/corefx.git","clone_url":"https://github.com/CIPop/corefx.git","svn_url":"https://github.com/CIPop/corefx","homepage":"http://dotnet.github.io/core/","size":32331,"stargazers_count":1,"watchers_count":1,"language":"C#","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":2,"forks":0,"open_issues":2,"watchers":1,"default_branch":"master"}},"base":{"label":"dotnet:master","ref":"master","sha":"f41c09dbb93723d62787e5b3973cd3fc8666fec8","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}","created_at":"2014-11-06T23:42:48Z","updated_at":"2015-09-13T17:57:36Z","pushed_at":"2015-09-13T17:41:06Z","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/core/","size":67217,"stargazers_count":8330,"watchers_count":8330,"language":"C#","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1782,"mirror_url":null,"open_issues_count":604,"forks":1782,"open_issues":604,"watchers":8330,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/dotnet/corefx/pulls/3113"},"html":{"href":"https://github.com/dotnet/corefx/pull/3113"},"issue":{"href":"https://api.github.com/repos/dotnet/corefx/issues/3113"},"comments":{"href":"https://api.github.com/repos/dotnet/corefx/issues/3113/comments"},"review_comments":{"href":"https://api.github.com/repos/dotnet/corefx/pulls/3113/comments"},"review_comment":{"href":"https://api.github.com/repos/dotnet/corefx/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/dotnet/corefx/pulls/3113/commits"},"statuses":{"href":"https://api.github.com/repos/dotnet/corefx/statuses/7261d4b1ab0e6fee20585d58b2b9cc1b82db72c1"}}}}