aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlex Gaynor <alex.gaynor@gmail.com>2013-10-20 20:53:06 -0700
committerAlex Gaynor <alex.gaynor@gmail.com>2013-10-20 20:53:06 -0700
commit71ed449ffe7e26e9217b6c44bb27e19996315a64 (patch)
tree97fc54775308b0d4f078ceb6b08221a3297114ef
parente58820924094b8846bf739c2eb66f049a9a75939 (diff)
parent02cd1fc7c4d5722c78ec1f586044ff21dea98975 (diff)
downloadcryptography-71ed449ffe7e26e9217b6c44bb27e19996315a64.tar.gz
cryptography-71ed449ffe7e26e9217b6c44bb27e19996315a64.tar.bz2
cryptography-71ed449ffe7e26e9217b6c44bb27e19996315a64.zip
Merge pull request #156 from reaperhulk/openssl-hmac-bindings
Add HMAC bindings
-rw-r--r--cryptography/bindings/openssl/api.py1
-rw-r--r--cryptography/bindings/openssl/hmac.py32
2 files changed, 33 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..e97ac35e
--- /dev/null
+++ b/cryptography/bindings/openssl/hmac.py
@@ -0,0 +1,32 @@
+# 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 = """
+typedef struct { ...; } 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 = """
+"""