{"action":"created","comment":{"url":"https://api.github.com/repos/dotnet/corefx/pulls/comments/192837731","pull_request_review_id":125691142,"id":192837731,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDE5MjgzNzczMQ==","diff_hunk":"@@ -177,9 +178,36 @@ internal sealed partial class ManagedPkcsPal : PkcsPal\n                 if (contentInfo.ContentType.Value == Oids.Pkcs7Data)\n                 {\n                     toEncrypt = EncodeOctetString(toEncrypt);\n+                    return encryptor.OneShot(toEncrypt);\n+                }\n+                else\n+                {\n+                    using (MemoryStream memoryStream = new MemoryStream())\n+                    {\n+                        using (var cryptoStream = new CryptoStream(memoryStream, encryptor, CryptoStreamMode.Write))","path":"src/System.Security.Cryptography.Pkcs/src/Internal/Cryptography/Pal/AnyOS/ManagedPal.Encrypt.cs","position":18,"original_position":18,"commit_id":"a576ac90be7ebf8270cd5418e31053d460ae9bd8","original_commit_id":"27ba447cf226feecbd051cda5ca6fc67585e34da","user":{"login":"bartonjs","id":10642668,"node_id":"MDQ6VXNlcjEwNjQyNjY4","avatar_url":"https://avatars3.githubusercontent.com/u/10642668?v=4","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":"Actually, it looks like this is just trying to do `reader.PeekContentBytes()`.  And I think Windows might not care that the outer tag is SEQUENCE.\r\n\r\nLooks like this passes on Windows:\r\n\r\n```C#\r\nContentInfo content = new ContentInfo(\r\n    new Oid(Oids.Pkcs7Enveloped),\r\n    \"0403010203\".HexToByteArray());\r\n\r\nEnvelopedCms cms = new EnvelopedCms(content);\r\n\r\nusing (X509Certificate2 cert = Certificates.RSAKeyTransferCapi1.TryGetCertificateWithPrivateKey())\r\n{\r\n    cms.Encrypt(new CmsRecipient(cert));\r\n    byte[] temp = cms.Encode();\r\n\r\n    // Double checking.\r\n    cms = new EnvelopedCms();\r\n    cms.Decode(temp);\r\n    cms.Decrypt(new X509Certificate2Collection(cert));\r\n}\r\n\r\nAssert.Equal(\"3003010203\", cms.ContentInfo.Content.ByteArrayToHex());\r\n```\r\n\r\nI don't know that I agree with it passing, but since we're making a compat fix, we should be compatible.","created_at":"2018-06-04T18:28:24Z","updated_at":"2018-06-04T18:28:25Z","html_url":"https://github.com/dotnet/corefx/pull/29926#discussion_r192837731","pull_request_url":"https://api.github.com/repos/dotnet/corefx/pulls/29926","author_association":"MEMBER","_links":{"self":{"href":"https://api.github.com/repos/dotnet/corefx/pulls/comments/192837731"},"html":{"href":"https://github.com/dotnet/corefx/pull/29926#discussion_r192837731"},"pull_request":{"href":"https://api.github.com/repos/dotnet/corefx/pulls/29926"}},"in_reply_to_id":191039655},"pull_request":{"url":"https://api.github.com/repos/dotnet/corefx/pulls/29926","id":190680920,"node_id":"MDExOlB1bGxSZXF1ZXN0MTkwNjgwOTIw","html_url":"https://github.com/dotnet/corefx/pull/29926","diff_url":"https://github.com/dotnet/corefx/pull/29926.diff","patch_url":"https://github.com/dotnet/corefx/pull/29926.patch","issue_url":"https://api.github.com/repos/dotnet/corefx/issues/29926","number":29926,"state":"open","locked":false,"title":"Allow EnvelopedCms to round-trip correctly cross platform when ContentInfo is not Pkcs7Data","user":{"login":"krwq","id":660048,"node_id":"MDQ6VXNlcjY2MDA0OA==","avatar_url":"https://avatars1.githubusercontent.com/u/660048?v=4","gravatar_id":"","url":"https://api.github.com/users/krwq","html_url":"https://github.com/krwq","followers_url":"https://api.github.com/users/krwq/followers","following_url":"https://api.github.com/users/krwq/following{/other_user}","gists_url":"https://api.github.com/users/krwq/gists{/gist_id}","starred_url":"https://api.github.com/users/krwq/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/krwq/subscriptions","organizations_url":"https://api.github.com/users/krwq/orgs","repos_url":"https://api.github.com/users/krwq/repos","events_url":"https://api.github.com/users/krwq/events{/privacy}","received_events_url":"https://api.github.com/users/krwq/received_events","type":"User","site_admin":false},"body":"Fixes https://github.com/dotnet/corefx/issues/29825\r\n\r\nThis might need to wait until @bartonjs is back from vacation.\r\n\r\nWe should consider this for 2.1.1 because documents encoded on non-Windows platforms with EnvelopedCms which have ContentInfo Oid different than `1.2.840.113549.1.7.1` will not roundtrip correctly cross platform. Any currently existing document encoded in such way will have additional DER \"Sequence\" prefix (0x30, `<length>`) after decryption","created_at":"2018-05-25T19:54:32Z","updated_at":"2018-06-04T18:28:25Z","closed_at":null,"merged_at":null,"merge_commit_sha":"022a0345769dabfa26d3b7e1208def94fe90a641","assignee":{"login":"krwq","id":660048,"node_id":"MDQ6VXNlcjY2MDA0OA==","avatar_url":"https://avatars1.githubusercontent.com/u/660048?v=4","gravatar_id":"","url":"https://api.github.com/users/krwq","html_url":"https://github.com/krwq","followers_url":"https://api.github.com/users/krwq/followers","following_url":"https://api.github.com/users/krwq/following{/other_user}","gists_url":"https://api.github.com/users/krwq/gists{/gist_id}","starred_url":"https://api.github.com/users/krwq/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/krwq/subscriptions","organizations_url":"https://api.github.com/users/krwq/orgs","repos_url":"https://api.github.com/users/krwq/repos","events_url":"https://api.github.com/users/krwq/events{/privacy}","received_events_url":"https://api.github.com/users/krwq/received_events","type":"User","site_admin":false},"assignees":[{"login":"krwq","id":660048,"node_id":"MDQ6VXNlcjY2MDA0OA==","avatar_url":"https://avatars1.githubusercontent.com/u/660048?v=4","gravatar_id":"","url":"https://api.github.com/users/krwq","html_url":"https://github.com/krwq","followers_url":"https://api.github.com/users/krwq/followers","following_url":"https://api.github.com/users/krwq/following{/other_user}","gists_url":"https://api.github.com/users/krwq/gists{/gist_id}","starred_url":"https://api.github.com/users/krwq/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/krwq/subscriptions","organizations_url":"https://api.github.com/users/krwq/orgs","repos_url":"https://api.github.com/users/krwq/repos","events_url":"https://api.github.com/users/krwq/events{/privacy}","received_events_url":"https://api.github.com/users/krwq/received_events","type":"User","site_admin":false}],"requested_reviewers":[{"login":"GrabYourPitchforks","id":1746272,"node_id":"MDQ6VXNlcjE3NDYyNzI=","avatar_url":"https://avatars0.githubusercontent.com/u/1746272?v=4","gravatar_id":"","url":"https://api.github.com/users/GrabYourPitchforks","html_url":"https://github.com/GrabYourPitchforks","followers_url":"https://api.github.com/users/GrabYourPitchforks/followers","following_url":"https://api.github.com/users/GrabYourPitchforks/following{/other_user}","gists_url":"https://api.github.com/users/GrabYourPitchforks/gists{/gist_id}","starred_url":"https://api.github.com/users/GrabYourPitchforks/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/GrabYourPitchforks/subscriptions","organizations_url":"https://api.github.com/users/GrabYourPitchforks/orgs","repos_url":"https://api.github.com/users/GrabYourPitchforks/repos","events_url":"https://api.github.com/users/GrabYourPitchforks/events{/privacy}","received_events_url":"https://api.github.com/users/GrabYourPitchforks/received_events","type":"User","site_admin":false},{"login":"morganbr","id":11641665,"node_id":"MDQ6VXNlcjExNjQxNjY1","avatar_url":"https://avatars1.githubusercontent.com/u/11641665?v=4","gravatar_id":"","url":"https://api.github.com/users/morganbr","html_url":"https://github.com/morganbr","followers_url":"https://api.github.com/users/morganbr/followers","following_url":"https://api.github.com/users/morganbr/following{/other_user}","gists_url":"https://api.github.com/users/morganbr/gists{/gist_id}","starred_url":"https://api.github.com/users/morganbr/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/morganbr/subscriptions","organizations_url":"https://api.github.com/users/morganbr/orgs","repos_url":"https://api.github.com/users/morganbr/repos","events_url":"https://api.github.com/users/morganbr/events{/privacy}","received_events_url":"https://api.github.com/users/morganbr/received_events","type":"User","site_admin":false}],"requested_teams":[],"labels":[{"id":934119903,"node_id":"MDU6TGFiZWw5MzQxMTk5MDM=","url":"https://api.github.com/repos/dotnet/corefx/labels/Servicing-Consider-2.1.1","name":"Servicing-Consider-2.1.1","color":"bfd4f2","default":false},{"id":163633782,"node_id":"MDU6TGFiZWwxNjM2MzM3ODI=","url":"https://api.github.com/repos/dotnet/corefx/labels/area-System.Security","name":"area-System.Security","color":"d4c5f9","default":false}],"milestone":null,"commits_url":"https://api.github.com/repos/dotnet/corefx/pulls/29926/commits","review_comments_url":"https://api.github.com/repos/dotnet/corefx/pulls/29926/comments","review_comment_url":"https://api.github.com/repos/dotnet/corefx/pulls/comments{/number}","comments_url":"https://api.github.com/repos/dotnet/corefx/issues/29926/comments","statuses_url":"https://api.github.com/repos/dotnet/corefx/statuses/a576ac90be7ebf8270cd5418e31053d460ae9bd8","head":{"label":"krwq:fix_29825_ecms_xplat_roundtripping","ref":"fix_29825_ecms_xplat_roundtripping","sha":"a576ac90be7ebf8270cd5418e31053d460ae9bd8","user":{"login":"krwq","id":660048,"node_id":"MDQ6VXNlcjY2MDA0OA==","avatar_url":"https://avatars1.githubusercontent.com/u/660048?v=4","gravatar_id":"","url":"https://api.github.com/users/krwq","html_url":"https://github.com/krwq","followers_url":"https://api.github.com/users/krwq/followers","following_url":"https://api.github.com/users/krwq/following{/other_user}","gists_url":"https://api.github.com/users/krwq/gists{/gist_id}","starred_url":"https://api.github.com/users/krwq/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/krwq/subscriptions","organizations_url":"https://api.github.com/users/krwq/orgs","repos_url":"https://api.github.com/users/krwq/repos","events_url":"https://api.github.com/users/krwq/events{/privacy}","received_events_url":"https://api.github.com/users/krwq/received_events","type":"User","site_admin":false},"repo":{"id":26556399,"node_id":"MDEwOlJlcG9zaXRvcnkyNjU1NjM5OQ==","name":"corefx","full_name":"krwq/corefx","owner":{"login":"krwq","id":660048,"node_id":"MDQ6VXNlcjY2MDA0OA==","avatar_url":"https://avatars1.githubusercontent.com/u/660048?v=4","gravatar_id":"","url":"https://api.github.com/users/krwq","html_url":"https://github.com/krwq","followers_url":"https://api.github.com/users/krwq/followers","following_url":"https://api.github.com/users/krwq/following{/other_user}","gists_url":"https://api.github.com/users/krwq/gists{/gist_id}","starred_url":"https://api.github.com/users/krwq/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/krwq/subscriptions","organizations_url":"https://api.github.com/users/krwq/orgs","repos_url":"https://api.github.com/users/krwq/repos","events_url":"https://api.github.com/users/krwq/events{/privacy}","received_events_url":"https://api.github.com/users/krwq/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/krwq/corefx","description":"This repository contains the foundational libraries that make up the .NET Core development stack.","fork":true,"url":"https://api.github.com/repos/krwq/corefx","forks_url":"https://api.github.com/repos/krwq/corefx/forks","keys_url":"https://api.github.com/repos/krwq/corefx/keys{/key_id}","collaborators_url":"https://api.github.com/repos/krwq/corefx/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/krwq/corefx/teams","hooks_url":"https://api.github.com/repos/krwq/corefx/hooks","issue_events_url":"https://api.github.com/repos/krwq/corefx/issues/events{/number}","events_url":"https://api.github.com/repos/krwq/corefx/events","assignees_url":"https://api.github.com/repos/krwq/corefx/assignees{/user}","branches_url":"https://api.github.com/repos/krwq/corefx/branches{/branch}","tags_url":"https://api.github.com/repos/krwq/corefx/tags","blobs_url":"https://api.github.com/repos/krwq/corefx/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/krwq/corefx/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/krwq/corefx/git/refs{/sha}","trees_url":"https://api.github.com/repos/krwq/corefx/git/trees{/sha}","statuses_url":"https://api.github.com/repos/krwq/corefx/statuses/{sha}","languages_url":"https://api.github.com/repos/krwq/corefx/languages","stargazers_url":"https://api.github.com/repos/krwq/corefx/stargazers","contributors_url":"https://api.github.com/repos/krwq/corefx/contributors","subscribers_url":"https://api.github.com/repos/krwq/corefx/subscribers","subscription_url":"https://api.github.com/repos/krwq/corefx/subscription","commits_url":"https://api.github.com/repos/krwq/corefx/commits{/sha}","git_commits_url":"https://api.github.com/repos/krwq/corefx/git/commits{/sha}","comments_url":"https://api.github.com/repos/krwq/corefx/comments{/number}","issue_comment_url":"https://api.github.com/repos/krwq/corefx/issues/comments{/number}","contents_url":"https://api.github.com/repos/krwq/corefx/contents/{+path}","compare_url":"https://api.github.com/repos/krwq/corefx/compare/{base}...{head}","merges_url":"https://api.github.com/repos/krwq/corefx/merges","archive_url":"https://api.github.com/repos/krwq/corefx/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/krwq/corefx/downloads","issues_url":"https://api.github.com/repos/krwq/corefx/issues{/number}","pulls_url":"https://api.github.com/repos/krwq/corefx/pulls{/number}","milestones_url":"https://api.github.com/repos/krwq/corefx/milestones{/number}","notifications_url":"https://api.github.com/repos/krwq/corefx/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/krwq/corefx/labels{/name}","releases_url":"https://api.github.com/repos/krwq/corefx/releases{/id}","deployments_url":"https://api.github.com/repos/krwq/corefx/deployments","created_at":"2014-11-12T21:11:44Z","updated_at":"2016-10-24T18:54:42Z","pushed_at":"2018-05-29T17:11:40Z","git_url":"git://github.com/krwq/corefx.git","ssh_url":"git@github.com:krwq/corefx.git","clone_url":"https://github.com/krwq/corefx.git","svn_url":"https://github.com/krwq/corefx","homepage":"","size":173414,"stargazers_count":0,"watchers_count":0,"language":"C#","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":{"key":"other","name":"Other","spdx_id":null,"url":null,"node_id":"MDc6TGljZW5zZTA="},"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"dotnet:master","ref":"master","sha":"a9ddb9bea36758af6de04cc3b38c4f1ee863b23a","user":{"login":"dotnet","id":9141961,"node_id":"MDEyOk9yZ2FuaXphdGlvbjkxNDE5NjE=","avatar_url":"https://avatars0.githubusercontent.com/u/9141961?v=4","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,"node_id":"MDEwOlJlcG9zaXRvcnkyNjI5NTM0NQ==","name":"corefx","full_name":"dotnet/corefx","owner":{"login":"dotnet","id":9141961,"node_id":"MDEyOk9yZ2FuaXphdGlvbjkxNDE5NjE=","avatar_url":"https://avatars0.githubusercontent.com/u/9141961?v=4","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. We welcome contributions.","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":"2018-06-04T17:50:03Z","pushed_at":"2018-06-04T18:24:42Z","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":"https://github.com/dotnet/core","size":178557,"stargazers_count":14085,"watchers_count":14085,"language":"C#","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":4083,"mirror_url":null,"archived":false,"open_issues_count":2267,"license":{"key":"other","name":"Other","spdx_id":null,"url":null,"node_id":"MDc6TGljZW5zZTA="},"forks":4083,"open_issues":2267,"watchers":14085,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/dotnet/corefx/pulls/29926"},"html":{"href":"https://github.com/dotnet/corefx/pull/29926"},"issue":{"href":"https://api.github.com/repos/dotnet/corefx/issues/29926"},"comments":{"href":"https://api.github.com/repos/dotnet/corefx/issues/29926/comments"},"review_comments":{"href":"https://api.github.com/repos/dotnet/corefx/pulls/29926/comments"},"review_comment":{"href":"https://api.github.com/repos/dotnet/corefx/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/dotnet/corefx/pulls/29926/commits"},"statuses":{"href":"https://api.github.com/repos/dotnet/corefx/statuses/a576ac90be7ebf8270cd5418e31053d460ae9bd8"}},"author_association":"MEMBER"}}
{"actor":{"display_login":"bartonjs"}}