{"action":"created","comment":{"url":"https://api.github.com/repos/openssl/openssl/pulls/comments/233420627","pull_request_review_id":174827306,"id":233420627,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIzMzQyMDYyNw==","diff_hunk":"@@ -31,145 +32,127 @@ typedef struct {\n     /* Buffer of concatenated seed data */\n     unsigned char seed[TLS1_PRF_MAXBUF];\n     size_t seedlen;\n-} TLS1_PRF_PKEY_CTX;\n+} TLS1_PRF_KDF_CTX;\n \n-static int pkey_tls1_prf_init(EVP_PKEY_CTX *ctx)\n+static void *kdf_tls1_prf_init(void)\n {\n-    TLS1_PRF_PKEY_CTX *kctx;\n-\n-    if ((kctx = OPENSSL_zalloc(sizeof(*kctx))) == NULL) {\n-        KDFerr(KDF_F_PKEY_TLS1_PRF_INIT, ERR_R_MALLOC_FAILURE);\n-        return 0;\n-    }\n-    ctx->data = kctx;\n+    TLS1_PRF_KDF_CTX *kctx;\n \n-    return 1;\n+    if ((kctx = OPENSSL_zalloc(sizeof(*kctx))) == NULL)\n+        KDFerr(KDF_F_KDF_TLS1_PRF_INIT, ERR_R_MALLOC_FAILURE);\n+    return kctx;\n }\n \n-static void pkey_tls1_prf_cleanup(EVP_PKEY_CTX *ctx)\n+static void kdf_tls1_prf_cleanup(void *ctx)\n {\n-    TLS1_PRF_PKEY_CTX *kctx = ctx->data;\n+    TLS1_PRF_KDF_CTX *kctx = ctx;\n+\n     OPENSSL_clear_free(kctx->sec, kctx->seclen);\n     OPENSSL_cleanse(kctx->seed, kctx->seedlen);\n     OPENSSL_free(kctx);\n }\n \n-static int pkey_tls1_prf_ctrl(EVP_PKEY_CTX *ctx, int type, int p1, void *p2)\n+static int kdf_tls1_prf_ctrl(void *ctx, int type, int p1, void *p2)\n {\n-    TLS1_PRF_PKEY_CTX *kctx = ctx->data;\n+    TLS1_PRF_KDF_CTX *kctx = ctx;\n+\n     switch (type) {\n-    case EVP_PKEY_CTRL_TLS_MD:\n+    case EVP_KDF_CTRL_MD:\n+        if (p2 == NULL)\n+            return 0;\n+\n         kctx->md = p2;\n         return 1;\n \n-    case EVP_PKEY_CTRL_TLS_SECRET:\n+    case EVP_KDF_CTRL_TLS_SECRET:\n         if (p1 < 0)\n             return 0;\n-        if (kctx->sec != NULL)\n-            OPENSSL_clear_free(kctx->sec, kctx->seclen);\n+\n+        OPENSSL_clear_free(kctx->sec, kctx->seclen);\n         OPENSSL_cleanse(kctx->seed, kctx->seedlen);\n         kctx->seedlen = 0;\n         kctx->sec = OPENSSL_memdup(p2, p1);\n         if (kctx->sec == NULL)\n             return 0;\n+\n         kctx->seclen  = p1;\n         return 1;\n \n-    case EVP_PKEY_CTRL_TLS_SEED:\n+    case EVP_KDF_CTRL_TLS_SEED:","path":"crypto/kdf/tls1_prf.c","position":116,"original_position":90,"commit_id":"24f56bbfc9545ec5cd039eab0ad54989a01be5d3","original_commit_id":"fe37e2893f16504b6fb38fa4c601b2d604f086bc","user":{"login":"daurnimator","id":127971,"node_id":"MDQ6VXNlcjEyNzk3MQ==","avatar_url":"https://avatars1.githubusercontent.com/u/127971?v=4","gravatar_id":"","url":"https://api.github.com/users/daurnimator","html_url":"https://github.com/daurnimator","followers_url":"https://api.github.com/users/daurnimator/followers","following_url":"https://api.github.com/users/daurnimator/following{/other_user}","gists_url":"https://api.github.com/users/daurnimator/gists{/gist_id}","starred_url":"https://api.github.com/users/daurnimator/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/daurnimator/subscriptions","organizations_url":"https://api.github.com/users/daurnimator/orgs","repos_url":"https://api.github.com/users/daurnimator/repos","events_url":"https://api.github.com/users/daurnimator/events{/privacy}","received_events_url":"https://api.github.com/users/daurnimator/received_events","type":"User","site_admin":false},"body":"From a binding perspective, it's good to have only a limited number of functions: if a new algorithm came out in a new openssl release that didn't require a different function call, then my users would instantly gain support.\r\nHowever if every new algorithm requires some new `_set_egg` that is almost the same as `set_seed` then users have to wait for my bindings to update.","created_at":"2018-11-14T12:08:16Z","updated_at":"2018-11-14T12:08:16Z","html_url":"https://github.com/openssl/openssl/pull/6674#discussion_r233420627","pull_request_url":"https://api.github.com/repos/openssl/openssl/pulls/6674","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/openssl/openssl/pulls/comments/233420627"},"html":{"href":"https://github.com/openssl/openssl/pull/6674#discussion_r233420627"},"pull_request":{"href":"https://api.github.com/repos/openssl/openssl/pulls/6674"}},"in_reply_to_id":229920541},"pull_request":{"url":"https://api.github.com/repos/openssl/openssl/pulls/6674","id":199972282,"node_id":"MDExOlB1bGxSZXF1ZXN0MTk5OTcyMjgy","html_url":"https://github.com/openssl/openssl/pull/6674","diff_url":"https://github.com/openssl/openssl/pull/6674.diff","patch_url":"https://github.com/openssl/openssl/pull/6674.patch","issue_url":"https://api.github.com/repos/openssl/openssl/issues/6674","number":6674,"state":"open","locked":false,"title":"WIP: Add EVP/KDF API","user":{"login":"davidmakepeace","id":25836117,"node_id":"MDQ6VXNlcjI1ODM2MTE3","avatar_url":"https://avatars2.githubusercontent.com/u/25836117?v=4","gravatar_id":"","url":"https://api.github.com/users/davidmakepeace","html_url":"https://github.com/davidmakepeace","followers_url":"https://api.github.com/users/davidmakepeace/followers","following_url":"https://api.github.com/users/davidmakepeace/following{/other_user}","gists_url":"https://api.github.com/users/davidmakepeace/gists{/gist_id}","starred_url":"https://api.github.com/users/davidmakepeace/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/davidmakepeace/subscriptions","organizations_url":"https://api.github.com/users/davidmakepeace/orgs","repos_url":"https://api.github.com/users/davidmakepeace/repos","events_url":"https://api.github.com/users/davidmakepeace/events{/privacy}","received_events_url":"https://api.github.com/users/davidmakepeace/received_events","type":"User","site_admin":false},"body":"This work-in-progress adds a new EVP/KDF API that collects all KDFs and PRFs under the one API.\r\n\r\n`#include <openssl/kdf.h>\r\n`\r\n\r\nCurrently some KDFs are available directly (PBKDF2 and scrypt) while others are available through the PKEY API (scrypt, TLS1 PRF and HKDF) even though the PKEY API was originally intended for Public Key algorithms. Note that the low level KDF functions (PKCS5_PBKDF2_HMAC and EVP_PBE_scrypt) are defined in openssl/evp.h even though EVP is the high level interface.\r\n\r\nThe new API is modeled after the current KDF support under the PKEY API in order to minimize the work required to update applications to use the new API. Support is included for PBKDF2, scrypt, TLS1 PRF and HKDF. PBKDF1 and PKCS12 KDF are not implemented.\r\n\r\nThe low level KDF functions and PKEY KDF support have been changed to wrap the new API. Other parts of OpenSSL have not yet been updated to call the new API.\r\n\r\nDocumentation to follow.\r\n\r\n- [x] documentation is added or updated\r\n- [x] tests are added or updated\r\n","created_at":"2018-07-09T01:20:32Z","updated_at":"2018-11-14T12:08:16Z","closed_at":null,"merged_at":null,"merge_commit_sha":"05542583b33757f99dc8b777f197e7fcc61cdafd","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[{"id":441165144,"node_id":"MDU6TGFiZWw0NDExNjUxNDQ=","url":"https://api.github.com/repos/openssl/openssl/labels/master","name":"master","color":"bfdadc","default":false}],"milestone":{"url":"https://api.github.com/repos/openssl/openssl/milestones/11","html_url":"https://github.com/openssl/openssl/milestone/11","labels_url":"https://api.github.com/repos/openssl/openssl/milestones/11/labels","id":3024154,"node_id":"MDk6TWlsZXN0b25lMzAyNDE1NA==","number":11,"title":"Post 1.1.1","description":"","creator":{"login":"kaduk","id":1894506,"node_id":"MDQ6VXNlcjE4OTQ1MDY=","avatar_url":"https://avatars1.githubusercontent.com/u/1894506?v=4","gravatar_id":"","url":"https://api.github.com/users/kaduk","html_url":"https://github.com/kaduk","followers_url":"https://api.github.com/users/kaduk/followers","following_url":"https://api.github.com/users/kaduk/following{/other_user}","gists_url":"https://api.github.com/users/kaduk/gists{/gist_id}","starred_url":"https://api.github.com/users/kaduk/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kaduk/subscriptions","organizations_url":"https://api.github.com/users/kaduk/orgs","repos_url":"https://api.github.com/users/kaduk/repos","events_url":"https://api.github.com/users/kaduk/events{/privacy}","received_events_url":"https://api.github.com/users/kaduk/received_events","type":"User","site_admin":false},"open_issues":235,"closed_issues":55,"state":"open","created_at":"2018-01-09T21:08:23Z","updated_at":"2018-11-13T02:22:12Z","due_on":null,"closed_at":null},"commits_url":"https://api.github.com/repos/openssl/openssl/pulls/6674/commits","review_comments_url":"https://api.github.com/repos/openssl/openssl/pulls/6674/comments","review_comment_url":"https://api.github.com/repos/openssl/openssl/pulls/comments{/number}","comments_url":"https://api.github.com/repos/openssl/openssl/issues/6674/comments","statuses_url":"https://api.github.com/repos/openssl/openssl/statuses/24f56bbfc9545ec5cd039eab0ad54989a01be5d3","head":{"label":"davidmakepeace:add-evp-kdf-api","ref":"add-evp-kdf-api","sha":"24f56bbfc9545ec5cd039eab0ad54989a01be5d3","user":{"login":"davidmakepeace","id":25836117,"node_id":"MDQ6VXNlcjI1ODM2MTE3","avatar_url":"https://avatars2.githubusercontent.com/u/25836117?v=4","gravatar_id":"","url":"https://api.github.com/users/davidmakepeace","html_url":"https://github.com/davidmakepeace","followers_url":"https://api.github.com/users/davidmakepeace/followers","following_url":"https://api.github.com/users/davidmakepeace/following{/other_user}","gists_url":"https://api.github.com/users/davidmakepeace/gists{/gist_id}","starred_url":"https://api.github.com/users/davidmakepeace/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/davidmakepeace/subscriptions","organizations_url":"https://api.github.com/users/davidmakepeace/orgs","repos_url":"https://api.github.com/users/davidmakepeace/repos","events_url":"https://api.github.com/users/davidmakepeace/events{/privacy}","received_events_url":"https://api.github.com/users/davidmakepeace/received_events","type":"User","site_admin":false},"repo":{"id":122570930,"node_id":"MDEwOlJlcG9zaXRvcnkxMjI1NzA5MzA=","name":"openssl","full_name":"davidmakepeace/openssl","private":false,"owner":{"login":"davidmakepeace","id":25836117,"node_id":"MDQ6VXNlcjI1ODM2MTE3","avatar_url":"https://avatars2.githubusercontent.com/u/25836117?v=4","gravatar_id":"","url":"https://api.github.com/users/davidmakepeace","html_url":"https://github.com/davidmakepeace","followers_url":"https://api.github.com/users/davidmakepeace/followers","following_url":"https://api.github.com/users/davidmakepeace/following{/other_user}","gists_url":"https://api.github.com/users/davidmakepeace/gists{/gist_id}","starred_url":"https://api.github.com/users/davidmakepeace/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/davidmakepeace/subscriptions","organizations_url":"https://api.github.com/users/davidmakepeace/orgs","repos_url":"https://api.github.com/users/davidmakepeace/repos","events_url":"https://api.github.com/users/davidmakepeace/events{/privacy}","received_events_url":"https://api.github.com/users/davidmakepeace/received_events","type":"User","site_admin":false},"html_url":"https://github.com/davidmakepeace/openssl","description":"TLS/SSL and crypto library","fork":true,"url":"https://api.github.com/repos/davidmakepeace/openssl","forks_url":"https://api.github.com/repos/davidmakepeace/openssl/forks","keys_url":"https://api.github.com/repos/davidmakepeace/openssl/keys{/key_id}","collaborators_url":"https://api.github.com/repos/davidmakepeace/openssl/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/davidmakepeace/openssl/teams","hooks_url":"https://api.github.com/repos/davidmakepeace/openssl/hooks","issue_events_url":"https://api.github.com/repos/davidmakepeace/openssl/issues/events{/number}","events_url":"https://api.github.com/repos/davidmakepeace/openssl/events","assignees_url":"https://api.github.com/repos/davidmakepeace/openssl/assignees{/user}","branches_url":"https://api.github.com/repos/davidmakepeace/openssl/branches{/branch}","tags_url":"https://api.github.com/repos/davidmakepeace/openssl/tags","blobs_url":"https://api.github.com/repos/davidmakepeace/openssl/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/davidmakepeace/openssl/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/davidmakepeace/openssl/git/refs{/sha}","trees_url":"https://api.github.com/repos/davidmakepeace/openssl/git/trees{/sha}","statuses_url":"https://api.github.com/repos/davidmakepeace/openssl/statuses/{sha}","languages_url":"https://api.github.com/repos/davidmakepeace/openssl/languages","stargazers_url":"https://api.github.com/repos/davidmakepeace/openssl/stargazers","contributors_url":"https://api.github.com/repos/davidmakepeace/openssl/contributors","subscribers_url":"https://api.github.com/repos/davidmakepeace/openssl/subscribers","subscription_url":"https://api.github.com/repos/davidmakepeace/openssl/subscription","commits_url":"https://api.github.com/repos/davidmakepeace/openssl/commits{/sha}","git_commits_url":"https://api.github.com/repos/davidmakepeace/openssl/git/commits{/sha}","comments_url":"https://api.github.com/repos/davidmakepeace/openssl/comments{/number}","issue_comment_url":"https://api.github.com/repos/davidmakepeace/openssl/issues/comments{/number}","contents_url":"https://api.github.com/repos/davidmakepeace/openssl/contents/{+path}","compare_url":"https://api.github.com/repos/davidmakepeace/openssl/compare/{base}...{head}","merges_url":"https://api.github.com/repos/davidmakepeace/openssl/merges","archive_url":"https://api.github.com/repos/davidmakepeace/openssl/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/davidmakepeace/openssl/downloads","issues_url":"https://api.github.com/repos/davidmakepeace/openssl/issues{/number}","pulls_url":"https://api.github.com/repos/davidmakepeace/openssl/pulls{/number}","milestones_url":"https://api.github.com/repos/davidmakepeace/openssl/milestones{/number}","notifications_url":"https://api.github.com/repos/davidmakepeace/openssl/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/davidmakepeace/openssl/labels{/name}","releases_url":"https://api.github.com/repos/davidmakepeace/openssl/releases{/id}","deployments_url":"https://api.github.com/repos/davidmakepeace/openssl/deployments","created_at":"2018-02-23T03:53:56Z","updated_at":"2018-11-14T00:48:49Z","pushed_at":"2018-11-14T06:44:18Z","git_url":"git://github.com/davidmakepeace/openssl.git","ssh_url":"git@github.com:davidmakepeace/openssl.git","clone_url":"https://github.com/davidmakepeace/openssl.git","svn_url":"https://github.com/davidmakepeace/openssl","homepage":"https://www.openssl.org","size":157574,"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":"other","name":"Other","spdx_id":"NOASSERTION","url":null,"node_id":"MDc6TGljZW5zZTA="},"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"openssl:master","ref":"master","sha":"2dc37bc2b4c678462a24d2904604e58c0c5ac1cb","user":{"login":"openssl","id":3279138,"node_id":"MDEyOk9yZ2FuaXphdGlvbjMyNzkxMzg=","avatar_url":"https://avatars2.githubusercontent.com/u/3279138?v=4","gravatar_id":"","url":"https://api.github.com/users/openssl","html_url":"https://github.com/openssl","followers_url":"https://api.github.com/users/openssl/followers","following_url":"https://api.github.com/users/openssl/following{/other_user}","gists_url":"https://api.github.com/users/openssl/gists{/gist_id}","starred_url":"https://api.github.com/users/openssl/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/openssl/subscriptions","organizations_url":"https://api.github.com/users/openssl/orgs","repos_url":"https://api.github.com/users/openssl/repos","events_url":"https://api.github.com/users/openssl/events{/privacy}","received_events_url":"https://api.github.com/users/openssl/received_events","type":"Organization","site_admin":false},"repo":{"id":7634677,"node_id":"MDEwOlJlcG9zaXRvcnk3NjM0Njc3","name":"openssl","full_name":"openssl/openssl","private":false,"owner":{"login":"openssl","id":3279138,"node_id":"MDEyOk9yZ2FuaXphdGlvbjMyNzkxMzg=","avatar_url":"https://avatars2.githubusercontent.com/u/3279138?v=4","gravatar_id":"","url":"https://api.github.com/users/openssl","html_url":"https://github.com/openssl","followers_url":"https://api.github.com/users/openssl/followers","following_url":"https://api.github.com/users/openssl/following{/other_user}","gists_url":"https://api.github.com/users/openssl/gists{/gist_id}","starred_url":"https://api.github.com/users/openssl/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/openssl/subscriptions","organizations_url":"https://api.github.com/users/openssl/orgs","repos_url":"https://api.github.com/users/openssl/repos","events_url":"https://api.github.com/users/openssl/events{/privacy}","received_events_url":"https://api.github.com/users/openssl/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/openssl/openssl","description":"TLS/SSL and crypto library","fork":false,"url":"https://api.github.com/repos/openssl/openssl","forks_url":"https://api.github.com/repos/openssl/openssl/forks","keys_url":"https://api.github.com/repos/openssl/openssl/keys{/key_id}","collaborators_url":"https://api.github.com/repos/openssl/openssl/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/openssl/openssl/teams","hooks_url":"https://api.github.com/repos/openssl/openssl/hooks","issue_events_url":"https://api.github.com/repos/openssl/openssl/issues/events{/number}","events_url":"https://api.github.com/repos/openssl/openssl/events","assignees_url":"https://api.github.com/repos/openssl/openssl/assignees{/user}","branches_url":"https://api.github.com/repos/openssl/openssl/branches{/branch}","tags_url":"https://api.github.com/repos/openssl/openssl/tags","blobs_url":"https://api.github.com/repos/openssl/openssl/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/openssl/openssl/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/openssl/openssl/git/refs{/sha}","trees_url":"https://api.github.com/repos/openssl/openssl/git/trees{/sha}","statuses_url":"https://api.github.com/repos/openssl/openssl/statuses/{sha}","languages_url":"https://api.github.com/repos/openssl/openssl/languages","stargazers_url":"https://api.github.com/repos/openssl/openssl/stargazers","contributors_url":"https://api.github.com/repos/openssl/openssl/contributors","subscribers_url":"https://api.github.com/repos/openssl/openssl/subscribers","subscription_url":"https://api.github.com/repos/openssl/openssl/subscription","commits_url":"https://api.github.com/repos/openssl/openssl/commits{/sha}","git_commits_url":"https://api.github.com/repos/openssl/openssl/git/commits{/sha}","comments_url":"https://api.github.com/repos/openssl/openssl/comments{/number}","issue_comment_url":"https://api.github.com/repos/openssl/openssl/issues/comments{/number}","contents_url":"https://api.github.com/repos/openssl/openssl/contents/{+path}","compare_url":"https://api.github.com/repos/openssl/openssl/compare/{base}...{head}","merges_url":"https://api.github.com/repos/openssl/openssl/merges","archive_url":"https://api.github.com/repos/openssl/openssl/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/openssl/openssl/downloads","issues_url":"https://api.github.com/repos/openssl/openssl/issues{/number}","pulls_url":"https://api.github.com/repos/openssl/openssl/pulls{/number}","milestones_url":"https://api.github.com/repos/openssl/openssl/milestones{/number}","notifications_url":"https://api.github.com/repos/openssl/openssl/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/openssl/openssl/labels{/name}","releases_url":"https://api.github.com/repos/openssl/openssl/releases{/id}","deployments_url":"https://api.github.com/repos/openssl/openssl/deployments","created_at":"2013-01-15T22:34:48Z","updated_at":"2018-11-14T11:38:26Z","pushed_at":"2018-11-14T11:38:14Z","git_url":"git://github.com/openssl/openssl.git","ssh_url":"git@github.com:openssl/openssl.git","clone_url":"https://github.com/openssl/openssl.git","svn_url":"https://github.com/openssl/openssl","homepage":"https://www.openssl.org","size":160798,"stargazers_count":8679,"watchers_count":8679,"language":"C","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":3975,"mirror_url":null,"archived":false,"open_issues_count":577,"license":{"key":"other","name":"Other","spdx_id":"NOASSERTION","url":null,"node_id":"MDc6TGljZW5zZTA="},"forks":3975,"open_issues":577,"watchers":8679,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/openssl/openssl/pulls/6674"},"html":{"href":"https://github.com/openssl/openssl/pull/6674"},"issue":{"href":"https://api.github.com/repos/openssl/openssl/issues/6674"},"comments":{"href":"https://api.github.com/repos/openssl/openssl/issues/6674/comments"},"review_comments":{"href":"https://api.github.com/repos/openssl/openssl/pulls/6674/comments"},"review_comment":{"href":"https://api.github.com/repos/openssl/openssl/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/openssl/openssl/pulls/6674/commits"},"statuses":{"href":"https://api.github.com/repos/openssl/openssl/statuses/24f56bbfc9545ec5cd039eab0ad54989a01be5d3"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"daurnimator"}}