{"action":"created","comment":{"url":"https://api.github.com/repos/OpenSC/OpenSC/pulls/comments/81049968","pull_request_review_id":2058917,"id":81049968,"diff_hunk":"@@ -2023,16 +2036,24 @@ do_read_key(unsigned char *data, size_t data_len, int private, EVP_PKEY **key)\n \n #define RSA_GET_BN(RSA, LOCALNAME, BNVALUE) \\\n \tdo { \\\n-\t\tRSA->LOCALNAME = malloc(BN_num_bytes(BNVALUE)); \\\n-\t\tif (!RSA->LOCALNAME) \\\n-\t\t\tutil_fatal(\"malloc() failure\"); \\\n-\t\tRSA->LOCALNAME##_len = BN_bn2bin(BNVALUE, RSA->LOCALNAME); \\\n+\t\tif (BNVALUE) { \\\n+\t\t\tRSA->LOCALNAME = malloc(BN_num_bytes(BNVALUE)); \\","path":"src/tools/pkcs11-tool.c","position":101,"original_position":101,"commit_id":"ebf968f1339080fc0bf6503aaa0e839228f6a016","original_commit_id":"ebf968f1339080fc0bf6503aaa0e839228f6a016","user":{"login":"dengert","id":865329,"avatar_url":"https://avatars.githubusercontent.com/u/865329?v=3","gravatar_id":"","url":"https://api.github.com/users/dengert","html_url":"https://github.com/dengert","followers_url":"https://api.github.com/users/dengert/followers","following_url":"https://api.github.com/users/dengert/following{/other_user}","gists_url":"https://api.github.com/users/dengert/gists{/gist_id}","starred_url":"https://api.github.com/users/dengert/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dengert/subscriptions","organizations_url":"https://api.github.com/users/dengert/orgs","repos_url":"https://api.github.com/users/dengert/repos","events_url":"https://api.github.com/users/dengert/events{/privacy}","received_events_url":"https://api.github.com/users/dengert/received_events","type":"User","site_admin":false},"body":"In parse_rsa_pkey one of the parameters is struct rsakey_info *rsa. \r\nThe macro RSA_GET_BN(RSA, LOCALNAME, BNVALUE) is only used in parse_pkey. \r\nSo the macro is operating on a struct rsakey_info not an OpenSSL RSA object. \r\n\r\nThe new code in parse_rsa_pkey uses the RSA_get0_* routines to get pointers to:\r\n +\tconst BIGNUM *r_n, *r_e, *r_d;\r\n+\tconst BIGNUM *r_p, *r_q;\r\n+\tconst BIGNUM *r_dmp1, *r_dmq1, *r_iqmp;\r\n\r\nthen the RSA_GET_BN macro is use to extract from teh BIGNUMs what it needs. \r\n\r\n\r\n","created_at":"2016-09-29T01:18:57Z","updated_at":"2016-09-29T01:18:57Z","html_url":"https://github.com/OpenSC/OpenSC/pull/861#discussion_r81049968","pull_request_url":"https://api.github.com/repos/OpenSC/OpenSC/pulls/861","_links":{"self":{"href":"https://api.github.com/repos/OpenSC/OpenSC/pulls/comments/81049968"},"html":{"href":"https://github.com/OpenSC/OpenSC/pull/861#discussion_r81049968"},"pull_request":{"href":"https://api.github.com/repos/OpenSC/OpenSC/pulls/861"}}},"pull_request":{"url":"https://api.github.com/repos/OpenSC/OpenSC/pulls/861","id":82820585,"html_url":"https://github.com/OpenSC/OpenSC/pull/861","diff_url":"https://github.com/OpenSC/OpenSC/pull/861.diff","patch_url":"https://github.com/OpenSC/OpenSC/pull/861.patch","issue_url":"https://api.github.com/repos/OpenSC/OpenSC/issues/861","number":861,"state":"open","locked":false,"title":"Use OpenSSL versions OpenSSL-0.9.7 to 1.1.0 for OpenSC","user":{"login":"dengert","id":865329,"avatar_url":"https://avatars.githubusercontent.com/u/865329?v=3","gravatar_id":"","url":"https://api.github.com/users/dengert","html_url":"https://github.com/dengert","followers_url":"https://api.github.com/users/dengert/followers","following_url":"https://api.github.com/users/dengert/following{/other_user}","gists_url":"https://api.github.com/users/dengert/gists{/gist_id}","starred_url":"https://api.github.com/users/dengert/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dengert/subscriptions","organizations_url":"https://api.github.com/users/dengert/orgs","repos_url":"https://api.github.com/users/dengert/repos","events_url":"https://api.github.com/users/dengert/events{/privacy}","received_events_url":"https://api.github.com/users/dengert/received_events","type":"User","site_admin":false},"body":"OpenSSL-1.1.0 was released today, 8/25/2016\r\n\r\n  https://www.openssl.org/news/openssl-1.1.0-notes.html\r\n\r\nChanges to allow the OpenSC code base to work with OpenSSL versions from\r\n0.9.7 to 1.1.0 with few changes.\r\n\r\nThis is an update  and rebased version of my prep-openssl-1.1.0-pre6 branch.\r\n\r\nNo attempt was made to back port any OpenSSL features. These changes\r\njust allow an updated OpenSC code base to use what is in the various OpenSSL\r\nreleases.\r\n\r\nA new header libopensc/sc-ossl-compat.h contains extra defines\r\nto reduce the need for so many #if OPENSSL_VERSION_NUMBER statements\r\nin the source code.\r\n\r\nThe OpenSC source can now use the OpenSSL 1.1 API. The libopensc/sc-ossl-compat.h\r\nhas defines for the new API for use with older versions of OpenSSL.\r\n\r\nsc-ossl-compat.h is included by libopensc/internal.h so all OpenSC\r\nlibrary routines can take advantage of it. For the tools, which do not use\r\nlibopensc/internal.h, libopensc/sc-ossl-compat.h is included by the tools.\r\n\r\nThe OpenSC source has been modified to use OpenSSL functions to access\r\nhidden structures, such X509, BIGNUM, EVP_CIPHER_CTX, and use XXX_new\r\nfunctions to allocate structures which most use pointer such as\r\nBIGNUM and EVP_CIPHER_CTX.\r\n\r\nFor backward compatability sc-ossl-compat.h now defines inline routines\r\nto emulate the RSA and DSA  access routines in OpenSSL-1.1.0. Thus\r\nthe same OpenSC source code can be used with openSSL versions from\r\n0.9.7 to 1.1.0.\r\n\r\nInline routines were chosen, because using macros does not work on all platforms.\r\nHaving OpenSC versions of these routines in libopensc would be a posibility,\r\nbut they are only used for older version of OpenSSL, and could be removed in\r\nthe future.\r\n\r\nThese mods need much testing. Testing code that I can not test.\r\nInput is welcome.\r\n\r\n Changes to be committed:\r\n\tmodified:   src/libopensc/card-entersafe.c\r\n\tmodified:   src/libopensc/card-epass2003.c\r\n\tmodified:   src/libopensc/card-gids.c\r\n\tmodified:   src/libopensc/card-gpk.c\r\n\tmodified:   src/libopensc/card-oberthur.c\r\n\tmodified:   src/libopensc/card-piv.c\r\n\tmodified:   src/libopensc/card-westcos.c\r\n\tmodified:   src/libopensc/cwa-dnie.c\r\n\tmodified:   src/libopensc/cwa14890.c\r\n\tmodified:   src/libopensc/internal.h\r\n\tmodified:   src/libopensc/p15card-helper.c\r\n\tmodified:   src/libopensc/pkcs15-itacns.c\r\n\tmodified:   src/libopensc/pkcs15-prkey.c\r\n\tmodified:   src/libopensc/pkcs15-pubkey.c\r\n\tnew file:   src/libopensc/sc-ossl-compat.h\r\n\tmodified:   src/pkcs11/openssl.c\r\n\tmodified:   src/pkcs15init/pkcs15-lib.c\r\n\tmodified:   src/pkcs15init/pkcs15-oberthur-awp.c\r\n\tmodified:   src/pkcs15init/pkcs15-oberthur.c\r\n\tmodified:   src/pkcs15init/pkcs15-oberthur.h\r\n\tmodified:   src/pkcs15init/pkcs15-westcos.c\r\n\tmodified:   src/tools/cryptoflex-tool.c\r\n\tmodified:   src/tools/gids-tool.c\r\n\tmodified:   src/tools/netkey-tool.c\r\n\tmodified:   src/tools/piv-tool.c\r\n\tmodified:   src/tools/pkcs11-tool.c\r\n\tmodified:   src/tools/pkcs15-init.c\r\n\tmodified:   src/tools/sc-hsm-tool.c\r\n\tmodified:   src/tools/westcos-tool.c","created_at":"2016-08-26T01:48:02Z","updated_at":"2016-09-29T01:18:57Z","closed_at":null,"merged_at":null,"merge_commit_sha":"cfb38ade65df9c6086611dbf2343983556b6a6d6","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/OpenSC/OpenSC/pulls/861/commits","review_comments_url":"https://api.github.com/repos/OpenSC/OpenSC/pulls/861/comments","review_comment_url":"https://api.github.com/repos/OpenSC/OpenSC/pulls/comments{/number}","comments_url":"https://api.github.com/repos/OpenSC/OpenSC/issues/861/comments","statuses_url":"https://api.github.com/repos/OpenSC/OpenSC/statuses/ebf968f1339080fc0bf6503aaa0e839228f6a016","head":{"label":"dengert:openssl-1.1.0-compat","ref":"openssl-1.1.0-compat","sha":"ebf968f1339080fc0bf6503aaa0e839228f6a016","user":{"login":"dengert","id":865329,"avatar_url":"https://avatars.githubusercontent.com/u/865329?v=3","gravatar_id":"","url":"https://api.github.com/users/dengert","html_url":"https://github.com/dengert","followers_url":"https://api.github.com/users/dengert/followers","following_url":"https://api.github.com/users/dengert/following{/other_user}","gists_url":"https://api.github.com/users/dengert/gists{/gist_id}","starred_url":"https://api.github.com/users/dengert/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dengert/subscriptions","organizations_url":"https://api.github.com/users/dengert/orgs","repos_url":"https://api.github.com/users/dengert/repos","events_url":"https://api.github.com/users/dengert/events{/privacy}","received_events_url":"https://api.github.com/users/dengert/received_events","type":"User","site_admin":false},"repo":{"id":26346144,"name":"OpenSC","full_name":"dengert/OpenSC","owner":{"login":"dengert","id":865329,"avatar_url":"https://avatars.githubusercontent.com/u/865329?v=3","gravatar_id":"","url":"https://api.github.com/users/dengert","html_url":"https://github.com/dengert","followers_url":"https://api.github.com/users/dengert/followers","following_url":"https://api.github.com/users/dengert/following{/other_user}","gists_url":"https://api.github.com/users/dengert/gists{/gist_id}","starred_url":"https://api.github.com/users/dengert/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dengert/subscriptions","organizations_url":"https://api.github.com/users/dengert/orgs","repos_url":"https://api.github.com/users/dengert/repos","events_url":"https://api.github.com/users/dengert/events{/privacy}","received_events_url":"https://api.github.com/users/dengert/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/dengert/OpenSC","description":"Open source smart card tools and middleware. PKCS#11/MiniDriver/Tokend","fork":true,"url":"https://api.github.com/repos/dengert/OpenSC","forks_url":"https://api.github.com/repos/dengert/OpenSC/forks","keys_url":"https://api.github.com/repos/dengert/OpenSC/keys{/key_id}","collaborators_url":"https://api.github.com/repos/dengert/OpenSC/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/dengert/OpenSC/teams","hooks_url":"https://api.github.com/repos/dengert/OpenSC/hooks","issue_events_url":"https://api.github.com/repos/dengert/OpenSC/issues/events{/number}","events_url":"https://api.github.com/repos/dengert/OpenSC/events","assignees_url":"https://api.github.com/repos/dengert/OpenSC/assignees{/user}","branches_url":"https://api.github.com/repos/dengert/OpenSC/branches{/branch}","tags_url":"https://api.github.com/repos/dengert/OpenSC/tags","blobs_url":"https://api.github.com/repos/dengert/OpenSC/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/dengert/OpenSC/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/dengert/OpenSC/git/refs{/sha}","trees_url":"https://api.github.com/repos/dengert/OpenSC/git/trees{/sha}","statuses_url":"https://api.github.com/repos/dengert/OpenSC/statuses/{sha}","languages_url":"https://api.github.com/repos/dengert/OpenSC/languages","stargazers_url":"https://api.github.com/repos/dengert/OpenSC/stargazers","contributors_url":"https://api.github.com/repos/dengert/OpenSC/contributors","subscribers_url":"https://api.github.com/repos/dengert/OpenSC/subscribers","subscription_url":"https://api.github.com/repos/dengert/OpenSC/subscription","commits_url":"https://api.github.com/repos/dengert/OpenSC/commits{/sha}","git_commits_url":"https://api.github.com/repos/dengert/OpenSC/git/commits{/sha}","comments_url":"https://api.github.com/repos/dengert/OpenSC/comments{/number}","issue_comment_url":"https://api.github.com/repos/dengert/OpenSC/issues/comments{/number}","contents_url":"https://api.github.com/repos/dengert/OpenSC/contents/{+path}","compare_url":"https://api.github.com/repos/dengert/OpenSC/compare/{base}...{head}","merges_url":"https://api.github.com/repos/dengert/OpenSC/merges","archive_url":"https://api.github.com/repos/dengert/OpenSC/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/dengert/OpenSC/downloads","issues_url":"https://api.github.com/repos/dengert/OpenSC/issues{/number}","pulls_url":"https://api.github.com/repos/dengert/OpenSC/pulls{/number}","milestones_url":"https://api.github.com/repos/dengert/OpenSC/milestones{/number}","notifications_url":"https://api.github.com/repos/dengert/OpenSC/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/dengert/OpenSC/labels{/name}","releases_url":"https://api.github.com/repos/dengert/OpenSC/releases{/id}","deployments_url":"https://api.github.com/repos/dengert/OpenSC/deployments","created_at":"2014-11-08T01:38:28Z","updated_at":"2016-01-19T03:43:23Z","pushed_at":"2016-09-23T14:57:57Z","git_url":"git://github.com/dengert/OpenSC.git","ssh_url":"git@github.com:dengert/OpenSC.git","clone_url":"https://github.com/dengert/OpenSC.git","svn_url":"https://github.com/dengert/OpenSC","homepage":"https://github.com/OpenSC/OpenSC/wiki","size":10386,"stargazers_count":0,"watchers_count":0,"language":"C","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"OpenSC:master","ref":"master","sha":"96ef5c0dc28c340e2cda5912b157cb5a73d79e2e","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}","deployments_url":"https://api.github.com/repos/OpenSC/OpenSC/deployments","created_at":"2011-07-05T09:45:08Z","updated_at":"2016-09-27T15:02:36Z","pushed_at":"2016-09-28T08:47:24Z","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":16481,"stargazers_count":527,"watchers_count":527,"language":"C","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":269,"mirror_url":null,"open_issues_count":35,"forks":269,"open_issues":35,"watchers":527,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/OpenSC/OpenSC/pulls/861"},"html":{"href":"https://github.com/OpenSC/OpenSC/pull/861"},"issue":{"href":"https://api.github.com/repos/OpenSC/OpenSC/issues/861"},"comments":{"href":"https://api.github.com/repos/OpenSC/OpenSC/issues/861/comments"},"review_comments":{"href":"https://api.github.com/repos/OpenSC/OpenSC/pulls/861/comments"},"review_comment":{"href":"https://api.github.com/repos/OpenSC/OpenSC/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/OpenSC/OpenSC/pulls/861/commits"},"statuses":{"href":"https://api.github.com/repos/OpenSC/OpenSC/statuses/ebf968f1339080fc0bf6503aaa0e839228f6a016"}}}}
{"actor":{"display_login":"dengert"}}