aboutsummaryrefslogtreecommitdiffstats
path: root/cryptography
diff options
context:
space:
mode:
authorPaul Kehrer <paul.l.kehrer@gmail.com>2014-02-05 17:41:41 -0600
committerPaul Kehrer <paul.l.kehrer@gmail.com>2014-02-05 17:41:41 -0600
commit387424bfab02aa929127201945a5a9476abb8be6 (patch)
tree02fcbc27786ea55aa7d0556d236e1061354831c6 /cryptography
parentf970eaa676eb0cd89cdb2389f03d365899812822 (diff)
parenta54dcde3bda3f2de83b56d4456903e7bdce182e6 (diff)
downloadcryptography-387424bfab02aa929127201945a5a9476abb8be6.tar.gz
cryptography-387424bfab02aa929127201945a5a9476abb8be6.tar.bz2
cryptography-387424bfab02aa929127201945a5a9476abb8be6.zip
Merge pull request #566 from alex/comment-cleanup
Write comments as complete sentences
Diffstat (limited to 'cryptography')
-rw-r--r--cryptography/hazmat/bindings/openssl/binding.py14
1 files changed, 8 insertions, 6 deletions
diff --git a/cryptography/hazmat/bindings/openssl/binding.py b/cryptography/hazmat/bindings/openssl/binding.py
index cde3bdbd..3adcc887 100644
--- a/cryptography/hazmat/bindings/openssl/binding.py
+++ b/cryptography/hazmat/bindings/openssl/binding.py
@@ -86,7 +86,8 @@ class Binding(object):
if cls.ffi is not None and cls.lib is not None:
return
- # platform check to set the right library names
+ # OpenSSL goes by a different library name on different operating
+ # systems.
if sys.platform != "win32":
libraries = ["crypto", "ssl"]
else: # pragma: no cover
@@ -98,7 +99,8 @@ class Binding(object):
@classmethod
def is_available(cls):
- # OpenSSL is the only binding so for now it must always be available
+ # For now, OpenSSL is considered our "default" binding, so we treat it
+ # as always available.
return True
@classmethod
@@ -112,15 +114,15 @@ class Binding(object):
cls._lock_cb
)
- # use Python's implementation if available
-
+ # Use Python's implementation if available, importing _ssl triggers
+ # the setup for this.
__import__("_ssl")
if cls.lib.CRYPTO_get_locking_callback() != cls.ffi.NULL:
return
- # otherwise setup our version
-
+ # If nothing else has setup a locking callback already, we set up
+ # our own
num_locks = cls.lib.CRYPTO_num_locks()
cls._locks = [threading.Lock() for n in range(num_locks)]