{"action":"created","issue":{"url":"https://api.github.com/repos/dotnet/corefx/issues/8499","repository_url":"https://api.github.com/repos/dotnet/corefx","labels_url":"https://api.github.com/repos/dotnet/corefx/issues/8499/labels{/name}","comments_url":"https://api.github.com/repos/dotnet/corefx/issues/8499/comments","events_url":"https://api.github.com/repos/dotnet/corefx/issues/8499/events","html_url":"https://github.com/dotnet/corefx/pull/8499","id":154732108,"number":8499,"title":"Deterministically dispose CngKey.Handle values.","user":{"login":"AtsushiKan","id":13223578,"avatar_url":"https://avatars.githubusercontent.com/u/13223578?v=3","gravatar_id":"","url":"https://api.github.com/users/AtsushiKan","html_url":"https://github.com/AtsushiKan","followers_url":"https://api.github.com/users/AtsushiKan/followers","following_url":"https://api.github.com/users/AtsushiKan/following{/other_user}","gists_url":"https://api.github.com/users/AtsushiKan/gists{/gist_id}","starred_url":"https://api.github.com/users/AtsushiKan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/AtsushiKan/subscriptions","organizations_url":"https://api.github.com/users/AtsushiKan/orgs","repos_url":"https://api.github.com/users/AtsushiKan/repos","events_url":"https://api.github.com/users/AtsushiKan/events{/privacy}","received_events_url":"https://api.github.com/users/AtsushiKan/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/dotnet/corefx/labels/2%20-%20In%20Progress","name":"2 - In Progress","color":"CCCCCC"},{"url":"https://api.github.com/repos/dotnet/corefx/labels/cla-already-signed","name":"cla-already-signed","color":"009800"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2016-05-13T14:59:27Z","updated_at":"2016-05-13T14:59:44Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/dotnet/corefx/pulls/8499","html_url":"https://github.com/dotnet/corefx/pull/8499","diff_url":"https://github.com/dotnet/corefx/pull/8499.diff","patch_url":"https://github.com/dotnet/corefx/pull/8499.patch"},"body":"Fixes: https://github.com/dotnet/corefx/issues/6010\r\n\r\nDispose all the handles we're pulling out of CngKey (which\r\nmeans the similarly named helper in Algorithms has to\r\nduplicate the safehandle too since they feed the same\r\nset of source-linked files. So we have to add a light-weight\r\nDuplicateSafeNcryptKeyHandle to go with our light-weight\r\nSafeNcryptKeyHandle.\r\n\r\nLatching the key handle independently of the key is fragile\r\nand tricky, especially with the key management split between\r\nRSA, RSACng and CngAlgorithmCore. It also opens us\r\nup to the \"You forgot that the GC can claim objects\r\nand their fields while one of their instance methods are executing\"\r\nbugs. (In fact, we probably had some of those bugs lurking\r\nnow that this commit fixes.) Not worth it given that we're doing\r\nexpensive crypto algorithms in between."},"comment":{"url":"https://api.github.com/repos/dotnet/corefx/issues/comments/219068761","html_url":"https://github.com/dotnet/corefx/pull/8499#issuecomment-219068761","issue_url":"https://api.github.com/repos/dotnet/corefx/issues/8499","id":219068761,"user":{"login":"AtsushiKan","id":13223578,"avatar_url":"https://avatars.githubusercontent.com/u/13223578?v=3","gravatar_id":"","url":"https://api.github.com/users/AtsushiKan","html_url":"https://github.com/AtsushiKan","followers_url":"https://api.github.com/users/AtsushiKan/followers","following_url":"https://api.github.com/users/AtsushiKan/following{/other_user}","gists_url":"https://api.github.com/users/AtsushiKan/gists{/gist_id}","starred_url":"https://api.github.com/users/AtsushiKan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/AtsushiKan/subscriptions","organizations_url":"https://api.github.com/users/AtsushiKan/orgs","repos_url":"https://api.github.com/users/AtsushiKan/repos","events_url":"https://api.github.com/users/AtsushiKan/events{/privacy}","received_events_url":"https://api.github.com/users/AtsushiKan/received_events","type":"User","site_admin":false},"created_at":"2016-05-13T14:59:44Z","updated_at":"2016-05-13T14:59:44Z","body":"cc @bartonjs \r\n"}}