diff options
author | Erlang/OTP <[email protected]> | 2019-01-15 19:35:04 +0100 |
---|---|---|
committer | Erlang/OTP <[email protected]> | 2019-01-15 19:35:04 +0100 |
commit | 67867c639aa760d0dfab8e57f5bee1566c1be6e0 (patch) | |
tree | 3659a889866b2bcf6e476b368a5d0c56861029d0 /lib/ssl/test/ssl_test_lib.erl | |
parent | 788b9bd0d7ef518fb58fe70793357eec47cd8671 (diff) | |
parent | 23b258560d28924b80677e96730a7292a2405e1e (diff) | |
download | otp-67867c639aa760d0dfab8e57f5bee1566c1be6e0.tar.gz otp-67867c639aa760d0dfab8e57f5bee1566c1be6e0.tar.bz2 otp-67867c639aa760d0dfab8e57f5bee1566c1be6e0.zip |
Merge branch 'ingela/ssl/enhance-error-handling/OTP-15505' into maint-21
* ingela/ssl/enhance-error-handling/OTP-15505:
ssl: Cuddle test cases
ssl: Fix test case
ssl: Fix two invalid gen_statem returns
Diffstat (limited to 'lib/ssl/test/ssl_test_lib.erl')
-rw-r--r-- | lib/ssl/test/ssl_test_lib.erl | 28 |
1 files changed, 15 insertions, 13 deletions
diff --git a/lib/ssl/test/ssl_test_lib.erl b/lib/ssl/test/ssl_test_lib.erl index a8d62d6c4e..7767d76a0d 100644 --- a/lib/ssl/test/ssl_test_lib.erl +++ b/lib/ssl/test/ssl_test_lib.erl @@ -1461,19 +1461,10 @@ cipher_result(Socket, Result) -> %% Importante to send two packets here %% to properly test "cipher state" handling ssl:send(Socket, "Hello\n"), - receive - {ssl, Socket, "H"} -> - ssl:send(Socket, " world\n"), - receive_rizzo_duong_beast(); - {ssl, Socket, "Hello\n"} -> - ssl:send(Socket, " world\n"), - receive - {ssl, Socket, " world\n"} -> - ok - end; - Other -> - {unexpected, Other} - end. + "Hello\n" = active_recv(Socket, length( "Hello\n")), + ssl:send(Socket, " world\n"), + " world\n" = active_recv(Socket, length(" world\n")), + ok. session_info_result(Socket) -> {ok, Info} = ssl:connection_information(Socket, [session_id, cipher_suite]), @@ -1622,6 +1613,17 @@ send_recv_result_active_once(Socket) -> ok end. +active_recv(Socket, N) -> + active_recv(Socket, N, []). + +active_recv(_Socket, 0, Acc) -> + Acc; +active_recv(Socket, N, Acc) -> + receive + {ssl, Socket, Bytes} -> + active_recv(Socket, N-length(Bytes), Acc ++ Bytes) + end. + is_sane_ecc(openssl) -> case os:cmd("openssl version") of "OpenSSL 1.0.0a" ++ _ -> % Known bug in openssl |