com php-src: Use EVP_PKEY_base_id where possible: ext/openssl/openssl.c
| From: | Jakub Zelenka | Date: | Sun, 17 Jul 2016 16:33:42 +0000 |
| Subject: | com php-src: Use EVP_PKEY_base_id where possible: ext/openssl/openssl.c | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-93256@lists.php.net to get a copy of this message | ||
Commit: f08660bb58876714cb747eff09d0ef51894f5f66
Author: Jakub Zelenka <bukka@php.net> Thu, 3 Mar 2016 20:11:46 +0000
Parents: f1de72293e4c55683bc52d40fa69d4abe08ad272
Branches: master
Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=f08660bb58876714cb747eff09d0ef51894f5f66
Log:
Use EVP_PKEY_base_id where possible
Changed paths:
M ext/openssl/openssl.c
Diff:
diff --git a/ext/openssl/openssl.c b/ext/openssl/openssl.c
index dcaa2c8..d653164 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;