{"action":"created","comment":{"url":"https://api.github.com/repos/OpenSC/OpenSC/pulls/comments/27159608","id":27159608,"diff_hunk":"@@ -803,10 +821,9 @@ static void ask_for_password(char **pwd, int *pwdlen)\n \n \n \n-static int generate_pwd_shares(sc_card_t *card, char **pwd, int *pwdlen, int password_shares_threshold, unsigned int password_shares_total)\n+static int generate_pwd_shares(sc_card_t *card, char **pwd, int *pwdlen, int password_shares_threshold, int password_shares_total)","path":"src/tools/sc-hsm-tool.c","position":64,"original_position":64,"commit_id":"6588aaa428507af012c1d00b9d7b95121dbd6c2b","original_commit_id":"6588aaa428507af012c1d00b9d7b95121dbd6c2b","user":{"login":"frankmorgner","id":1266577,"avatar_url":"https://avatars.githubusercontent.com/u/1266577?v=3","gravatar_id":"","url":"https://api.github.com/users/frankmorgner","html_url":"https://github.com/frankmorgner","followers_url":"https://api.github.com/users/frankmorgner/followers","following_url":"https://api.github.com/users/frankmorgner/following{/other_user}","gists_url":"https://api.github.com/users/frankmorgner/gists{/gist_id}","starred_url":"https://api.github.com/users/frankmorgner/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/frankmorgner/subscriptions","organizations_url":"https://api.github.com/users/frankmorgner/orgs","repos_url":"https://api.github.com/users/frankmorgner/repos","events_url":"https://api.github.com/users/frankmorgner/events{/privacy}","received_events_url":"https://api.github.com/users/frankmorgner/received_events","type":"User","site_admin":false},"body":"That's OK. I'm fine with `-1` as default value. I am talking about the following different layers:\r\n1. `create_dkek_share` which creates shares from a given user input (e.g. negative values)\r\n2. `generate_pwd_shares` which creates shares from well defined `password_shares_threshold` and `password_shares_total` (e.g. at least positive/unsigned values)\r\n\r\nThere is no need for a rewrite when keeping these logical layers alive. But, what ever, it's way too unimportant to spend so much time on this discussions ;-)","created_at":"2015-03-25T20:01:07Z","updated_at":"2015-03-25T20:01:07Z","html_url":"https://github.com/OpenSC/OpenSC/pull/399#discussion_r27159608","pull_request_url":"https://api.github.com/repos/OpenSC/OpenSC/pulls/399","_links":{"self":{"href":"https://api.github.com/repos/OpenSC/OpenSC/pulls/comments/27159608"},"html":{"href":"https://github.com/OpenSC/OpenSC/pull/399#discussion_r27159608"},"pull_request":{"href":"https://api.github.com/repos/OpenSC/OpenSC/pulls/399"}}},"pull_request":{"url":"https://api.github.com/repos/OpenSC/OpenSC/pulls/399","id":31690557,"html_url":"https://github.com/OpenSC/OpenSC/pull/399","diff_url":"https://github.com/OpenSC/OpenSC/pull/399.diff","patch_url":"https://github.com/OpenSC/OpenSC/pull/399.patch","issue_url":"https://api.github.com/repos/OpenSC/OpenSC/issues/399","number":399,"state":"open","locked":false,"title":"Revert broken a4c8d671108bca5ce93472f4e3555d59682aff55","user":{"login":"CardContact","id":2071184,"avatar_url":"https://avatars.githubusercontent.com/u/2071184?v=3","gravatar_id":"","url":"https://api.github.com/users/CardContact","html_url":"https://github.com/CardContact","followers_url":"https://api.github.com/users/CardContact/followers","following_url":"https://api.github.com/users/CardContact/following{/other_user}","gists_url":"https://api.github.com/users/CardContact/gists{/gist_id}","starred_url":"https://api.github.com/users/CardContact/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/CardContact/subscriptions","organizations_url":"https://api.github.com/users/CardContact/orgs","repos_url":"https://api.github.com/users/CardContact/repos","events_url":"https://api.github.com/users/CardContact/events{/privacy}","received_events_url":"https://api.github.com/users/CardContact/received_events","type":"User","site_admin":false},"body":"The change introduced by the above commit breaks the generation of DKEK shares with a password not split in an n-of-m share.\r\n\r\nThis commit reverts the change, but adds the parameter checking that was intended by the original committer. It also removes compiler warning related to unchecked returns.","created_at":"2015-03-22T16:42:52Z","updated_at":"2015-03-25T20:01:08Z","closed_at":null,"merged_at":null,"merge_commit_sha":"038907371864c7b940e802db84848d7d1e237d1b","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/OpenSC/OpenSC/pulls/399/commits","review_comments_url":"https://api.github.com/repos/OpenSC/OpenSC/pulls/399/comments","review_comment_url":"https://api.github.com/repos/OpenSC/OpenSC/pulls/comments{/number}","comments_url":"https://api.github.com/repos/OpenSC/OpenSC/issues/399/comments","statuses_url":"https://api.github.com/repos/OpenSC/OpenSC/statuses/6588aaa428507af012c1d00b9d7b95121dbd6c2b","head":{"label":"CardContact:master","ref":"master","sha":"6588aaa428507af012c1d00b9d7b95121dbd6c2b","user":{"login":"CardContact","id":2071184,"avatar_url":"https://avatars.githubusercontent.com/u/2071184?v=3","gravatar_id":"","url":"https://api.github.com/users/CardContact","html_url":"https://github.com/CardContact","followers_url":"https://api.github.com/users/CardContact/followers","following_url":"https://api.github.com/users/CardContact/following{/other_user}","gists_url":"https://api.github.com/users/CardContact/gists{/gist_id}","starred_url":"https://api.github.com/users/CardContact/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/CardContact/subscriptions","organizations_url":"https://api.github.com/users/CardContact/orgs","repos_url":"https://api.github.com/users/CardContact/repos","events_url":"https://api.github.com/users/CardContact/events{/privacy}","received_events_url":"https://api.github.com/users/CardContact/received_events","type":"User","site_admin":false},"repo":{"id":5284281,"name":"OpenSC","full_name":"CardContact/OpenSC","owner":{"login":"CardContact","id":2071184,"avatar_url":"https://avatars.githubusercontent.com/u/2071184?v=3","gravatar_id":"","url":"https://api.github.com/users/CardContact","html_url":"https://github.com/CardContact","followers_url":"https://api.github.com/users/CardContact/followers","following_url":"https://api.github.com/users/CardContact/following{/other_user}","gists_url":"https://api.github.com/users/CardContact/gists{/gist_id}","starred_url":"https://api.github.com/users/CardContact/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/CardContact/subscriptions","organizations_url":"https://api.github.com/users/CardContact/orgs","repos_url":"https://api.github.com/users/CardContact/repos","events_url":"https://api.github.com/users/CardContact/events{/privacy}","received_events_url":"https://api.github.com/users/CardContact/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/CardContact/OpenSC","description":"Open source smart card tools and middleware. PKCS#11/MiniDriver/Tokend","fork":true,"url":"https://api.github.com/repos/CardContact/OpenSC","forks_url":"https://api.github.com/repos/CardContact/OpenSC/forks","keys_url":"https://api.github.com/repos/CardContact/OpenSC/keys{/key_id}","collaborators_url":"https://api.github.com/repos/CardContact/OpenSC/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/CardContact/OpenSC/teams","hooks_url":"https://api.github.com/repos/CardContact/OpenSC/hooks","issue_events_url":"https://api.github.com/repos/CardContact/OpenSC/issues/events{/number}","events_url":"https://api.github.com/repos/CardContact/OpenSC/events","assignees_url":"https://api.github.com/repos/CardContact/OpenSC/assignees{/user}","branches_url":"https://api.github.com/repos/CardContact/OpenSC/branches{/branch}","tags_url":"https://api.github.com/repos/CardContact/OpenSC/tags","blobs_url":"https://api.github.com/repos/CardContact/OpenSC/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/CardContact/OpenSC/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/CardContact/OpenSC/git/refs{/sha}","trees_url":"https://api.github.com/repos/CardContact/OpenSC/git/trees{/sha}","statuses_url":"https://api.github.com/repos/CardContact/OpenSC/statuses/{sha}","languages_url":"https://api.github.com/repos/CardContact/OpenSC/languages","stargazers_url":"https://api.github.com/repos/CardContact/OpenSC/stargazers","contributors_url":"https://api.github.com/repos/CardContact/OpenSC/contributors","subscribers_url":"https://api.github.com/repos/CardContact/OpenSC/subscribers","subscription_url":"https://api.github.com/repos/CardContact/OpenSC/subscription","commits_url":"https://api.github.com/repos/CardContact/OpenSC/commits{/sha}","git_commits_url":"https://api.github.com/repos/CardContact/OpenSC/git/commits{/sha}","comments_url":"https://api.github.com/repos/CardContact/OpenSC/comments{/number}","issue_comment_url":"https://api.github.com/repos/CardContact/OpenSC/issues/comments{/number}","contents_url":"https://api.github.com/repos/CardContact/OpenSC/contents/{+path}","compare_url":"https://api.github.com/repos/CardContact/OpenSC/compare/{base}...{head}","merges_url":"https://api.github.com/repos/CardContact/OpenSC/merges","archive_url":"https://api.github.com/repos/CardContact/OpenSC/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/CardContact/OpenSC/downloads","issues_url":"https://api.github.com/repos/CardContact/OpenSC/issues{/number}","pulls_url":"https://api.github.com/repos/CardContact/OpenSC/pulls{/number}","milestones_url":"https://api.github.com/repos/CardContact/OpenSC/milestones{/number}","notifications_url":"https://api.github.com/repos/CardContact/OpenSC/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/CardContact/OpenSC/labels{/name}","releases_url":"https://api.github.com/repos/CardContact/OpenSC/releases{/id}","created_at":"2012-08-03T10:52:37Z","updated_at":"2015-03-22T17:08:18Z","pushed_at":"2015-03-22T17:08:18Z","git_url":"git://github.com/CardContact/OpenSC.git","ssh_url":"git@github.com:CardContact/OpenSC.git","clone_url":"https://github.com/CardContact/OpenSC.git","svn_url":"https://github.com/CardContact/OpenSC","homepage":"https://www.opensc-project.org/","size":9621,"stargazers_count":2,"watchers_count":2,"language":"C","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":0,"forks":1,"open_issues":0,"watchers":2,"default_branch":"master"}},"base":{"label":"OpenSC:master","ref":"master","sha":"c0c8a89126a0a11d315badcd778670d757b60f4c","user":{"login":"OpenSC","id":895249,"avatar_url":"https://avatars.githubusercontent.com/u/895249?v=3","gravatar_id":"","url":"https://api.github.com/users/OpenSC","html_url":"https://github.com/OpenSC","followers_url":"https://api.github.com/users/OpenSC/followers","following_url":"https://api.github.com/users/OpenSC/following{/other_user}","gists_url":"https://api.github.com/users/OpenSC/gists{/gist_id}","starred_url":"https://api.github.com/users/OpenSC/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/OpenSC/subscriptions","organizations_url":"https://api.github.com/users/OpenSC/orgs","repos_url":"https://api.github.com/users/OpenSC/repos","events_url":"https://api.github.com/users/OpenSC/events{/privacy}","received_events_url":"https://api.github.com/users/OpenSC/received_events","type":"Organization","site_admin":false},"repo":{"id":1999692,"name":"OpenSC","full_name":"OpenSC/OpenSC","owner":{"login":"OpenSC","id":895249,"avatar_url":"https://avatars.githubusercontent.com/u/895249?v=3","gravatar_id":"","url":"https://api.github.com/users/OpenSC","html_url":"https://github.com/OpenSC","followers_url":"https://api.github.com/users/OpenSC/followers","following_url":"https://api.github.com/users/OpenSC/following{/other_user}","gists_url":"https://api.github.com/users/OpenSC/gists{/gist_id}","starred_url":"https://api.github.com/users/OpenSC/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/OpenSC/subscriptions","organizations_url":"https://api.github.com/users/OpenSC/orgs","repos_url":"https://api.github.com/users/OpenSC/repos","events_url":"https://api.github.com/users/OpenSC/events{/privacy}","received_events_url":"https://api.github.com/users/OpenSC/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/OpenSC/OpenSC","description":"Open source smart card tools and middleware. PKCS#11/MiniDriver/Tokend","fork":false,"url":"https://api.github.com/repos/OpenSC/OpenSC","forks_url":"https://api.github.com/repos/OpenSC/OpenSC/forks","keys_url":"https://api.github.com/repos/OpenSC/OpenSC/keys{/key_id}","collaborators_url":"https://api.github.com/repos/OpenSC/OpenSC/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/OpenSC/OpenSC/teams","hooks_url":"https://api.github.com/repos/OpenSC/OpenSC/hooks","issue_events_url":"https://api.github.com/repos/OpenSC/OpenSC/issues/events{/number}","events_url":"https://api.github.com/repos/OpenSC/OpenSC/events","assignees_url":"https://api.github.com/repos/OpenSC/OpenSC/assignees{/user}","branches_url":"https://api.github.com/repos/OpenSC/OpenSC/branches{/branch}","tags_url":"https://api.github.com/repos/OpenSC/OpenSC/tags","blobs_url":"https://api.github.com/repos/OpenSC/OpenSC/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/OpenSC/OpenSC/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/OpenSC/OpenSC/git/refs{/sha}","trees_url":"https://api.github.com/repos/OpenSC/OpenSC/git/trees{/sha}","statuses_url":"https://api.github.com/repos/OpenSC/OpenSC/statuses/{sha}","languages_url":"https://api.github.com/repos/OpenSC/OpenSC/languages","stargazers_url":"https://api.github.com/repos/OpenSC/OpenSC/stargazers","contributors_url":"https://api.github.com/repos/OpenSC/OpenSC/contributors","subscribers_url":"https://api.github.com/repos/OpenSC/OpenSC/subscribers","subscription_url":"https://api.github.com/repos/OpenSC/OpenSC/subscription","commits_url":"https://api.github.com/repos/OpenSC/OpenSC/commits{/sha}","git_commits_url":"https://api.github.com/repos/OpenSC/OpenSC/git/commits{/sha}","comments_url":"https://api.github.com/repos/OpenSC/OpenSC/comments{/number}","issue_comment_url":"https://api.github.com/repos/OpenSC/OpenSC/issues/comments{/number}","contents_url":"https://api.github.com/repos/OpenSC/OpenSC/contents/{+path}","compare_url":"https://api.github.com/repos/OpenSC/OpenSC/compare/{base}...{head}","merges_url":"https://api.github.com/repos/OpenSC/OpenSC/merges","archive_url":"https://api.github.com/repos/OpenSC/OpenSC/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/OpenSC/OpenSC/downloads","issues_url":"https://api.github.com/repos/OpenSC/OpenSC/issues{/number}","pulls_url":"https://api.github.com/repos/OpenSC/OpenSC/pulls{/number}","milestones_url":"https://api.github.com/repos/OpenSC/OpenSC/milestones{/number}","notifications_url":"https://api.github.com/repos/OpenSC/OpenSC/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/OpenSC/OpenSC/labels{/name}","releases_url":"https://api.github.com/repos/OpenSC/OpenSC/releases{/id}","created_at":"2011-07-05T09:45:08Z","updated_at":"2015-03-25T00:03:40Z","pushed_at":"2015-03-25T13:04:33Z","git_url":"git://github.com/OpenSC/OpenSC.git","ssh_url":"git@github.com:OpenSC/OpenSC.git","clone_url":"https://github.com/OpenSC/OpenSC.git","svn_url":"https://github.com/OpenSC/OpenSC","homepage":"https://github.com/OpenSC/OpenSC/wiki","size":38786,"stargazers_count":245,"watchers_count":245,"language":"C","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":166,"mirror_url":null,"open_issues_count":41,"forks":166,"open_issues":41,"watchers":245,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/OpenSC/OpenSC/pulls/399"},"html":{"href":"https://github.com/OpenSC/OpenSC/pull/399"},"issue":{"href":"https://api.github.com/repos/OpenSC/OpenSC/issues/399"},"comments":{"href":"https://api.github.com/repos/OpenSC/OpenSC/issues/399/comments"},"review_comments":{"href":"https://api.github.com/repos/OpenSC/OpenSC/pulls/399/comments"},"review_comment":{"href":"https://api.github.com/repos/OpenSC/OpenSC/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/OpenSC/OpenSC/pulls/399/commits"},"statuses":{"href":"https://api.github.com/repos/OpenSC/OpenSC/statuses/6588aaa428507af012c1d00b9d7b95121dbd6c2b"}}}}