]> granicus.if.org Git - php/commitdiff
Merge branch 'PHP-5.6'
authorDaniel Lowrey <rdlowrey@php.net>
Thu, 5 Mar 2015 19:24:04 +0000 (12:24 -0700)
committerDaniel Lowrey <rdlowrey@php.net>
Thu, 5 Mar 2015 19:24:04 +0000 (12:24 -0700)
* PHP-5.6:
  Fix ZTS
  Fix ZTS build

Conflicts:
ext/openssl/openssl.c
ext/openssl/xp_ssl.c

1  2 
ext/openssl/xp_ssl.c

index 3e1a92a145189f32a39470f75db9b0e543a451fd,bfa46e3de0a81ffa1877ac897c9ad3736c23c0f4..9de0dcbef261529ab75dac4f6816ece881382ae3
@@@ -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 **)&current, &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;