summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJakub Zelenka <bukka@php.net>2016-03-03 20:11:46 +0000
committerJakub Zelenka <bukka@php.net>2016-07-17 17:33:42 +0100
commitf08660bb58876714cb747eff09d0ef51894f5f66 (patch)
tree1ed9f82632a7001b647269e8349905ddac3140a2
parentf1de72293e4c55683bc52d40fa69d4abe08ad272 (diff)
downloadphp-git-f08660bb58876714cb747eff09d0ef51894f5f66.tar.gz
Use EVP_PKEY_base_id where possible
-rw-r--r--ext/openssl/openssl.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/ext/openssl/openssl.c b/ext/openssl/openssl.c
index dcaa2c8bce..d653164fcc 100644
--- a/ext/openssl/openssl.c
+++ b/ext/openssl/openssl.c
@@ -4181,7 +4181,7 @@ PHP_FUNCTION(openssl_pkey_export_to_file)
cipher = NULL;
}
- switch (EVP_PKEY_type(key->type)) {
+ switch (EVP_PKEY_base_id(key)) {
#ifdef HAVE_EVP_PKEY_EC
case EVP_PKEY_EC:
pem_write = PEM_write_bio_ECPrivateKey(bio_out, EVP_PKEY_get1_EC_KEY(key), cipher, (unsigned char *)passphrase, (int)passphrase_len, NULL, NULL);
@@ -4255,7 +4255,7 @@ PHP_FUNCTION(openssl_pkey_export)
cipher = NULL;
}
- switch (EVP_PKEY_type(key->type)) {
+ switch (EVP_PKEY_base_id(key)) {
#ifdef HAVE_EVP_PKEY_EC
case EVP_PKEY_EC:
pem_write = PEM_write_bio_ECPrivateKey(bio_out, EVP_PKEY_get1_EC_KEY(key), cipher, (unsigned char *)passphrase, (int)passphrase_len, NULL, NULL);
@@ -4384,7 +4384,7 @@ PHP_FUNCTION(openssl_pkey_get_details)
/*TODO: Use the real values once the openssl constants are used
* See the enum at the top of this file
*/
- switch (EVP_PKEY_type(pkey->type)) {
+ switch (EVP_PKEY_base_id(pkey)) {
case EVP_PKEY_RSA:
case EVP_PKEY_RSA2:
ktype = OPENSSL_KEYTYPE_RSA;