diff options
author | Tim Kelsey <tim.kelsey@hp.com> | 2014-12-15 16:48:49 +0000 |
---|---|---|
committer | Tim Kelsey <tim.kelsey@hp.com> | 2014-12-15 16:48:49 +0000 |
commit | 095f9649217adb2f4497c737eacc76acd005cca9 (patch) | |
tree | 05993d12488e4c2fc274edc17c3104f244171976 | |
parent | 9e507d2ab62cec4c9b63b08a6f5ae8656106a162 (diff) | |
download | cryptography-095f9649217adb2f4497c737eacc76acd005cca9.tar.gz cryptography-095f9649217adb2f4497c737eacc76acd005cca9.tar.bz2 cryptography-095f9649217adb2f4497c737eacc76acd005cca9.zip |
Adding more cffi bindings to openssl backend.
- specifically adding items relating to X509 certificates.
-rw-r--r-- | src/cryptography/hazmat/bindings/openssl/asn1.py | 12 | ||||
-rw-r--r-- | src/cryptography/hazmat/bindings/openssl/evp.py | 11 | ||||
-rw-r--r-- | src/cryptography/hazmat/bindings/openssl/nid.py | 11 | ||||
-rw-r--r-- | src/cryptography/hazmat/bindings/openssl/x509.py | 4 | ||||
-rw-r--r-- | src/cryptography/hazmat/bindings/openssl/x509name.py | 4 |
5 files changed, 41 insertions, 1 deletions
diff --git a/src/cryptography/hazmat/bindings/openssl/asn1.py b/src/cryptography/hazmat/bindings/openssl/asn1.py index a73dc325..fbc0822a 100644 --- a/src/cryptography/hazmat/bindings/openssl/asn1.py +++ b/src/cryptography/hazmat/bindings/openssl/asn1.py @@ -99,7 +99,19 @@ ASN1_GENERALIZEDTIME *ASN1_TIME_to_generalizedtime(ASN1_TIME *, ASN1_GENERALIZEDTIME **); /* ASN1 UTCTIME */ +ASN1_UTCTIME *ASN1_UTCTIME_new(void); +void ASN1_UTCTIME_free(ASN1_UTCTIME *); int ASN1_UTCTIME_cmp_time_t(const ASN1_UTCTIME *, time_t); +ASN1_UTCTIME *ASN1_UTCTIME_set(ASN1_UTCTIME *, time_t); +int ASN1_UTCTIME_check(ASN1_UTCTIME *); + +/* DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER */ +/* int ASN1_UTCTIME_set_string(ASN1_UTCTIME *, const char *); */ + +int ASN1_UTCTIME_print(BIO * , ASN1_UTCTIME *); + +/* no such symbol on OSX (10.9.5 maybe others) */ +/* ASN1_UTCTIME *ASN1_UTCTIME_dup(const ASN1_UTCTIME *); */ /* ASN1 GENERALIZEDTIME */ int ASN1_GENERALIZEDTIME_set_string(ASN1_GENERALIZEDTIME *, const char *); diff --git a/src/cryptography/hazmat/bindings/openssl/evp.py b/src/cryptography/hazmat/bindings/openssl/evp.py index 29590579..8c4a88e0 100644 --- a/src/cryptography/hazmat/bindings/openssl/evp.py +++ b/src/cryptography/hazmat/bindings/openssl/evp.py @@ -91,6 +91,17 @@ int EVP_VerifyFinal(EVP_MD_CTX *, const unsigned char *, unsigned int, EVP_PKEY *); const EVP_MD *EVP_md5(void); +const EVP_MD *EVP_sha1(void); +const EVP_MD *EVP_ripemd160(void); + +/*#if OPENSSL_VERSION_NUMBER >= 0x0090800fL*/ + +const EVP_MD *EVP_sha224(void); +const EVP_MD *EVP_sha256(void); +const EVP_MD *EVP_sha384(void); +const EVP_MD *EVP_sha512(void); + +/*#endif*/ int PKCS5_PBKDF2_HMAC_SHA1(const char *, int, const unsigned char *, int, int, int, unsigned char *); diff --git a/src/cryptography/hazmat/bindings/openssl/nid.py b/src/cryptography/hazmat/bindings/openssl/nid.py index 8d83c1e1..a025d3b4 100644 --- a/src/cryptography/hazmat/bindings/openssl/nid.py +++ b/src/cryptography/hazmat/bindings/openssl/nid.py @@ -201,6 +201,17 @@ static const int NID_any_policy; static const int NID_policy_mappings; static const int NID_target_information; static const int NID_no_rev_avail; + +static const int NID_commonName; +static const int NID_countryName; +static const int NID_localityName; +static const int NID_stateOrProvinceName; +static const int NID_organizationName; +static const int NID_organizationalUnitName; +static const int NID_serialNumber; +static const int NID_surname; +static const int NID_givenName; +static const int NID_pkcs9_emailAddress; """ FUNCTIONS = """ diff --git a/src/cryptography/hazmat/bindings/openssl/x509.py b/src/cryptography/hazmat/bindings/openssl/x509.py index a6e1cb63..dd5e08ad 100644 --- a/src/cryptography/hazmat/bindings/openssl/x509.py +++ b/src/cryptography/hazmat/bindings/openssl/x509.py @@ -113,6 +113,8 @@ X509 *X509_dup(X509 *); int X509_print_ex(BIO *, X509 *, unsigned long, unsigned long); int X509_set_version(X509 *, long); +int X509_set_notBefore(X509 *, ASN1_UTCTIME *); +int X509_set_notAfter(X509 *, ASN1_UTCTIME *); EVP_PKEY *X509_get_pubkey(X509 *); int X509_set_pubkey(X509 *, EVP_PKEY *); @@ -140,6 +142,8 @@ int X509_EXTENSION_get_critical(X509_EXTENSION *); ASN1_OBJECT *X509_EXTENSION_get_object(X509_EXTENSION *); void X509_EXTENSION_free(X509_EXTENSION *); +int i2d_X509(X509 *, unsigned char **); + int X509_REQ_set_version(X509_REQ *, long); X509_REQ *X509_REQ_new(void); void X509_REQ_free(X509_REQ *); diff --git a/src/cryptography/hazmat/bindings/openssl/x509name.py b/src/cryptography/hazmat/bindings/openssl/x509name.py index 9863c195..bda92eb7 100644 --- a/src/cryptography/hazmat/bindings/openssl/x509name.py +++ b/src/cryptography/hazmat/bindings/openssl/x509name.py @@ -20,6 +20,9 @@ typedef ... Cryptography_STACK_OF_X509_NAME; """ FUNCTIONS = """ +X509_NAME *X509_NAME_new(void); +void X509_NAME_free(X509_NAME *); + int X509_NAME_entry_count(X509_NAME *); X509_NAME_ENTRY *X509_NAME_get_entry(X509_NAME *, int); ASN1_OBJECT *X509_NAME_ENTRY_get_object(X509_NAME_ENTRY *); @@ -37,7 +40,6 @@ int X509_NAME_get_index_by_NID(X509_NAME *, int, int); int X509_NAME_cmp(const X509_NAME *, const X509_NAME *); char *X509_NAME_oneline(X509_NAME *, char *, int); X509_NAME *X509_NAME_dup(X509_NAME *); -void X509_NAME_free(X509_NAME *); """ MACROS = """ |