Skip to content

Add LDAP_OPT_X_TLS_PROTOCOL_MAX and LDAP_OPT_X_TLS_PROTOCOL_TLS1_3 #13405

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 2 commits into from
Closed
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
6 changes: 6 additions & 0 deletions ext/ldap/ldap.c
Original file line number Diff line number Diff line change
Expand Up @@ -2991,6 +2991,9 @@ PHP_FUNCTION(ldap_get_option)
#ifdef LDAP_OPT_X_TLS_PROTOCOL_MIN
case LDAP_OPT_X_TLS_PROTOCOL_MIN:
#endif
#ifdef LDAP_OPT_X_TLS_PROTOCOL_MAX
case LDAP_OPT_X_TLS_PROTOCOL_MAX:
#endif
#ifdef LDAP_OPT_X_KEEPALIVE_IDLE
case LDAP_OPT_X_KEEPALIVE_IDLE:
case LDAP_OPT_X_KEEPALIVE_PROBES:
Expand Down Expand Up @@ -3159,6 +3162,9 @@ PHP_FUNCTION(ldap_set_option)
#ifdef LDAP_OPT_X_TLS_PROTOCOL_MIN
case LDAP_OPT_X_TLS_PROTOCOL_MIN:
#endif
#ifdef LDAP_OPT_X_TLS_PROTOCOL_MAX
case LDAP_OPT_X_TLS_PROTOCOL_MAX:
#endif
#ifdef LDAP_OPT_X_KEEPALIVE_IDLE
case LDAP_OPT_X_KEEPALIVE_IDLE:
case LDAP_OPT_X_KEEPALIVE_PROBES:
Expand Down
14 changes: 14 additions & 0 deletions ext/ldap/ldap.stub.php
Original file line number Diff line number Diff line change
Expand Up @@ -358,6 +358,20 @@
*/
const LDAP_OPT_X_TLS_PROTOCOL_TLS1_2 = UNKNOWN;
#endif
#ifdef LDAP_OPT_X_TLS_PROTOCOL_TLS1_3
/**
* @var int
* @cvalue LDAP_OPT_X_TLS_PROTOCOL_TLS1_3
*/
const LDAP_OPT_X_TLS_PROTOCOL_TLS1_3 = UNKNOWN;
#endif
#ifdef LDAP_OPT_X_TLS_PROTOCOL_MAX
/**
* @var int
* @cvalue LDAP_OPT_X_TLS_PROTOCOL_MAX
*/
const LDAP_OPT_X_TLS_PROTOCOL_MAX = UNKNOWN;
#endif

#ifdef LDAP_OPT_X_TLS_PACKAGE
/**
Expand Down
8 changes: 7 additions & 1 deletion ext/ldap/ldap_arginfo.h

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

39 changes: 39 additions & 0 deletions ext/ldap/tests/ldap_set_option_tls_protocol_max_basic.phpt
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
--TEST--
ldap_set_option() - Basic test for TLS protocol max ldap option
--CREDITS--
Chad Sikorra <[email protected]>
--EXTENSIONS--
ldap
--FILE--
<?php
require "connect.inc";
$link = ldap_connect($uri);

foreach([
LDAP_OPT_X_TLS_PROTOCOL_SSL2,
LDAP_OPT_X_TLS_PROTOCOL_SSL3,
LDAP_OPT_X_TLS_PROTOCOL_TLS1_0,
LDAP_OPT_X_TLS_PROTOCOL_TLS1_1,
LDAP_OPT_X_TLS_PROTOCOL_TLS1_2,
LDAP_OPT_X_TLS_PROTOCOL_TLS1_3,
] as $option) {
$result = ldap_set_option($link, LDAP_OPT_X_TLS_PROTOCOL_MAX, $option);
var_dump($result);

ldap_get_option($link, LDAP_OPT_X_TLS_PROTOCOL_MAX, $optionval);
var_dump($optionval);
}
?>
--EXPECT--
bool(true)
int(512)
bool(true)
int(768)
bool(true)
int(769)
bool(true)
int(770)
bool(true)
int(771)
bool(true)
int(772)
3 changes: 3 additions & 0 deletions ext/ldap/tests/ldap_set_option_tls_protocol_min_basic.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ foreach([
LDAP_OPT_X_TLS_PROTOCOL_TLS1_0,
LDAP_OPT_X_TLS_PROTOCOL_TLS1_1,
LDAP_OPT_X_TLS_PROTOCOL_TLS1_2,
LDAP_OPT_X_TLS_PROTOCOL_TLS1_3,
] as $option) {
$result = ldap_set_option($link, LDAP_OPT_X_TLS_PROTOCOL_MIN, $option);
var_dump($result);
Expand All @@ -34,3 +35,5 @@ bool(true)
int(770)
bool(true)
int(771)
bool(true)
int(772)