Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
home:Ledest:erlang:24
erlang
0699-add-test-case-for-ssl-renegotiate-1-for-co...
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File 0699-add-test-case-for-ssl-renegotiate-1-for-connection-r.patch of Package erlang
From ca279b3033ee792ef7103cb62a1f838fed4f9ab5 Mon Sep 17 00:00:00 2001 From: anupamasingh10 <anupamasingh31@gmail.com> Date: Tue, 21 Mar 2023 11:33:42 +0100 Subject: [PATCH 2/2] add test case for ssl:renegotiate/1 for connection running TLS-1.3 --- lib/ssl/test/tls_1_3_version_SUITE.erl | 27 ++++++++++++++++++++++++-- 1 file changed, 25 insertions(+), 2 deletions(-) diff --git a/lib/ssl/test/tls_1_3_version_SUITE.erl b/lib/ssl/test/tls_1_3_version_SUITE.erl index 8a3ff288f7..58aae7d1ee 100644 --- a/lib/ssl/test/tls_1_3_version_SUITE.erl +++ b/lib/ssl/test/tls_1_3_version_SUITE.erl @@ -57,7 +57,9 @@ middle_box_tls12_enabled_client/0, middle_box_tls12_enabled_client/1, middle_box_client_tls_v2_session_reused/0, - middle_box_client_tls_v2_session_reused/1 + middle_box_client_tls_v2_session_reused/1, + renegotiate_error/0, + renegotiate_error/1 ]). @@ -90,7 +92,8 @@ tls_1_3_1_2_tests() -> tls12_client_tls_server, middle_box_tls13_client, middle_box_tls12_enabled_client, - middle_box_client_tls_v2_session_reused + middle_box_client_tls_v2_session_reused, + renegotiate_error ]. legacy_tests() -> [tls_client_tls10_server, @@ -329,6 +332,26 @@ middle_box_client_tls_v2_session_reused(Config) when is_list(Config) -> {reuse_session, {SessionId, SessData}} | ClientOpts]}]), {ok,[{session_id, SessionId}]} = ssl:connection_information(CSock1, [session_id]). +renegotiate_error() -> + [{doc, "Test that an error is returned when ssl:renegotiate/1 is called on a connection running TLS-1.3"}]. +renegotiate_error(Config) when is_list(Config) -> + {_ClientNode, ServerNode, Hostname} = ssl_test_lib:run_where(Config), + ClientOpts = ssl_test_lib:ssl_options(client_cert_opts, Config), + ServerOpts = ssl_test_lib:ssl_options(server_cert_opts, Config), + + Server = ssl_test_lib:start_server([{node, ServerNode}, {port, 0}, + {from, self()}, + {mfa, {ssl_test_lib, send_recv_result_active, []}}, + {options, [{versions, ['tlsv1.3']} | ServerOpts]}]), + Port = ssl_test_lib:inet_port(Server), + Options = [{versions, ['tlsv1.3']} | ClientOpts], + case ssl:connect(Hostname, Port, Options) of + {ok, Socket} -> + {error, notsup} = ssl:renegotiate(Socket); + {error, Reason} -> + ct:fail(Reason) + end. + %%-------------------------------------------------------------------- %% Internal functions and callbacks ----------------------------------- %%-------------------------------------------------------------------- -- 2.35.3
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor