diff options
author | Alex Gaynor <alex.gaynor@gmail.com> | 2014-03-03 09:37:23 -0800 |
---|---|---|
committer | Alex Gaynor <alex.gaynor@gmail.com> | 2014-03-03 09:37:23 -0800 |
commit | 6963d50ff7c867d49bbd62243c3aa0a861a8e7b6 (patch) | |
tree | d3ddc648964eee762375ef2d69170817c4fad56b | |
parent | 930eed8bcbea6f6250998f0ee042babd62667a9f (diff) | |
parent | 862a82760def4c6311d9a9ace9ac34217522207c (diff) | |
download | cryptography-6963d50ff7c867d49bbd62243c3aa0a861a8e7b6.tar.gz cryptography-6963d50ff7c867d49bbd62243c3aa0a861a8e7b6.tar.bz2 cryptography-6963d50ff7c867d49bbd62243c3aa0a861a8e7b6.zip |
Merge pull request #721 from reaperhulk/pss-funcs
Add MGF1 MD selection function (available in OpenSSL 1.0.1+)
-rw-r--r-- | cryptography/hazmat/bindings/openssl/rsa.py | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/cryptography/hazmat/bindings/openssl/rsa.py b/cryptography/hazmat/bindings/openssl/rsa.py index 359305c6..f895cd02 100644 --- a/cryptography/hazmat/bindings/openssl/rsa.py +++ b/cryptography/hazmat/bindings/openssl/rsa.py @@ -37,6 +37,7 @@ static const int RSA_PKCS1_PSS_PADDING; static const int RSA_F4; static const int Cryptography_HAS_PSS_PADDING; +static const int Cryptography_HAS_MGF1_MD; """ FUNCTIONS = """ @@ -70,6 +71,7 @@ int RSA_padding_check_PKCS1_OAEP(unsigned char *, int, const unsigned char *, MACROS = """ int EVP_PKEY_CTX_set_rsa_padding(EVP_PKEY_CTX *, int); int EVP_PKEY_CTX_set_rsa_pss_saltlen(EVP_PKEY_CTX *, int); +int EVP_PKEY_CTX_set_rsa_mgf1_md(EVP_PKEY_CTX *, EVP_MD *); """ CUSTOMIZATIONS = """ @@ -82,6 +84,12 @@ int (*EVP_PKEY_CTX_set_rsa_padding)(EVP_PKEY_CTX *, int) = NULL; int (*EVP_PKEY_CTX_set_rsa_pss_saltlen)(EVP_PKEY_CTX *, int) = NULL; static const long RSA_PKCS1_PSS_PADDING = 0; #endif +#if OPENSSL_VERSION_NUMBER >= 0x1000100f +static const long Cryptography_HAS_MGF1_MD = 1; +#else +static const long Cryptography_HAS_MGF1_MD = 0; +int (*EVP_PKEY_CTX_set_rsa_mgf1_md)(EVP_PKEY_CTX *, EVP_MD *) = NULL; +#endif """ CONDITIONAL_NAMES = { @@ -92,4 +100,7 @@ CONDITIONAL_NAMES = { "Cryptography_HAS_PSS_PADDING": [ "RSA_PKCS1_PSS_PADDING", ], + "Cryptography_HAS_MGF1_MD": [ + "EVP_PKEY_CTX_set_rsa_mgf1_md", + ], } |