Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add platform check to set library names for linking on windows #322

Merged
merged 3 commits into from Jan 24, 2014
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 1 addition & 0 deletions .coveragerc
Expand Up @@ -3,5 +3,6 @@ branch = True

[report]
exclude_lines =
pragma: no cover
@abc.abstractmethod
@abc.abstractproperty
10 changes: 9 additions & 1 deletion cryptography/hazmat/bindings/openssl/binding.py
Expand Up @@ -13,6 +13,8 @@

from __future__ import absolute_import, division, print_function

import sys

from cryptography.hazmat.bindings.utils import build_ffi


Expand Down Expand Up @@ -79,9 +81,15 @@ def _ensure_ffi_initialized(cls):
if cls.ffi is not None and cls.lib is not None:
return

# platform check to set the right library names
if sys.platform != "win32":
libraries = ["crypto", "ssl"]
else: # pragma: no cover
libraries = ["libeay32", "ssleay32", "advapi32"]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm afraid to ask, but why do we need "advapi32"?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh I can actually remove that until we land the os random engine. advapi32 is for cryptgenrandom.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sounds good. (I hate everything)

On Thu, Jan 23, 2014 at 8:19 PM, Paul Kehrer notifications@github.comwrote:

In cryptography/hazmat/bindings/openssl/binding.py:

@@ -79,9 +81,15 @@ def _ensure_ffi_initialized(cls):
if cls.ffi is not None and cls.lib is not None:
return

  •    # platform check to set the right library names
    
  •    if sys.platform != "win32":
    
  •        libraries = ["crypto", "ssl"]
    
  •    else:  # pragma: no cover
    
  •        libraries = ["libeay32", "ssleay32", "advapi32"]
    

Oh I can actually remove that until we land the os random engine. advapi32
is for cryptgenrandom.


Reply to this email directly or view it on GitHubhttps://github.com//pull/322/files#r9138609
.

"I disapprove of what you say, but I will defend to the death your right to
say it." -- Evelyn Beatrice Hall (summarizing Voltaire)
"The people's good is the highest law." -- Cicero
GPG Key fingerprint: 125F 5C67 DFE9 4084


cls.ffi, cls.lib = build_ffi(cls._module_prefix, cls._modules,
_OSX_PRE_INCLUDE, _OSX_POST_INCLUDE,
["crypto", "ssl"])
libraries)

@classmethod
def is_available(cls):
Expand Down