File tree Expand file tree Collapse file tree 1 file changed +18
-2
lines changed Expand file tree Collapse file tree 1 file changed +18
-2
lines changed Original file line number Diff line number Diff line change @@ -4950,7 +4950,21 @@ PHP_FUNCTION(openssl_pkey_get_details)
4950
4950
*/
4951
4951
#if PHP_OPENSSL_API_VERSION >= 0x30000
4952
4952
zval ary ;
4953
- switch (EVP_PKEY_base_id (pkey )) {
4953
+ int base_id = 0 ;
4954
+
4955
+ if (EVP_PKEY_id (pkey ) != EVP_PKEY_KEYMGMT ) {
4956
+ base_id = EVP_PKEY_base_id (pkey );
4957
+ } else {
4958
+ const char * type_name = EVP_PKEY_get0_type_name (pkey );
4959
+ if (type_name ) {
4960
+ int nid = OBJ_txt2nid (type_name );
4961
+ if (nid != NID_undef ) {
4962
+ base_id = EVP_PKEY_type (nid );
4963
+ }
4964
+ }
4965
+ }
4966
+
4967
+ switch (base_id ) {
4954
4968
case EVP_PKEY_RSA :
4955
4969
ktype = OPENSSL_KEYTYPE_RSA ;
4956
4970
array_init (& ary );
@@ -5013,7 +5027,9 @@ PHP_FUNCTION(openssl_pkey_get_details)
5013
5027
break ;
5014
5028
}
5015
5029
#endif
5016
- EMPTY_SWITCH_DEFAULT_CASE ();
5030
+ default :
5031
+ ktype = -1 ;
5032
+ break ;
5017
5033
}
5018
5034
#else
5019
5035
switch (EVP_PKEY_base_id (pkey )) {
You can’t perform that action at this time.
0 commit comments