Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion ext/curl/interface.c
Original file line number Diff line number Diff line change
Expand Up @@ -1868,7 +1868,6 @@ static zend_result _php_curl_setopt(php_curl *ch, zend_long option, zval *zvalue
case CURLOPT_PROXYUSERPWD:
case CURLOPT_REFERER:
case CURLOPT_SSLCERTTYPE:
case CURLOPT_SSLENGINE:
case CURLOPT_SSLENGINE_DEFAULT:
case CURLOPT_SSLKEY:
case CURLOPT_SSLKEYPASSWD:
Expand Down Expand Up @@ -2228,6 +2227,7 @@ static zend_result _php_curl_setopt(php_curl *ch, zend_long option, zval *zvalue
case CURLOPT_CRLFILE:
case CURLOPT_ISSUERCERT:
case CURLOPT_SSH_KNOWNHOSTS:
case CURLOPT_SSLENGINE:
{
zend_string *tmp_str;
zend_string *str = zval_get_tmp_string(zvalue, &tmp_str);
Expand Down
35 changes: 35 additions & 0 deletions ext/curl/tests/curl_setopt_CURLOPT_SSLENGINE.phpt
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
--TEST--
curl_setopt(CURLOPT_SSLENGINE) should respect open_basedir for engine paths
--EXTENSIONS--
curl
--SKIPIF--
<?php
if (!defined('CURLOPT_SSLENGINE')) {
die('skip CURLOPT_SSLENGINE not available');
}

$version = curl_version();

if (!isset($version['ssl_version']) ||
stripos($version['ssl_version'], 'OpenSSL') === false) {
die('skip requires libcurl built against OpenSSL');
}
?>
--INI--
open_basedir=.
display_errors=1
log_errors=0
--FILE--
<?php

$ch = curl_init();
var_dump(curl_setopt($ch, CURLOPT_SSLENGINE, '/dev/null'));
var_dump(curl_setopt($ch, CURLOPT_SSLENGINE, __FILE__));
var_dump(curl_setopt($ch, CURLOPT_SSLENGINE, 'someengine:property'));

?>
--EXPECTF--
Warning: curl_setopt(): open_basedir restriction in effect. File(/dev/null) is not within the allowed path(s): (.) in %s on line %d
bool(false)
bool(false)
bool(false)
Loading