diff options
Diffstat (limited to 'src/sp_curl_verify_certificates.c')
| -rw-r--r-- | src/sp_curl_verify_certificates.c | 33 |
1 files changed, 0 insertions, 33 deletions
diff --git a/src/sp_curl_verify_certificates.c b/src/sp_curl_verify_certificates.c deleted file mode 100644 index 057ee29..0000000 --- a/src/sp_curl_verify_certificates.c +++ /dev/null | |||
| @@ -1,33 +0,0 @@ | |||
| 1 | #include "php_snuffleupagus.h" | ||
| 2 | #include "sp_config.h" | ||
| 3 | |||
| 4 | ZEND_DECLARE_MODULE_GLOBALS(snuffleupagus) | ||
| 5 | |||
| 6 | PHP_FUNCTION(sp_curl_setopt) { | ||
| 7 | void (*orig_handler)(INTERNAL_FUNCTION_PARAMETERS); | ||
| 8 | zend_string *protocol_name = NULL; | ||
| 9 | zval *zid, *zvalue; | ||
| 10 | zend_long options; | ||
| 11 | |||
| 12 | ZEND_PARSE_PARAMETERS_START(3, 3) | ||
| 13 | Z_PARAM_RESOURCE(zid) | ||
| 14 | Z_PARAM_LONG(options) | ||
| 15 | Z_PARAM_ZVAL(zvalue) | ||
| 16 | ZEND_PARSE_PARAMETERS_END(); | ||
| 17 | |||
| 18 | if (options & CURLOPT_SSL_VERIFYPEER && zval_get_long(zvalue) != 1) { | ||
| 19 | sp_log_err("verify_vertificates", "Please don't deactivate server certificate validation"); | ||
| 20 | } else if (options & CURLOPT_SSL_VERIFYHOST && zval_get_long(zvalue) != 2) { | ||
| 21 | sp_log_err("verify_vertificates", "Please don't deactivate client certificate validation"); | ||
| 22 | } | ||
| 23 | |||
| 24 | orig_handler(INTERNAL_FUNCTION_PARAM_PASSTHRU); | ||
| 25 | } | ||
| 26 | |||
| 27 | int hook_curl_verify_certificates() { | ||
| 28 | TSRMLS_FETCH(); | ||
| 29 | |||
| 30 | HOOK_FUNCTION("curl_setopt", sp_internal_functions_hook, PHP_FN(sp_curl_setopt)); | ||
| 31 | |||
| 32 | return SUCCESS; | ||
| 33 | } | ||
