aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPaul Kehrer <paul.l.kehrer@gmail.com>2013-10-20 22:11:04 -0500
committerPaul Kehrer <paul.l.kehrer@gmail.com>2013-10-20 22:11:04 -0500
commitc5833bfcad56fe44e30455dc037c2874e425b241 (patch)
treecdb2d48ff738a3a46061b48c316cf6697d65b6aa
parente58820924094b8846bf739c2eb66f049a9a75939 (diff)
downloadcryptography-c5833bfcad56fe44e30455dc037c2874e425b241.tar.gz
cryptography-c5833bfcad56fe44e30455dc037c2874e425b241.tar.bz2
cryptography-c5833bfcad56fe44e30455dc037c2874e425b241.zip
Add HMAC bindings
-rw-r--r--cryptography/bindings/openssl/api.py1
-rw-r--r--cryptography/bindings/openssl/hmac.py33
2 files changed, 34 insertions, 0 deletions
diff --git a/cryptography/bindings/openssl/api.py b/cryptography/bindings/openssl/api.py
index f5e042e7..12082c09 100644
--- a/cryptography/bindings/openssl/api.py
+++ b/cryptography/bindings/openssl/api.py
@@ -35,6 +35,7 @@ class API(object):
"engine",
"err",
"evp",
+ "hmac",
"nid",
"opensslv",
"pem",
diff --git a/cryptography/bindings/openssl/hmac.py b/cryptography/bindings/openssl/hmac.py
new file mode 100644
index 00000000..7a9d05b5
--- /dev/null
+++ b/cryptography/bindings/openssl/hmac.py
@@ -0,0 +1,33 @@
+# 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/hmac.h>
+"""
+
+TYPES = """
+struct hmac_ctx_st { ...; };
+typedef struct hmac_ctx_st HMAC_CTX;
+"""
+
+FUNCTIONS = """
+void HMAC_CTX_init(HMAC_CTX *);
+void HMAC_CTX_cleanup(HMAC_CTX *);
+int HMAC_Init_ex(HMAC_CTX *, const void *, int, const EVP_MD *, ENGINE *);
+int HMAC_Update(HMAC_CTX *, const unsigned char *, size_t);
+int HMAC_Final(HMAC_CTX *, unsigned char *, unsigned int *);
+int HMAC_CTX_copy(HMAC_CTX *, HMAC_CTX *);
+"""
+
+MACROS = """
+"""