]> granicus.if.org Git - php/commitdiff
Don't generate spurious warning is security_level not supported
authorNikita Popov <nikita.ppv@gmail.com>
Thu, 18 Jun 2020 12:20:23 +0000 (14:20 +0200)
committerNikita Popov <nikita.ppv@gmail.com>
Thu, 18 Jun 2020 12:21:53 +0000 (14:21 +0200)
People should not have to worry about the used openssl version
when downgrading security_level.

ext/openssl/xp_ssl.c

index 31f8ffa424f42bdacfc389bef4c355f6e649d64c..a390dcb7241c6219984f5d8b5bba05cea8024635 100644 (file)
@@ -1711,16 +1711,12 @@ int php_openssl_setup_crypto(php_stream *stream,
        }
 
        if (GET_VER_OPT("security_level")) {
-#ifdef HAVE_SEC_LEVEL
                zend_long lval = zval_get_long(val);
                if (lval < 0 || lval > 5) {
                        php_error_docref(NULL, E_WARNING, "Security level must be between 0 and 5");
                }
+#ifdef HAVE_SEC_LEVEL
                SSL_CTX_set_security_level(sslsock->ctx, lval);
-#else
-               php_error_docref(NULL, E_WARNING,
-                               "security_level is not supported by the linked OpenSSL library "
-                               "- it is supported from version 1.1.0");
 #endif
        }