aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDonald Stufft <donald@stufft.io>2013-10-27 16:52:33 -0400
committerDonald Stufft <donald@stufft.io>2013-10-28 08:37:33 -0400
commitce0d781707979ccb7f6983601c5ccb25d2354582 (patch)
treef6eab1903394ead5b86d8f05274f43703f5d4dee
parentf04317ae24441082279ea73ccca0a6630c33cc86 (diff)
downloadcryptography-ce0d781707979ccb7f6983601c5ccb25d2354582.tar.gz
cryptography-ce0d781707979ccb7f6983601c5ccb25d2354582.tar.bz2
cryptography-ce0d781707979ccb7f6983601c5ccb25d2354582.zip
Move the bindings into the hazmat module
-rw-r--r--cryptography/hazmat/bindings/__init__.py (renamed from cryptography/bindings/__init__.py)2
-rw-r--r--cryptography/hazmat/bindings/openssl/__init__.py (renamed from cryptography/bindings/openssl/__init__.py)2
-rw-r--r--cryptography/hazmat/bindings/openssl/asn1.py (renamed from cryptography/bindings/openssl/asn1.py)0
-rw-r--r--cryptography/hazmat/bindings/openssl/backend.py (renamed from cryptography/bindings/openssl/backend.py)6
-rw-r--r--cryptography/hazmat/bindings/openssl/bignum.py (renamed from cryptography/bindings/openssl/bignum.py)0
-rw-r--r--cryptography/hazmat/bindings/openssl/bio.py (renamed from cryptography/bindings/openssl/bio.py)0
-rw-r--r--cryptography/hazmat/bindings/openssl/conf.py (renamed from cryptography/bindings/openssl/conf.py)0
-rw-r--r--cryptography/hazmat/bindings/openssl/crypto.py (renamed from cryptography/bindings/openssl/crypto.py)0
-rw-r--r--cryptography/hazmat/bindings/openssl/dh.py (renamed from cryptography/bindings/openssl/dh.py)0
-rw-r--r--cryptography/hazmat/bindings/openssl/dsa.py (renamed from cryptography/bindings/openssl/dsa.py)0
-rw-r--r--cryptography/hazmat/bindings/openssl/engine.py (renamed from cryptography/bindings/openssl/engine.py)0
-rw-r--r--cryptography/hazmat/bindings/openssl/err.py (renamed from cryptography/bindings/openssl/err.py)0
-rw-r--r--cryptography/hazmat/bindings/openssl/evp.py (renamed from cryptography/bindings/openssl/evp.py)0
-rw-r--r--cryptography/hazmat/bindings/openssl/hmac.py (renamed from cryptography/bindings/openssl/hmac.py)0
-rw-r--r--cryptography/hazmat/bindings/openssl/nid.py (renamed from cryptography/bindings/openssl/nid.py)0
-rw-r--r--cryptography/hazmat/bindings/openssl/opensslv.py (renamed from cryptography/bindings/openssl/opensslv.py)0
-rw-r--r--cryptography/hazmat/bindings/openssl/pem.py (renamed from cryptography/bindings/openssl/pem.py)0
-rw-r--r--cryptography/hazmat/bindings/openssl/pkcs12.py (renamed from cryptography/bindings/openssl/pkcs12.py)0
-rw-r--r--cryptography/hazmat/bindings/openssl/pkcs7.py (renamed from cryptography/bindings/openssl/pkcs7.py)0
-rw-r--r--cryptography/hazmat/bindings/openssl/rand.py (renamed from cryptography/bindings/openssl/rand.py)0
-rw-r--r--cryptography/hazmat/bindings/openssl/rsa.py (renamed from cryptography/bindings/openssl/rsa.py)0
-rw-r--r--cryptography/hazmat/bindings/openssl/ssl.py (renamed from cryptography/bindings/openssl/ssl.py)0
-rw-r--r--cryptography/hazmat/bindings/openssl/x509.py (renamed from cryptography/bindings/openssl/x509.py)0
-rw-r--r--cryptography/hazmat/bindings/openssl/x509name.py (renamed from cryptography/bindings/openssl/x509name.py)0
-rw-r--r--cryptography/hazmat/bindings/openssl/x509v3.py (renamed from cryptography/bindings/openssl/x509v3.py)0
-rw-r--r--cryptography/hazmat/primitives/block/base.py4
-rw-r--r--cryptography/hazmat/primitives/hashes.py2
-rw-r--r--docs/architecture.rst10
-rw-r--r--docs/hazmat/bindings/index.rst (renamed from docs/bindings/index.rst)0
-rw-r--r--docs/hazmat/bindings/openssl.rst (renamed from docs/bindings/openssl.rst)2
-rw-r--r--docs/index.rst2
-rw-r--r--tests/conftest.py2
-rw-r--r--tests/hazmat/bindings/__init__.py (renamed from tests/bindings/__init__.py)0
-rw-r--r--tests/hazmat/bindings/test_openssl.py (renamed from tests/bindings/test_openssl.py)2
-rw-r--r--tests/hazmat/primitives/test_hashes.py3
-rw-r--r--tests/hazmat/primitives/utils.py2
36 files changed, 21 insertions, 18 deletions
diff --git a/cryptography/bindings/__init__.py b/cryptography/hazmat/bindings/__init__.py
index 5006d134..eb828999 100644
--- a/cryptography/bindings/__init__.py
+++ b/cryptography/hazmat/bindings/__init__.py
@@ -11,7 +11,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.
-from cryptography.bindings import openssl
+from cryptography.hazmat.bindings import openssl
_default_backend = openssl.backend
diff --git a/cryptography/bindings/openssl/__init__.py b/cryptography/hazmat/bindings/openssl/__init__.py
index cfe2e665..44267efd 100644
--- a/cryptography/bindings/openssl/__init__.py
+++ b/cryptography/hazmat/bindings/openssl/__init__.py
@@ -11,7 +11,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.
-from cryptography.bindings.openssl.backend import backend
+from cryptography.hazmat.bindings.openssl.backend import backend
__all__ = ["backend"]
diff --git a/cryptography/bindings/openssl/asn1.py b/cryptography/hazmat/bindings/openssl/asn1.py
index 5bd72e9a..5bd72e9a 100644
--- a/cryptography/bindings/openssl/asn1.py
+++ b/cryptography/hazmat/bindings/openssl/asn1.py
diff --git a/cryptography/bindings/openssl/backend.py b/cryptography/hazmat/bindings/openssl/backend.py
index 3477d3ee..4b6ea1f5 100644
--- a/cryptography/bindings/openssl/backend.py
+++ b/cryptography/hazmat/bindings/openssl/backend.py
@@ -60,8 +60,10 @@ class Backend(object):
functions = []
macros = []
for name in self._modules:
- __import__("cryptography.bindings.openssl." + name)
- module = sys.modules["cryptography.bindings.openssl." + name]
+ __import__("cryptography.hazmat.bindings.openssl." + name)
+ module = (
+ sys.modules["cryptography.hazmat.bindings.openssl." + name]
+ )
self.ffi.cdef(module.TYPES)
macros.append(module.MACROS)
diff --git a/cryptography/bindings/openssl/bignum.py b/cryptography/hazmat/bindings/openssl/bignum.py
index 72d467c3..72d467c3 100644
--- a/cryptography/bindings/openssl/bignum.py
+++ b/cryptography/hazmat/bindings/openssl/bignum.py
diff --git a/cryptography/bindings/openssl/bio.py b/cryptography/hazmat/bindings/openssl/bio.py
index 88be788f..88be788f 100644
--- a/cryptography/bindings/openssl/bio.py
+++ b/cryptography/hazmat/bindings/openssl/bio.py
diff --git a/cryptography/bindings/openssl/conf.py b/cryptography/hazmat/bindings/openssl/conf.py
index 85c7a210..85c7a210 100644
--- a/cryptography/bindings/openssl/conf.py
+++ b/cryptography/hazmat/bindings/openssl/conf.py
diff --git a/cryptography/bindings/openssl/crypto.py b/cryptography/hazmat/bindings/openssl/crypto.py
index 501fb5a1..501fb5a1 100644
--- a/cryptography/bindings/openssl/crypto.py
+++ b/cryptography/hazmat/bindings/openssl/crypto.py
diff --git a/cryptography/bindings/openssl/dh.py b/cryptography/hazmat/bindings/openssl/dh.py
index ac130054..ac130054 100644
--- a/cryptography/bindings/openssl/dh.py
+++ b/cryptography/hazmat/bindings/openssl/dh.py
diff --git a/cryptography/bindings/openssl/dsa.py b/cryptography/hazmat/bindings/openssl/dsa.py
index 2fa67b87..2fa67b87 100644
--- a/cryptography/bindings/openssl/dsa.py
+++ b/cryptography/hazmat/bindings/openssl/dsa.py
diff --git a/cryptography/bindings/openssl/engine.py b/cryptography/hazmat/bindings/openssl/engine.py
index b3ec3125..b3ec3125 100644
--- a/cryptography/bindings/openssl/engine.py
+++ b/cryptography/hazmat/bindings/openssl/engine.py
diff --git a/cryptography/bindings/openssl/err.py b/cryptography/hazmat/bindings/openssl/err.py
index 39ae315c..39ae315c 100644
--- a/cryptography/bindings/openssl/err.py
+++ b/cryptography/hazmat/bindings/openssl/err.py
diff --git a/cryptography/bindings/openssl/evp.py b/cryptography/hazmat/bindings/openssl/evp.py
index a5a97a50..a5a97a50 100644
--- a/cryptography/bindings/openssl/evp.py
+++ b/cryptography/hazmat/bindings/openssl/evp.py
diff --git a/cryptography/bindings/openssl/hmac.py b/cryptography/hazmat/bindings/openssl/hmac.py
index e97ac35e..e97ac35e 100644
--- a/cryptography/bindings/openssl/hmac.py
+++ b/cryptography/hazmat/bindings/openssl/hmac.py
diff --git a/cryptography/bindings/openssl/nid.py b/cryptography/hazmat/bindings/openssl/nid.py
index 0f5b0003..0f5b0003 100644
--- a/cryptography/bindings/openssl/nid.py
+++ b/cryptography/hazmat/bindings/openssl/nid.py
diff --git a/cryptography/bindings/openssl/opensslv.py b/cryptography/hazmat/bindings/openssl/opensslv.py
index d1a1b3e6..d1a1b3e6 100644
--- a/cryptography/bindings/openssl/opensslv.py
+++ b/cryptography/hazmat/bindings/openssl/opensslv.py
diff --git a/cryptography/bindings/openssl/pem.py b/cryptography/hazmat/bindings/openssl/pem.py
index 8c8f736d..8c8f736d 100644
--- a/cryptography/bindings/openssl/pem.py
+++ b/cryptography/hazmat/bindings/openssl/pem.py
diff --git a/cryptography/bindings/openssl/pkcs12.py b/cryptography/hazmat/bindings/openssl/pkcs12.py
index 5c002b93..5c002b93 100644
--- a/cryptography/bindings/openssl/pkcs12.py
+++ b/cryptography/hazmat/bindings/openssl/pkcs12.py
diff --git a/cryptography/bindings/openssl/pkcs7.py b/cryptography/hazmat/bindings/openssl/pkcs7.py
index 752bfa00..752bfa00 100644
--- a/cryptography/bindings/openssl/pkcs7.py
+++ b/cryptography/hazmat/bindings/openssl/pkcs7.py
diff --git a/cryptography/bindings/openssl/rand.py b/cryptography/hazmat/bindings/openssl/rand.py
index e4f6be23..e4f6be23 100644
--- a/cryptography/bindings/openssl/rand.py
+++ b/cryptography/hazmat/bindings/openssl/rand.py
diff --git a/cryptography/bindings/openssl/rsa.py b/cryptography/hazmat/bindings/openssl/rsa.py
index c8bf1cc0..c8bf1cc0 100644
--- a/cryptography/bindings/openssl/rsa.py
+++ b/cryptography/hazmat/bindings/openssl/rsa.py
diff --git a/cryptography/bindings/openssl/ssl.py b/cryptography/hazmat/bindings/openssl/ssl.py
index 8aca86e4..8aca86e4 100644
--- a/cryptography/bindings/openssl/ssl.py
+++ b/cryptography/hazmat/bindings/openssl/ssl.py
diff --git a/cryptography/bindings/openssl/x509.py b/cryptography/hazmat/bindings/openssl/x509.py
index 9a51a6d0..9a51a6d0 100644
--- a/cryptography/bindings/openssl/x509.py
+++ b/cryptography/hazmat/bindings/openssl/x509.py
diff --git a/cryptography/bindings/openssl/x509name.py b/cryptography/hazmat/bindings/openssl/x509name.py
index bd7abe2d..bd7abe2d 100644
--- a/cryptography/bindings/openssl/x509name.py
+++ b/cryptography/hazmat/bindings/openssl/x509name.py
diff --git a/cryptography/bindings/openssl/x509v3.py b/cryptography/hazmat/bindings/openssl/x509v3.py
index 413bde5f..413bde5f 100644
--- a/cryptography/bindings/openssl/x509v3.py
+++ b/cryptography/hazmat/bindings/openssl/x509v3.py
diff --git a/cryptography/hazmat/primitives/block/base.py b/cryptography/hazmat/primitives/block/base.py
index b4cc32a4..ece3b32d 100644
--- a/cryptography/hazmat/primitives/block/base.py
+++ b/cryptography/hazmat/primitives/block/base.py
@@ -21,7 +21,9 @@ class BlockCipher(object):
super(BlockCipher, self).__init__()
if backend is None:
- from cryptography.bindings import _default_backend as backend
+ from cryptography.hazmat.bindings import (
+ _default_backend as backend,
+ )
self.cipher = cipher
self.mode = mode
diff --git a/cryptography/hazmat/primitives/hashes.py b/cryptography/hazmat/primitives/hashes.py
index 023041cb..3ccb59d1 100644
--- a/cryptography/hazmat/primitives/hashes.py
+++ b/cryptography/hazmat/primitives/hashes.py
@@ -23,7 +23,7 @@ import six
class BaseHash(six.with_metaclass(abc.ABCMeta)):
def __init__(self, data=None, backend=None, ctx=None):
if backend is None:
- from cryptography.bindings import _default_backend
+ from cryptography.hazmat.bindings import _default_backend
backend = _default_backend
self._backend = backend
if ctx is None:
diff --git a/docs/architecture.rst b/docs/architecture.rst
index 8de8649d..4cf639c2 100644
--- a/docs/architecture.rst
+++ b/docs/architecture.rst
@@ -8,11 +8,11 @@ Architecture
``cryptography`` has three different layers:
-* ``cryptography.bindings``: This package contains bindings to low level
- cryptographic libraries. Our initial target will be OpenSSL.
-* ``cryptography.hazmat.primitives``: This packages contains low level
- algorithms, things like ``AES`` or ``SHA1``. This is implemented on top of
- ``cryptography.bindings``.
* ``cryptography``: This package contains higher level recipes, for example
"encrypt and then MAC". This is implemented on top of
``cryptography.hazmat.primitives``.
+* ``cryptography.hazmat.primitives``: This packages contains low level
+ algorithms, things like ``AES`` or ``SHA1``. This is implemented on top of
+ ``cryptography.hazmat.bindings``.
+* ``cryptography.hazmat.bindings``: This package contains bindings to low level
+ cryptographic libraries. Our initial target will be OpenSSL.
diff --git a/docs/bindings/index.rst b/docs/hazmat/bindings/index.rst
index 80f53594..80f53594 100644
--- a/docs/bindings/index.rst
+++ b/docs/hazmat/bindings/index.rst
diff --git a/docs/bindings/openssl.rst b/docs/hazmat/bindings/openssl.rst
index e59b0c13..5a00395e 100644
--- a/docs/bindings/openssl.rst
+++ b/docs/hazmat/bindings/openssl.rst
@@ -10,7 +10,7 @@ OpenSSL
These are `CFFI`_ bindings to the `OpenSSL`_ C library.
-.. data:: cryptography.bindings.openssl.backend
+.. data:: cryptography.hazmat.bindings.openssl.backend
This is the exposed API for the OpenSSL bindings. It has two public
attributes:
diff --git a/docs/index.rst b/docs/index.rst
index 47418abb..b2420a8f 100644
--- a/docs/index.rst
+++ b/docs/index.rst
@@ -31,7 +31,6 @@ Contents
:maxdepth: 2
architecture
- bindings/index
contributing
security
community
@@ -43,3 +42,4 @@ Hazard Materials
:maxdepth: 2
hazmat/primitives/index
+ hazmat/bindings/index
diff --git a/tests/conftest.py b/tests/conftest.py
index d2ba03de..fab40b14 100644
--- a/tests/conftest.py
+++ b/tests/conftest.py
@@ -1,5 +1,5 @@
def pytest_generate_tests(metafunc):
- from cryptography.bindings import _ALL_BACKENDS
+ from cryptography.hazmat.bindings import _ALL_BACKENDS
if "backend" in metafunc.fixturenames:
metafunc.parametrize("backend", _ALL_BACKENDS)
diff --git a/tests/bindings/__init__.py b/tests/hazmat/bindings/__init__.py
index e69de29b..e69de29b 100644
--- a/tests/bindings/__init__.py
+++ b/tests/hazmat/bindings/__init__.py
diff --git a/tests/bindings/test_openssl.py b/tests/hazmat/bindings/test_openssl.py
index 69ab38d0..9ce882e4 100644
--- a/tests/bindings/test_openssl.py
+++ b/tests/hazmat/bindings/test_openssl.py
@@ -13,7 +13,7 @@
import pytest
-from cryptography.bindings.openssl.backend import backend
+from cryptography.hazmat.bindings.openssl.backend import backend
from cryptography.hazmat.primitives.block.ciphers import AES
from cryptography.hazmat.primitives.block.modes import CBC
diff --git a/tests/hazmat/primitives/test_hashes.py b/tests/hazmat/primitives/test_hashes.py
index 110ca4b7..797fe4ff 100644
--- a/tests/hazmat/primitives/test_hashes.py
+++ b/tests/hazmat/primitives/test_hashes.py
@@ -19,8 +19,7 @@ import pytest
import six
-from cryptography.bindings import _default_backend
-
+from cryptography.hazmat.bindings import _default_backend
from cryptography.hazmat.primitives import hashes
from .utils import generate_base_hash_test
diff --git a/tests/hazmat/primitives/utils.py b/tests/hazmat/primitives/utils.py
index 79d0aba4..fabdca01 100644
--- a/tests/hazmat/primitives/utils.py
+++ b/tests/hazmat/primitives/utils.py
@@ -3,7 +3,7 @@ import os
import pytest
-from cryptography.bindings import _ALL_BACKENDS
+from cryptography.hazmat.bindings import _ALL_BACKENDS
from cryptography.hazmat.primitives.block import BlockCipher