{"action":"created","comment":{"url":"https://api.github.com/repos/tpm2-software/tpm2-tools/pulls/comments/231698094","pull_request_review_id":172725072,"id":231698094,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIzMTY5ODA5NA==","diff_hunk":"@@ -0,0 +1,82 @@\n+#!/bin/bash\n+#;**********************************************************************;\n+#\n+# Copyright (c) 2018, Intel Corporation\n+# All rights reserved.\n+#\n+# Redistribution and use in source and binary forms, with or without\n+# modification, are permitted provided that the following conditions are met:\n+#\n+# 1. Redistributions of source code must retain the above copyright notice,\n+# this list of conditions and the following disclaimer.\n+#\n+# 2. Redistributions in binary form must reproduce the above copyright notice,\n+# this list of conditions and the following disclaimer in the documentation\n+# and/or other materials provided with the distribution.\n+#\n+# 3. Neither the name of Intel Corporation nor the names of its contributors\n+# may be used to endorse or promote products derived from this software without\n+# specific prior written permission.\n+#\n+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\"\n+# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\n+# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n+# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE\n+# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR\n+# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF\n+# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS\n+# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN\n+# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n+# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF\n+# THE POSSIBILITY OF SUCH DAMAGE.\n+#;**********************************************************************;\n+\n+source helpers.sh\n+\n+policypassword=policy.dat\n+session_ctx=session.ctx\n+o_policy_digest=policy.digest\n+primary_key_ctx=prim.ctx\n+key_ctx=key.ctx\n+key_pub=key.pub\n+key_priv=key.priv\n+plain_txt=plain.txt\n+encrypted_txt=enc.txt\n+decrypted_txt=dec.txt\n+testpswd=testpswd\n+\n+cleanup() {\n+  rm -f  $policypassword $session_ctx $o_policy_digest $primary_key_ctx $key_ctx\\\n+  \t$key_pub $key_priv $plain_txt $encrypted_txt $decrypted_txt\n+\n+  tpm2_flushcontext -S $session_ctx 2>/dev/null || true\n+}\n+trap cleanup EXIT\n+\n+start_up\n+\n+cleanup\n+\n+echo \"plaintext\" > $plain_txt\n+\n+tpm2_startauthsession -S $session_ctx\n+tpm2_policypassword -S $session_ctx -o $policypassword\n+tpm2_flushcontext -S $session_ctx\n+\n+tpm2_createprimary -a o -o $primary_key_ctx\n+\n+tpm2_create -g sha256 -G aes -u $key_pub -r $key_priv -C $primary_key_ctx \\\n+  -L $policypassword -p $testpswd\n+\n+tpm2_load -C $primary_key_ctx -u $key_pub -r $key_priv -o $key_ctx\n+tpm2_encryptdecrypt -c $key_ctx -o $encrypted_txt -I $plain_txt -p $testpswd\n+\n+tpm2_startauthsession -a -S $session_ctx\n+tpm2_policypassword -S $session_ctx -o $policypassword\n+tpm2_encryptdecrypt -c $key_ctx -I $encrypted_txt -o $decrypted_txt -D \\\n+  -p session:$session_ctx+$testpswd","path":"test/integration/tests/tcti/abrmd/policypassword.sh","position":77,"original_position":77,"commit_id":"986a294acaa76ab361b48a6fd179b335260729fd","original_commit_id":"0eab05fc3667f6ad1c5f32eac1ff6be004533a38","user":{"login":"idesai","id":16821900,"node_id":"MDQ6VXNlcjE2ODIxOTAw","avatar_url":"https://avatars3.githubusercontent.com/u/16821900?v=4","gravatar_id":"","url":"https://api.github.com/users/idesai","html_url":"https://github.com/idesai","followers_url":"https://api.github.com/users/idesai/followers","following_url":"https://api.github.com/users/idesai/following{/other_user}","gists_url":"https://api.github.com/users/idesai/gists{/gist_id}","starred_url":"https://api.github.com/users/idesai/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/idesai/subscriptions","organizations_url":"https://api.github.com/users/idesai/orgs","repos_url":"https://api.github.com/users/idesai/repos","events_url":"https://api.github.com/users/idesai/events{/privacy}","received_events_url":"https://api.github.com/users/idesai/received_events","type":"User","site_admin":false},"body":"as in, we are actually updating the auth value and session handle for same auth session.","created_at":"2018-11-07T22:13:21Z","updated_at":"2018-11-07T22:13:21Z","html_url":"https://github.com/tpm2-software/tpm2-tools/pull/1227#discussion_r231698094","pull_request_url":"https://api.github.com/repos/tpm2-software/tpm2-tools/pulls/1227","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/tpm2-software/tpm2-tools/pulls/comments/231698094"},"html":{"href":"https://github.com/tpm2-software/tpm2-tools/pull/1227#discussion_r231698094"},"pull_request":{"href":"https://api.github.com/repos/tpm2-software/tpm2-tools/pulls/1227"}},"in_reply_to_id":231569569},"pull_request":{"url":"https://api.github.com/repos/tpm2-software/tpm2-tools/pulls/1227","id":228088417,"node_id":"MDExOlB1bGxSZXF1ZXN0MjI4MDg4NDE3","html_url":"https://github.com/tpm2-software/tpm2-tools/pull/1227","diff_url":"https://github.com/tpm2-software/tpm2-tools/pull/1227.diff","patch_url":"https://github.com/tpm2-software/tpm2-tools/pull/1227.patch","issue_url":"https://api.github.com/repos/tpm2-software/tpm2-tools/issues/1227","number":1227,"state":"open","locked":false,"title":"tpm2_policypassword: Adding new tool to bind policies with PolicyPassword","user":{"login":"idesai","id":16821900,"node_id":"MDQ6VXNlcjE2ODIxOTAw","avatar_url":"https://avatars3.githubusercontent.com/u/16821900?v=4","gravatar_id":"","url":"https://api.github.com/users/idesai","html_url":"https://github.com/idesai","followers_url":"https://api.github.com/users/idesai/followers","following_url":"https://api.github.com/users/idesai/following{/other_user}","gists_url":"https://api.github.com/users/idesai/gists{/gist_id}","starred_url":"https://api.github.com/users/idesai/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/idesai/subscriptions","organizations_url":"https://api.github.com/users/idesai/orgs","repos_url":"https://api.github.com/users/idesai/repos","events_url":"https://api.github.com/users/idesai/events{/privacy}","received_events_url":"https://api.github.com/users/idesai/received_events","type":"User","site_admin":false},"body":"","created_at":"2018-11-03T00:34:00Z","updated_at":"2018-11-07T22:13:21Z","closed_at":null,"merged_at":null,"merge_commit_sha":"15fac25bc1bcc9a1bdea21f707ec5c6d0fc3e77f","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/tpm2-software/tpm2-tools/pulls/1227/commits","review_comments_url":"https://api.github.com/repos/tpm2-software/tpm2-tools/pulls/1227/comments","review_comment_url":"https://api.github.com/repos/tpm2-software/tpm2-tools/pulls/comments{/number}","comments_url":"https://api.github.com/repos/tpm2-software/tpm2-tools/issues/1227/comments","statuses_url":"https://api.github.com/repos/tpm2-software/tpm2-tools/statuses/986a294acaa76ab361b48a6fd179b335260729fd","head":{"label":"idesai:tpm2_policypassword","ref":"tpm2_policypassword","sha":"986a294acaa76ab361b48a6fd179b335260729fd","user":{"login":"idesai","id":16821900,"node_id":"MDQ6VXNlcjE2ODIxOTAw","avatar_url":"https://avatars3.githubusercontent.com/u/16821900?v=4","gravatar_id":"","url":"https://api.github.com/users/idesai","html_url":"https://github.com/idesai","followers_url":"https://api.github.com/users/idesai/followers","following_url":"https://api.github.com/users/idesai/following{/other_user}","gists_url":"https://api.github.com/users/idesai/gists{/gist_id}","starred_url":"https://api.github.com/users/idesai/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/idesai/subscriptions","organizations_url":"https://api.github.com/users/idesai/orgs","repos_url":"https://api.github.com/users/idesai/repos","events_url":"https://api.github.com/users/idesai/events{/privacy}","received_events_url":"https://api.github.com/users/idesai/received_events","type":"User","site_admin":false},"repo":{"id":50965081,"node_id":"MDEwOlJlcG9zaXRvcnk1MDk2NTA4MQ==","name":"tpm2.0-tools","full_name":"idesai/tpm2.0-tools","private":false,"owner":{"login":"idesai","id":16821900,"node_id":"MDQ6VXNlcjE2ODIxOTAw","avatar_url":"https://avatars3.githubusercontent.com/u/16821900?v=4","gravatar_id":"","url":"https://api.github.com/users/idesai","html_url":"https://github.com/idesai","followers_url":"https://api.github.com/users/idesai/followers","following_url":"https://api.github.com/users/idesai/following{/other_user}","gists_url":"https://api.github.com/users/idesai/gists{/gist_id}","starred_url":"https://api.github.com/users/idesai/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/idesai/subscriptions","organizations_url":"https://api.github.com/users/idesai/orgs","repos_url":"https://api.github.com/users/idesai/repos","events_url":"https://api.github.com/users/idesai/events{/privacy}","received_events_url":"https://api.github.com/users/idesai/received_events","type":"User","site_admin":false},"html_url":"https://github.com/idesai/tpm2.0-tools","description":null,"fork":true,"url":"https://api.github.com/repos/idesai/tpm2.0-tools","forks_url":"https://api.github.com/repos/idesai/tpm2.0-tools/forks","keys_url":"https://api.github.com/repos/idesai/tpm2.0-tools/keys{/key_id}","collaborators_url":"https://api.github.com/repos/idesai/tpm2.0-tools/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/idesai/tpm2.0-tools/teams","hooks_url":"https://api.github.com/repos/idesai/tpm2.0-tools/hooks","issue_events_url":"https://api.github.com/repos/idesai/tpm2.0-tools/issues/events{/number}","events_url":"https://api.github.com/repos/idesai/tpm2.0-tools/events","assignees_url":"https://api.github.com/repos/idesai/tpm2.0-tools/assignees{/user}","branches_url":"https://api.github.com/repos/idesai/tpm2.0-tools/branches{/branch}","tags_url":"https://api.github.com/repos/idesai/tpm2.0-tools/tags","blobs_url":"https://api.github.com/repos/idesai/tpm2.0-tools/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/idesai/tpm2.0-tools/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/idesai/tpm2.0-tools/git/refs{/sha}","trees_url":"https://api.github.com/repos/idesai/tpm2.0-tools/git/trees{/sha}","statuses_url":"https://api.github.com/repos/idesai/tpm2.0-tools/statuses/{sha}","languages_url":"https://api.github.com/repos/idesai/tpm2.0-tools/languages","stargazers_url":"https://api.github.com/repos/idesai/tpm2.0-tools/stargazers","contributors_url":"https://api.github.com/repos/idesai/tpm2.0-tools/contributors","subscribers_url":"https://api.github.com/repos/idesai/tpm2.0-tools/subscribers","subscription_url":"https://api.github.com/repos/idesai/tpm2.0-tools/subscription","commits_url":"https://api.github.com/repos/idesai/tpm2.0-tools/commits{/sha}","git_commits_url":"https://api.github.com/repos/idesai/tpm2.0-tools/git/commits{/sha}","comments_url":"https://api.github.com/repos/idesai/tpm2.0-tools/comments{/number}","issue_comment_url":"https://api.github.com/repos/idesai/tpm2.0-tools/issues/comments{/number}","contents_url":"https://api.github.com/repos/idesai/tpm2.0-tools/contents/{+path}","compare_url":"https://api.github.com/repos/idesai/tpm2.0-tools/compare/{base}...{head}","merges_url":"https://api.github.com/repos/idesai/tpm2.0-tools/merges","archive_url":"https://api.github.com/repos/idesai/tpm2.0-tools/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/idesai/tpm2.0-tools/downloads","issues_url":"https://api.github.com/repos/idesai/tpm2.0-tools/issues{/number}","pulls_url":"https://api.github.com/repos/idesai/tpm2.0-tools/pulls{/number}","milestones_url":"https://api.github.com/repos/idesai/tpm2.0-tools/milestones{/number}","notifications_url":"https://api.github.com/repos/idesai/tpm2.0-tools/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/idesai/tpm2.0-tools/labels{/name}","releases_url":"https://api.github.com/repos/idesai/tpm2.0-tools/releases{/id}","deployments_url":"https://api.github.com/repos/idesai/tpm2.0-tools/deployments","created_at":"2016-02-03T01:32:08Z","updated_at":"2018-11-05T23:48:10Z","pushed_at":"2018-11-07T22:06:48Z","git_url":"git://github.com/idesai/tpm2.0-tools.git","ssh_url":"git@github.com:idesai/tpm2.0-tools.git","clone_url":"https://github.com/idesai/tpm2.0-tools.git","svn_url":"https://github.com/idesai/tpm2.0-tools","homepage":null,"size":4826,"stargazers_count":0,"watchers_count":0,"language":"C","has_issues":true,"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":"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","node_id":"MDc6TGljZW5zZTU="},"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"tpm2-software:master","ref":"master","sha":"4e0f9de6833f29faafd1f9431fda835dbb77d3a1","user":{"login":"tpm2-software","id":34488697,"node_id":"MDEyOk9yZ2FuaXphdGlvbjM0NDg4Njk3","avatar_url":"https://avatars3.githubusercontent.com/u/34488697?v=4","gravatar_id":"","url":"https://api.github.com/users/tpm2-software","html_url":"https://github.com/tpm2-software","followers_url":"https://api.github.com/users/tpm2-software/followers","following_url":"https://api.github.com/users/tpm2-software/following{/other_user}","gists_url":"https://api.github.com/users/tpm2-software/gists{/gist_id}","starred_url":"https://api.github.com/users/tpm2-software/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tpm2-software/subscriptions","organizations_url":"https://api.github.com/users/tpm2-software/orgs","repos_url":"https://api.github.com/users/tpm2-software/repos","events_url":"https://api.github.com/users/tpm2-software/events{/privacy}","received_events_url":"https://api.github.com/users/tpm2-software/received_events","type":"Organization","site_admin":false},"repo":{"id":41126332,"node_id":"MDEwOlJlcG9zaXRvcnk0MTEyNjMzMg==","name":"tpm2-tools","full_name":"tpm2-software/tpm2-tools","private":false,"owner":{"login":"tpm2-software","id":34488697,"node_id":"MDEyOk9yZ2FuaXphdGlvbjM0NDg4Njk3","avatar_url":"https://avatars3.githubusercontent.com/u/34488697?v=4","gravatar_id":"","url":"https://api.github.com/users/tpm2-software","html_url":"https://github.com/tpm2-software","followers_url":"https://api.github.com/users/tpm2-software/followers","following_url":"https://api.github.com/users/tpm2-software/following{/other_user}","gists_url":"https://api.github.com/users/tpm2-software/gists{/gist_id}","starred_url":"https://api.github.com/users/tpm2-software/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tpm2-software/subscriptions","organizations_url":"https://api.github.com/users/tpm2-software/orgs","repos_url":"https://api.github.com/users/tpm2-software/repos","events_url":"https://api.github.com/users/tpm2-software/events{/privacy}","received_events_url":"https://api.github.com/users/tpm2-software/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/tpm2-software/tpm2-tools","description":"The source repository for the TPM (Trusted Platform Module) 2 tools","fork":false,"url":"https://api.github.com/repos/tpm2-software/tpm2-tools","forks_url":"https://api.github.com/repos/tpm2-software/tpm2-tools/forks","keys_url":"https://api.github.com/repos/tpm2-software/tpm2-tools/keys{/key_id}","collaborators_url":"https://api.github.com/repos/tpm2-software/tpm2-tools/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/tpm2-software/tpm2-tools/teams","hooks_url":"https://api.github.com/repos/tpm2-software/tpm2-tools/hooks","issue_events_url":"https://api.github.com/repos/tpm2-software/tpm2-tools/issues/events{/number}","events_url":"https://api.github.com/repos/tpm2-software/tpm2-tools/events","assignees_url":"https://api.github.com/repos/tpm2-software/tpm2-tools/assignees{/user}","branches_url":"https://api.github.com/repos/tpm2-software/tpm2-tools/branches{/branch}","tags_url":"https://api.github.com/repos/tpm2-software/tpm2-tools/tags","blobs_url":"https://api.github.com/repos/tpm2-software/tpm2-tools/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/tpm2-software/tpm2-tools/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/tpm2-software/tpm2-tools/git/refs{/sha}","trees_url":"https://api.github.com/repos/tpm2-software/tpm2-tools/git/trees{/sha}","statuses_url":"https://api.github.com/repos/tpm2-software/tpm2-tools/statuses/{sha}","languages_url":"https://api.github.com/repos/tpm2-software/tpm2-tools/languages","stargazers_url":"https://api.github.com/repos/tpm2-software/tpm2-tools/stargazers","contributors_url":"https://api.github.com/repos/tpm2-software/tpm2-tools/contributors","subscribers_url":"https://api.github.com/repos/tpm2-software/tpm2-tools/subscribers","subscription_url":"https://api.github.com/repos/tpm2-software/tpm2-tools/subscription","commits_url":"https://api.github.com/repos/tpm2-software/tpm2-tools/commits{/sha}","git_commits_url":"https://api.github.com/repos/tpm2-software/tpm2-tools/git/commits{/sha}","comments_url":"https://api.github.com/repos/tpm2-software/tpm2-tools/comments{/number}","issue_comment_url":"https://api.github.com/repos/tpm2-software/tpm2-tools/issues/comments{/number}","contents_url":"https://api.github.com/repos/tpm2-software/tpm2-tools/contents/{+path}","compare_url":"https://api.github.com/repos/tpm2-software/tpm2-tools/compare/{base}...{head}","merges_url":"https://api.github.com/repos/tpm2-software/tpm2-tools/merges","archive_url":"https://api.github.com/repos/tpm2-software/tpm2-tools/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/tpm2-software/tpm2-tools/downloads","issues_url":"https://api.github.com/repos/tpm2-software/tpm2-tools/issues{/number}","pulls_url":"https://api.github.com/repos/tpm2-software/tpm2-tools/pulls{/number}","milestones_url":"https://api.github.com/repos/tpm2-software/tpm2-tools/milestones{/number}","notifications_url":"https://api.github.com/repos/tpm2-software/tpm2-tools/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/tpm2-software/tpm2-tools/labels{/name}","releases_url":"https://api.github.com/repos/tpm2-software/tpm2-tools/releases{/id}","deployments_url":"https://api.github.com/repos/tpm2-software/tpm2-tools/deployments","created_at":"2015-08-21T01:07:28Z","updated_at":"2018-11-06T18:04:29Z","pushed_at":"2018-11-07T22:06:50Z","git_url":"git://github.com/tpm2-software/tpm2-tools.git","ssh_url":"git@github.com:tpm2-software/tpm2-tools.git","clone_url":"https://github.com/tpm2-software/tpm2-tools.git","svn_url":"https://github.com/tpm2-software/tpm2-tools","homepage":"","size":4899,"stargazers_count":147,"watchers_count":147,"language":"C","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":108,"mirror_url":null,"archived":false,"open_issues_count":111,"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","node_id":"MDc6TGljZW5zZTU="},"forks":108,"open_issues":111,"watchers":147,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/tpm2-software/tpm2-tools/pulls/1227"},"html":{"href":"https://github.com/tpm2-software/tpm2-tools/pull/1227"},"issue":{"href":"https://api.github.com/repos/tpm2-software/tpm2-tools/issues/1227"},"comments":{"href":"https://api.github.com/repos/tpm2-software/tpm2-tools/issues/1227/comments"},"review_comments":{"href":"https://api.github.com/repos/tpm2-software/tpm2-tools/pulls/1227/comments"},"review_comment":{"href":"https://api.github.com/repos/tpm2-software/tpm2-tools/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/tpm2-software/tpm2-tools/pulls/1227/commits"},"statuses":{"href":"https://api.github.com/repos/tpm2-software/tpm2-tools/statuses/986a294acaa76ab361b48a6fd179b335260729fd"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"idesai"}}