From 9b4c3132ac38beca887786b5528b05a2186a5bfe Mon Sep 17 00:00:00 2001 From: Alex Gaynor Date: Tue, 26 May 2015 19:54:56 -0400 Subject: Fixed #1969 -- added bindings for some more OpenSSL functions --- src/cryptography/hazmat/bindings/openssl/x509.py | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'src') diff --git a/src/cryptography/hazmat/bindings/openssl/x509.py b/src/cryptography/hazmat/bindings/openssl/x509.py index caa33969..262163e4 100644 --- a/src/cryptography/hazmat/bindings/openssl/x509.py +++ b/src/cryptography/hazmat/bindings/openssl/x509.py @@ -310,9 +310,14 @@ int i2d_EC_PUBKEY(EC_KEY *, unsigned char **); EC_KEY *d2i_EC_PUBKEY(EC_KEY **, const unsigned char **, long); EC_KEY *d2i_EC_PUBKEY_bio(BIO *, EC_KEY **); int i2d_EC_PUBKEY_bio(BIO *, EC_KEY *); +EC_KEY *d2i_ECPrivateKey(EC_KEY **, const unsigned char **, long); EC_KEY *d2i_ECPrivateKey_bio(BIO *, EC_KEY **); +int i2d_ECPrivateKey(EC_KEY *, unsigned char **); int i2d_ECPrivateKey_bio(BIO *, EC_KEY *); +EC_KEY *d2o_ECPrivateKey(EC_KEY **, const unsigned char **, long); +int i2o_ECPrivateKey(EC_KEY *, unsigned char **); + // declared in safestack int sk_ASN1_OBJECT_num(Cryptography_STACK_OF_ASN1_OBJECT *); ASN1_OBJECT *sk_ASN1_OBJECT_value(Cryptography_STACK_OF_ASN1_OBJECT *, int); @@ -340,7 +345,11 @@ CONDITIONAL_NAMES = { "d2i_EC_PUBKEY", "d2i_EC_PUBKEY_bio", "i2d_EC_PUBKEY_bio", + "d2i_ECPrivateKey", "d2i_ECPrivateKey_bio", + "i2d_ECPrivateKey", "i2d_ECPrivateKey_bio", + "i2o_ECPublicKey" + "o2i_ECPublicKey", ] } -- cgit v1.2.3 From b1d59e76d3f6ebb5fdb08537593024e864331725 Mon Sep 17 00:00:00 2001 From: Alex Gaynor Date: Tue, 26 May 2015 20:02:50 -0400 Subject: bleh, fixed typos --- src/cryptography/hazmat/bindings/openssl/x509.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/cryptography/hazmat/bindings/openssl/x509.py b/src/cryptography/hazmat/bindings/openssl/x509.py index 262163e4..55b57206 100644 --- a/src/cryptography/hazmat/bindings/openssl/x509.py +++ b/src/cryptography/hazmat/bindings/openssl/x509.py @@ -315,7 +315,7 @@ EC_KEY *d2i_ECPrivateKey_bio(BIO *, EC_KEY **); int i2d_ECPrivateKey(EC_KEY *, unsigned char **); int i2d_ECPrivateKey_bio(BIO *, EC_KEY *); -EC_KEY *d2o_ECPrivateKey(EC_KEY **, const unsigned char **, long); +EC_KEY *o2i_ECPrivateKey(EC_KEY **, const unsigned char **, long); int i2o_ECPrivateKey(EC_KEY *, unsigned char **); // declared in safestack @@ -349,7 +349,7 @@ CONDITIONAL_NAMES = { "d2i_ECPrivateKey_bio", "i2d_ECPrivateKey", "i2d_ECPrivateKey_bio", - "i2o_ECPublicKey" - "o2i_ECPublicKey", + "i2o_ECPrivateKey" + "o2i_ECPrivateKey", ] } -- cgit v1.2.3 From e44a56e5add6e11b0c129ce604e1d8ccffeacd66 Mon Sep 17 00:00:00 2001 From: Alex Gaynor Date: Tue, 26 May 2015 20:04:55 -0400 Subject: Added these to the macros area as well --- src/cryptography/hazmat/bindings/openssl/x509.py | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'src') diff --git a/src/cryptography/hazmat/bindings/openssl/x509.py b/src/cryptography/hazmat/bindings/openssl/x509.py index 55b57206..d9aea629 100644 --- a/src/cryptography/hazmat/bindings/openssl/x509.py +++ b/src/cryptography/hazmat/bindings/openssl/x509.py @@ -334,8 +334,13 @@ int (*i2d_EC_PUBKEY)(EC_KEY *, unsigned char **) = NULL; EC_KEY *(*d2i_EC_PUBKEY)(EC_KEY **, const unsigned char **, long) = NULL; EC_KEY *(*d2i_EC_PUBKEY_bio)(BIO *, EC_KEY **) = NULL; int (*i2d_EC_PUBKEY_bio)(BIO *, EC_KEY *) = NULL; +EC_KEY *(*d2i_ECPrivateKey)(EC_KEY **, const unsigned char **, long) = NULL; EC_KEY *(*d2i_ECPrivateKey_bio)(BIO *, EC_KEY **) = NULL; +int (*i2d_ECPrivateKey)(EC_KEY *, unsigned char **) = NULL; int (*i2d_ECPrivateKey_bio)(BIO *, EC_KEY *) = NULL; + +EC_KEY *(*o2i_ECPrivateKey)(EC_KEY **, const unsigned char **, long) = NULL; +int (*i2o_ECPrivateKey)(EC_KEY *, unsigned char **) = NULL; #endif """ -- cgit v1.2.3 From 8ac357f7ee5af833099f0c1349422155778711a7 Mon Sep 17 00:00:00 2001 From: Alex Gaynor Date: Tue, 26 May 2015 20:08:00 -0400 Subject: Bleh, these were the wrong type --- src/cryptography/hazmat/bindings/openssl/x509.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'src') diff --git a/src/cryptography/hazmat/bindings/openssl/x509.py b/src/cryptography/hazmat/bindings/openssl/x509.py index d9aea629..0e161acb 100644 --- a/src/cryptography/hazmat/bindings/openssl/x509.py +++ b/src/cryptography/hazmat/bindings/openssl/x509.py @@ -315,8 +315,8 @@ EC_KEY *d2i_ECPrivateKey_bio(BIO *, EC_KEY **); int i2d_ECPrivateKey(EC_KEY *, unsigned char **); int i2d_ECPrivateKey_bio(BIO *, EC_KEY *); -EC_KEY *o2i_ECPrivateKey(EC_KEY **, const unsigned char **, long); -int i2o_ECPrivateKey(EC_KEY *, unsigned char **); +EC_KEY *o2i_ECPublicKey(EC_KEY **, const unsigned char **, long); +int i2o_ECPublicKey(EC_KEY *, unsigned char **); // declared in safestack int sk_ASN1_OBJECT_num(Cryptography_STACK_OF_ASN1_OBJECT *); @@ -339,8 +339,8 @@ EC_KEY *(*d2i_ECPrivateKey_bio)(BIO *, EC_KEY **) = NULL; int (*i2d_ECPrivateKey)(EC_KEY *, unsigned char **) = NULL; int (*i2d_ECPrivateKey_bio)(BIO *, EC_KEY *) = NULL; -EC_KEY *(*o2i_ECPrivateKey)(EC_KEY **, const unsigned char **, long) = NULL; -int (*i2o_ECPrivateKey)(EC_KEY *, unsigned char **) = NULL; +EC_KEY *(*o2i_ECPublicKey)(EC_KEY **, const unsigned char **, long) = NULL; +int (*i2o_ECPublicKey)(EC_KEY *, unsigned char **) = NULL; #endif """ @@ -354,7 +354,7 @@ CONDITIONAL_NAMES = { "d2i_ECPrivateKey_bio", "i2d_ECPrivateKey", "i2d_ECPrivateKey_bio", - "i2o_ECPrivateKey" - "o2i_ECPrivateKey", + "i2o_ECPublicKey" + "o2i_ECPublicKey", ] } -- cgit v1.2.3 From 50f9a3fb049f635b53d4a21a645a8ae666244230 Mon Sep 17 00:00:00 2001 From: Alex Gaynor Date: Tue, 26 May 2015 20:35:54 -0400 Subject: missing comma --- src/cryptography/hazmat/bindings/openssl/x509.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/cryptography/hazmat/bindings/openssl/x509.py b/src/cryptography/hazmat/bindings/openssl/x509.py index 0e161acb..6f12b725 100644 --- a/src/cryptography/hazmat/bindings/openssl/x509.py +++ b/src/cryptography/hazmat/bindings/openssl/x509.py @@ -354,7 +354,7 @@ CONDITIONAL_NAMES = { "d2i_ECPrivateKey_bio", "i2d_ECPrivateKey", "i2d_ECPrivateKey_bio", - "i2o_ECPublicKey" + "i2o_ECPublicKey", "o2i_ECPublicKey", ] } -- cgit v1.2.3