From: Daniel Lowrey Date: Thu, 5 Mar 2015 19:24:04 +0000 (-0700) Subject: Merge branch 'PHP-5.6' X-Git-Tag: PRE_PHP7_NSAPI_REMOVAL~797 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=927b137c1b6490384080a66a8ba678db3a90f6ba;p=php Merge branch 'PHP-5.6' * PHP-5.6: Fix ZTS Fix ZTS build Conflicts: ext/openssl/openssl.c ext/openssl/xp_ssl.c --- 927b137c1b6490384080a66a8ba678db3a90f6ba diff --cc ext/openssl/xp_ssl.c index 3e1a92a145,bfa46e3de0..9de0dcbef2 --- a/ext/openssl/xp_ssl.c +++ b/ext/openssl/xp_ssl.c @@@ -345,19 -311,26 +345,20 @@@ static zend_bool php_x509_fingerprint_m return 0; } - for (zend_hash_internal_pointer_reset_ex(Z_ARRVAL_P(val), &pos); - zend_hash_get_current_data_ex(Z_ARRVAL_P(val), (void **)¤t, &pos) == SUCCESS; - zend_hash_move_forward_ex(Z_ARRVAL_P(val), &pos) - ) { - int key_type = zend_hash_get_current_key_ex(Z_ARRVAL_P(val), &key, &key_len, &key_index, 0, &pos); - - if (!(key_type == HASH_KEY_IS_STRING && Z_TYPE_PP(current) == IS_STRING)) { - php_error_docref(NULL, E_WARNING, "Invalid peer_fingerprint array; [algo => fingerprint] form required" TSRMLS_CC); + ZEND_HASH_FOREACH_STR_KEY_VAL(Z_ARRVAL_P(val), key, current) { + if (key == NULL || Z_TYPE_P(current) != IS_STRING) { + php_error_docref(NULL, E_WARNING, "Invalid peer_fingerprint array; [algo => fingerprint] form required"); return 0; } - if (php_x509_fingerprint_cmp(peer, key, Z_STRVAL_PP(current) TSRMLS_CC) != 0) { + if (php_x509_fingerprint_cmp(peer, key->val, Z_STRVAL_P(current)) != 0) { return 0; } - } + } ZEND_HASH_FOREACH_END(); return 1; - } else { - php_error_docref(NULL, E_WARNING, "Invalid peer_fingerprint value; fingerprint string or array of the form [algo => fingerprint] required"); + php_error_docref(NULL, E_WARNING, - "Invalid peer_fingerprint value; fingerprint string or array of the form [algo => fingerprint] required" TSRMLS_CC); ++ "Invalid peer_fingerprint value; fingerprint string or array of the form [algo => fingerprint] required"); } return 0;