aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPaul Kehrer <paul.l.kehrer@gmail.com>2014-02-13 17:01:26 -0600
committerPaul Kehrer <paul.l.kehrer@gmail.com>2014-02-13 17:01:26 -0600
commit2253ab4a7c51820d510d1384c0ccb6b936931d56 (patch)
tree2ef341d2393791918c302b8f176db4816443854d
parent43e4d7a1b97d66c6da1f4ce34faaa4ba45937739 (diff)
downloadcryptography-2253ab4a7c51820d510d1384c0ccb6b936931d56.tar.gz
cryptography-2253ab4a7c51820d510d1384c0ccb6b936931d56.tar.bz2
cryptography-2253ab4a7c51820d510d1384c0ccb6b936931d56.zip
add some PKEY_CTX bindings we'll need for signing
-rw-r--r--cryptography/hazmat/bindings/openssl/evp.py8
-rw-r--r--cryptography/hazmat/bindings/openssl/rsa.py2
2 files changed, 10 insertions, 0 deletions
diff --git a/cryptography/hazmat/bindings/openssl/evp.py b/cryptography/hazmat/bindings/openssl/evp.py
index c7cc154f..06c0381e 100644
--- a/cryptography/hazmat/bindings/openssl/evp.py
+++ b/cryptography/hazmat/bindings/openssl/evp.py
@@ -32,6 +32,7 @@ typedef struct evp_pkey_st {
int type;
...;
} EVP_PKEY;
+typedef ... EVP_PKEY_CTX;
static const int EVP_PKEY_RSA;
static const int EVP_PKEY_DSA;
static const int EVP_MAX_MD_SIZE;
@@ -86,6 +87,11 @@ int EVP_PKEY_type(int);
int EVP_PKEY_bits(EVP_PKEY *);
RSA *EVP_PKEY_get1_RSA(EVP_PKEY *);
+EVP_PKEY_CTX *EVP_PKEY_CTX_new(EVP_PKEY *, ENGINE *);
+EVP_PKEY_CTX *EVP_PKEY_CTX_new_id(int, ENGINE *);
+EVP_PKEY_CTX *EVP_PKEY_CTX_dup(EVP_PKEY_CTX *);
+void EVP_PKEY_CTX_free(EVP_PKEY_CTX *);
+
int EVP_SignInit(EVP_MD_CTX *, const EVP_MD *);
int EVP_SignUpdate(EVP_MD_CTX *, const void *, size_t);
int EVP_SignFinal(EVP_MD_CTX *, unsigned char *, unsigned int *, EVP_PKEY *);
@@ -110,6 +116,8 @@ int EVP_CIPHER_CTX_ctrl(EVP_CIPHER_CTX *, int, int, void *);
int PKCS5_PBKDF2_HMAC(const char *, int, const unsigned char *, int, int,
const EVP_MD *, int, unsigned char *);
+
+int EVP_PKEY_CTX_set_signature_md(EVP_PKEY_CTX *, EVP_MD_CTX *);
"""
CUSTOMIZATIONS = """
diff --git a/cryptography/hazmat/bindings/openssl/rsa.py b/cryptography/hazmat/bindings/openssl/rsa.py
index a44ca4a6..77beba92 100644
--- a/cryptography/hazmat/bindings/openssl/rsa.py
+++ b/cryptography/hazmat/bindings/openssl/rsa.py
@@ -55,6 +55,8 @@ int RSA_print(BIO *, const RSA *, int);
"""
MACROS = """
+int EVP_PKEY_CTX_set_rsa_padding(EVP_PKEY_CTX *, int);
+int EVP_PKEY_CTX_set_rsa_pss_saltlen(EVP_PKEY_CTX *, int);
"""
CUSTOMIZATIONS = """