{"action":"created","comment":{"url":"https://api.github.com/repos/ARMmbed/mbedtls/pulls/comments/281524841","pull_request_review_id":234379550,"id":281524841,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDI4MTUyNDg0MQ==","diff_hunk":"@@ -501,6 +501,22 @@ int mbedtls_x509_crt_verify_restartable( mbedtls_x509_crt *crt,\n                      void *p_vrfy,\n                      mbedtls_x509_crt_restart_ctx *rs_ctx );\n \n+/**\n+ * \\brief          Sort the server cert chain to handle potentially extraneous certificates and arbitrary orderings.\n+ *                 For more detail pelease check https://tools.ietf.org/id/draft-ietf-tls-tls13-23.html#certificate.\n+ *\n+ * \\note           From https://tools.ietf.org/id/draft-ietf-tls-tls13-23.html#certificate\n+ *                 Prior to TLS 1.3, \"certificate_list\" ordering required each certificate to certify the one immediately\n+ *                 preceding it; however, some implementations allowed some flexibility. Servers sometimes send both a\n+ *                 current and deprecated intermediate for transitional purposes, and others are simply configured incorrectly,\n+ *                 but these cases can nonetheless be validated properly. For maximum compatibility,\n+ *                 all implementations SHOULD be prepared to handle potentially extraneous certificates and arbitrary orderings\n+ *                 from any TLS version, with the exception of the end-entity certificate which MUST be first.\n+ *\n+ * \\param chain    a certificate chain to be sorted\n+ */\n+void mbedtls_x509_crt_sort( mbedtls_x509_crt *chain );","path":"include/mbedtls/x509_crt.h","position":18,"original_position":18,"commit_id":"8699fbfb118861cdf63c843c786647918c83b2a1","original_commit_id":"8699fbfb118861cdf63c843c786647918c83b2a1","user":{"login":"hanno-arm","id":26892988,"node_id":"MDQ6VXNlcjI2ODkyOTg4","avatar_url":"https://avatars1.githubusercontent.com/u/26892988?v=4","gravatar_id":"","url":"https://api.github.com/users/hanno-arm","html_url":"https://github.com/hanno-arm","followers_url":"https://api.github.com/users/hanno-arm/followers","following_url":"https://api.github.com/users/hanno-arm/following{/other_user}","gists_url":"https://api.github.com/users/hanno-arm/gists{/gist_id}","starred_url":"https://api.github.com/users/hanno-arm/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hanno-arm/subscriptions","organizations_url":"https://api.github.com/users/hanno-arm/orgs","repos_url":"https://api.github.com/users/hanno-arm/repos","events_url":"https://api.github.com/users/hanno-arm/events{/privacy}","received_events_url":"https://api.github.com/users/hanno-arm/received_events","type":"User","site_admin":false},"body":"What's the rationale for making this part of the public API? I'd expect it to be an internal function only.","created_at":"2019-05-07T08:32:30Z","updated_at":"2019-05-07T08:32:30Z","html_url":"https://github.com/ARMmbed/mbedtls/pull/2491#discussion_r281524841","pull_request_url":"https://api.github.com/repos/ARMmbed/mbedtls/pulls/2491","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/ARMmbed/mbedtls/pulls/comments/281524841"},"html":{"href":"https://github.com/ARMmbed/mbedtls/pull/2491#discussion_r281524841"},"pull_request":{"href":"https://api.github.com/repos/ARMmbed/mbedtls/pulls/2491"}}},"pull_request":{"url":"https://api.github.com/repos/ARMmbed/mbedtls/pulls/2491","id":257805487,"node_id":"MDExOlB1bGxSZXF1ZXN0MjU3ODA1NDg3","html_url":"https://github.com/ARMmbed/mbedtls/pull/2491","diff_url":"https://github.com/ARMmbed/mbedtls/pull/2491.diff","patch_url":"https://github.com/ARMmbed/mbedtls/pull/2491.patch","issue_url":"https://api.github.com/repos/ARMmbed/mbedtls/issues/2491","number":2491,"state":"open","locked":false,"title":"Sort the server cert chain before verify.","user":{"login":"ArthurMa1978","id":20514459,"node_id":"MDQ6VXNlcjIwNTE0NDU5","avatar_url":"https://avatars3.githubusercontent.com/u/20514459?v=4","gravatar_id":"","url":"https://api.github.com/users/ArthurMa1978","html_url":"https://github.com/ArthurMa1978","followers_url":"https://api.github.com/users/ArthurMa1978/followers","following_url":"https://api.github.com/users/ArthurMa1978/following{/other_user}","gists_url":"https://api.github.com/users/ArthurMa1978/gists{/gist_id}","starred_url":"https://api.github.com/users/ArthurMa1978/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ArthurMa1978/subscriptions","organizations_url":"https://api.github.com/users/ArthurMa1978/orgs","repos_url":"https://api.github.com/users/ArthurMa1978/repos","events_url":"https://api.github.com/users/ArthurMa1978/events{/privacy}","received_events_url":"https://api.github.com/users/ArthurMa1978/received_events","type":"User","site_admin":false},"body":"Notes:\r\n* Pull requests cannot be accepted until:\r\n-  The submitter has [accepted the online agreement here with a click through](https://developer.mbed.org/contributor_agreement/) \r\n   or for companies or those that do not wish to create an mbed account, a slightly different agreement can be found [here](https://www.mbed.com/en/about-mbed/contributor-license-agreements/)\r\n- The PR follows the [mbed TLS coding standards](https://tls.mbed.org/kb/development/mbedtls-coding-standards)\r\n* This is just a template, so feel free to use/remove the unnecessary things\r\n## Description\r\nSort the server cert chain to handle potentially extraneous certificates and arbitrary orderings.\r\nThis is the fix for https://github.com/ARMmbed/mbed-os/issues/9868.\r\n\r\n## Status\r\n**READY/IN DEVELOPMENT/HOLD**\r\n\r\n## Requires Backporting\r\nWhen there is a bug fix, it should be backported to all maintained and supported branches.\r\nChanges do not have to be backported if:\r\n- This PR is a new feature\\enhancement\r\n- This PR contains changes in the API. If this is true, and there is a need for the fix to be backported, the fix should be handled differently in the legacy branch\r\n\r\nNO  \r\n\r\n## Migrations\r\nIf there is any API change, what's the incentive and logic for it.\r\n\r\nNO\r\n\r\n## Additional comments\r\nAlready had a pr https://github.com/ARMmbed/mbed-os/pull/9909 in mbed-os repo.\r\nSince there have huge different between mbed-os/feature/mbedtls and this repo, I don't know which one should be the right place that I should send the pr.\r\n\r\n## Todos\r\n- [ ] Tests\r\n- [ ] Documentation\r\n- [ ] Changelog updated\r\n- [ ] Backported\r\n\r\n\r\n## Steps to test or reproduce\r\nN/A\r\n","created_at":"2019-03-04T04:06:18Z","updated_at":"2019-05-07T08:32:30Z","closed_at":null,"merged_at":null,"merge_commit_sha":"2a5bb629b80d640c5e5a52efdc7ac5670796443e","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[{"id":278176777,"node_id":"MDU6TGFiZWwyNzgxNzY3Nzc=","url":"https://api.github.com/repos/ARMmbed/mbedtls/labels/CLA%20valid","name":"CLA valid","color":"bfdadc","default":false},{"id":937148211,"node_id":"MDU6TGFiZWw5MzcxNDgyMTE=","url":"https://api.github.com/repos/ARMmbed/mbedtls/labels/component:%20X.509","name":"component: X.509","color":"CEF6F5","default":false},{"id":19280386,"node_id":"MDU6TGFiZWwxOTI4MDM4Ng==","url":"https://api.github.com/repos/ARMmbed/mbedtls/labels/enhancement","name":"enhancement","color":"84b6eb","default":true},{"id":705358813,"node_id":"MDU6TGFiZWw3MDUzNTg4MTM=","url":"https://api.github.com/repos/ARMmbed/mbedtls/labels/needs:%20review","name":"needs: review","color":"fbca04","default":false}],"milestone":null,"commits_url":"https://api.github.com/repos/ARMmbed/mbedtls/pulls/2491/commits","review_comments_url":"https://api.github.com/repos/ARMmbed/mbedtls/pulls/2491/comments","review_comment_url":"https://api.github.com/repos/ARMmbed/mbedtls/pulls/comments{/number}","comments_url":"https://api.github.com/repos/ARMmbed/mbedtls/issues/2491/comments","statuses_url":"https://api.github.com/repos/ARMmbed/mbedtls/statuses/8699fbfb118861cdf63c843c786647918c83b2a1","head":{"label":"ArthurMa1978:development","ref":"development","sha":"8699fbfb118861cdf63c843c786647918c83b2a1","user":{"login":"ArthurMa1978","id":20514459,"node_id":"MDQ6VXNlcjIwNTE0NDU5","avatar_url":"https://avatars3.githubusercontent.com/u/20514459?v=4","gravatar_id":"","url":"https://api.github.com/users/ArthurMa1978","html_url":"https://github.com/ArthurMa1978","followers_url":"https://api.github.com/users/ArthurMa1978/followers","following_url":"https://api.github.com/users/ArthurMa1978/following{/other_user}","gists_url":"https://api.github.com/users/ArthurMa1978/gists{/gist_id}","starred_url":"https://api.github.com/users/ArthurMa1978/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ArthurMa1978/subscriptions","organizations_url":"https://api.github.com/users/ArthurMa1978/orgs","repos_url":"https://api.github.com/users/ArthurMa1978/repos","events_url":"https://api.github.com/users/ArthurMa1978/events{/privacy}","received_events_url":"https://api.github.com/users/ArthurMa1978/received_events","type":"User","site_admin":false},"repo":{"id":173669320,"node_id":"MDEwOlJlcG9zaXRvcnkxNzM2NjkzMjA=","name":"mbedtls","full_name":"ArthurMa1978/mbedtls","private":false,"owner":{"login":"ArthurMa1978","id":20514459,"node_id":"MDQ6VXNlcjIwNTE0NDU5","avatar_url":"https://avatars3.githubusercontent.com/u/20514459?v=4","gravatar_id":"","url":"https://api.github.com/users/ArthurMa1978","html_url":"https://github.com/ArthurMa1978","followers_url":"https://api.github.com/users/ArthurMa1978/followers","following_url":"https://api.github.com/users/ArthurMa1978/following{/other_user}","gists_url":"https://api.github.com/users/ArthurMa1978/gists{/gist_id}","starred_url":"https://api.github.com/users/ArthurMa1978/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ArthurMa1978/subscriptions","organizations_url":"https://api.github.com/users/ArthurMa1978/orgs","repos_url":"https://api.github.com/users/ArthurMa1978/repos","events_url":"https://api.github.com/users/ArthurMa1978/events{/privacy}","received_events_url":"https://api.github.com/users/ArthurMa1978/received_events","type":"User","site_admin":false},"html_url":"https://github.com/ArthurMa1978/mbedtls","description":"An open source, portable, easy to use, readable and flexible SSL library","fork":true,"url":"https://api.github.com/repos/ArthurMa1978/mbedtls","forks_url":"https://api.github.com/repos/ArthurMa1978/mbedtls/forks","keys_url":"https://api.github.com/repos/ArthurMa1978/mbedtls/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ArthurMa1978/mbedtls/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ArthurMa1978/mbedtls/teams","hooks_url":"https://api.github.com/repos/ArthurMa1978/mbedtls/hooks","issue_events_url":"https://api.github.com/repos/ArthurMa1978/mbedtls/issues/events{/number}","events_url":"https://api.github.com/repos/ArthurMa1978/mbedtls/events","assignees_url":"https://api.github.com/repos/ArthurMa1978/mbedtls/assignees{/user}","branches_url":"https://api.github.com/repos/ArthurMa1978/mbedtls/branches{/branch}","tags_url":"https://api.github.com/repos/ArthurMa1978/mbedtls/tags","blobs_url":"https://api.github.com/repos/ArthurMa1978/mbedtls/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ArthurMa1978/mbedtls/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ArthurMa1978/mbedtls/git/refs{/sha}","trees_url":"https://api.github.com/repos/ArthurMa1978/mbedtls/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ArthurMa1978/mbedtls/statuses/{sha}","languages_url":"https://api.github.com/repos/ArthurMa1978/mbedtls/languages","stargazers_url":"https://api.github.com/repos/ArthurMa1978/mbedtls/stargazers","contributors_url":"https://api.github.com/repos/ArthurMa1978/mbedtls/contributors","subscribers_url":"https://api.github.com/repos/ArthurMa1978/mbedtls/subscribers","subscription_url":"https://api.github.com/repos/ArthurMa1978/mbedtls/subscription","commits_url":"https://api.github.com/repos/ArthurMa1978/mbedtls/commits{/sha}","git_commits_url":"https://api.github.com/repos/ArthurMa1978/mbedtls/git/commits{/sha}","comments_url":"https://api.github.com/repos/ArthurMa1978/mbedtls/comments{/number}","issue_comment_url":"https://api.github.com/repos/ArthurMa1978/mbedtls/issues/comments{/number}","contents_url":"https://api.github.com/repos/ArthurMa1978/mbedtls/contents/{+path}","compare_url":"https://api.github.com/repos/ArthurMa1978/mbedtls/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ArthurMa1978/mbedtls/merges","archive_url":"https://api.github.com/repos/ArthurMa1978/mbedtls/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ArthurMa1978/mbedtls/downloads","issues_url":"https://api.github.com/repos/ArthurMa1978/mbedtls/issues{/number}","pulls_url":"https://api.github.com/repos/ArthurMa1978/mbedtls/pulls{/number}","milestones_url":"https://api.github.com/repos/ArthurMa1978/mbedtls/milestones{/number}","notifications_url":"https://api.github.com/repos/ArthurMa1978/mbedtls/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ArthurMa1978/mbedtls/labels{/name}","releases_url":"https://api.github.com/repos/ArthurMa1978/mbedtls/releases{/id}","deployments_url":"https://api.github.com/repos/ArthurMa1978/mbedtls/deployments","created_at":"2019-03-04T03:45:53Z","updated_at":"2019-03-14T02:30:30Z","pushed_at":"2019-03-14T02:30:27Z","git_url":"git://github.com/ArthurMa1978/mbedtls.git","ssh_url":"git@github.com:ArthurMa1978/mbedtls.git","clone_url":"https://github.com/ArthurMa1978/mbedtls.git","svn_url":"https://github.com/ArthurMa1978/mbedtls","homepage":"https://tls.mbed.org","size":35069,"stargazers_count":0,"watchers_count":0,"language":"C","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"disabled":false,"open_issues_count":0,"license":{"key":"other","name":"Other","spdx_id":"NOASSERTION","url":null,"node_id":"MDc6TGljZW5zZTA="},"forks":0,"open_issues":0,"watchers":0,"default_branch":"development"}},"base":{"label":"ARMmbed:development","ref":"development","sha":"535ee4a35b9c4ddd059451b8fa5b201bfc89fbcf","user":{"login":"ARMmbed","id":8916057,"node_id":"MDEyOk9yZ2FuaXphdGlvbjg5MTYwNTc=","avatar_url":"https://avatars3.githubusercontent.com/u/8916057?v=4","gravatar_id":"","url":"https://api.github.com/users/ARMmbed","html_url":"https://github.com/ARMmbed","followers_url":"https://api.github.com/users/ARMmbed/followers","following_url":"https://api.github.com/users/ARMmbed/following{/other_user}","gists_url":"https://api.github.com/users/ARMmbed/gists{/gist_id}","starred_url":"https://api.github.com/users/ARMmbed/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ARMmbed/subscriptions","organizations_url":"https://api.github.com/users/ARMmbed/orgs","repos_url":"https://api.github.com/users/ARMmbed/repos","events_url":"https://api.github.com/users/ARMmbed/events{/privacy}","received_events_url":"https://api.github.com/users/ARMmbed/received_events","type":"Organization","site_admin":false},"repo":{"id":6687936,"node_id":"MDEwOlJlcG9zaXRvcnk2Njg3OTM2","name":"mbedtls","full_name":"ARMmbed/mbedtls","private":false,"owner":{"login":"ARMmbed","id":8916057,"node_id":"MDEyOk9yZ2FuaXphdGlvbjg5MTYwNTc=","avatar_url":"https://avatars3.githubusercontent.com/u/8916057?v=4","gravatar_id":"","url":"https://api.github.com/users/ARMmbed","html_url":"https://github.com/ARMmbed","followers_url":"https://api.github.com/users/ARMmbed/followers","following_url":"https://api.github.com/users/ARMmbed/following{/other_user}","gists_url":"https://api.github.com/users/ARMmbed/gists{/gist_id}","starred_url":"https://api.github.com/users/ARMmbed/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ARMmbed/subscriptions","organizations_url":"https://api.github.com/users/ARMmbed/orgs","repos_url":"https://api.github.com/users/ARMmbed/repos","events_url":"https://api.github.com/users/ARMmbed/events{/privacy}","received_events_url":"https://api.github.com/users/ARMmbed/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/ARMmbed/mbedtls","description":"An open source, portable, easy to use, readable and flexible SSL library","fork":false,"url":"https://api.github.com/repos/ARMmbed/mbedtls","forks_url":"https://api.github.com/repos/ARMmbed/mbedtls/forks","keys_url":"https://api.github.com/repos/ARMmbed/mbedtls/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ARMmbed/mbedtls/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ARMmbed/mbedtls/teams","hooks_url":"https://api.github.com/repos/ARMmbed/mbedtls/hooks","issue_events_url":"https://api.github.com/repos/ARMmbed/mbedtls/issues/events{/number}","events_url":"https://api.github.com/repos/ARMmbed/mbedtls/events","assignees_url":"https://api.github.com/repos/ARMmbed/mbedtls/assignees{/user}","branches_url":"https://api.github.com/repos/ARMmbed/mbedtls/branches{/branch}","tags_url":"https://api.github.com/repos/ARMmbed/mbedtls/tags","blobs_url":"https://api.github.com/repos/ARMmbed/mbedtls/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ARMmbed/mbedtls/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ARMmbed/mbedtls/git/refs{/sha}","trees_url":"https://api.github.com/repos/ARMmbed/mbedtls/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ARMmbed/mbedtls/statuses/{sha}","languages_url":"https://api.github.com/repos/ARMmbed/mbedtls/languages","stargazers_url":"https://api.github.com/repos/ARMmbed/mbedtls/stargazers","contributors_url":"https://api.github.com/repos/ARMmbed/mbedtls/contributors","subscribers_url":"https://api.github.com/repos/ARMmbed/mbedtls/subscribers","subscription_url":"https://api.github.com/repos/ARMmbed/mbedtls/subscription","commits_url":"https://api.github.com/repos/ARMmbed/mbedtls/commits{/sha}","git_commits_url":"https://api.github.com/repos/ARMmbed/mbedtls/git/commits{/sha}","comments_url":"https://api.github.com/repos/ARMmbed/mbedtls/comments{/number}","issue_comment_url":"https://api.github.com/repos/ARMmbed/mbedtls/issues/comments{/number}","contents_url":"https://api.github.com/repos/ARMmbed/mbedtls/contents/{+path}","compare_url":"https://api.github.com/repos/ARMmbed/mbedtls/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ARMmbed/mbedtls/merges","archive_url":"https://api.github.com/repos/ARMmbed/mbedtls/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ARMmbed/mbedtls/downloads","issues_url":"https://api.github.com/repos/ARMmbed/mbedtls/issues{/number}","pulls_url":"https://api.github.com/repos/ARMmbed/mbedtls/pulls{/number}","milestones_url":"https://api.github.com/repos/ARMmbed/mbedtls/milestones{/number}","notifications_url":"https://api.github.com/repos/ARMmbed/mbedtls/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ARMmbed/mbedtls/labels{/name}","releases_url":"https://api.github.com/repos/ARMmbed/mbedtls/releases{/id}","deployments_url":"https://api.github.com/repos/ARMmbed/mbedtls/deployments","created_at":"2012-11-14T13:13:13Z","updated_at":"2019-05-06T20:22:41Z","pushed_at":"2019-05-07T08:26:22Z","git_url":"git://github.com/ARMmbed/mbedtls.git","ssh_url":"git@github.com:ARMmbed/mbedtls.git","clone_url":"https://github.com/ARMmbed/mbedtls.git","svn_url":"https://github.com/ARMmbed/mbedtls","homepage":"https://tls.mbed.org","size":36034,"stargazers_count":1884,"watchers_count":1884,"language":"C","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":1083,"mirror_url":null,"archived":false,"disabled":false,"open_issues_count":601,"license":{"key":"other","name":"Other","spdx_id":"NOASSERTION","url":null,"node_id":"MDc6TGljZW5zZTA="},"forks":1083,"open_issues":601,"watchers":1884,"default_branch":"development"}},"_links":{"self":{"href":"https://api.github.com/repos/ARMmbed/mbedtls/pulls/2491"},"html":{"href":"https://github.com/ARMmbed/mbedtls/pull/2491"},"issue":{"href":"https://api.github.com/repos/ARMmbed/mbedtls/issues/2491"},"comments":{"href":"https://api.github.com/repos/ARMmbed/mbedtls/issues/2491/comments"},"review_comments":{"href":"https://api.github.com/repos/ARMmbed/mbedtls/pulls/2491/comments"},"review_comment":{"href":"https://api.github.com/repos/ARMmbed/mbedtls/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/ARMmbed/mbedtls/pulls/2491/commits"},"statuses":{"href":"https://api.github.com/repos/ARMmbed/mbedtls/statuses/8699fbfb118861cdf63c843c786647918c83b2a1"}},"author_association":"NONE"}}
{"actor":{"display_login":"hanno-arm"}}