{"action":"created","comment":{"url":"https://api.github.com/repos/in-toto/in-toto/pulls/comments/172881294","pull_request_review_id":101970363,"id":172881294,"diff_hunk":"@@ -57,6 +57,21 @@\n import securesystemslib.schema as ssl_schema\n import securesystemslib.formats as ssl_formats\n \n+def _create_pubkey_with_subkey_schema(pubkey_schema):\n+  \"\"\"Helper method to extend the passed public key schema with an optional\n+  dictionary of sub public keys \"subkeys\" with the same schema.\"\"\"\n+  schema = pubkey_schema\n+  subkey_schema_tpl =  (\"subkeys\", ssl_schema.Optional(\n+        ssl_schema.DictOf(\n+          key_schema=ssl_formats.KEYID_SCHEMA,\n+          value_schema=pubkey_schema\n+          )\n+        )\n+      )\n+  # TODO: Find a way that does not require to access a proteced member\n+  schema._required.append(subkey_schema_tpl) # pylint: disable=protected-access","path":"in_toto/gpg/formats.py","position":16,"original_position":16,"commit_id":"90ed9fafe596891d8b66c5a5820aae7a1771e286","original_commit_id":"90ed9fafe596891d8b66c5a5820aae7a1771e286","user":{"login":"vladimir-v-diaz","id":3520883,"avatar_url":"https://avatars2.githubusercontent.com/u/3520883?v=4","gravatar_id":"","url":"https://api.github.com/users/vladimir-v-diaz","html_url":"https://github.com/vladimir-v-diaz","followers_url":"https://api.github.com/users/vladimir-v-diaz/followers","following_url":"https://api.github.com/users/vladimir-v-diaz/following{/other_user}","gists_url":"https://api.github.com/users/vladimir-v-diaz/gists{/gist_id}","starred_url":"https://api.github.com/users/vladimir-v-diaz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vladimir-v-diaz/subscriptions","organizations_url":"https://api.github.com/users/vladimir-v-diaz/orgs","repos_url":"https://api.github.com/users/vladimir-v-diaz/repos","events_url":"https://api.github.com/users/vladimir-v-diaz/events{/privacy}","received_events_url":"https://api.github.com/users/vladimir-v-diaz/received_events","type":"User","site_admin":false},"body":"I don't quite understand this use of `_required()`.  The comment above stated that this is optional, but then this _required() call is here.","created_at":"2018-03-07T15:33:59Z","updated_at":"2018-03-07T15:35:17Z","html_url":"https://github.com/in-toto/in-toto/pull/190#discussion_r172881294","pull_request_url":"https://api.github.com/repos/in-toto/in-toto/pulls/190","author_association":"COLLABORATOR","_links":{"self":{"href":"https://api.github.com/repos/in-toto/in-toto/pulls/comments/172881294"},"html":{"href":"https://github.com/in-toto/in-toto/pull/190#discussion_r172881294"},"pull_request":{"href":"https://api.github.com/repos/in-toto/in-toto/pulls/190"}}},"pull_request":{"url":"https://api.github.com/repos/in-toto/in-toto/pulls/190","id":172366169,"html_url":"https://github.com/in-toto/in-toto/pull/190","diff_url":"https://github.com/in-toto/in-toto/pull/190.diff","patch_url":"https://github.com/in-toto/in-toto/pull/190.patch","issue_url":"https://api.github.com/repos/in-toto/in-toto/issues/190","number":190,"state":"open","locked":false,"title":"Add GPG signing subkey support","user":{"login":"lukpueh","id":589324,"avatar_url":"https://avatars2.githubusercontent.com/u/589324?v=4","gravatar_id":"","url":"https://api.github.com/users/lukpueh","html_url":"https://github.com/lukpueh","followers_url":"https://api.github.com/users/lukpueh/followers","following_url":"https://api.github.com/users/lukpueh/following{/other_user}","gists_url":"https://api.github.com/users/lukpueh/gists{/gist_id}","starred_url":"https://api.github.com/users/lukpueh/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lukpueh/subscriptions","organizations_url":"https://api.github.com/users/lukpueh/orgs","repos_url":"https://api.github.com/users/lukpueh/repos","events_url":"https://api.github.com/users/lukpueh/events{/privacy}","received_events_url":"https://api.github.com/users/lukpueh/received_events","type":"User","site_admin":false},"body":"**Description of the changes being introduced by the pull request**:\r\n\r\nGPG is often used together with subkeys, where a master key is associated with several sub keys with different capabilities (signing, encryption, both). This PR updates in-toto's `gpg` module to support subkeys and adds subkey trust to in_toto's `link` and `layout` signature verification.\r\n\r\n***The main chunks of this PR are:***\r\n\r\n- Update gpg module to support exporting public key bundles (master key + sub keys)  instead of the master public key only. 46d8ad1a657a67a453964f6d0913c38bd1d08c45, 105d62589278bcb4ae3da3fc6868a9bb2580f74b\r\n\r\n- Update gpg module to  better support signing with old versions of GPG that don't add the full keyid to the signature. 28ba99384eba6219a578d3de395941121ba6a6b1\r\n\r\n- Update signature verification methods to accept a public key bundle and also iterate over subkeys to find the right verification key for a signature. c63553c29c09089993e6eb4e2ca76c3aa3398587 \r\n\r\n- Update link threshold verification to support gpg trust delegations. A good overview over the newly supported scenarios can be found in the [related verifylib TestCase](https://github.com/in-toto/in-toto/blob/90ed9fafe596891d8b66c5a5820aae7a1771e286/tests/test_verifylib.py#L1286-L1311).\r\n0a6dcacaabd864346246b1a7a249bfa01c711a81, 7324c76be191d8166b4aadac0d72dbee2964cfd1, 90ed9fafe596891d8b66c5a5820aae7a1771e286\r\n\r\nAs always, please consider the commit messages as source for additional info.\r\n\r\n**Please verify and check that the pull request fulfills the following\r\nrequirements**:\r\n\r\n- [ ] The code follows the [Code Style Guidelines](https://github.com/secure-systems-lab/code-style-guidelines#code-style-guidelines)\r\n- [ ] Tests have been added for the bug fix or new feature\r\n- [ ] Docs have been added for the bug fix or new feature\r\n\r\n\r\n","created_at":"2018-03-01T22:01:28Z","updated_at":"2018-03-07T15:35:17Z","closed_at":null,"merged_at":null,"merge_commit_sha":"39981667f7cf964bb12615ac9a380df46ec602d4","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/in-toto/in-toto/pulls/190/commits","review_comments_url":"https://api.github.com/repos/in-toto/in-toto/pulls/190/comments","review_comment_url":"https://api.github.com/repos/in-toto/in-toto/pulls/comments{/number}","comments_url":"https://api.github.com/repos/in-toto/in-toto/issues/190/comments","statuses_url":"https://api.github.com/repos/in-toto/in-toto/statuses/90ed9fafe596891d8b66c5a5820aae7a1771e286","head":{"label":"lukpueh:gpg-subkeys","ref":"gpg-subkeys","sha":"90ed9fafe596891d8b66c5a5820aae7a1771e286","user":{"login":"lukpueh","id":589324,"avatar_url":"https://avatars2.githubusercontent.com/u/589324?v=4","gravatar_id":"","url":"https://api.github.com/users/lukpueh","html_url":"https://github.com/lukpueh","followers_url":"https://api.github.com/users/lukpueh/followers","following_url":"https://api.github.com/users/lukpueh/following{/other_user}","gists_url":"https://api.github.com/users/lukpueh/gists{/gist_id}","starred_url":"https://api.github.com/users/lukpueh/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lukpueh/subscriptions","organizations_url":"https://api.github.com/users/lukpueh/orgs","repos_url":"https://api.github.com/users/lukpueh/repos","events_url":"https://api.github.com/users/lukpueh/events{/privacy}","received_events_url":"https://api.github.com/users/lukpueh/received_events","type":"User","site_admin":false},"repo":{"id":110009391,"name":"in-toto","full_name":"lukpueh/in-toto","owner":{"login":"lukpueh","id":589324,"avatar_url":"https://avatars2.githubusercontent.com/u/589324?v=4","gravatar_id":"","url":"https://api.github.com/users/lukpueh","html_url":"https://github.com/lukpueh","followers_url":"https://api.github.com/users/lukpueh/followers","following_url":"https://api.github.com/users/lukpueh/following{/other_user}","gists_url":"https://api.github.com/users/lukpueh/gists{/gist_id}","starred_url":"https://api.github.com/users/lukpueh/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lukpueh/subscriptions","organizations_url":"https://api.github.com/users/lukpueh/orgs","repos_url":"https://api.github.com/users/lukpueh/repos","events_url":"https://api.github.com/users/lukpueh/events{/privacy}","received_events_url":"https://api.github.com/users/lukpueh/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/lukpueh/in-toto","description":"in-toto is a framework to protect supply chain integrity.","fork":true,"url":"https://api.github.com/repos/lukpueh/in-toto","forks_url":"https://api.github.com/repos/lukpueh/in-toto/forks","keys_url":"https://api.github.com/repos/lukpueh/in-toto/keys{/key_id}","collaborators_url":"https://api.github.com/repos/lukpueh/in-toto/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/lukpueh/in-toto/teams","hooks_url":"https://api.github.com/repos/lukpueh/in-toto/hooks","issue_events_url":"https://api.github.com/repos/lukpueh/in-toto/issues/events{/number}","events_url":"https://api.github.com/repos/lukpueh/in-toto/events","assignees_url":"https://api.github.com/repos/lukpueh/in-toto/assignees{/user}","branches_url":"https://api.github.com/repos/lukpueh/in-toto/branches{/branch}","tags_url":"https://api.github.com/repos/lukpueh/in-toto/tags","blobs_url":"https://api.github.com/repos/lukpueh/in-toto/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/lukpueh/in-toto/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/lukpueh/in-toto/git/refs{/sha}","trees_url":"https://api.github.com/repos/lukpueh/in-toto/git/trees{/sha}","statuses_url":"https://api.github.com/repos/lukpueh/in-toto/statuses/{sha}","languages_url":"https://api.github.com/repos/lukpueh/in-toto/languages","stargazers_url":"https://api.github.com/repos/lukpueh/in-toto/stargazers","contributors_url":"https://api.github.com/repos/lukpueh/in-toto/contributors","subscribers_url":"https://api.github.com/repos/lukpueh/in-toto/subscribers","subscription_url":"https://api.github.com/repos/lukpueh/in-toto/subscription","commits_url":"https://api.github.com/repos/lukpueh/in-toto/commits{/sha}","git_commits_url":"https://api.github.com/repos/lukpueh/in-toto/git/commits{/sha}","comments_url":"https://api.github.com/repos/lukpueh/in-toto/comments{/number}","issue_comment_url":"https://api.github.com/repos/lukpueh/in-toto/issues/comments{/number}","contents_url":"https://api.github.com/repos/lukpueh/in-toto/contents/{+path}","compare_url":"https://api.github.com/repos/lukpueh/in-toto/compare/{base}...{head}","merges_url":"https://api.github.com/repos/lukpueh/in-toto/merges","archive_url":"https://api.github.com/repos/lukpueh/in-toto/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/lukpueh/in-toto/downloads","issues_url":"https://api.github.com/repos/lukpueh/in-toto/issues{/number}","pulls_url":"https://api.github.com/repos/lukpueh/in-toto/pulls{/number}","milestones_url":"https://api.github.com/repos/lukpueh/in-toto/milestones{/number}","notifications_url":"https://api.github.com/repos/lukpueh/in-toto/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/lukpueh/in-toto/labels{/name}","releases_url":"https://api.github.com/repos/lukpueh/in-toto/releases{/id}","deployments_url":"https://api.github.com/repos/lukpueh/in-toto/deployments","created_at":"2017-11-08T17:40:47Z","updated_at":"2017-11-08T17:40:48Z","pushed_at":"2018-03-06T22:49:57Z","git_url":"git://github.com/lukpueh/in-toto.git","ssh_url":"git@github.com:lukpueh/in-toto.git","clone_url":"https://github.com/lukpueh/in-toto.git","svn_url":"https://github.com/lukpueh/in-toto","homepage":"https://in-toto.io","size":1272,"stargazers_count":0,"watchers_count":0,"language":"Python","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":null,"forks":0,"open_issues":0,"watchers":0,"default_branch":"develop"}},"base":{"label":"in-toto:develop","ref":"develop","sha":"e53abb1c344a4f7ddab1661d0f218e5b673f50dc","user":{"login":"in-toto","id":22891761,"avatar_url":"https://avatars0.githubusercontent.com/u/22891761?v=4","gravatar_id":"","url":"https://api.github.com/users/in-toto","html_url":"https://github.com/in-toto","followers_url":"https://api.github.com/users/in-toto/followers","following_url":"https://api.github.com/users/in-toto/following{/other_user}","gists_url":"https://api.github.com/users/in-toto/gists{/gist_id}","starred_url":"https://api.github.com/users/in-toto/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/in-toto/subscriptions","organizations_url":"https://api.github.com/users/in-toto/orgs","repos_url":"https://api.github.com/users/in-toto/repos","events_url":"https://api.github.com/users/in-toto/events{/privacy}","received_events_url":"https://api.github.com/users/in-toto/received_events","type":"Organization","site_admin":false},"repo":{"id":59531400,"name":"in-toto","full_name":"in-toto/in-toto","owner":{"login":"in-toto","id":22891761,"avatar_url":"https://avatars0.githubusercontent.com/u/22891761?v=4","gravatar_id":"","url":"https://api.github.com/users/in-toto","html_url":"https://github.com/in-toto","followers_url":"https://api.github.com/users/in-toto/followers","following_url":"https://api.github.com/users/in-toto/following{/other_user}","gists_url":"https://api.github.com/users/in-toto/gists{/gist_id}","starred_url":"https://api.github.com/users/in-toto/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/in-toto/subscriptions","organizations_url":"https://api.github.com/users/in-toto/orgs","repos_url":"https://api.github.com/users/in-toto/repos","events_url":"https://api.github.com/users/in-toto/events{/privacy}","received_events_url":"https://api.github.com/users/in-toto/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/in-toto/in-toto","description":"in-toto is a framework to protect supply chain integrity.","fork":false,"url":"https://api.github.com/repos/in-toto/in-toto","forks_url":"https://api.github.com/repos/in-toto/in-toto/forks","keys_url":"https://api.github.com/repos/in-toto/in-toto/keys{/key_id}","collaborators_url":"https://api.github.com/repos/in-toto/in-toto/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/in-toto/in-toto/teams","hooks_url":"https://api.github.com/repos/in-toto/in-toto/hooks","issue_events_url":"https://api.github.com/repos/in-toto/in-toto/issues/events{/number}","events_url":"https://api.github.com/repos/in-toto/in-toto/events","assignees_url":"https://api.github.com/repos/in-toto/in-toto/assignees{/user}","branches_url":"https://api.github.com/repos/in-toto/in-toto/branches{/branch}","tags_url":"https://api.github.com/repos/in-toto/in-toto/tags","blobs_url":"https://api.github.com/repos/in-toto/in-toto/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/in-toto/in-toto/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/in-toto/in-toto/git/refs{/sha}","trees_url":"https://api.github.com/repos/in-toto/in-toto/git/trees{/sha}","statuses_url":"https://api.github.com/repos/in-toto/in-toto/statuses/{sha}","languages_url":"https://api.github.com/repos/in-toto/in-toto/languages","stargazers_url":"https://api.github.com/repos/in-toto/in-toto/stargazers","contributors_url":"https://api.github.com/repos/in-toto/in-toto/contributors","subscribers_url":"https://api.github.com/repos/in-toto/in-toto/subscribers","subscription_url":"https://api.github.com/repos/in-toto/in-toto/subscription","commits_url":"https://api.github.com/repos/in-toto/in-toto/commits{/sha}","git_commits_url":"https://api.github.com/repos/in-toto/in-toto/git/commits{/sha}","comments_url":"https://api.github.com/repos/in-toto/in-toto/comments{/number}","issue_comment_url":"https://api.github.com/repos/in-toto/in-toto/issues/comments{/number}","contents_url":"https://api.github.com/repos/in-toto/in-toto/contents/{+path}","compare_url":"https://api.github.com/repos/in-toto/in-toto/compare/{base}...{head}","merges_url":"https://api.github.com/repos/in-toto/in-toto/merges","archive_url":"https://api.github.com/repos/in-toto/in-toto/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/in-toto/in-toto/downloads","issues_url":"https://api.github.com/repos/in-toto/in-toto/issues{/number}","pulls_url":"https://api.github.com/repos/in-toto/in-toto/pulls{/number}","milestones_url":"https://api.github.com/repos/in-toto/in-toto/milestones{/number}","notifications_url":"https://api.github.com/repos/in-toto/in-toto/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/in-toto/in-toto/labels{/name}","releases_url":"https://api.github.com/repos/in-toto/in-toto/releases{/id}","deployments_url":"https://api.github.com/repos/in-toto/in-toto/deployments","created_at":"2016-05-24T01:46:38Z","updated_at":"2018-02-08T18:25:42Z","pushed_at":"2018-03-06T22:59:08Z","git_url":"git://github.com/in-toto/in-toto.git","ssh_url":"git@github.com:in-toto/in-toto.git","clone_url":"https://github.com/in-toto/in-toto.git","svn_url":"https://github.com/in-toto/in-toto","homepage":"https://in-toto.io","size":1143,"stargazers_count":25,"watchers_count":25,"language":"Python","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":18,"mirror_url":null,"archived":false,"open_issues_count":26,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit"},"forks":18,"open_issues":26,"watchers":25,"default_branch":"develop"}},"_links":{"self":{"href":"https://api.github.com/repos/in-toto/in-toto/pulls/190"},"html":{"href":"https://github.com/in-toto/in-toto/pull/190"},"issue":{"href":"https://api.github.com/repos/in-toto/in-toto/issues/190"},"comments":{"href":"https://api.github.com/repos/in-toto/in-toto/issues/190/comments"},"review_comments":{"href":"https://api.github.com/repos/in-toto/in-toto/pulls/190/comments"},"review_comment":{"href":"https://api.github.com/repos/in-toto/in-toto/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/in-toto/in-toto/pulls/190/commits"},"statuses":{"href":"https://api.github.com/repos/in-toto/in-toto/statuses/90ed9fafe596891d8b66c5a5820aae7a1771e286"}},"author_association":"COLLABORATOR"}}
{"actor":{"display_login":"vladimir-v-diaz"}}