{"action":"created","comment":{"url":"https://api.github.com/repos/keybase/client/pulls/comments/182500911","pull_request_review_id":113308868,"id":182500911,"diff_hunk":"@@ -1256,23 +1296,39 @@ func (b *Boxer) boxV1(messagePlaintext chat1.MessagePlaintext, key types.CryptKe\n \treturn boxed, nil\n }\n \n-func (b *Boxer) boxV2(messagePlaintext chat1.MessagePlaintext, baseEncryptionKey types.CryptKey,\n-\tsigningKeyPair libkb.NaclSigningKeyPair) (*chat1.MessageBoxed, error) {\n+// V3 is just V2 but with exploding messages support. All future versions after\n+// V3 will support exploding messages without a version distinction.\n+func (b *Boxer) boxV2orV3(messagePlaintext chat1.MessagePlaintext, baseEncryptionKey types.CryptKey,\n+\tephemeralSeed *keybase1.TeamEk, signingKeyPair libkb.NaclSigningKeyPair,\n+\tversion chat1.MessageBoxedVersion) (*chat1.MessageBoxed, error) {\n \n \tif messagePlaintext.ClientHeader.MerkleRoot == nil {\n \t\treturn nil, NewBoxingError(\"cannot send message without merkle root\", false)\n \t}\n \n-\tderivedEncryptionKey, err := libkb.DeriveSymmetricKey(\n+\theaderEncryptionKey, err := libkb.DeriveSymmetricKey(\n \t\tlibkb.NaclSecretBoxKey(baseEncryptionKey.Material()), libkb.EncryptionReasonChatMessage)\n \tif err != nil {\n \t\treturn nil, err\n \t}\n \n+\t// Regular messages use the same encryption key for the header and for the\n+\t// body. Exploding messages use a derived ephemeral key for the body.\n+\tbodyEncryptionKey := headerEncryptionKey\n+\tif messagePlaintext.IsExploding() {\n+\t\tbodyEncryptionKey, err = libkb.DeriveFromSecret(ephemeralSeed.Seed, libkb.DeriveReasonTeamEKExplodingChat)\n+\t\tif err != nil {\n+\t\t\treturn nil, err\n+\t\t}\n+\t\t// The MessagePlaintext supplied by the caller has a Lifetime, but we","path":"go/chat/boxer.go","position":225,"original_position":225,"commit_id":"0447d0877093c2d4d09d6e94f60c5dd0dd68d274","original_commit_id":"0447d0877093c2d4d09d6e94f60c5dd0dd68d274","user":{"login":"oconnor663","id":860932,"avatar_url":"https://avatars0.githubusercontent.com/u/860932?v=4","gravatar_id":"","url":"https://api.github.com/users/oconnor663","html_url":"https://github.com/oconnor663","followers_url":"https://api.github.com/users/oconnor663/followers","following_url":"https://api.github.com/users/oconnor663/following{/other_user}","gists_url":"https://api.github.com/users/oconnor663/gists{/gist_id}","starred_url":"https://api.github.com/users/oconnor663/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/oconnor663/subscriptions","organizations_url":"https://api.github.com/users/oconnor663/orgs","repos_url":"https://api.github.com/users/oconnor663/repos","events_url":"https://api.github.com/users/oconnor663/events{/privacy}","received_events_url":"https://api.github.com/users/oconnor663/received_events","type":"User","site_admin":false},"body":"I'll leave it as is given our design talk this morning.","created_at":"2018-04-18T17:05:19Z","updated_at":"2018-04-18T17:05:19Z","html_url":"https://github.com/keybase/client/pull/11404#discussion_r182500911","pull_request_url":"https://api.github.com/repos/keybase/client/pulls/11404","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/keybase/client/pulls/comments/182500911"},"html":{"href":"https://github.com/keybase/client/pull/11404#discussion_r182500911"},"pull_request":{"href":"https://api.github.com/repos/keybase/client/pulls/11404"}},"in_reply_to_id":182237900},"pull_request":{"url":"https://api.github.com/repos/keybase/client/pulls/11404","id":181589696,"html_url":"https://github.com/keybase/client/pull/11404","diff_url":"https://github.com/keybase/client/pull/11404.diff","patch_url":"https://github.com/keybase/client/pull/11404.patch","issue_url":"https://api.github.com/repos/keybase/client/issues/11404","number":11404,"state":"open","locked":false,"title":"encrypting exploding chat messages","user":{"login":"oconnor663","id":860932,"avatar_url":"https://avatars0.githubusercontent.com/u/860932?v=4","gravatar_id":"","url":"https://api.github.com/users/oconnor663","html_url":"https://github.com/oconnor663","followers_url":"https://api.github.com/users/oconnor663/followers","following_url":"https://api.github.com/users/oconnor663/following{/other_user}","gists_url":"https://api.github.com/users/oconnor663/gists{/gist_id}","starred_url":"https://api.github.com/users/oconnor663/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/oconnor663/subscriptions","organizations_url":"https://api.github.com/users/oconnor663/orgs","repos_url":"https://api.github.com/users/oconnor663/repos","events_url":"https://api.github.com/users/oconnor663/events{/privacy}","received_events_url":"https://api.github.com/users/oconnor663/received_events","type":"User","site_admin":false},"body":"cc @mmaxim and @joshblum. I don't have any tests in place for this yet, so there will probably be bugs, but it's at least all compiling if you're interested in looking at it now.","created_at":"2018-04-13T20:33:35Z","updated_at":"2018-04-18T17:05:19Z","closed_at":null,"merged_at":null,"merge_commit_sha":"584b8ccbfc8dfb7750e3d4c577ed2cbea5cfb7b5","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/keybase/client/pulls/11404/commits","review_comments_url":"https://api.github.com/repos/keybase/client/pulls/11404/comments","review_comment_url":"https://api.github.com/repos/keybase/client/pulls/comments{/number}","comments_url":"https://api.github.com/repos/keybase/client/issues/11404/comments","statuses_url":"https://api.github.com/repos/keybase/client/statuses/0447d0877093c2d4d09d6e94f60c5dd0dd68d274","head":{"label":"keybase:jack/CORE-6879/exploding2","ref":"jack/CORE-6879/exploding2","sha":"0447d0877093c2d4d09d6e94f60c5dd0dd68d274","user":{"login":"keybase","id":5400834,"avatar_url":"https://avatars2.githubusercontent.com/u/5400834?v=4","gravatar_id":"","url":"https://api.github.com/users/keybase","html_url":"https://github.com/keybase","followers_url":"https://api.github.com/users/keybase/followers","following_url":"https://api.github.com/users/keybase/following{/other_user}","gists_url":"https://api.github.com/users/keybase/gists{/gist_id}","starred_url":"https://api.github.com/users/keybase/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/keybase/subscriptions","organizations_url":"https://api.github.com/users/keybase/orgs","repos_url":"https://api.github.com/users/keybase/repos","events_url":"https://api.github.com/users/keybase/events{/privacy}","received_events_url":"https://api.github.com/users/keybase/received_events","type":"Organization","site_admin":false},"repo":{"id":29099181,"name":"client","full_name":"keybase/client","owner":{"login":"keybase","id":5400834,"avatar_url":"https://avatars2.githubusercontent.com/u/5400834?v=4","gravatar_id":"","url":"https://api.github.com/users/keybase","html_url":"https://github.com/keybase","followers_url":"https://api.github.com/users/keybase/followers","following_url":"https://api.github.com/users/keybase/following{/other_user}","gists_url":"https://api.github.com/users/keybase/gists{/gist_id}","starred_url":"https://api.github.com/users/keybase/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/keybase/subscriptions","organizations_url":"https://api.github.com/users/keybase/orgs","repos_url":"https://api.github.com/users/keybase/repos","events_url":"https://api.github.com/users/keybase/events{/privacy}","received_events_url":"https://api.github.com/users/keybase/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/keybase/client","description":"Keybase Go Library, Client, Service, OS X, iOS, Android, Electron","fork":false,"url":"https://api.github.com/repos/keybase/client","forks_url":"https://api.github.com/repos/keybase/client/forks","keys_url":"https://api.github.com/repos/keybase/client/keys{/key_id}","collaborators_url":"https://api.github.com/repos/keybase/client/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/keybase/client/teams","hooks_url":"https://api.github.com/repos/keybase/client/hooks","issue_events_url":"https://api.github.com/repos/keybase/client/issues/events{/number}","events_url":"https://api.github.com/repos/keybase/client/events","assignees_url":"https://api.github.com/repos/keybase/client/assignees{/user}","branches_url":"https://api.github.com/repos/keybase/client/branches{/branch}","tags_url":"https://api.github.com/repos/keybase/client/tags","blobs_url":"https://api.github.com/repos/keybase/client/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/keybase/client/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/keybase/client/git/refs{/sha}","trees_url":"https://api.github.com/repos/keybase/client/git/trees{/sha}","statuses_url":"https://api.github.com/repos/keybase/client/statuses/{sha}","languages_url":"https://api.github.com/repos/keybase/client/languages","stargazers_url":"https://api.github.com/repos/keybase/client/stargazers","contributors_url":"https://api.github.com/repos/keybase/client/contributors","subscribers_url":"https://api.github.com/repos/keybase/client/subscribers","subscription_url":"https://api.github.com/repos/keybase/client/subscription","commits_url":"https://api.github.com/repos/keybase/client/commits{/sha}","git_commits_url":"https://api.github.com/repos/keybase/client/git/commits{/sha}","comments_url":"https://api.github.com/repos/keybase/client/comments{/number}","issue_comment_url":"https://api.github.com/repos/keybase/client/issues/comments{/number}","contents_url":"https://api.github.com/repos/keybase/client/contents/{+path}","compare_url":"https://api.github.com/repos/keybase/client/compare/{base}...{head}","merges_url":"https://api.github.com/repos/keybase/client/merges","archive_url":"https://api.github.com/repos/keybase/client/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/keybase/client/downloads","issues_url":"https://api.github.com/repos/keybase/client/issues{/number}","pulls_url":"https://api.github.com/repos/keybase/client/pulls{/number}","milestones_url":"https://api.github.com/repos/keybase/client/milestones{/number}","notifications_url":"https://api.github.com/repos/keybase/client/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/keybase/client/labels{/name}","releases_url":"https://api.github.com/repos/keybase/client/releases{/id}","deployments_url":"https://api.github.com/repos/keybase/client/deployments","created_at":"2015-01-11T17:17:12Z","updated_at":"2018-04-18T16:55:47Z","pushed_at":"2018-04-18T17:04:06Z","git_url":"git://github.com/keybase/client.git","ssh_url":"git@github.com:keybase/client.git","clone_url":"https://github.com/keybase/client.git","svn_url":"https://github.com/keybase/client","homepage":"","size":231350,"stargazers_count":3526,"watchers_count":3526,"language":"Go","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":337,"mirror_url":null,"archived":false,"open_issues_count":2014,"license":{"key":"bsd-3-clause","name":"BSD 3-Clause \"New\" or \"Revised\" License","spdx_id":"BSD-3-Clause","url":"https://api.github.com/licenses/bsd-3-clause"},"forks":337,"open_issues":2014,"watchers":3526,"default_branch":"master"}},"base":{"label":"keybase:master","ref":"master","sha":"d951d49abd3d9cfccdd87db491f7c9de42886f7b","user":{"login":"keybase","id":5400834,"avatar_url":"https://avatars2.githubusercontent.com/u/5400834?v=4","gravatar_id":"","url":"https://api.github.com/users/keybase","html_url":"https://github.com/keybase","followers_url":"https://api.github.com/users/keybase/followers","following_url":"https://api.github.com/users/keybase/following{/other_user}","gists_url":"https://api.github.com/users/keybase/gists{/gist_id}","starred_url":"https://api.github.com/users/keybase/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/keybase/subscriptions","organizations_url":"https://api.github.com/users/keybase/orgs","repos_url":"https://api.github.com/users/keybase/repos","events_url":"https://api.github.com/users/keybase/events{/privacy}","received_events_url":"https://api.github.com/users/keybase/received_events","type":"Organization","site_admin":false},"repo":{"id":29099181,"name":"client","full_name":"keybase/client","owner":{"login":"keybase","id":5400834,"avatar_url":"https://avatars2.githubusercontent.com/u/5400834?v=4","gravatar_id":"","url":"https://api.github.com/users/keybase","html_url":"https://github.com/keybase","followers_url":"https://api.github.com/users/keybase/followers","following_url":"https://api.github.com/users/keybase/following{/other_user}","gists_url":"https://api.github.com/users/keybase/gists{/gist_id}","starred_url":"https://api.github.com/users/keybase/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/keybase/subscriptions","organizations_url":"https://api.github.com/users/keybase/orgs","repos_url":"https://api.github.com/users/keybase/repos","events_url":"https://api.github.com/users/keybase/events{/privacy}","received_events_url":"https://api.github.com/users/keybase/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/keybase/client","description":"Keybase Go Library, Client, Service, OS X, iOS, Android, Electron","fork":false,"url":"https://api.github.com/repos/keybase/client","forks_url":"https://api.github.com/repos/keybase/client/forks","keys_url":"https://api.github.com/repos/keybase/client/keys{/key_id}","collaborators_url":"https://api.github.com/repos/keybase/client/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/keybase/client/teams","hooks_url":"https://api.github.com/repos/keybase/client/hooks","issue_events_url":"https://api.github.com/repos/keybase/client/issues/events{/number}","events_url":"https://api.github.com/repos/keybase/client/events","assignees_url":"https://api.github.com/repos/keybase/client/assignees{/user}","branches_url":"https://api.github.com/repos/keybase/client/branches{/branch}","tags_url":"https://api.github.com/repos/keybase/client/tags","blobs_url":"https://api.github.com/repos/keybase/client/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/keybase/client/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/keybase/client/git/refs{/sha}","trees_url":"https://api.github.com/repos/keybase/client/git/trees{/sha}","statuses_url":"https://api.github.com/repos/keybase/client/statuses/{sha}","languages_url":"https://api.github.com/repos/keybase/client/languages","stargazers_url":"https://api.github.com/repos/keybase/client/stargazers","contributors_url":"https://api.github.com/repos/keybase/client/contributors","subscribers_url":"https://api.github.com/repos/keybase/client/subscribers","subscription_url":"https://api.github.com/repos/keybase/client/subscription","commits_url":"https://api.github.com/repos/keybase/client/commits{/sha}","git_commits_url":"https://api.github.com/repos/keybase/client/git/commits{/sha}","comments_url":"https://api.github.com/repos/keybase/client/comments{/number}","issue_comment_url":"https://api.github.com/repos/keybase/client/issues/comments{/number}","contents_url":"https://api.github.com/repos/keybase/client/contents/{+path}","compare_url":"https://api.github.com/repos/keybase/client/compare/{base}...{head}","merges_url":"https://api.github.com/repos/keybase/client/merges","archive_url":"https://api.github.com/repos/keybase/client/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/keybase/client/downloads","issues_url":"https://api.github.com/repos/keybase/client/issues{/number}","pulls_url":"https://api.github.com/repos/keybase/client/pulls{/number}","milestones_url":"https://api.github.com/repos/keybase/client/milestones{/number}","notifications_url":"https://api.github.com/repos/keybase/client/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/keybase/client/labels{/name}","releases_url":"https://api.github.com/repos/keybase/client/releases{/id}","deployments_url":"https://api.github.com/repos/keybase/client/deployments","created_at":"2015-01-11T17:17:12Z","updated_at":"2018-04-18T16:55:47Z","pushed_at":"2018-04-18T17:04:06Z","git_url":"git://github.com/keybase/client.git","ssh_url":"git@github.com:keybase/client.git","clone_url":"https://github.com/keybase/client.git","svn_url":"https://github.com/keybase/client","homepage":"","size":231350,"stargazers_count":3526,"watchers_count":3526,"language":"Go","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":337,"mirror_url":null,"archived":false,"open_issues_count":2014,"license":{"key":"bsd-3-clause","name":"BSD 3-Clause \"New\" or \"Revised\" License","spdx_id":"BSD-3-Clause","url":"https://api.github.com/licenses/bsd-3-clause"},"forks":337,"open_issues":2014,"watchers":3526,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/keybase/client/pulls/11404"},"html":{"href":"https://github.com/keybase/client/pull/11404"},"issue":{"href":"https://api.github.com/repos/keybase/client/issues/11404"},"comments":{"href":"https://api.github.com/repos/keybase/client/issues/11404/comments"},"review_comments":{"href":"https://api.github.com/repos/keybase/client/pulls/11404/comments"},"review_comment":{"href":"https://api.github.com/repos/keybase/client/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/keybase/client/pulls/11404/commits"},"statuses":{"href":"https://api.github.com/repos/keybase/client/statuses/0447d0877093c2d4d09d6e94f60c5dd0dd68d274"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"oconnor663"}}