{"action":"created","comment":{"url":"https://api.github.com/repos/openssl/openssl/pulls/comments/186298376","pull_request_review_id":117848413,"id":186298376,"diff_hunk":"@@ -0,0 +1,130 @@\n+=pod\n+\n+=head1 NAME\n+\n+password handling - How diverse parts of OpenSSL treat pass phrases\n+\n+=head1 DESCRIPTION\n+\n+In a modern world with all sorts of character encodings, the treatment of pass\n+phrases has become increasingly complex.\n+This manual page attempts to give an overview over how this problem is\n+currently addressed in different parts of the openssl library.\n+\n+=head2 The general case\n+\n+The OpenSSL library doesn't treat pass phrases in any special way as a general\n+rule, and trusts the application or user to choose a suitable character set\n+and stick to that throughout the life of affected objects.\n+This means that for an object that was encrypted using a pass phrase encoded in\n+ISO-8859-1, that object needs to be decrypted using a pass phrase encoded in\n+ISO-8859-1.\n+Anything else will have the decryption fail.\n+\n+=head2 PKCS#12\n+\n+PKCS#12 is a bit different regarding pass phrase encoding.\n+The standard stipulates that the pass phrase shall be encoded as a BMPString,\n+i.e. UCS-2 BE.\n+\n+OpenSSL tries to adapt to this requirements in one of the following manners:\n+\n+=over 4\n+\n+=item 1.\n+\n+Tries to read the pass phrase as UTF-8 and re-encode that to UTF-16 (which is\n+the same as UCS-2 for characters U+0000 to U+D7FF and U+E000 to U+FFFF, but\n+becomes an expansion for any other character), or failing that, proceeds with\n+step 2.\n+\n+=item 2.\n+\n+Assumes that the pass phrase is encoded in ASCII or ISO-8859-1 and\n+opportunistically prepends each byte with a zero byte and uses the result\n+as a BMPString.\n+\n+Note that since there is no check of your locale, this may produce UCS-2 /\n+UTF-16 characters that do not correspond to the original pass phrase characters\n+for other character sets, such as any ISO-8859-X other than ISO-8859-1.\n+\n+=back\n+\n+OpenSSL versions older than 1.1.0 do variant 2 only, and that is the reason why\n+OpenSSL still does this, to be able to read files produced with older versions.\n+\n+It should be noted that this approach isn't entirely fault free.\n+A passphrase encoded in ISO-8859-1 could very well have a sequence such as\n+0xC3 0xAF (which is the two characters \"LATIN CAPITAL LETTER A WITH TILDE\"\n+and \"MACRON\" in ISO-8859-1 encoding), but would be misunterpreted as the\n+perfectly valid UTF-8 encoded U+00EF (LATIN SMALL LETTER I WITH DIARESIS).","path":"doc/man7/password-handling.pod","position":60,"original_position":60,"commit_id":"c6c37922a39d6b2b59c58f70ecee4a9126d3c876","original_commit_id":"c6c37922a39d6b2b59c58f70ecee4a9126d3c876","user":{"login":"mspncp","id":11467854,"avatar_url":"https://avatars2.githubusercontent.com/u/11467854?v=4","gravatar_id":"","url":"https://api.github.com/users/mspncp","html_url":"https://github.com/mspncp","followers_url":"https://api.github.com/users/mspncp/followers","following_url":"https://api.github.com/users/mspncp/following{/other_user}","gists_url":"https://api.github.com/users/mspncp/gists{/gist_id}","starred_url":"https://api.github.com/users/mspncp/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mspncp/subscriptions","organizations_url":"https://api.github.com/users/mspncp/orgs","repos_url":"https://api.github.com/users/mspncp/repos","events_url":"https://api.github.com/users/mspncp/events{/privacy}","received_events_url":"https://api.github.com/users/mspncp/received_events","type":"User","site_admin":false},"body":"perfectly valid UTF-8 encoded code point U+00EF ,,,","created_at":"2018-05-06T18:09:19Z","updated_at":"2018-05-06T18:50:22Z","html_url":"https://github.com/openssl/openssl/pull/6179#discussion_r186298376","pull_request_url":"https://api.github.com/repos/openssl/openssl/pulls/6179","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/openssl/openssl/pulls/comments/186298376"},"html":{"href":"https://github.com/openssl/openssl/pull/6179#discussion_r186298376"},"pull_request":{"href":"https://api.github.com/repos/openssl/openssl/pulls/6179"}}},"pull_request":{"url":"https://api.github.com/repos/openssl/openssl/pulls/6179","id":186114950,"html_url":"https://github.com/openssl/openssl/pull/6179","diff_url":"https://github.com/openssl/openssl/pull/6179.diff","patch_url":"https://github.com/openssl/openssl/pull/6179.patch","issue_url":"https://api.github.com/repos/openssl/openssl/issues/6179","number":6179,"state":"open","locked":false,"title":"WIP: Docs: add general document on how pass phrases are handled","user":{"login":"levitte","id":698918,"avatar_url":"https://avatars1.githubusercontent.com/u/698918?v=4","gravatar_id":"","url":"https://api.github.com/users/levitte","html_url":"https://github.com/levitte","followers_url":"https://api.github.com/users/levitte/followers","following_url":"https://api.github.com/users/levitte/following{/other_user}","gists_url":"https://api.github.com/users/levitte/gists{/gist_id}","starred_url":"https://api.github.com/users/levitte/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/levitte/subscriptions","organizations_url":"https://api.github.com/users/levitte/orgs","repos_url":"https://api.github.com/users/levitte/repos","events_url":"https://api.github.com/users/levitte/events{/privacy}","received_events_url":"https://api.github.com/users/levitte/received_events","type":"User","site_admin":false},"body":"Related to #3531","created_at":"2018-05-04T22:09:27Z","updated_at":"2018-05-06T18:50:22Z","closed_at":null,"merged_at":null,"merge_commit_sha":"a7047d4d3b7caa2e48151a82e06ebc6c51ec909a","assignee":null,"assignees":[],"requested_reviewers":[{"login":"kaduk","id":1894506,"avatar_url":"https://avatars1.githubusercontent.com/u/1894506?v=4","gravatar_id":"","url":"https://api.github.com/users/kaduk","html_url":"https://github.com/kaduk","followers_url":"https://api.github.com/users/kaduk/followers","following_url":"https://api.github.com/users/kaduk/following{/other_user}","gists_url":"https://api.github.com/users/kaduk/gists{/gist_id}","starred_url":"https://api.github.com/users/kaduk/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kaduk/subscriptions","organizations_url":"https://api.github.com/users/kaduk/orgs","repos_url":"https://api.github.com/users/kaduk/repos","events_url":"https://api.github.com/users/kaduk/events{/privacy}","received_events_url":"https://api.github.com/users/kaduk/received_events","type":"User","site_admin":false},{"login":"richsalz","id":7332500,"avatar_url":"https://avatars0.githubusercontent.com/u/7332500?v=4","gravatar_id":"","url":"https://api.github.com/users/richsalz","html_url":"https://github.com/richsalz","followers_url":"https://api.github.com/users/richsalz/followers","following_url":"https://api.github.com/users/richsalz/following{/other_user}","gists_url":"https://api.github.com/users/richsalz/gists{/gist_id}","starred_url":"https://api.github.com/users/richsalz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/richsalz/subscriptions","organizations_url":"https://api.github.com/users/richsalz/orgs","repos_url":"https://api.github.com/users/richsalz/repos","events_url":"https://api.github.com/users/richsalz/events{/privacy}","received_events_url":"https://api.github.com/users/richsalz/received_events","type":"User","site_admin":false},{"login":"t-j-h","id":7409473,"avatar_url":"https://avatars2.githubusercontent.com/u/7409473?v=4","gravatar_id":"","url":"https://api.github.com/users/t-j-h","html_url":"https://github.com/t-j-h","followers_url":"https://api.github.com/users/t-j-h/followers","following_url":"https://api.github.com/users/t-j-h/following{/other_user}","gists_url":"https://api.github.com/users/t-j-h/gists{/gist_id}","starred_url":"https://api.github.com/users/t-j-h/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/t-j-h/subscriptions","organizations_url":"https://api.github.com/users/t-j-h/orgs","repos_url":"https://api.github.com/users/t-j-h/repos","events_url":"https://api.github.com/users/t-j-h/events{/privacy}","received_events_url":"https://api.github.com/users/t-j-h/received_events","type":"User","site_admin":false},{"login":"mattcaswell","id":7422273,"avatar_url":"https://avatars0.githubusercontent.com/u/7422273?v=4","gravatar_id":"","url":"https://api.github.com/users/mattcaswell","html_url":"https://github.com/mattcaswell","followers_url":"https://api.github.com/users/mattcaswell/followers","following_url":"https://api.github.com/users/mattcaswell/following{/other_user}","gists_url":"https://api.github.com/users/mattcaswell/gists{/gist_id}","starred_url":"https://api.github.com/users/mattcaswell/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mattcaswell/subscriptions","organizations_url":"https://api.github.com/users/mattcaswell/orgs","repos_url":"https://api.github.com/users/mattcaswell/repos","events_url":"https://api.github.com/users/mattcaswell/events{/privacy}","received_events_url":"https://api.github.com/users/mattcaswell/received_events","type":"User","site_admin":false},{"login":"dot-asm","id":9038069,"avatar_url":"https://avatars2.githubusercontent.com/u/9038069?v=4","gravatar_id":"","url":"https://api.github.com/users/dot-asm","html_url":"https://github.com/dot-asm","followers_url":"https://api.github.com/users/dot-asm/followers","following_url":"https://api.github.com/users/dot-asm/following{/other_user}","gists_url":"https://api.github.com/users/dot-asm/gists{/gist_id}","starred_url":"https://api.github.com/users/dot-asm/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dot-asm/subscriptions","organizations_url":"https://api.github.com/users/dot-asm/orgs","repos_url":"https://api.github.com/users/dot-asm/repos","events_url":"https://api.github.com/users/dot-asm/events{/privacy}","received_events_url":"https://api.github.com/users/dot-asm/received_events","type":"User","site_admin":false}],"requested_teams":[],"labels":[{"id":872237503,"url":"https://api.github.com/repos/openssl/openssl/labels/1.1.1","name":"1.1.1","color":"bfdadc","default":false},{"id":441165144,"url":"https://api.github.com/repos/openssl/openssl/labels/master","name":"master","color":"bfdadc","default":false}],"milestone":null,"commits_url":"https://api.github.com/repos/openssl/openssl/pulls/6179/commits","review_comments_url":"https://api.github.com/repos/openssl/openssl/pulls/6179/comments","review_comment_url":"https://api.github.com/repos/openssl/openssl/pulls/comments{/number}","comments_url":"https://api.github.com/repos/openssl/openssl/issues/6179/comments","statuses_url":"https://api.github.com/repos/openssl/openssl/statuses/c6c37922a39d6b2b59c58f70ecee4a9126d3c876","head":{"label":"levitte:document-password-handling","ref":"document-password-handling","sha":"c6c37922a39d6b2b59c58f70ecee4a9126d3c876","user":{"login":"levitte","id":698918,"avatar_url":"https://avatars1.githubusercontent.com/u/698918?v=4","gravatar_id":"","url":"https://api.github.com/users/levitte","html_url":"https://github.com/levitte","followers_url":"https://api.github.com/users/levitte/followers","following_url":"https://api.github.com/users/levitte/following{/other_user}","gists_url":"https://api.github.com/users/levitte/gists{/gist_id}","starred_url":"https://api.github.com/users/levitte/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/levitte/subscriptions","organizations_url":"https://api.github.com/users/levitte/orgs","repos_url":"https://api.github.com/users/levitte/repos","events_url":"https://api.github.com/users/levitte/events{/privacy}","received_events_url":"https://api.github.com/users/levitte/received_events","type":"User","site_admin":false},"repo":{"id":22960861,"name":"openssl","full_name":"levitte/openssl","owner":{"login":"levitte","id":698918,"avatar_url":"https://avatars1.githubusercontent.com/u/698918?v=4","gravatar_id":"","url":"https://api.github.com/users/levitte","html_url":"https://github.com/levitte","followers_url":"https://api.github.com/users/levitte/followers","following_url":"https://api.github.com/users/levitte/following{/other_user}","gists_url":"https://api.github.com/users/levitte/gists{/gist_id}","starred_url":"https://api.github.com/users/levitte/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/levitte/subscriptions","organizations_url":"https://api.github.com/users/levitte/orgs","repos_url":"https://api.github.com/users/levitte/repos","events_url":"https://api.github.com/users/levitte/events{/privacy}","received_events_url":"https://api.github.com/users/levitte/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/levitte/openssl","description":null,"fork":true,"url":"https://api.github.com/repos/levitte/openssl","forks_url":"https://api.github.com/repos/levitte/openssl/forks","keys_url":"https://api.github.com/repos/levitte/openssl/keys{/key_id}","collaborators_url":"https://api.github.com/repos/levitte/openssl/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/levitte/openssl/teams","hooks_url":"https://api.github.com/repos/levitte/openssl/hooks","issue_events_url":"https://api.github.com/repos/levitte/openssl/issues/events{/number}","events_url":"https://api.github.com/repos/levitte/openssl/events","assignees_url":"https://api.github.com/repos/levitte/openssl/assignees{/user}","branches_url":"https://api.github.com/repos/levitte/openssl/branches{/branch}","tags_url":"https://api.github.com/repos/levitte/openssl/tags","blobs_url":"https://api.github.com/repos/levitte/openssl/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/levitte/openssl/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/levitte/openssl/git/refs{/sha}","trees_url":"https://api.github.com/repos/levitte/openssl/git/trees{/sha}","statuses_url":"https://api.github.com/repos/levitte/openssl/statuses/{sha}","languages_url":"https://api.github.com/repos/levitte/openssl/languages","stargazers_url":"https://api.github.com/repos/levitte/openssl/stargazers","contributors_url":"https://api.github.com/repos/levitte/openssl/contributors","subscribers_url":"https://api.github.com/repos/levitte/openssl/subscribers","subscription_url":"https://api.github.com/repos/levitte/openssl/subscription","commits_url":"https://api.github.com/repos/levitte/openssl/commits{/sha}","git_commits_url":"https://api.github.com/repos/levitte/openssl/git/commits{/sha}","comments_url":"https://api.github.com/repos/levitte/openssl/comments{/number}","issue_comment_url":"https://api.github.com/repos/levitte/openssl/issues/comments{/number}","contents_url":"https://api.github.com/repos/levitte/openssl/contents/{+path}","compare_url":"https://api.github.com/repos/levitte/openssl/compare/{base}...{head}","merges_url":"https://api.github.com/repos/levitte/openssl/merges","archive_url":"https://api.github.com/repos/levitte/openssl/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/levitte/openssl/downloads","issues_url":"https://api.github.com/repos/levitte/openssl/issues{/number}","pulls_url":"https://api.github.com/repos/levitte/openssl/pulls{/number}","milestones_url":"https://api.github.com/repos/levitte/openssl/milestones{/number}","notifications_url":"https://api.github.com/repos/levitte/openssl/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/levitte/openssl/labels{/name}","releases_url":"https://api.github.com/repos/levitte/openssl/releases{/id}","deployments_url":"https://api.github.com/repos/levitte/openssl/deployments","created_at":"2014-08-14T16:32:56Z","updated_at":"2017-07-15T16:59:17Z","pushed_at":"2018-05-06T12:49:23Z","git_url":"git://github.com/levitte/openssl.git","ssh_url":"git@github.com:levitte/openssl.git","clone_url":"https://github.com/levitte/openssl.git","svn_url":"https://github.com/levitte/openssl","homepage":"","size":148842,"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":1,"mirror_url":null,"archived":false,"open_issues_count":0,"license":{"key":"other","name":"Other","spdx_id":null,"url":null},"forks":1,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"openssl:master","ref":"master","sha":"781fb90cd7ec28a0d4e94cbb4a95fecb72020c2d","user":{"login":"openssl","id":3279138,"avatar_url":"https://avatars2.githubusercontent.com/u/3279138?v=4","gravatar_id":"","url":"https://api.github.com/users/openssl","html_url":"https://github.com/openssl","followers_url":"https://api.github.com/users/openssl/followers","following_url":"https://api.github.com/users/openssl/following{/other_user}","gists_url":"https://api.github.com/users/openssl/gists{/gist_id}","starred_url":"https://api.github.com/users/openssl/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/openssl/subscriptions","organizations_url":"https://api.github.com/users/openssl/orgs","repos_url":"https://api.github.com/users/openssl/repos","events_url":"https://api.github.com/users/openssl/events{/privacy}","received_events_url":"https://api.github.com/users/openssl/received_events","type":"Organization","site_admin":false},"repo":{"id":7634677,"name":"openssl","full_name":"openssl/openssl","owner":{"login":"openssl","id":3279138,"avatar_url":"https://avatars2.githubusercontent.com/u/3279138?v=4","gravatar_id":"","url":"https://api.github.com/users/openssl","html_url":"https://github.com/openssl","followers_url":"https://api.github.com/users/openssl/followers","following_url":"https://api.github.com/users/openssl/following{/other_user}","gists_url":"https://api.github.com/users/openssl/gists{/gist_id}","starred_url":"https://api.github.com/users/openssl/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/openssl/subscriptions","organizations_url":"https://api.github.com/users/openssl/orgs","repos_url":"https://api.github.com/users/openssl/repos","events_url":"https://api.github.com/users/openssl/events{/privacy}","received_events_url":"https://api.github.com/users/openssl/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/openssl/openssl","description":"TLS/SSL and crypto library","fork":false,"url":"https://api.github.com/repos/openssl/openssl","forks_url":"https://api.github.com/repos/openssl/openssl/forks","keys_url":"https://api.github.com/repos/openssl/openssl/keys{/key_id}","collaborators_url":"https://api.github.com/repos/openssl/openssl/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/openssl/openssl/teams","hooks_url":"https://api.github.com/repos/openssl/openssl/hooks","issue_events_url":"https://api.github.com/repos/openssl/openssl/issues/events{/number}","events_url":"https://api.github.com/repos/openssl/openssl/events","assignees_url":"https://api.github.com/repos/openssl/openssl/assignees{/user}","branches_url":"https://api.github.com/repos/openssl/openssl/branches{/branch}","tags_url":"https://api.github.com/repos/openssl/openssl/tags","blobs_url":"https://api.github.com/repos/openssl/openssl/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/openssl/openssl/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/openssl/openssl/git/refs{/sha}","trees_url":"https://api.github.com/repos/openssl/openssl/git/trees{/sha}","statuses_url":"https://api.github.com/repos/openssl/openssl/statuses/{sha}","languages_url":"https://api.github.com/repos/openssl/openssl/languages","stargazers_url":"https://api.github.com/repos/openssl/openssl/stargazers","contributors_url":"https://api.github.com/repos/openssl/openssl/contributors","subscribers_url":"https://api.github.com/repos/openssl/openssl/subscribers","subscription_url":"https://api.github.com/repos/openssl/openssl/subscription","commits_url":"https://api.github.com/repos/openssl/openssl/commits{/sha}","git_commits_url":"https://api.github.com/repos/openssl/openssl/git/commits{/sha}","comments_url":"https://api.github.com/repos/openssl/openssl/comments{/number}","issue_comment_url":"https://api.github.com/repos/openssl/openssl/issues/comments{/number}","contents_url":"https://api.github.com/repos/openssl/openssl/contents/{+path}","compare_url":"https://api.github.com/repos/openssl/openssl/compare/{base}...{head}","merges_url":"https://api.github.com/repos/openssl/openssl/merges","archive_url":"https://api.github.com/repos/openssl/openssl/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/openssl/openssl/downloads","issues_url":"https://api.github.com/repos/openssl/openssl/issues{/number}","pulls_url":"https://api.github.com/repos/openssl/openssl/pulls{/number}","milestones_url":"https://api.github.com/repos/openssl/openssl/milestones{/number}","notifications_url":"https://api.github.com/repos/openssl/openssl/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/openssl/openssl/labels{/name}","releases_url":"https://api.github.com/repos/openssl/openssl/releases{/id}","deployments_url":"https://api.github.com/repos/openssl/openssl/deployments","created_at":"2013-01-15T22:34:48Z","updated_at":"2018-05-06T18:15:04Z","pushed_at":"2018-05-06T16:37:10Z","git_url":"git://github.com/openssl/openssl.git","ssh_url":"git@github.com:openssl/openssl.git","clone_url":"https://github.com/openssl/openssl.git","svn_url":"https://github.com/openssl/openssl","homepage":"https://www.openssl.org","size":147207,"stargazers_count":7004,"watchers_count":7004,"language":"C","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":3417,"mirror_url":null,"archived":false,"open_issues_count":346,"license":{"key":"other","name":"Other","spdx_id":null,"url":null},"forks":3417,"open_issues":346,"watchers":7004,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/openssl/openssl/pulls/6179"},"html":{"href":"https://github.com/openssl/openssl/pull/6179"},"issue":{"href":"https://api.github.com/repos/openssl/openssl/issues/6179"},"comments":{"href":"https://api.github.com/repos/openssl/openssl/issues/6179/comments"},"review_comments":{"href":"https://api.github.com/repos/openssl/openssl/pulls/6179/comments"},"review_comment":{"href":"https://api.github.com/repos/openssl/openssl/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/openssl/openssl/pulls/6179/commits"},"statuses":{"href":"https://api.github.com/repos/openssl/openssl/statuses/c6c37922a39d6b2b59c58f70ecee4a9126d3c876"}},"author_association":"OWNER"}}
{"actor":{"display_login":"mspncp"}}