{"action":"created","comment":{"url":"https://api.github.com/repos/php/php-src/pulls/comments/71188828","id":71188828,"diff_hunk":"@@ -61,7 +81,14 @@ static php_password_algo php_password_determine_algo(const char *hash, const siz\n {\n \tif (len > 3 && hash[0] == '$' && hash[1] == '2' && hash[2] == 'y' && len == 60) {\n \t\treturn PHP_PASSWORD_BCRYPT;\n+\t} \n+#if HAVE_ARGON2LIB\n+\tif (hash[0] == '$' && strstr(hash, \"argon2i\")) {","path":"ext/standard/password.c","position":56,"original_position":56,"commit_id":"98722089a0a0f44f7540e7e0f6da0fa1dd56b1fc","original_commit_id":"98722089a0a0f44f7540e7e0f6da0fa1dd56b1fc","user":{"login":"nikic","id":216080,"avatar_url":"https://avatars.githubusercontent.com/u/216080?v=3","gravatar_id":"","url":"https://api.github.com/users/nikic","html_url":"https://github.com/nikic","followers_url":"https://api.github.com/users/nikic/followers","following_url":"https://api.github.com/users/nikic/following{/other_user}","gists_url":"https://api.github.com/users/nikic/gists{/gist_id}","starred_url":"https://api.github.com/users/nikic/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nikic/subscriptions","organizations_url":"https://api.github.com/users/nikic/orgs","repos_url":"https://api.github.com/users/nikic/repos","events_url":"https://api.github.com/users/nikic/events{/privacy}","received_events_url":"https://api.github.com/users/nikic/received_events","type":"User","site_admin":false},"body":"The comment about the length check was only to avoid out of bounds memcmp, not ensure a particular value. I.e. something along the lines of:\r\n\r\n```c\r\nif (hash_len >= sizeof(\"$argon2i$\")-1 && !memcmp(hash, \"$argon2i$\", sizeof(\"$argon2i$\")-1)) {\r\n    return PHP_PASSWORD_ARGON2I;\r\n}\r\n// ...\r\n```\r\n\r\nYou're right that it probably doesn't matter anyway. The only problem I can imagine is the string \"argon2i\" occurring in the salt of a non-bcrypt non-argon hash (iirc password_verify also accepts crypt hashes that password_hash cannot generate). But this is probably pretty far fetched ^^","created_at":"2016-07-18T17:16:49Z","updated_at":"2016-07-18T17:16:49Z","html_url":"https://github.com/php/php-src/pull/1997#discussion_r71188828","pull_request_url":"https://api.github.com/repos/php/php-src/pulls/1997","_links":{"self":{"href":"https://api.github.com/repos/php/php-src/pulls/comments/71188828"},"html":{"href":"https://github.com/php/php-src/pull/1997#discussion_r71188828"},"pull_request":{"href":"https://api.github.com/repos/php/php-src/pulls/1997"}}},"pull_request":{"url":"https://api.github.com/repos/php/php-src/pulls/1997","id":76880761,"html_url":"https://github.com/php/php-src/pull/1997","diff_url":"https://github.com/php/php-src/pull/1997.diff","patch_url":"https://github.com/php/php-src/pull/1997.patch","issue_url":"https://api.github.com/repos/php/php-src/issues/1997","number":1997,"state":"open","locked":false,"title":"[RFC]: Add Argon2 to password_*","user":{"login":"charlesportwoodii","id":630969,"avatar_url":"https://avatars.githubusercontent.com/u/630969?v=3","gravatar_id":"","url":"https://api.github.com/users/charlesportwoodii","html_url":"https://github.com/charlesportwoodii","followers_url":"https://api.github.com/users/charlesportwoodii/followers","following_url":"https://api.github.com/users/charlesportwoodii/following{/other_user}","gists_url":"https://api.github.com/users/charlesportwoodii/gists{/gist_id}","starred_url":"https://api.github.com/users/charlesportwoodii/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/charlesportwoodii/subscriptions","organizations_url":"https://api.github.com/users/charlesportwoodii/orgs","repos_url":"https://api.github.com/users/charlesportwoodii/repos","events_url":"https://api.github.com/users/charlesportwoodii/events{/privacy}","received_events_url":"https://api.github.com/users/charlesportwoodii/received_events","type":"User","site_admin":false},"body":"RFC: https://wiki.php.net/rfc/argon2_password_hash","created_at":"2016-07-10T18:56:04Z","updated_at":"2016-07-18T17:16:49Z","closed_at":null,"merged_at":null,"merge_commit_sha":"be550263ce56e76d853cc6a9486880ba4ccd6155","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/php/php-src/pulls/1997/commits","review_comments_url":"https://api.github.com/repos/php/php-src/pulls/1997/comments","review_comment_url":"https://api.github.com/repos/php/php-src/pulls/comments{/number}","comments_url":"https://api.github.com/repos/php/php-src/issues/1997/comments","statuses_url":"https://api.github.com/repos/php/php-src/statuses/98722089a0a0f44f7540e7e0f6da0fa1dd56b1fc","head":{"label":"charlesportwoodii:argon2","ref":"argon2","sha":"98722089a0a0f44f7540e7e0f6da0fa1dd56b1fc","user":{"login":"charlesportwoodii","id":630969,"avatar_url":"https://avatars.githubusercontent.com/u/630969?v=3","gravatar_id":"","url":"https://api.github.com/users/charlesportwoodii","html_url":"https://github.com/charlesportwoodii","followers_url":"https://api.github.com/users/charlesportwoodii/followers","following_url":"https://api.github.com/users/charlesportwoodii/following{/other_user}","gists_url":"https://api.github.com/users/charlesportwoodii/gists{/gist_id}","starred_url":"https://api.github.com/users/charlesportwoodii/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/charlesportwoodii/subscriptions","organizations_url":"https://api.github.com/users/charlesportwoodii/orgs","repos_url":"https://api.github.com/users/charlesportwoodii/repos","events_url":"https://api.github.com/users/charlesportwoodii/events{/privacy}","received_events_url":"https://api.github.com/users/charlesportwoodii/received_events","type":"User","site_admin":false},"repo":{"id":62909388,"name":"php-src","full_name":"charlesportwoodii/php-src","owner":{"login":"charlesportwoodii","id":630969,"avatar_url":"https://avatars.githubusercontent.com/u/630969?v=3","gravatar_id":"","url":"https://api.github.com/users/charlesportwoodii","html_url":"https://github.com/charlesportwoodii","followers_url":"https://api.github.com/users/charlesportwoodii/followers","following_url":"https://api.github.com/users/charlesportwoodii/following{/other_user}","gists_url":"https://api.github.com/users/charlesportwoodii/gists{/gist_id}","starred_url":"https://api.github.com/users/charlesportwoodii/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/charlesportwoodii/subscriptions","organizations_url":"https://api.github.com/users/charlesportwoodii/orgs","repos_url":"https://api.github.com/users/charlesportwoodii/repos","events_url":"https://api.github.com/users/charlesportwoodii/events{/privacy}","received_events_url":"https://api.github.com/users/charlesportwoodii/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/charlesportwoodii/php-src","description":"The PHP Interpreter","fork":true,"url":"https://api.github.com/repos/charlesportwoodii/php-src","forks_url":"https://api.github.com/repos/charlesportwoodii/php-src/forks","keys_url":"https://api.github.com/repos/charlesportwoodii/php-src/keys{/key_id}","collaborators_url":"https://api.github.com/repos/charlesportwoodii/php-src/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/charlesportwoodii/php-src/teams","hooks_url":"https://api.github.com/repos/charlesportwoodii/php-src/hooks","issue_events_url":"https://api.github.com/repos/charlesportwoodii/php-src/issues/events{/number}","events_url":"https://api.github.com/repos/charlesportwoodii/php-src/events","assignees_url":"https://api.github.com/repos/charlesportwoodii/php-src/assignees{/user}","branches_url":"https://api.github.com/repos/charlesportwoodii/php-src/branches{/branch}","tags_url":"https://api.github.com/repos/charlesportwoodii/php-src/tags","blobs_url":"https://api.github.com/repos/charlesportwoodii/php-src/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/charlesportwoodii/php-src/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/charlesportwoodii/php-src/git/refs{/sha}","trees_url":"https://api.github.com/repos/charlesportwoodii/php-src/git/trees{/sha}","statuses_url":"https://api.github.com/repos/charlesportwoodii/php-src/statuses/{sha}","languages_url":"https://api.github.com/repos/charlesportwoodii/php-src/languages","stargazers_url":"https://api.github.com/repos/charlesportwoodii/php-src/stargazers","contributors_url":"https://api.github.com/repos/charlesportwoodii/php-src/contributors","subscribers_url":"https://api.github.com/repos/charlesportwoodii/php-src/subscribers","subscription_url":"https://api.github.com/repos/charlesportwoodii/php-src/subscription","commits_url":"https://api.github.com/repos/charlesportwoodii/php-src/commits{/sha}","git_commits_url":"https://api.github.com/repos/charlesportwoodii/php-src/git/commits{/sha}","comments_url":"https://api.github.com/repos/charlesportwoodii/php-src/comments{/number}","issue_comment_url":"https://api.github.com/repos/charlesportwoodii/php-src/issues/comments{/number}","contents_url":"https://api.github.com/repos/charlesportwoodii/php-src/contents/{+path}","compare_url":"https://api.github.com/repos/charlesportwoodii/php-src/compare/{base}...{head}","merges_url":"https://api.github.com/repos/charlesportwoodii/php-src/merges","archive_url":"https://api.github.com/repos/charlesportwoodii/php-src/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/charlesportwoodii/php-src/downloads","issues_url":"https://api.github.com/repos/charlesportwoodii/php-src/issues{/number}","pulls_url":"https://api.github.com/repos/charlesportwoodii/php-src/pulls{/number}","milestones_url":"https://api.github.com/repos/charlesportwoodii/php-src/milestones{/number}","notifications_url":"https://api.github.com/repos/charlesportwoodii/php-src/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/charlesportwoodii/php-src/labels{/name}","releases_url":"https://api.github.com/repos/charlesportwoodii/php-src/releases{/id}","deployments_url":"https://api.github.com/repos/charlesportwoodii/php-src/deployments","created_at":"2016-07-08T18:34:11Z","updated_at":"2016-07-08T18:35:09Z","pushed_at":"2016-07-13T13:00:12Z","git_url":"git://github.com/charlesportwoodii/php-src.git","ssh_url":"git@github.com:charlesportwoodii/php-src.git","clone_url":"https://github.com/charlesportwoodii/php-src.git","svn_url":"https://github.com/charlesportwoodii/php-src","homepage":"http://www.php.net","size":255604,"stargazers_count":0,"watchers_count":0,"language":"C","has_issues":false,"has_downloads":true,"has_wiki":false,"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":"php:master","ref":"master","sha":"1223f7f91b63d37c1282c05c0fab5a16bc83bbf1","user":{"login":"php","id":25158,"avatar_url":"https://avatars.githubusercontent.com/u/25158?v=3","gravatar_id":"","url":"https://api.github.com/users/php","html_url":"https://github.com/php","followers_url":"https://api.github.com/users/php/followers","following_url":"https://api.github.com/users/php/following{/other_user}","gists_url":"https://api.github.com/users/php/gists{/gist_id}","starred_url":"https://api.github.com/users/php/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/php/subscriptions","organizations_url":"https://api.github.com/users/php/orgs","repos_url":"https://api.github.com/users/php/repos","events_url":"https://api.github.com/users/php/events{/privacy}","received_events_url":"https://api.github.com/users/php/received_events","type":"Organization","site_admin":false},"repo":{"id":1903522,"name":"php-src","full_name":"php/php-src","owner":{"login":"php","id":25158,"avatar_url":"https://avatars.githubusercontent.com/u/25158?v=3","gravatar_id":"","url":"https://api.github.com/users/php","html_url":"https://github.com/php","followers_url":"https://api.github.com/users/php/followers","following_url":"https://api.github.com/users/php/following{/other_user}","gists_url":"https://api.github.com/users/php/gists{/gist_id}","starred_url":"https://api.github.com/users/php/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/php/subscriptions","organizations_url":"https://api.github.com/users/php/orgs","repos_url":"https://api.github.com/users/php/repos","events_url":"https://api.github.com/users/php/events{/privacy}","received_events_url":"https://api.github.com/users/php/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/php/php-src","description":"The PHP Interpreter","fork":false,"url":"https://api.github.com/repos/php/php-src","forks_url":"https://api.github.com/repos/php/php-src/forks","keys_url":"https://api.github.com/repos/php/php-src/keys{/key_id}","collaborators_url":"https://api.github.com/repos/php/php-src/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/php/php-src/teams","hooks_url":"https://api.github.com/repos/php/php-src/hooks","issue_events_url":"https://api.github.com/repos/php/php-src/issues/events{/number}","events_url":"https://api.github.com/repos/php/php-src/events","assignees_url":"https://api.github.com/repos/php/php-src/assignees{/user}","branches_url":"https://api.github.com/repos/php/php-src/branches{/branch}","tags_url":"https://api.github.com/repos/php/php-src/tags","blobs_url":"https://api.github.com/repos/php/php-src/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/php/php-src/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/php/php-src/git/refs{/sha}","trees_url":"https://api.github.com/repos/php/php-src/git/trees{/sha}","statuses_url":"https://api.github.com/repos/php/php-src/statuses/{sha}","languages_url":"https://api.github.com/repos/php/php-src/languages","stargazers_url":"https://api.github.com/repos/php/php-src/stargazers","contributors_url":"https://api.github.com/repos/php/php-src/contributors","subscribers_url":"https://api.github.com/repos/php/php-src/subscribers","subscription_url":"https://api.github.com/repos/php/php-src/subscription","commits_url":"https://api.github.com/repos/php/php-src/commits{/sha}","git_commits_url":"https://api.github.com/repos/php/php-src/git/commits{/sha}","comments_url":"https://api.github.com/repos/php/php-src/comments{/number}","issue_comment_url":"https://api.github.com/repos/php/php-src/issues/comments{/number}","contents_url":"https://api.github.com/repos/php/php-src/contents/{+path}","compare_url":"https://api.github.com/repos/php/php-src/compare/{base}...{head}","merges_url":"https://api.github.com/repos/php/php-src/merges","archive_url":"https://api.github.com/repos/php/php-src/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/php/php-src/downloads","issues_url":"https://api.github.com/repos/php/php-src/issues{/number}","pulls_url":"https://api.github.com/repos/php/php-src/pulls{/number}","milestones_url":"https://api.github.com/repos/php/php-src/milestones{/number}","notifications_url":"https://api.github.com/repos/php/php-src/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/php/php-src/labels{/name}","releases_url":"https://api.github.com/repos/php/php-src/releases{/id}","deployments_url":"https://api.github.com/repos/php/php-src/deployments","created_at":"2011-06-16T01:52:25Z","updated_at":"2016-07-18T13:28:21Z","pushed_at":"2016-07-18T14:31:24Z","git_url":"git://github.com/php/php-src.git","ssh_url":"git@github.com:php/php-src.git","clone_url":"https://github.com/php/php-src.git","svn_url":"https://github.com/php/php-src","homepage":"http://www.php.net","size":407977,"stargazers_count":9560,"watchers_count":9560,"language":"C","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":3346,"mirror_url":null,"open_issues_count":312,"forks":3346,"open_issues":312,"watchers":9560,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/php/php-src/pulls/1997"},"html":{"href":"https://github.com/php/php-src/pull/1997"},"issue":{"href":"https://api.github.com/repos/php/php-src/issues/1997"},"comments":{"href":"https://api.github.com/repos/php/php-src/issues/1997/comments"},"review_comments":{"href":"https://api.github.com/repos/php/php-src/pulls/1997/comments"},"review_comment":{"href":"https://api.github.com/repos/php/php-src/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/php/php-src/pulls/1997/commits"},"statuses":{"href":"https://api.github.com/repos/php/php-src/statuses/98722089a0a0f44f7540e7e0f6da0fa1dd56b1fc"}}}}
{"actor":{"display_login":"nikic"}}