aboutsummaryrefslogtreecommitdiffstats
path: root/cryptography
diff options
context:
space:
mode:
authorAlex Gaynor <alex.gaynor@gmail.com>2013-10-28 10:09:15 -0700
committerAlex Gaynor <alex.gaynor@gmail.com>2013-10-28 10:09:15 -0700
commit9d683f71433ca4f2a09052159dc10d2f2dcb3222 (patch)
tree86928a635b22a4dc36bce266550323533e166ff8 /cryptography
parent01fbdf74967f8e22e3ea2d15f195898c64d34cc3 (diff)
parent0a1550e86fbb8a64a1f534babd76da5afd1c4c11 (diff)
downloadcryptography-9d683f71433ca4f2a09052159dc10d2f2dcb3222.tar.gz
cryptography-9d683f71433ca4f2a09052159dc10d2f2dcb3222.tar.bz2
cryptography-9d683f71433ca4f2a09052159dc10d2f2dcb3222.zip
Merge pull request #188 from dstufft/hazmat
Create a Hazardous Materials Area
Diffstat (limited to 'cryptography')
-rw-r--r--cryptography/__about__.py2
-rw-r--r--cryptography/hazmat/__init__.py12
-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)14
-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/__init__.py (renamed from cryptography/primitives/__init__.py)0
-rw-r--r--cryptography/hazmat/primitives/block/__init__.py (renamed from cryptography/primitives/block/__init__.py)2
-rw-r--r--cryptography/hazmat/primitives/block/base.py (renamed from cryptography/primitives/block/base.py)6
-rw-r--r--cryptography/hazmat/primitives/block/ciphers.py (renamed from cryptography/primitives/block/ciphers.py)0
-rw-r--r--cryptography/hazmat/primitives/block/modes.py (renamed from cryptography/primitives/block/modes.py)2
-rw-r--r--cryptography/hazmat/primitives/hashes.py (renamed from cryptography/primitives/hashes.py)2
-rw-r--r--cryptography/hazmat/primitives/interfaces.py (renamed from cryptography/primitives/interfaces.py)0
34 files changed, 31 insertions, 13 deletions
diff --git a/cryptography/__about__.py b/cryptography/__about__.py
index e5eca6c6..cd207fcc 100644
--- a/cryptography/__about__.py
+++ b/cryptography/__about__.py
@@ -19,7 +19,7 @@ __all__ = [
__title__ = "cryptography"
__summary__ = ("cryptography is a package designed to expose cryptographic "
- "primitives and recipes to Python developers.")
+ "recipes and primitives to Python developers.")
__uri__ = "https://github.com/pyca/cryptography"
__version__ = "0.1.dev1"
diff --git a/cryptography/hazmat/__init__.py b/cryptography/hazmat/__init__.py
new file mode 100644
index 00000000..55c925c6
--- /dev/null
+++ b/cryptography/hazmat/__init__.py
@@ -0,0 +1,12 @@
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+# implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
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 4ec16189..494430ba 100644
--- a/cryptography/bindings/openssl/backend.py
+++ b/cryptography/hazmat/bindings/openssl/backend.py
@@ -18,9 +18,11 @@ import sys
import cffi
-from cryptography.primitives import interfaces
-from cryptography.primitives.block.ciphers import AES, Camellia, TripleDES
-from cryptography.primitives.block.modes import CBC, CTR, ECB, OFB, CFB
+from cryptography.hazmat.primitives import interfaces
+from cryptography.hazmat.primitives.block.ciphers import (
+ AES, Camellia, TripleDES,
+)
+from cryptography.hazmat.primitives.block.modes import CBC, CTR, ECB, OFB, CFB
class Backend(object):
@@ -58,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]
+ module_name = "cryptography.hazmat.bindings.openssl." + name
+ __import__(module_name)
+ module = sys.modules[module_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/primitives/__init__.py b/cryptography/hazmat/primitives/__init__.py
index e69de29b..e69de29b 100644
--- a/cryptography/primitives/__init__.py
+++ b/cryptography/hazmat/primitives/__init__.py
diff --git a/cryptography/primitives/block/__init__.py b/cryptography/hazmat/primitives/block/__init__.py
index a0c6d03f..5b8942b6 100644
--- a/cryptography/primitives/block/__init__.py
+++ b/cryptography/hazmat/primitives/block/__init__.py
@@ -13,7 +13,7 @@
from __future__ import absolute_import, division, print_function
-from cryptography.primitives.block.base import BlockCipher
+from cryptography.hazmat.primitives.block.base import BlockCipher
__all__ = [
diff --git a/cryptography/primitives/block/base.py b/cryptography/hazmat/primitives/block/base.py
index 7924cf9c..ece3b32d 100644
--- a/cryptography/primitives/block/base.py
+++ b/cryptography/hazmat/primitives/block/base.py
@@ -13,7 +13,7 @@
from __future__ import absolute_import, division, print_function
-from cryptography.primitives import interfaces
+from cryptography.hazmat.primitives import interfaces
class BlockCipher(object):
@@ -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/primitives/block/ciphers.py b/cryptography/hazmat/primitives/block/ciphers.py
index 4143b89d..4143b89d 100644
--- a/cryptography/primitives/block/ciphers.py
+++ b/cryptography/hazmat/primitives/block/ciphers.py
diff --git a/cryptography/primitives/block/modes.py b/cryptography/hazmat/primitives/block/modes.py
index a933c187..a60e8a34 100644
--- a/cryptography/primitives/block/modes.py
+++ b/cryptography/hazmat/primitives/block/modes.py
@@ -13,7 +13,7 @@
from __future__ import absolute_import, division, print_function
-from cryptography.primitives import interfaces
+from cryptography.hazmat.primitives import interfaces
@interfaces.register(interfaces.ModeWithInitializationVector)
diff --git a/cryptography/primitives/hashes.py b/cryptography/hazmat/primitives/hashes.py
index 023041cb..3ccb59d1 100644
--- a/cryptography/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/cryptography/primitives/interfaces.py b/cryptography/hazmat/primitives/interfaces.py
index 49c19d0e..49c19d0e 100644
--- a/cryptography/primitives/interfaces.py
+++ b/cryptography/hazmat/primitives/interfaces.py