{"action":"created","comment":{"url":"https://api.github.com/repos/spring-projects/spring-security/pulls/comments/226322575","pull_request_review_id":166115762,"id":226322575,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIyNjMyMjU3NQ==","diff_hunk":"@@ -51,32 +53,77 @@ public BCryptPasswordEncoder(int strength) {\n \t\tthis(strength, null);\n \t}\n \n+\t/**\n+\t * @param version the version of bcrypt, can be 2a,2b,2y\n+\t */\n+\tpublic BCryptPasswordEncoder(String version) {\n+\t\tthis(version, null);\n+\t}\n+\n+\t/**\n+\t * @param version the version of bcrypt, can be 2a,2b,2y\n+\t * @param random the secure random instance to use\n+\t */\n+\tpublic BCryptPasswordEncoder(String version, SecureRandom random) {\n+\t\tthis(version, -1, random);\n+\t}\n+\n \t/**\n \t * @param strength the log rounds to use, between 4 and 31\n \t * @param random the secure random instance to use\n \t *\n \t */\n \tpublic BCryptPasswordEncoder(int strength, SecureRandom random) {\n+\t\tthis(null, strength, random);\n+\t}\n+\n+\t/**\n+\t * @param version the version of bcrypt, can be 2a,2b,2y\n+\t * @param strength the log rounds to use, between 4 and 31\n+\t */\n+\tpublic BCryptPasswordEncoder(String version, int strength) {\n+\t\tthis(version, strength, null);\n+\t}\n+\n+\t/**\n+\t * @param version the version of bcrypt, can be 2a,2b,2y\n+\t * @param strength the log rounds to use, between 4 and 31\n+\t * @param random the secure random instance to use\n+\t *\n+\t */\n+\tpublic BCryptPasswordEncoder(String version, int strength, SecureRandom random) {\n \t\tif (strength != -1 && (strength < BCrypt.MIN_LOG_ROUNDS || strength > BCrypt.MAX_LOG_ROUNDS)) {\n \t\t\tthrow new IllegalArgumentException(\"Bad strength\");\n \t\t}\n+\t\tthis.version = version;\n \t\tthis.strength = strength;\n \t\tthis.random = random;\n \t}\n \n \tpublic String encode(CharSequence rawPassword) {\n \t\tString salt;\n-\t\tif (strength > 0) {\n-\t\t\tif (random != null) {\n-\t\t\t\tsalt = BCrypt.gensalt(strength, random);\n+\t\tif(version != null) {\n+\t\t\tif (strength > 0) {\n+\t\t\t\tif (random != null) {\n+\t\t\t\t\tsalt = BCrypt.gensalt(version, strength, random);\n+\t\t\t\t} else {\n+\t\t\t\t\tSystem.out.println(version);","path":"crypto/src/main/java/org/springframework/security/crypto/bcrypt/BCryptPasswordEncoder.java","position":78,"original_position":78,"commit_id":"d68419d9046ab78bd84d44e3fc5cc1438d16418e","original_commit_id":"d68419d9046ab78bd84d44e3fc5cc1438d16418e","user":{"login":"rwinch","id":362503,"node_id":"MDQ6VXNlcjM2MjUwMw==","avatar_url":"https://avatars0.githubusercontent.com/u/362503?v=4","gravatar_id":"","url":"https://api.github.com/users/rwinch","html_url":"https://github.com/rwinch","followers_url":"https://api.github.com/users/rwinch/followers","following_url":"https://api.github.com/users/rwinch/following{/other_user}","gists_url":"https://api.github.com/users/rwinch/gists{/gist_id}","starred_url":"https://api.github.com/users/rwinch/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rwinch/subscriptions","organizations_url":"https://api.github.com/users/rwinch/orgs","repos_url":"https://api.github.com/users/rwinch/repos","events_url":"https://api.github.com/users/rwinch/events{/privacy}","received_events_url":"https://api.github.com/users/rwinch/received_events","type":"User","site_admin":false},"body":"Remove the println statement","created_at":"2018-10-18T14:15:15Z","updated_at":"2018-10-18T14:38:21Z","html_url":"https://github.com/spring-projects/spring-security/pull/5992#discussion_r226322575","pull_request_url":"https://api.github.com/repos/spring-projects/spring-security/pulls/5992","author_association":"MEMBER","_links":{"self":{"href":"https://api.github.com/repos/spring-projects/spring-security/pulls/comments/226322575"},"html":{"href":"https://github.com/spring-projects/spring-security/pull/5992#discussion_r226322575"},"pull_request":{"href":"https://api.github.com/repos/spring-projects/spring-security/pulls/5992"}}},"pull_request":{"url":"https://api.github.com/repos/spring-projects/spring-security/pulls/5992","id":223859313,"node_id":"MDExOlB1bGxSZXF1ZXN0MjIzODU5MzEz","html_url":"https://github.com/spring-projects/spring-security/pull/5992","diff_url":"https://github.com/spring-projects/spring-security/pull/5992.diff","patch_url":"https://github.com/spring-projects/spring-security/pull/5992.patch","issue_url":"https://api.github.com/repos/spring-projects/spring-security/issues/5992","number":5992,"state":"open","locked":false,"title":"fix issue#3320 Support for bcrypt revision","user":{"login":"lin199231","id":4330978,"node_id":"MDQ6VXNlcjQzMzA5Nzg=","avatar_url":"https://avatars1.githubusercontent.com/u/4330978?v=4","gravatar_id":"","url":"https://api.github.com/users/lin199231","html_url":"https://github.com/lin199231","followers_url":"https://api.github.com/users/lin199231/followers","following_url":"https://api.github.com/users/lin199231/following{/other_user}","gists_url":"https://api.github.com/users/lin199231/gists{/gist_id}","starred_url":"https://api.github.com/users/lin199231/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lin199231/subscriptions","organizations_url":"https://api.github.com/users/lin199231/orgs","repos_url":"https://api.github.com/users/lin199231/repos","events_url":"https://api.github.com/users/lin199231/events{/privacy}","received_events_url":"https://api.github.com/users/lin199231/received_events","type":"User","site_admin":false},"body":"From issue #3320\r\nI find that jBCrypt are already support\r\nhttps://code.google.com/archive/p/jbcrypt/issues/9\r\nSo I try to add bcrypt revision support for BCryptPasswordEncoder, and compatible with old version.\r\nPlease merge my request, thanks.","created_at":"2018-10-18T08:01:22Z","updated_at":"2018-10-18T14:38:21Z","closed_at":null,"merged_at":null,"merge_commit_sha":"95c7a1333fdc9cc8b8b850c62fceec6bf5769ad8","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/spring-projects/spring-security/pulls/5992/commits","review_comments_url":"https://api.github.com/repos/spring-projects/spring-security/pulls/5992/comments","review_comment_url":"https://api.github.com/repos/spring-projects/spring-security/pulls/comments{/number}","comments_url":"https://api.github.com/repos/spring-projects/spring-security/issues/5992/comments","statuses_url":"https://api.github.com/repos/spring-projects/spring-security/statuses/d68419d9046ab78bd84d44e3fc5cc1438d16418e","head":{"label":"lin199231:fix_issue#3320","ref":"fix_issue#3320","sha":"d68419d9046ab78bd84d44e3fc5cc1438d16418e","user":{"login":"lin199231","id":4330978,"node_id":"MDQ6VXNlcjQzMzA5Nzg=","avatar_url":"https://avatars1.githubusercontent.com/u/4330978?v=4","gravatar_id":"","url":"https://api.github.com/users/lin199231","html_url":"https://github.com/lin199231","followers_url":"https://api.github.com/users/lin199231/followers","following_url":"https://api.github.com/users/lin199231/following{/other_user}","gists_url":"https://api.github.com/users/lin199231/gists{/gist_id}","starred_url":"https://api.github.com/users/lin199231/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lin199231/subscriptions","organizations_url":"https://api.github.com/users/lin199231/orgs","repos_url":"https://api.github.com/users/lin199231/repos","events_url":"https://api.github.com/users/lin199231/events{/privacy}","received_events_url":"https://api.github.com/users/lin199231/received_events","type":"User","site_admin":false},"repo":{"id":153579766,"node_id":"MDEwOlJlcG9zaXRvcnkxNTM1Nzk3NjY=","name":"spring-security","full_name":"lin199231/spring-security","private":false,"owner":{"login":"lin199231","id":4330978,"node_id":"MDQ6VXNlcjQzMzA5Nzg=","avatar_url":"https://avatars1.githubusercontent.com/u/4330978?v=4","gravatar_id":"","url":"https://api.github.com/users/lin199231","html_url":"https://github.com/lin199231","followers_url":"https://api.github.com/users/lin199231/followers","following_url":"https://api.github.com/users/lin199231/following{/other_user}","gists_url":"https://api.github.com/users/lin199231/gists{/gist_id}","starred_url":"https://api.github.com/users/lin199231/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lin199231/subscriptions","organizations_url":"https://api.github.com/users/lin199231/orgs","repos_url":"https://api.github.com/users/lin199231/repos","events_url":"https://api.github.com/users/lin199231/events{/privacy}","received_events_url":"https://api.github.com/users/lin199231/received_events","type":"User","site_admin":false},"html_url":"https://github.com/lin199231/spring-security","description":"Spring Security","fork":true,"url":"https://api.github.com/repos/lin199231/spring-security","forks_url":"https://api.github.com/repos/lin199231/spring-security/forks","keys_url":"https://api.github.com/repos/lin199231/spring-security/keys{/key_id}","collaborators_url":"https://api.github.com/repos/lin199231/spring-security/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/lin199231/spring-security/teams","hooks_url":"https://api.github.com/repos/lin199231/spring-security/hooks","issue_events_url":"https://api.github.com/repos/lin199231/spring-security/issues/events{/number}","events_url":"https://api.github.com/repos/lin199231/spring-security/events","assignees_url":"https://api.github.com/repos/lin199231/spring-security/assignees{/user}","branches_url":"https://api.github.com/repos/lin199231/spring-security/branches{/branch}","tags_url":"https://api.github.com/repos/lin199231/spring-security/tags","blobs_url":"https://api.github.com/repos/lin199231/spring-security/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/lin199231/spring-security/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/lin199231/spring-security/git/refs{/sha}","trees_url":"https://api.github.com/repos/lin199231/spring-security/git/trees{/sha}","statuses_url":"https://api.github.com/repos/lin199231/spring-security/statuses/{sha}","languages_url":"https://api.github.com/repos/lin199231/spring-security/languages","stargazers_url":"https://api.github.com/repos/lin199231/spring-security/stargazers","contributors_url":"https://api.github.com/repos/lin199231/spring-security/contributors","subscribers_url":"https://api.github.com/repos/lin199231/spring-security/subscribers","subscription_url":"https://api.github.com/repos/lin199231/spring-security/subscription","commits_url":"https://api.github.com/repos/lin199231/spring-security/commits{/sha}","git_commits_url":"https://api.github.com/repos/lin199231/spring-security/git/commits{/sha}","comments_url":"https://api.github.com/repos/lin199231/spring-security/comments{/number}","issue_comment_url":"https://api.github.com/repos/lin199231/spring-security/issues/comments{/number}","contents_url":"https://api.github.com/repos/lin199231/spring-security/contents/{+path}","compare_url":"https://api.github.com/repos/lin199231/spring-security/compare/{base}...{head}","merges_url":"https://api.github.com/repos/lin199231/spring-security/merges","archive_url":"https://api.github.com/repos/lin199231/spring-security/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/lin199231/spring-security/downloads","issues_url":"https://api.github.com/repos/lin199231/spring-security/issues{/number}","pulls_url":"https://api.github.com/repos/lin199231/spring-security/pulls{/number}","milestones_url":"https://api.github.com/repos/lin199231/spring-security/milestones{/number}","notifications_url":"https://api.github.com/repos/lin199231/spring-security/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/lin199231/spring-security/labels{/name}","releases_url":"https://api.github.com/repos/lin199231/spring-security/releases{/id}","deployments_url":"https://api.github.com/repos/lin199231/spring-security/deployments","created_at":"2018-10-18T07:14:30Z","updated_at":"2018-10-18T07:14:40Z","pushed_at":"2018-10-18T08:00:00Z","git_url":"git://github.com/lin199231/spring-security.git","ssh_url":"git@github.com:lin199231/spring-security.git","clone_url":"https://github.com/lin199231/spring-security.git","svn_url":"https://github.com/lin199231/spring-security","homepage":"http://spring.io/spring-security","size":32593,"stargazers_count":0,"watchers_count":0,"language":"Java","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":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0","node_id":"MDc6TGljZW5zZTI="},"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"spring-projects:master","ref":"master","sha":"8f49ca850ab509a4885efd3312033feafa9f21a0","user":{"login":"spring-projects","id":317776,"node_id":"MDEyOk9yZ2FuaXphdGlvbjMxNzc3Ng==","avatar_url":"https://avatars0.githubusercontent.com/u/317776?v=4","gravatar_id":"","url":"https://api.github.com/users/spring-projects","html_url":"https://github.com/spring-projects","followers_url":"https://api.github.com/users/spring-projects/followers","following_url":"https://api.github.com/users/spring-projects/following{/other_user}","gists_url":"https://api.github.com/users/spring-projects/gists{/gist_id}","starred_url":"https://api.github.com/users/spring-projects/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/spring-projects/subscriptions","organizations_url":"https://api.github.com/users/spring-projects/orgs","repos_url":"https://api.github.com/users/spring-projects/repos","events_url":"https://api.github.com/users/spring-projects/events{/privacy}","received_events_url":"https://api.github.com/users/spring-projects/received_events","type":"Organization","site_admin":false},"repo":{"id":3148979,"node_id":"MDEwOlJlcG9zaXRvcnkzMTQ4OTc5","name":"spring-security","full_name":"spring-projects/spring-security","private":false,"owner":{"login":"spring-projects","id":317776,"node_id":"MDEyOk9yZ2FuaXphdGlvbjMxNzc3Ng==","avatar_url":"https://avatars0.githubusercontent.com/u/317776?v=4","gravatar_id":"","url":"https://api.github.com/users/spring-projects","html_url":"https://github.com/spring-projects","followers_url":"https://api.github.com/users/spring-projects/followers","following_url":"https://api.github.com/users/spring-projects/following{/other_user}","gists_url":"https://api.github.com/users/spring-projects/gists{/gist_id}","starred_url":"https://api.github.com/users/spring-projects/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/spring-projects/subscriptions","organizations_url":"https://api.github.com/users/spring-projects/orgs","repos_url":"https://api.github.com/users/spring-projects/repos","events_url":"https://api.github.com/users/spring-projects/events{/privacy}","received_events_url":"https://api.github.com/users/spring-projects/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/spring-projects/spring-security","description":"Spring Security","fork":false,"url":"https://api.github.com/repos/spring-projects/spring-security","forks_url":"https://api.github.com/repos/spring-projects/spring-security/forks","keys_url":"https://api.github.com/repos/spring-projects/spring-security/keys{/key_id}","collaborators_url":"https://api.github.com/repos/spring-projects/spring-security/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/spring-projects/spring-security/teams","hooks_url":"https://api.github.com/repos/spring-projects/spring-security/hooks","issue_events_url":"https://api.github.com/repos/spring-projects/spring-security/issues/events{/number}","events_url":"https://api.github.com/repos/spring-projects/spring-security/events","assignees_url":"https://api.github.com/repos/spring-projects/spring-security/assignees{/user}","branches_url":"https://api.github.com/repos/spring-projects/spring-security/branches{/branch}","tags_url":"https://api.github.com/repos/spring-projects/spring-security/tags","blobs_url":"https://api.github.com/repos/spring-projects/spring-security/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/spring-projects/spring-security/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/spring-projects/spring-security/git/refs{/sha}","trees_url":"https://api.github.com/repos/spring-projects/spring-security/git/trees{/sha}","statuses_url":"https://api.github.com/repos/spring-projects/spring-security/statuses/{sha}","languages_url":"https://api.github.com/repos/spring-projects/spring-security/languages","stargazers_url":"https://api.github.com/repos/spring-projects/spring-security/stargazers","contributors_url":"https://api.github.com/repos/spring-projects/spring-security/contributors","subscribers_url":"https://api.github.com/repos/spring-projects/spring-security/subscribers","subscription_url":"https://api.github.com/repos/spring-projects/spring-security/subscription","commits_url":"https://api.github.com/repos/spring-projects/spring-security/commits{/sha}","git_commits_url":"https://api.github.com/repos/spring-projects/spring-security/git/commits{/sha}","comments_url":"https://api.github.com/repos/spring-projects/spring-security/comments{/number}","issue_comment_url":"https://api.github.com/repos/spring-projects/spring-security/issues/comments{/number}","contents_url":"https://api.github.com/repos/spring-projects/spring-security/contents/{+path}","compare_url":"https://api.github.com/repos/spring-projects/spring-security/compare/{base}...{head}","merges_url":"https://api.github.com/repos/spring-projects/spring-security/merges","archive_url":"https://api.github.com/repos/spring-projects/spring-security/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/spring-projects/spring-security/downloads","issues_url":"https://api.github.com/repos/spring-projects/spring-security/issues{/number}","pulls_url":"https://api.github.com/repos/spring-projects/spring-security/pulls{/number}","milestones_url":"https://api.github.com/repos/spring-projects/spring-security/milestones{/number}","notifications_url":"https://api.github.com/repos/spring-projects/spring-security/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/spring-projects/spring-security/labels{/name}","releases_url":"https://api.github.com/repos/spring-projects/spring-security/releases{/id}","deployments_url":"https://api.github.com/repos/spring-projects/spring-security/deployments","created_at":"2012-01-10T21:50:57Z","updated_at":"2018-10-18T10:58:19Z","pushed_at":"2018-10-18T08:01:23Z","git_url":"git://github.com/spring-projects/spring-security.git","ssh_url":"git@github.com:spring-projects/spring-security.git","clone_url":"https://github.com/spring-projects/spring-security.git","svn_url":"https://github.com/spring-projects/spring-security","homepage":"http://spring.io/spring-security","size":32600,"stargazers_count":2867,"watchers_count":2867,"language":"Java","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":2716,"mirror_url":null,"archived":false,"open_issues_count":892,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0","node_id":"MDc6TGljZW5zZTI="},"forks":2716,"open_issues":892,"watchers":2867,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/spring-projects/spring-security/pulls/5992"},"html":{"href":"https://github.com/spring-projects/spring-security/pull/5992"},"issue":{"href":"https://api.github.com/repos/spring-projects/spring-security/issues/5992"},"comments":{"href":"https://api.github.com/repos/spring-projects/spring-security/issues/5992/comments"},"review_comments":{"href":"https://api.github.com/repos/spring-projects/spring-security/pulls/5992/comments"},"review_comment":{"href":"https://api.github.com/repos/spring-projects/spring-security/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/spring-projects/spring-security/pulls/5992/commits"},"statuses":{"href":"https://api.github.com/repos/spring-projects/spring-security/statuses/d68419d9046ab78bd84d44e3fc5cc1438d16418e"}},"author_association":"NONE"}}
{"actor":{"display_login":"rwinch"}}