@@ -48,6 +48,7 @@ groups() ->
48
48
test_update_secret ,
49
49
cannot_update_username_after_authenticated ,
50
50
cannot_use_another_authmechanism_when_updating_secret ,
51
+ update_secret_should_close_connection_if_wrong_secret ,
51
52
unauthenticated_client_rejected_tcp_connected ,
52
53
timeout_tcp_connected ,
53
54
unauthenticated_client_rejected_peer_properties_exchanged ,
@@ -292,22 +293,30 @@ test_update_secret(Config) ->
292
293
293
294
cannot_update_username_after_authenticated (Config ) ->
294
295
{S , C0 } = connect_and_authenticate (gen_tcp , Config ),
295
- C1 = expect_unsuccessful_authentication (
296
- try_authenticate (gen_tcp , S , C0 , <<" PLAIN" >>, <<" other" >>, <<" other" >>),
297
- ? RESPONSE_SASL_CANNOT_CHANGE_USERNAME ),
298
- _C2 = test_close (gen_tcp , S , C1 ),
296
+ _C1 = expect_unsuccessful_authentication (
297
+ try_authenticate (gen_tcp , S , C0 , <<" PLAIN" >>, <<" other" >>, <<" other" >>),
298
+ ? RESPONSE_SASL_CANNOT_CHANGE_USERNAME ),
299
299
closed = wait_for_socket_close (gen_tcp , S , 10 ),
300
300
ok .
301
301
302
302
cannot_use_another_authmechanism_when_updating_secret (Config ) ->
303
303
{S , C0 } = connect_and_authenticate (gen_tcp , Config ),
304
- C1 = expect_unsuccessful_authentication (
305
- try_authenticate (gen_tcp , S , C0 , <<" EXTERNAL" >>, <<" guest" >>, <<" new_password" >>),
306
- ? RESPONSE_SASL_CANNOT_CHANGE_MECHANISM ),
307
- _C2 = test_close (gen_tcp , S , C1 ),
304
+ _C1 = expect_unsuccessful_authentication (
305
+ try_authenticate (gen_tcp , S , C0 , <<" EXTERNAL" >>, <<" guest" >>, <<" new_password" >>),
306
+ ? RESPONSE_SASL_CANNOT_CHANGE_MECHANISM ),
308
307
closed = wait_for_socket_close (gen_tcp , S , 10 ),
309
308
ok .
310
309
310
+ update_secret_should_close_connection_if_wrong_secret (Config ) ->
311
+ Transport = gen_tcp ,
312
+ {S , C0 } = connect_and_authenticate (Transport , Config ),
313
+ Pwd = rand :bytes (20 ),
314
+ _C1 = expect_unsuccessful_authentication (
315
+ try_authenticate (Transport , S , C0 , <<" PLAIN" >>, <<" guest" >>, Pwd ),
316
+ ? RESPONSE_AUTHENTICATION_FAILURE ),
317
+ closed = wait_for_socket_close (Transport , S , 10 ),
318
+ ok .
319
+
311
320
test_stream_tls (Config ) ->
312
321
Stream = atom_to_binary (? FUNCTION_NAME , utf8 ),
313
322
test_server (ssl , Stream , Config ),
0 commit comments