{"action":"created","comment":{"url":"https://api.github.com/repos/h2o/neverbleed/pulls/comments/176419335","pull_request_review_id":106075236,"id":176419335,"diff_hunk":"@@ -390,15 +396,61 @@ static RSA *daemon_get_rsa(size_t key_index)\n     return rsa;\n }\n \n-static size_t daemon_set_rsa(RSA *rsa)\n+/*\n+ *  Returns one plus the index of the least significant 1-bit of b within tot\n+ *  or if not found, returns zero\n+ */\n+static uint32_t bita_ffirst(const uint8_t *b, const size_t tot, size_t bits)","path":"neverbleed.c","position":29,"original_position":29,"commit_id":"d0fde1f3cd5df8061d014d3aabab9f4e418aaf9a","original_commit_id":"d0fde1f3cd5df8061d014d3aabab9f4e418aaf9a","user":{"login":"kazuho","id":41567,"avatar_url":"https://avatars2.githubusercontent.com/u/41567?v=4","gravatar_id":"","url":"https://api.github.com/users/kazuho","html_url":"https://github.com/kazuho","followers_url":"https://api.github.com/users/kazuho/followers","following_url":"https://api.github.com/users/kazuho/following{/other_user}","gists_url":"https://api.github.com/users/kazuho/gists{/gist_id}","starred_url":"https://api.github.com/users/kazuho/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kazuho/subscriptions","organizations_url":"https://api.github.com/users/kazuho/orgs","repos_url":"https://api.github.com/users/kazuho/repos","events_url":"https://api.github.com/users/kazuho/events{/privacy}","received_events_url":"https://api.github.com/users/kazuho/received_events","type":"User","site_admin":false},"body":"The function currently returns a `uint32_t` value that represents the true offset + 1, which seems a bit confusing to me.\r\n\r\nCould we change the returned type to `size_t` (because the purpose of the value is to represent the offset of an array), and return the offset (or `SIZE_MAX` if not found) instead of doing +1?","created_at":"2018-03-22T13:31:45Z","updated_at":"2018-03-22T13:35:05Z","html_url":"https://github.com/h2o/neverbleed/pull/16#discussion_r176419335","pull_request_url":"https://api.github.com/repos/h2o/neverbleed/pulls/16","author_association":"OWNER","_links":{"self":{"href":"https://api.github.com/repos/h2o/neverbleed/pulls/comments/176419335"},"html":{"href":"https://github.com/h2o/neverbleed/pull/16#discussion_r176419335"},"pull_request":{"href":"https://api.github.com/repos/h2o/neverbleed/pulls/16"}}},"pull_request":{"url":"https://api.github.com/repos/h2o/neverbleed/pulls/16","id":176376876,"html_url":"https://github.com/h2o/neverbleed/pull/16","diff_url":"https://github.com/h2o/neverbleed/pull/16.diff","patch_url":"https://github.com/h2o/neverbleed/pull/16.patch","issue_url":"https://api.github.com/repos/h2o/neverbleed/issues/16","number":16,"state":"open","locked":false,"title":"add support for removal of private keys","user":{"login":"robguima","id":6162854,"avatar_url":"https://avatars1.githubusercontent.com/u/6162854?v=4","gravatar_id":"","url":"https://api.github.com/users/robguima","html_url":"https://github.com/robguima","followers_url":"https://api.github.com/users/robguima/followers","following_url":"https://api.github.com/users/robguima/following{/other_user}","gists_url":"https://api.github.com/users/robguima/gists{/gist_id}","starred_url":"https://api.github.com/users/robguima/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/robguima/subscriptions","organizations_url":"https://api.github.com/users/robguima/orgs","repos_url":"https://api.github.com/users/robguima/repos","events_url":"https://api.github.com/users/robguima/events{/privacy}","received_events_url":"https://api.github.com/users/robguima/received_events","type":"User","site_admin":false},"body":"hi 👋 \r\nhere's the PR we've discussed earlier: well, the initial cut that adds removal of private keys.\r\n\r\nNew functions: neverbleed_del_rsa_key(), neverbleed_del_ecdsa_key(), and neverbleed_load_private_key_file_index().\r\nUse a bitarray impl to quickly find gaps in either key array - could go for a union of a common (key) type but then with a larger changeset.\r\n\r\nThis PR also changes the allocation of the key arrays to chunks rounded up to wordsize. This may be important when many keys are inserted quickly (which happens to be our use case). The rounding up to wordsize is mostly important (makes it simpler) for the bitarray check (no need to mask off remaining bytes). Does this make sense?\r\n\r\nneverbleed_load_private_key_file_index() in particular looks odd... perhaps it could return the key type, which would make it different from neverbleed_load_private_key_file() function, which expects 0 or 1 returns.\r\n\r\nConsidering this PR, it has passed only the most rudimentary tests: like a few loads and mid-array removals.\r\n\r\nPlanning on adding a stress tester which would add and remove thousands of keys measuring performance and perhaps finding issues along the way.\r\n\r\nAlso, not sure whether the del() functions should return an errbuf reponse like the load stub func. \r\n\r\nplease let me know what you think. Thank you! \r\n\r\ncheers 🍺 \r\n","created_at":"2018-03-21T03:48:55Z","updated_at":"2018-03-22T13:35:05Z","closed_at":null,"merged_at":null,"merge_commit_sha":"43885781011a817d5a597d78fc6cf491939029d2","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/h2o/neverbleed/pulls/16/commits","review_comments_url":"https://api.github.com/repos/h2o/neverbleed/pulls/16/comments","review_comment_url":"https://api.github.com/repos/h2o/neverbleed/pulls/comments{/number}","comments_url":"https://api.github.com/repos/h2o/neverbleed/issues/16/comments","statuses_url":"https://api.github.com/repos/h2o/neverbleed/statuses/d0fde1f3cd5df8061d014d3aabab9f4e418aaf9a","head":{"label":"robguima:master","ref":"master","sha":"d0fde1f3cd5df8061d014d3aabab9f4e418aaf9a","user":{"login":"robguima","id":6162854,"avatar_url":"https://avatars1.githubusercontent.com/u/6162854?v=4","gravatar_id":"","url":"https://api.github.com/users/robguima","html_url":"https://github.com/robguima","followers_url":"https://api.github.com/users/robguima/followers","following_url":"https://api.github.com/users/robguima/following{/other_user}","gists_url":"https://api.github.com/users/robguima/gists{/gist_id}","starred_url":"https://api.github.com/users/robguima/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/robguima/subscriptions","organizations_url":"https://api.github.com/users/robguima/orgs","repos_url":"https://api.github.com/users/robguima/repos","events_url":"https://api.github.com/users/robguima/events{/privacy}","received_events_url":"https://api.github.com/users/robguima/received_events","type":"User","site_admin":false},"repo":{"id":124479879,"name":"neverbleed","full_name":"robguima/neverbleed","owner":{"login":"robguima","id":6162854,"avatar_url":"https://avatars1.githubusercontent.com/u/6162854?v=4","gravatar_id":"","url":"https://api.github.com/users/robguima","html_url":"https://github.com/robguima","followers_url":"https://api.github.com/users/robguima/followers","following_url":"https://api.github.com/users/robguima/following{/other_user}","gists_url":"https://api.github.com/users/robguima/gists{/gist_id}","starred_url":"https://api.github.com/users/robguima/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/robguima/subscriptions","organizations_url":"https://api.github.com/users/robguima/orgs","repos_url":"https://api.github.com/users/robguima/repos","events_url":"https://api.github.com/users/robguima/events{/privacy}","received_events_url":"https://api.github.com/users/robguima/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/robguima/neverbleed","description":"privilege separation engine for OpenSSL / LibreSSL","fork":true,"url":"https://api.github.com/repos/robguima/neverbleed","forks_url":"https://api.github.com/repos/robguima/neverbleed/forks","keys_url":"https://api.github.com/repos/robguima/neverbleed/keys{/key_id}","collaborators_url":"https://api.github.com/repos/robguima/neverbleed/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/robguima/neverbleed/teams","hooks_url":"https://api.github.com/repos/robguima/neverbleed/hooks","issue_events_url":"https://api.github.com/repos/robguima/neverbleed/issues/events{/number}","events_url":"https://api.github.com/repos/robguima/neverbleed/events","assignees_url":"https://api.github.com/repos/robguima/neverbleed/assignees{/user}","branches_url":"https://api.github.com/repos/robguima/neverbleed/branches{/branch}","tags_url":"https://api.github.com/repos/robguima/neverbleed/tags","blobs_url":"https://api.github.com/repos/robguima/neverbleed/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/robguima/neverbleed/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/robguima/neverbleed/git/refs{/sha}","trees_url":"https://api.github.com/repos/robguima/neverbleed/git/trees{/sha}","statuses_url":"https://api.github.com/repos/robguima/neverbleed/statuses/{sha}","languages_url":"https://api.github.com/repos/robguima/neverbleed/languages","stargazers_url":"https://api.github.com/repos/robguima/neverbleed/stargazers","contributors_url":"https://api.github.com/repos/robguima/neverbleed/contributors","subscribers_url":"https://api.github.com/repos/robguima/neverbleed/subscribers","subscription_url":"https://api.github.com/repos/robguima/neverbleed/subscription","commits_url":"https://api.github.com/repos/robguima/neverbleed/commits{/sha}","git_commits_url":"https://api.github.com/repos/robguima/neverbleed/git/commits{/sha}","comments_url":"https://api.github.com/repos/robguima/neverbleed/comments{/number}","issue_comment_url":"https://api.github.com/repos/robguima/neverbleed/issues/comments{/number}","contents_url":"https://api.github.com/repos/robguima/neverbleed/contents/{+path}","compare_url":"https://api.github.com/repos/robguima/neverbleed/compare/{base}...{head}","merges_url":"https://api.github.com/repos/robguima/neverbleed/merges","archive_url":"https://api.github.com/repos/robguima/neverbleed/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/robguima/neverbleed/downloads","issues_url":"https://api.github.com/repos/robguima/neverbleed/issues{/number}","pulls_url":"https://api.github.com/repos/robguima/neverbleed/pulls{/number}","milestones_url":"https://api.github.com/repos/robguima/neverbleed/milestones{/number}","notifications_url":"https://api.github.com/repos/robguima/neverbleed/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/robguima/neverbleed/labels{/name}","releases_url":"https://api.github.com/repos/robguima/neverbleed/releases{/id}","deployments_url":"https://api.github.com/repos/robguima/neverbleed/deployments","created_at":"2018-03-09T03:03:23Z","updated_at":"2018-03-22T01:08:09Z","pushed_at":"2018-03-22T01:08:07Z","git_url":"git://github.com/robguima/neverbleed.git","ssh_url":"git@github.com:robguima/neverbleed.git","clone_url":"https://github.com/robguima/neverbleed.git","svn_url":"https://github.com/robguima/neverbleed","homepage":null,"size":68,"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":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit"},"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"h2o:master","ref":"master","sha":"ff1171188fe508f633b1f247b5ab458c741d95b0","user":{"login":"h2o","id":9275116,"avatar_url":"https://avatars3.githubusercontent.com/u/9275116?v=4","gravatar_id":"","url":"https://api.github.com/users/h2o","html_url":"https://github.com/h2o","followers_url":"https://api.github.com/users/h2o/followers","following_url":"https://api.github.com/users/h2o/following{/other_user}","gists_url":"https://api.github.com/users/h2o/gists{/gist_id}","starred_url":"https://api.github.com/users/h2o/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/h2o/subscriptions","organizations_url":"https://api.github.com/users/h2o/orgs","repos_url":"https://api.github.com/users/h2o/repos","events_url":"https://api.github.com/users/h2o/events{/privacy}","received_events_url":"https://api.github.com/users/h2o/received_events","type":"Organization","site_admin":false},"repo":{"id":42901143,"name":"neverbleed","full_name":"h2o/neverbleed","owner":{"login":"h2o","id":9275116,"avatar_url":"https://avatars3.githubusercontent.com/u/9275116?v=4","gravatar_id":"","url":"https://api.github.com/users/h2o","html_url":"https://github.com/h2o","followers_url":"https://api.github.com/users/h2o/followers","following_url":"https://api.github.com/users/h2o/following{/other_user}","gists_url":"https://api.github.com/users/h2o/gists{/gist_id}","starred_url":"https://api.github.com/users/h2o/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/h2o/subscriptions","organizations_url":"https://api.github.com/users/h2o/orgs","repos_url":"https://api.github.com/users/h2o/repos","events_url":"https://api.github.com/users/h2o/events{/privacy}","received_events_url":"https://api.github.com/users/h2o/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/h2o/neverbleed","description":"privilege separation engine for OpenSSL / LibreSSL","fork":false,"url":"https://api.github.com/repos/h2o/neverbleed","forks_url":"https://api.github.com/repos/h2o/neverbleed/forks","keys_url":"https://api.github.com/repos/h2o/neverbleed/keys{/key_id}","collaborators_url":"https://api.github.com/repos/h2o/neverbleed/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/h2o/neverbleed/teams","hooks_url":"https://api.github.com/repos/h2o/neverbleed/hooks","issue_events_url":"https://api.github.com/repos/h2o/neverbleed/issues/events{/number}","events_url":"https://api.github.com/repos/h2o/neverbleed/events","assignees_url":"https://api.github.com/repos/h2o/neverbleed/assignees{/user}","branches_url":"https://api.github.com/repos/h2o/neverbleed/branches{/branch}","tags_url":"https://api.github.com/repos/h2o/neverbleed/tags","blobs_url":"https://api.github.com/repos/h2o/neverbleed/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/h2o/neverbleed/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/h2o/neverbleed/git/refs{/sha}","trees_url":"https://api.github.com/repos/h2o/neverbleed/git/trees{/sha}","statuses_url":"https://api.github.com/repos/h2o/neverbleed/statuses/{sha}","languages_url":"https://api.github.com/repos/h2o/neverbleed/languages","stargazers_url":"https://api.github.com/repos/h2o/neverbleed/stargazers","contributors_url":"https://api.github.com/repos/h2o/neverbleed/contributors","subscribers_url":"https://api.github.com/repos/h2o/neverbleed/subscribers","subscription_url":"https://api.github.com/repos/h2o/neverbleed/subscription","commits_url":"https://api.github.com/repos/h2o/neverbleed/commits{/sha}","git_commits_url":"https://api.github.com/repos/h2o/neverbleed/git/commits{/sha}","comments_url":"https://api.github.com/repos/h2o/neverbleed/comments{/number}","issue_comment_url":"https://api.github.com/repos/h2o/neverbleed/issues/comments{/number}","contents_url":"https://api.github.com/repos/h2o/neverbleed/contents/{+path}","compare_url":"https://api.github.com/repos/h2o/neverbleed/compare/{base}...{head}","merges_url":"https://api.github.com/repos/h2o/neverbleed/merges","archive_url":"https://api.github.com/repos/h2o/neverbleed/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/h2o/neverbleed/downloads","issues_url":"https://api.github.com/repos/h2o/neverbleed/issues{/number}","pulls_url":"https://api.github.com/repos/h2o/neverbleed/pulls{/number}","milestones_url":"https://api.github.com/repos/h2o/neverbleed/milestones{/number}","notifications_url":"https://api.github.com/repos/h2o/neverbleed/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/h2o/neverbleed/labels{/name}","releases_url":"https://api.github.com/repos/h2o/neverbleed/releases{/id}","deployments_url":"https://api.github.com/repos/h2o/neverbleed/deployments","created_at":"2015-09-22T00:23:35Z","updated_at":"2018-01-11T04:53:23Z","pushed_at":"2018-03-22T01:08:09Z","git_url":"git://github.com/h2o/neverbleed.git","ssh_url":"git@github.com:h2o/neverbleed.git","clone_url":"https://github.com/h2o/neverbleed.git","svn_url":"https://github.com/h2o/neverbleed","homepage":null,"size":54,"stargazers_count":133,"watchers_count":133,"language":"C","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":6,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit"},"forks":18,"open_issues":6,"watchers":133,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/h2o/neverbleed/pulls/16"},"html":{"href":"https://github.com/h2o/neverbleed/pull/16"},"issue":{"href":"https://api.github.com/repos/h2o/neverbleed/issues/16"},"comments":{"href":"https://api.github.com/repos/h2o/neverbleed/issues/16/comments"},"review_comments":{"href":"https://api.github.com/repos/h2o/neverbleed/pulls/16/comments"},"review_comment":{"href":"https://api.github.com/repos/h2o/neverbleed/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/h2o/neverbleed/pulls/16/commits"},"statuses":{"href":"https://api.github.com/repos/h2o/neverbleed/statuses/d0fde1f3cd5df8061d014d3aabab9f4e418aaf9a"}},"author_association":"NONE"}}
{"actor":{"display_login":"kazuho"}}