aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlex Gaynor <alex.gaynor@gmail.com>2014-01-22 09:00:51 -0800
committerAlex Gaynor <alex.gaynor@gmail.com>2014-01-22 09:00:51 -0800
commiteddef3af8efe6f9b94139b5ab64d5e7a16c1a547 (patch)
tree9645e336be30750b1c504822118ba05ac72b3583
parent272e7487271ed5fb07587e4f90ecfb1ec885a588 (diff)
parent0f82a6698af65f3786fb597636d09f25fbcc49de (diff)
downloadcryptography-eddef3af8efe6f9b94139b5ab64d5e7a16c1a547.tar.gz
cryptography-eddef3af8efe6f9b94139b5ab64d5e7a16c1a547.tar.bz2
cryptography-eddef3af8efe6f9b94139b5ab64d5e7a16c1a547.zip
Merge pull request #493 from reaperhulk/aes-keywrap-bindings
Support for AES keywrap (RFC 3394) in the bindings
-rw-r--r--cryptography/hazmat/bindings/openssl/aes.py40
-rw-r--r--cryptography/hazmat/bindings/openssl/binding.py1
2 files changed, 41 insertions, 0 deletions
diff --git a/cryptography/hazmat/bindings/openssl/aes.py b/cryptography/hazmat/bindings/openssl/aes.py
new file mode 100644
index 00000000..6cbcd577
--- /dev/null
+++ b/cryptography/hazmat/bindings/openssl/aes.py
@@ -0,0 +1,40 @@
+# 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.
+
+INCLUDES = """
+#include <openssl/aes.h>
+"""
+
+TYPES = """
+struct aes_key_st {
+ ...;
+};
+typedef struct aes_key_st AES_KEY;
+"""
+
+FUNCTIONS = """
+int AES_set_encrypt_key(const unsigned char *, const int, AES_KEY *);
+int AES_set_decrypt_key(const unsigned char *, const int, AES_KEY *);
+int AES_wrap_key(AES_KEY *, const unsigned char *, unsigned char *,
+ const unsigned char *, unsigned int);
+int AES_unwrap_key(AES_KEY *, const unsigned char *, unsigned char *,
+ const unsigned char *, unsigned int);
+"""
+
+MACROS = """
+"""
+
+CUSTOMIZATIONS = """
+"""
+
+CONDITIONAL_NAMES = {}
diff --git a/cryptography/hazmat/bindings/openssl/binding.py b/cryptography/hazmat/bindings/openssl/binding.py
index 88299d14..4dedd816 100644
--- a/cryptography/hazmat/bindings/openssl/binding.py
+++ b/cryptography/hazmat/bindings/openssl/binding.py
@@ -41,6 +41,7 @@ class Binding(object):
"""
_module_prefix = "cryptography.hazmat.bindings.openssl."
_modules = [
+ "aes",
"asn1",
"bignum",
"bio",