{"action":"created","comment":{"url":"https://api.github.com/repos/pyca/cryptography/pulls/comments/31877305","id":31877305,"diff_hunk":"@@ -4,136 +4,30 @@\n \n from __future__ import absolute_import, division, print_function\n \n-import os\n-import sys\n import threading\n \n-from cryptography.hazmat.bindings.utils import (\n-    build_ffi_for_binding, load_library_for_binding,\n-)\n-\n-\n-_OSX_PRE_INCLUDE = \"\"\"\n-#ifdef __APPLE__\n-#include <AvailabilityMacros.h>\n-#define __ORIG_DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER \\\n-    DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER\n-#undef DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER\n-#define DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER\n-#endif\n-\"\"\"\n-\n-_OSX_POST_INCLUDE = \"\"\"\n-#ifdef __APPLE__\n-#undef DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER\n-#define DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER \\\n-    __ORIG_DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER\n-#endif\n-\"\"\"\n-\n-\n-def _get_libraries(platform):\n-    # OpenSSL goes by a different library name on different operating systems.\n-    if platform != \"win32\":\n-        # In some circumstances, the order in which these libs are\n-        # specified on the linker command-line is significant;\n-        # libssl must come before libcrypto\n-        # (http://marc.info/?l=openssl-users&m=135361825921871)\n-        return [\"ssl\", \"crypto\"]\n-    else:\n-        link_type = os.environ.get(\"PYCA_WINDOWS_LINK_TYPE\", \"static\")\n-        return _get_windows_libraries(link_type)\n-\n-\n-def _get_windows_libraries(link_type):\n-    if link_type == \"dynamic\":\n-        return [\"libeay32\", \"ssleay32\", \"advapi32\"]\n-    elif link_type == \"static\" or link_type == \"\":\n-        return [\"libeay32mt\", \"ssleay32mt\", \"advapi32\",\n-                \"crypt32\", \"gdi32\", \"user32\", \"ws2_32\"]\n-    else:\n-        raise ValueError(\n-            \"PYCA_WINDOWS_LINK_TYPE must be 'static' or 'dynamic'\"\n-        )\n+from cryptography._cryptography_openssl import ffi, lib\n+\n+res = lib.Cryptography_add_osrandom_engine()","path":"src/cryptography/hazmat/bindings/openssl/binding.py","position":57,"original_position":57,"commit_id":"14a68ddee5a102d42517146bc75fe88abe46400e","original_commit_id":"65746cac59fc1e6c1db1eb559f31684c5d5b64be","user":{"login":"reaperhulk","id":161495,"avatar_url":"https://avatars.githubusercontent.com/u/161495?v=3","gravatar_id":"","url":"https://api.github.com/users/reaperhulk","html_url":"https://github.com/reaperhulk","followers_url":"https://api.github.com/users/reaperhulk/followers","following_url":"https://api.github.com/users/reaperhulk/following{/other_user}","gists_url":"https://api.github.com/users/reaperhulk/gists{/gist_id}","starred_url":"https://api.github.com/users/reaperhulk/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/reaperhulk/subscriptions","organizations_url":"https://api.github.com/users/reaperhulk/orgs","repos_url":"https://api.github.com/users/reaperhulk/repos","events_url":"https://api.github.com/users/reaperhulk/events{/privacy}","received_events_url":"https://api.github.com/users/reaperhulk/received_events","type":"User","site_admin":false},"body":"If we ever want to get rid of the `Binding` object (and I think we probably should since it doesn't really need to exist now) we'll eventually have to transition all this class global state to module global state anyway. I'm going to revert this to simplify review for now though. We can discuss deprecation/removal of `Binding` in the future.","created_at":"2015-06-07T14:32:00Z","updated_at":"2015-06-07T14:32:00Z","html_url":"https://github.com/pyca/cryptography/pull/1986#discussion_r31877305","pull_request_url":"https://api.github.com/repos/pyca/cryptography/pulls/1986","_links":{"self":{"href":"https://api.github.com/repos/pyca/cryptography/pulls/comments/31877305"},"html":{"href":"https://github.com/pyca/cryptography/pull/1986#discussion_r31877305"},"pull_request":{"href":"https://api.github.com/repos/pyca/cryptography/pulls/1986"}}},"pull_request":{"url":"https://api.github.com/repos/pyca/cryptography/pulls/1986","id":35987205,"html_url":"https://github.com/pyca/cryptography/pull/1986","diff_url":"https://github.com/pyca/cryptography/pull/1986.diff","patch_url":"https://github.com/pyca/cryptography/pull/1986.patch","issue_url":"https://api.github.com/repos/pyca/cryptography/issues/1986","number":1986,"state":"open","locked":false,"title":"cffi 1.0","user":{"login":"reaperhulk","id":161495,"avatar_url":"https://avatars.githubusercontent.com/u/161495?v=3","gravatar_id":"","url":"https://api.github.com/users/reaperhulk","html_url":"https://github.com/reaperhulk","followers_url":"https://api.github.com/users/reaperhulk/followers","following_url":"https://api.github.com/users/reaperhulk/following{/other_user}","gists_url":"https://api.github.com/users/reaperhulk/gists{/gist_id}","starred_url":"https://api.github.com/users/reaperhulk/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/reaperhulk/subscriptions","organizations_url":"https://api.github.com/users/reaperhulk/orgs","repos_url":"https://api.github.com/users/reaperhulk/repos","events_url":"https://api.github.com/users/reaperhulk/events{/privacy}","received_events_url":"https://api.github.com/users/reaperhulk/received_events","type":"User","site_admin":false},"body":"This is a very early patch. @dstufft I'd appreciate pointers on how to make this less crazy. Specifically I'm baffled by where these build scripts should live (and why building creates two copies of the shared objects -- one in the right place and another in the root of the repository).\r\n\r\nThe tests will also fail right now because we attempt to monkeypatch to do elliptic curve supported checks (and also pypy doesn't have cffi 1.0).","created_at":"2015-05-21T23:13:11Z","updated_at":"2015-06-07T14:32:00Z","closed_at":null,"merged_at":null,"merge_commit_sha":"f1e2dacae23c0b33a64be57dd191184f0a9a3d56","assignee":null,"milestone":{"url":"https://api.github.com/repos/pyca/cryptography/milestones/11","html_url":"https://github.com/pyca/cryptography/milestones/Tenth%20Release","labels_url":"https://api.github.com/repos/pyca/cryptography/milestones/11/labels","id":1099545,"number":11,"title":"Tenth Release","description":"","creator":{"login":"reaperhulk","id":161495,"avatar_url":"https://avatars.githubusercontent.com/u/161495?v=3","gravatar_id":"","url":"https://api.github.com/users/reaperhulk","html_url":"https://github.com/reaperhulk","followers_url":"https://api.github.com/users/reaperhulk/followers","following_url":"https://api.github.com/users/reaperhulk/following{/other_user}","gists_url":"https://api.github.com/users/reaperhulk/gists{/gist_id}","starred_url":"https://api.github.com/users/reaperhulk/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/reaperhulk/subscriptions","organizations_url":"https://api.github.com/users/reaperhulk/orgs","repos_url":"https://api.github.com/users/reaperhulk/repos","events_url":"https://api.github.com/users/reaperhulk/events{/privacy}","received_events_url":"https://api.github.com/users/reaperhulk/received_events","type":"User","site_admin":false},"open_issues":21,"closed_issues":38,"state":"open","created_at":"2015-05-07T04:01:32Z","updated_at":"2015-06-07T04:29:50Z","due_on":null,"closed_at":null},"commits_url":"https://api.github.com/repos/pyca/cryptography/pulls/1986/commits","review_comments_url":"https://api.github.com/repos/pyca/cryptography/pulls/1986/comments","review_comment_url":"https://api.github.com/repos/pyca/cryptography/pulls/comments{/number}","comments_url":"https://api.github.com/repos/pyca/cryptography/issues/1986/comments","statuses_url":"https://api.github.com/repos/pyca/cryptography/statuses/14a68ddee5a102d42517146bc75fe88abe46400e","head":{"label":"reaperhulk:cffi10","ref":"cffi10","sha":"14a68ddee5a102d42517146bc75fe88abe46400e","user":{"login":"reaperhulk","id":161495,"avatar_url":"https://avatars.githubusercontent.com/u/161495?v=3","gravatar_id":"","url":"https://api.github.com/users/reaperhulk","html_url":"https://github.com/reaperhulk","followers_url":"https://api.github.com/users/reaperhulk/followers","following_url":"https://api.github.com/users/reaperhulk/following{/other_user}","gists_url":"https://api.github.com/users/reaperhulk/gists{/gist_id}","starred_url":"https://api.github.com/users/reaperhulk/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/reaperhulk/subscriptions","organizations_url":"https://api.github.com/users/reaperhulk/orgs","repos_url":"https://api.github.com/users/reaperhulk/repos","events_url":"https://api.github.com/users/reaperhulk/events{/privacy}","received_events_url":"https://api.github.com/users/reaperhulk/received_events","type":"User","site_admin":false},"repo":{"id":12704352,"name":"cryptography","full_name":"reaperhulk/cryptography","owner":{"login":"reaperhulk","id":161495,"avatar_url":"https://avatars.githubusercontent.com/u/161495?v=3","gravatar_id":"","url":"https://api.github.com/users/reaperhulk","html_url":"https://github.com/reaperhulk","followers_url":"https://api.github.com/users/reaperhulk/followers","following_url":"https://api.github.com/users/reaperhulk/following{/other_user}","gists_url":"https://api.github.com/users/reaperhulk/gists{/gist_id}","starred_url":"https://api.github.com/users/reaperhulk/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/reaperhulk/subscriptions","organizations_url":"https://api.github.com/users/reaperhulk/orgs","repos_url":"https://api.github.com/users/reaperhulk/repos","events_url":"https://api.github.com/users/reaperhulk/events{/privacy}","received_events_url":"https://api.github.com/users/reaperhulk/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/reaperhulk/cryptography","description":"cryptography is a package designed to expose cryptographic primitives and recipes to Python developers.","fork":true,"url":"https://api.github.com/repos/reaperhulk/cryptography","forks_url":"https://api.github.com/repos/reaperhulk/cryptography/forks","keys_url":"https://api.github.com/repos/reaperhulk/cryptography/keys{/key_id}","collaborators_url":"https://api.github.com/repos/reaperhulk/cryptography/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/reaperhulk/cryptography/teams","hooks_url":"https://api.github.com/repos/reaperhulk/cryptography/hooks","issue_events_url":"https://api.github.com/repos/reaperhulk/cryptography/issues/events{/number}","events_url":"https://api.github.com/repos/reaperhulk/cryptography/events","assignees_url":"https://api.github.com/repos/reaperhulk/cryptography/assignees{/user}","branches_url":"https://api.github.com/repos/reaperhulk/cryptography/branches{/branch}","tags_url":"https://api.github.com/repos/reaperhulk/cryptography/tags","blobs_url":"https://api.github.com/repos/reaperhulk/cryptography/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/reaperhulk/cryptography/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/reaperhulk/cryptography/git/refs{/sha}","trees_url":"https://api.github.com/repos/reaperhulk/cryptography/git/trees{/sha}","statuses_url":"https://api.github.com/repos/reaperhulk/cryptography/statuses/{sha}","languages_url":"https://api.github.com/repos/reaperhulk/cryptography/languages","stargazers_url":"https://api.github.com/repos/reaperhulk/cryptography/stargazers","contributors_url":"https://api.github.com/repos/reaperhulk/cryptography/contributors","subscribers_url":"https://api.github.com/repos/reaperhulk/cryptography/subscribers","subscription_url":"https://api.github.com/repos/reaperhulk/cryptography/subscription","commits_url":"https://api.github.com/repos/reaperhulk/cryptography/commits{/sha}","git_commits_url":"https://api.github.com/repos/reaperhulk/cryptography/git/commits{/sha}","comments_url":"https://api.github.com/repos/reaperhulk/cryptography/comments{/number}","issue_comment_url":"https://api.github.com/repos/reaperhulk/cryptography/issues/comments{/number}","contents_url":"https://api.github.com/repos/reaperhulk/cryptography/contents/{+path}","compare_url":"https://api.github.com/repos/reaperhulk/cryptography/compare/{base}...{head}","merges_url":"https://api.github.com/repos/reaperhulk/cryptography/merges","archive_url":"https://api.github.com/repos/reaperhulk/cryptography/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/reaperhulk/cryptography/downloads","issues_url":"https://api.github.com/repos/reaperhulk/cryptography/issues{/number}","pulls_url":"https://api.github.com/repos/reaperhulk/cryptography/pulls{/number}","milestones_url":"https://api.github.com/repos/reaperhulk/cryptography/milestones{/number}","notifications_url":"https://api.github.com/repos/reaperhulk/cryptography/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/reaperhulk/cryptography/labels{/name}","releases_url":"https://api.github.com/repos/reaperhulk/cryptography/releases{/id}","created_at":"2013-09-09T14:59:27Z","updated_at":"2015-05-03T01:56:14Z","pushed_at":"2015-06-07T14:18:43Z","git_url":"git://github.com/reaperhulk/cryptography.git","ssh_url":"git@github.com:reaperhulk/cryptography.git","clone_url":"https://github.com/reaperhulk/cryptography.git","svn_url":"https://github.com/reaperhulk/cryptography","homepage":"","size":34558,"stargazers_count":0,"watchers_count":0,"language":"Python","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":"pyca:master","ref":"master","sha":"014b68ead801e23a33e06524c20d2f290ba6772f","user":{"login":"pyca","id":5615737,"avatar_url":"https://avatars.githubusercontent.com/u/5615737?v=3","gravatar_id":"","url":"https://api.github.com/users/pyca","html_url":"https://github.com/pyca","followers_url":"https://api.github.com/users/pyca/followers","following_url":"https://api.github.com/users/pyca/following{/other_user}","gists_url":"https://api.github.com/users/pyca/gists{/gist_id}","starred_url":"https://api.github.com/users/pyca/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pyca/subscriptions","organizations_url":"https://api.github.com/users/pyca/orgs","repos_url":"https://api.github.com/users/pyca/repos","events_url":"https://api.github.com/users/pyca/events{/privacy}","received_events_url":"https://api.github.com/users/pyca/received_events","type":"Organization","site_admin":false},"repo":{"id":11939484,"name":"cryptography","full_name":"pyca/cryptography","owner":{"login":"pyca","id":5615737,"avatar_url":"https://avatars.githubusercontent.com/u/5615737?v=3","gravatar_id":"","url":"https://api.github.com/users/pyca","html_url":"https://github.com/pyca","followers_url":"https://api.github.com/users/pyca/followers","following_url":"https://api.github.com/users/pyca/following{/other_user}","gists_url":"https://api.github.com/users/pyca/gists{/gist_id}","starred_url":"https://api.github.com/users/pyca/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pyca/subscriptions","organizations_url":"https://api.github.com/users/pyca/orgs","repos_url":"https://api.github.com/users/pyca/repos","events_url":"https://api.github.com/users/pyca/events{/privacy}","received_events_url":"https://api.github.com/users/pyca/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/pyca/cryptography","description":"cryptography is a package designed to expose cryptographic primitives and recipes to Python developers.","fork":false,"url":"https://api.github.com/repos/pyca/cryptography","forks_url":"https://api.github.com/repos/pyca/cryptography/forks","keys_url":"https://api.github.com/repos/pyca/cryptography/keys{/key_id}","collaborators_url":"https://api.github.com/repos/pyca/cryptography/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/pyca/cryptography/teams","hooks_url":"https://api.github.com/repos/pyca/cryptography/hooks","issue_events_url":"https://api.github.com/repos/pyca/cryptography/issues/events{/number}","events_url":"https://api.github.com/repos/pyca/cryptography/events","assignees_url":"https://api.github.com/repos/pyca/cryptography/assignees{/user}","branches_url":"https://api.github.com/repos/pyca/cryptography/branches{/branch}","tags_url":"https://api.github.com/repos/pyca/cryptography/tags","blobs_url":"https://api.github.com/repos/pyca/cryptography/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/pyca/cryptography/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/pyca/cryptography/git/refs{/sha}","trees_url":"https://api.github.com/repos/pyca/cryptography/git/trees{/sha}","statuses_url":"https://api.github.com/repos/pyca/cryptography/statuses/{sha}","languages_url":"https://api.github.com/repos/pyca/cryptography/languages","stargazers_url":"https://api.github.com/repos/pyca/cryptography/stargazers","contributors_url":"https://api.github.com/repos/pyca/cryptography/contributors","subscribers_url":"https://api.github.com/repos/pyca/cryptography/subscribers","subscription_url":"https://api.github.com/repos/pyca/cryptography/subscription","commits_url":"https://api.github.com/repos/pyca/cryptography/commits{/sha}","git_commits_url":"https://api.github.com/repos/pyca/cryptography/git/commits{/sha}","comments_url":"https://api.github.com/repos/pyca/cryptography/comments{/number}","issue_comment_url":"https://api.github.com/repos/pyca/cryptography/issues/comments{/number}","contents_url":"https://api.github.com/repos/pyca/cryptography/contents/{+path}","compare_url":"https://api.github.com/repos/pyca/cryptography/compare/{base}...{head}","merges_url":"https://api.github.com/repos/pyca/cryptography/merges","archive_url":"https://api.github.com/repos/pyca/cryptography/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/pyca/cryptography/downloads","issues_url":"https://api.github.com/repos/pyca/cryptography/issues{/number}","pulls_url":"https://api.github.com/repos/pyca/cryptography/pulls{/number}","milestones_url":"https://api.github.com/repos/pyca/cryptography/milestones{/number}","notifications_url":"https://api.github.com/repos/pyca/cryptography/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/pyca/cryptography/labels{/name}","releases_url":"https://api.github.com/repos/pyca/cryptography/releases{/id}","created_at":"2013-08-07T02:23:38Z","updated_at":"2015-06-07T06:04:58Z","pushed_at":"2015-06-07T14:18:44Z","git_url":"git://github.com/pyca/cryptography.git","ssh_url":"git@github.com:pyca/cryptography.git","clone_url":"https://github.com/pyca/cryptography.git","svn_url":"https://github.com/pyca/cryptography","homepage":"https://cryptography.io/","size":43309,"stargazers_count":702,"watchers_count":702,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":159,"mirror_url":null,"open_issues_count":96,"forks":159,"open_issues":96,"watchers":702,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/pyca/cryptography/pulls/1986"},"html":{"href":"https://github.com/pyca/cryptography/pull/1986"},"issue":{"href":"https://api.github.com/repos/pyca/cryptography/issues/1986"},"comments":{"href":"https://api.github.com/repos/pyca/cryptography/issues/1986/comments"},"review_comments":{"href":"https://api.github.com/repos/pyca/cryptography/pulls/1986/comments"},"review_comment":{"href":"https://api.github.com/repos/pyca/cryptography/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/pyca/cryptography/pulls/1986/commits"},"statuses":{"href":"https://api.github.com/repos/pyca/cryptography/statuses/14a68ddee5a102d42517146bc75fe88abe46400e"}}}}