aboutsummaryrefslogtreecommitdiff
path: root/ext/POW.c
diff options
context:
space:
mode:
authorRob Austein <sra@hactrn.net>2014-05-10 04:04:46 +0000
committerRob Austein <sra@hactrn.net>2014-05-10 04:04:46 +0000
commitcb34da98906421cde8c391da337055efef1d3e0d (patch)
tree2f9d32232aa8345ba87108e4ae766a27cbe292e5 /ext/POW.c
parentf9572f97d8d0fa7eaa602a82135fc253cc8c4a64 (diff)
Proper idiom.
svn path=/trunk/; revision=5828
Diffstat (limited to 'ext/POW.c')
-rw-r--r--ext/POW.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/ext/POW.c b/ext/POW.c
index 3a87de57..0f2383ae 100644
--- a/ext/POW.c
+++ b/ext/POW.c
@@ -1085,12 +1085,14 @@ ASN1_OBJECT_to_PyString(const ASN1_OBJECT *oid)
static void
whack_ec_key_to_namedCurve(EVP_PKEY *pkey)
{
+ EC_KEY *ec_key;
+
ENTERING(whack_ec_key_to_namedCurve);
- if (pkey != NULL && pkey->type == EVP_PKEY_EC && pkey->pkey.ptr != NULL) {
- EC_KEY *ec_key = EVP_PKEY_get0(pkey);
+ if (pkey != NULL &&
+ EVP_PKEY_id(pkey) == EVP_PKEY_EC &&
+ (ec_key = EVP_PKEY_get0(pkey)) != NULL)
EC_KEY_set_asn1_flag(ec_key, OPENSSL_EC_NAMED_CURVE);
- }
}