Skip to content
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

Fix the issue with max_stanza_size #4197

Merged
merged 5 commits into from
Dec 22, 2023
Merged
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
4 changes: 2 additions & 2 deletions big_tests/rebar.config
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,13 @@
{deps, [
{lager, "3.9.2"},
{base16, "2.0.1"},
{exml, "3.3.3", {pkg, hexml}},
{exml, "3.4.0", {pkg, hexml}},
{bbmustache, "1.12.2"},
{jiffy, "1.1.1"},
{proper, "1.4.0"},
{gun, "2.0.0-rc.2"},
{fusco, "0.1.1"},
{escalus, "4.2.10"},
{escalus, "4.2.11"},
{cowboy, "2.9.0"},
{csv, "3.0.3", {pkg, csve}},
{amqp_client, "3.12.6"},
Expand Down
36 changes: 18 additions & 18 deletions big_tests/rebar.lock
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@
{pkg,<<"credentials_obfuscation">>,<<"3.4.0">>},
1},
{<<"csv">>,{pkg,<<"csve">>,<<"3.0.3">>},0},
{<<"escalus">>,{pkg,<<"escalus">>,<<"4.2.10">>},0},
{<<"escalus">>,{pkg,<<"escalus">>,<<"4.2.11">>},0},
{<<"esip">>,{pkg,<<"esip">>,<<"1.0.48">>},0},
{<<"exml">>,{pkg,<<"hexml">>,<<"3.3.3">>},0},
{<<"exml">>,{pkg,<<"hexml">>,<<"3.4.0">>},0},
{<<"fast_pbkdf2">>,{pkg,<<"fast_pbkdf2">>,<<"1.0.3">>},2},
{<<"fast_scram">>,{pkg,<<"fast_scram">>,<<"0.4.4">>},1},
{<<"fast_scram">>,{pkg,<<"fast_scram">>,<<"0.5.0">>},1},
{<<"fast_tls">>,{pkg,<<"fast_tls">>,<<"1.1.16">>},1},
{<<"fusco">>,{pkg,<<"fusco">>,<<"0.1.1">>},0},
{<<"goldrush">>,{pkg,<<"goldrush">>,<<"0.1.9">>},1},
Expand All @@ -23,15 +23,15 @@
{<<"meck">>,{pkg,<<"meck">>,<<"0.9.2">>},1},
{<<"p1_utils">>,{pkg,<<"p1_utils">>,<<"1.0.25">>},1},
{<<"proper">>,{pkg,<<"proper">>,<<"1.4.0">>},0},
{<<"quickrand">>,{pkg,<<"quickrand">>,<<"2.0.5">>},2},
{<<"quickrand">>,{pkg,<<"quickrand">>,<<"2.0.7">>},2},
{<<"rabbit_common">>,{pkg,<<"rabbit_common">>,<<"3.12.6">>},1},
{<<"ranch">>,{pkg,<<"ranch">>,<<"1.8.0">>},1},
{<<"recon">>,{pkg,<<"recon">>,<<"2.5.3">>},2},
{<<"stringprep">>,{pkg,<<"stringprep">>,<<"1.0.27">>},1},
{<<"stun">>,{pkg,<<"stun">>,<<"1.2.6">>},1},
{<<"thoas">>,{pkg,<<"thoas">>,<<"1.0.0">>},2},
{<<"uuid">>,{pkg,<<"uuid_erl">>,<<"2.0.5">>},1},
{<<"worker_pool">>,{pkg,<<"worker_pool">>,<<"6.0.1">>},1}]}.
{<<"uuid">>,{pkg,<<"uuid_erl">>,<<"2.0.7">>},1},
{<<"worker_pool">>,{pkg,<<"worker_pool">>,<<"6.2.0">>},1}]}.
[
{pkg_hash,[
{<<"amqp_client">>, <<"B0050183BB4CFBD5B3F9A3276689DFA135A196AEDC3584110F231B2CE04B0426">>},
Expand All @@ -41,11 +41,11 @@
{<<"cowlib">>, <<"0B9FF9C346629256C42EBE1EEB769A83C6CB771A6EE5960BD110AB0B9B872063">>},
{<<"credentials_obfuscation">>, <<"34E18B126B3AEFD6E8143776FBE1CECEEA6792307C99AC5EE8687911F048CFD7">>},
{<<"csv">>, <<"69E7D9B3FDC72016644368762C6A3E6CBFEB85BCCADBF1BD99AB6C827E360E04">>},
{<<"escalus">>, <<"3640C7EA77BCE0E5191751D9A02EF3A68CD0005F2705EC19026DFD96577D0434">>},
{<<"escalus">>, <<"FBEC4F874AACCFD5B493EE9CFE39F7FE9DDADFCB5054DFD83B8965B64ED43497">>},
{<<"esip">>, <<"3B3B3AFC798BE9458517D4FD2730674322368E54C2C1211AA630327354946D1B">>},
{<<"exml">>, <<"C64FE46373886FD62F3F753D8031034E231DC0C138F9CD3539F738EF220F0960">>},
{<<"exml">>, <<"18F9B02107E14F6CCDEFBDB7FEB0706C56AD3AFD0DD524BDD1F0ECD98746B9BC">>},
{<<"fast_pbkdf2">>, <<"4F09D6C6C20DBEE1970E0A6AE91432E1B7731F88426C671D083BAC31FFA1FDAD">>},
{<<"fast_scram">>, <<"299A2D430955A62A94CB43B1A727C5D21A5C4BD11AEBA476AE2F3A24CFBE89C3">>},
{<<"fast_scram">>, <<"BD0B946911B07D36EC22AD950FF22F77F27B94E4E24452AF966597C6D8CB5E7F">>},
{<<"fast_tls">>, <<"85FA7F3112EA4FF5CCB4F3ABADC130A8C855AD74EB00869487399CB0C322D208">>},
{<<"fusco">>, <<"3DD6A90151DFEF30EA1937CC44E9A59177C0094918388D9BCAA2F2DC5E2AE4AA">>},
{<<"goldrush">>, <<"F06E5D5F1277DA5C413E84D5A2924174182FB108DABB39D5EC548B27424CD106">>},
Expand All @@ -56,15 +56,15 @@
{<<"meck">>, <<"85CCBAB053F1DB86C7CA240E9FC718170EE5BDA03810A6292B5306BF31BAE5F5">>},
{<<"p1_utils">>, <<"2D39B5015A567BBD2CC7033EEB93A7C60D8C84EFE1EF69A3473FAA07FA268187">>},
{<<"proper">>, <<"89A44B8C39D28BB9B4BE8E4D715D534905B325470F2E0EC5E004D12484A79434">>},
{<<"quickrand">>, <<"06FCAD85CB47D5C85C51D6BC9C84A082501BA098A89D64AD0A2F69599E034C04">>},
{<<"quickrand">>, <<"D2BD76676A446E6A058D678444B7FDA1387B813710D1AF6D6E29BB92186C8820">>},
{<<"rabbit_common">>, <<"FEBD37E11483F94B614CD636C1EDBCE1099FF64866598F75D0A624D3A60437C6">>},
{<<"ranch">>, <<"8C7A100A139FD57F17327B6413E4167AC559FBC04CA7448E9BE9057311597A1D">>},
{<<"recon">>, <<"739107B9050EA683C30E96DE050BC59248FD27EC147696F79A8797FF9FA17153">>},
{<<"stringprep">>, <<"02808C7024BC6285CA6A8A67E7ADDFC16F35DDA55551A582C5181D8EA960E890">>},
{<<"stun">>, <<"5D1978D340EA20EFB28BC1E58779A3A1D64568C66168DB4D20692E76CE813D5E">>},
{<<"thoas">>, <<"567C03902920827A18A89F05B79A37B5BF93553154B883E0131801600CF02CE0">>},
{<<"uuid">>, <<"60FAEEB7EDFD40847ED13CB0DD1044BAABE4E79A00C0CA9C4D13A073914B1016">>},
{<<"worker_pool">>, <<"CA262C2DFB3B4AF661B206C82065D86F83922B7227508AA6E0BC34D3E5AE5135">>}]},
{<<"uuid">>, <<"B2078D2CC814F53AFA52D36C91E08962C7E7373585C623F4C0EA6DFB04B2AF94">>},
{<<"worker_pool">>, <<"506DE38C528A81ED2C6A80A419B83DDE6DA5E295BD320BDF4D35A69AFEB0247A">>}]},
{pkg_hash_ext,[
{<<"amqp_client">>, <<"B856F6404E7AF98C90DA870C8CE50D1380F13F2CEE02F16564B5CC5142BAE308">>},
{<<"base16">>, <<"06EA2D48343282E712160BA89F692B471DB8B36ABE8394F3445FF9032251D772">>},
Expand All @@ -73,11 +73,11 @@
{<<"cowlib">>, <<"2B3E9DA0B21C4565751A6D4901C20D1B4CC25CBB7FD50D91D2AB6DD287BC86A9">>},
{<<"credentials_obfuscation">>, <<"738ACE0ED5545D2710D3F7383906FC6F6B582D019036E5269C4DBD85DBCED566">>},
{<<"csv">>, <<"741D1A55AABADAA3E0FE13051050101A73E90C4570B9F9403A939D9546813521">>},
{<<"escalus">>, <<"08A84CAB2EDCE5F69EA5B93F039E6D7047FB3FF10CBD5B5AB855EE3144743B56">>},
{<<"escalus">>, <<"4E1262E6B1EEF834FE421FA1D3BBE69EF2028A8B88140DC397703B31B904C6D0">>},
{<<"esip">>, <<"02B9FC6E071415CBC62105F5115AEB68D11184BDAD3960DA7B62EA3E99E7FCCF">>},
{<<"exml">>, <<"CB54BF62E2902B52FE9CAF7E65176E764E8A10CCC51DE2DEDC0FC5C8D9F91AC6">>},
{<<"exml">>, <<"5F73224B784D45C743A949FC5AF4BB441B6B546B3D9883C0441D45401505ADD2">>},
{<<"fast_pbkdf2">>, <<"2900431E2E6402F23A92754448BBD949DA366BC9C984FDC791DDCFCC41042434">>},
{<<"fast_scram">>, <<"4B30084E3BDB39158076381FC871035BEFD157D5EE614BDA5E19EA482855E5D5">>},
{<<"fast_scram">>, <<"D45B746B8D17C0F73A94CBDB526E115A4AEDFECB4D42CA935BCB1195D783B4E1">>},
{<<"fast_tls">>, <<"AA08CCA89B4044E74F1F12E399817D8BEAEAE3EE006C98A893C0BFB1D81FBA51">>},
{<<"fusco">>, <<"6343551BD1E824F2A6CA85E1158C5B37C320FD449FBFEC7450A73F192AAF9022">>},
{<<"goldrush">>, <<"99CB4128CFFCB3227581E5D4D803D5413FA643F4EB96523F77D9E6937D994CEB">>},
Expand All @@ -88,13 +88,13 @@
{<<"meck">>, <<"81344F561357DC40A8344AFA53767C32669153355B626EA9FCBC8DA6B3045826">>},
{<<"p1_utils">>, <<"9219214428F2C6E5D3187FF8EB9A8783695C2427420BE9A259840E07ADA32847">>},
{<<"proper">>, <<"18285842185BD33EFBDA97D134A5CB5A0884384DB36119FEE0E3CFA488568CBB">>},
{<<"quickrand">>, <<"252CF0493570EBF1A58985CB71990982CDDCD4396B6427F1E10CF58924C1C052">>},
{<<"quickrand">>, <<"B8ACBF89A224BC217C3070CA8BEBC6EB236DBE7F9767993B274084EA044D35F0">>},
{<<"rabbit_common">>, <<"D85282C8C9BE456B42AA4B265EDE68D176CA8A28DFCF1D521BE19267167C0DC3">>},
{<<"ranch">>, <<"49FBCFD3682FAB1F5D109351B61257676DA1A2FDBE295904176D5E521A2DDFE5">>},
{<<"recon">>, <<"6C6683F46FD4A1DFD98404B9F78DCABC7FCD8826613A89DCB984727A8C3099D7">>},
{<<"stringprep">>, <<"A5967B1144CA8002A58A03D16DD109FBD0BCDB82616CEAD2F983944314AF6A00">>},
{<<"stun">>, <<"21AED098457E5099E925129459590592E001C470CF7503E5614A7A6B688FF146">>},
{<<"thoas">>, <<"FC763185B932ECB32A554FB735EE03C3B6B1B31366077A2427D2A97F3BD26735">>},
{<<"uuid">>, <<"E54373262CA88401689277947C54B95E9ECBC977BD5C57C9DD44AD9DA278E360">>},
{<<"worker_pool">>, <<"772E12CCB26909EA7F804B52E86E733DF66BB8150F683B591B0A762196494C74">>}]}
{<<"uuid">>, <<"4E4C5CA3461DC47C5E157ED42AA3981A053B7A186792AF972A27B14A9489324E">>},
{<<"worker_pool">>, <<"E1DED160797FBE656AD683109DBD741B520097DF17BDF7B51E3E4697073A6E62">>}]}
].
5 changes: 3 additions & 2 deletions big_tests/tests/anonymous_SUITE.erl
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
-module(anonymous_SUITE).
-compile([export_all, nowarn_export_all]).

-include_lib("jid/include/jid.hrl").
-include_lib("escalus/include/escalus.hrl").
-include_lib("eunit/include/eunit.hrl").

Expand Down Expand Up @@ -67,7 +68,7 @@ connection_is_registered_with_sasl_anon(Config) ->
escalus:story(Config, [{jon, 1}], fun(Jon) ->
JID = jid:from_binary(escalus_client:short_jid(Jon)),
OrigName = escalus_users:get_username(Config, jon),
?assertNotEqual(OrigName, JID#jid.user),
?assertNotEqual(OrigName, JID#jid.luser),
F = fun() -> rpc(mim(), ejabberd_auth, does_user_exist, [JID]) end,
true = F(),
escalus_connection:kill(Jon),
Expand All @@ -78,7 +79,7 @@ connection_is_registered_with_login(Config) ->
escalus:story(Config, [{anna, 1}], fun(Anna) ->
JID = jid:from_binary(escalus_client:short_jid(Anna)),
OrigName = escalus_users:get_username(Config, anna),
?assertEqual(OrigName, JID#jid.user),
?assertEqual(OrigName, JID#jid.luser),
F = fun() -> rpc(mim(), ejabberd_auth, does_user_exist, [JID]) end,
true = F(),
escalus_connection:kill(Anna),
Expand Down
11 changes: 6 additions & 5 deletions big_tests/tests/bind2_SUITE.erl
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

-include_lib("stdlib/include/assert.hrl").
-include_lib("exml/include/exml.hrl").
-include_lib("jid/include/jid.hrl").
-include_lib("escalus/include/escalus.hrl").
-include_lib("escalus/include/escalus_xmlns.hrl").

Expand Down Expand Up @@ -100,7 +101,7 @@ auth_and_bind_to_random_resource(Config) ->
Bound = exml_query:path(Success, [{element_with_ns, <<"bound">>, ?NS_BIND_2}]),
?assertNotEqual(undefined, Bound),
Identifier = exml_query:path(Success, [{element, <<"authorization-identifier">>}, cdata]),
#jid{resource = LResource} = jid:from_binary(Identifier),
#jid{lresource = LResource} = jid:from_binary(Identifier),
?assert(0 =< byte_size(LResource), LResource).

auth_and_bind_do_not_expose_user_agent_id_in_client(Config) ->
Expand All @@ -110,7 +111,7 @@ auth_and_bind_do_not_expose_user_agent_id_in_client(Config) ->
Bound = exml_query:path(Success, [{element_with_ns, <<"bound">>, ?NS_BIND_2}]),
?assertNotEqual(undefined, Bound),
Identifier = exml_query:path(Success, [{element, <<"authorization-identifier">>}, cdata]),
#jid{resource = LResource} = jid:from_binary(Identifier),
#jid{lresource = LResource} = jid:from_binary(Identifier),
?assertNotEqual(Uuid, LResource).

auth_and_bind_contains_client_tag(Config) ->
Expand All @@ -120,7 +121,7 @@ auth_and_bind_contains_client_tag(Config) ->
Bound = exml_query:path(Success, [{element_with_ns, <<"bound">>, ?NS_BIND_2}]),
?assertNotEqual(undefined, Bound),
Identifier = exml_query:path(Success, [{element, <<"authorization-identifier">>}, cdata]),
#jid{resource = LResource} = jid:from_binary(Identifier),
#jid{lresource = LResource} = jid:from_binary(Identifier),
ResourceParts = binary:split(LResource, <<"/">>, [global]),
?assertMatch([Tag, _], ResourceParts).

Expand Down Expand Up @@ -180,7 +181,7 @@ stream_resumption_failing_does_bind_and_contains_sm_status(Config) ->
Resumed = exml_query:path(Success, [{element_with_ns, <<"failed">>, ?NS_STREAM_MGNT_3}]),
escalus:assert(is_sm_failed, [<<"item-not-found">>], Resumed),
Identifier = exml_query:path(Success, [{element, <<"authorization-identifier">>}, cdata]),
#jid{resource = LResource} = jid:from_binary(Identifier),
#jid{lresource = LResource} = jid:from_binary(Identifier),
ResourceParts = binary:split(LResource, <<"/">>, [global]),
?assertMatch([Tag, _], ResourceParts).

Expand Down Expand Up @@ -286,7 +287,7 @@ plain_auth(_Config, Client, Data, BindElems, Extra) ->
escalus:send(Client, Authenticate),
Answer = escalus_client:wait_for_stanza(Client),
Identifier = exml_query:path(Answer, [{element, <<"authorization-identifier">>}, cdata]),
#jid{resource = LResource} = jid:from_binary(Identifier),
#jid{lresource = LResource} = jid:from_binary(Identifier),
{Client, Data#{answer => Answer, client_1_jid => Identifier, bind2_resource => LResource}}.

start_peer(Config, Client, Data) ->
Expand Down
22 changes: 18 additions & 4 deletions big_tests/tests/mim_c2s_SUITE.erl
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
-include_lib("escalus/include/escalus.hrl").
-include_lib("escalus/include/escalus_xmlns.hrl").
-define(BAD_RESOURCE, <<"\x{EFBB}"/utf8>>).
-define(MAX_STANZA_SIZE, 1024).

-import(distributed_helper, [mim/0]).

Expand All @@ -28,7 +29,8 @@ groups() ->
client_sets_stream_from_server_answers_with_to,
stream_from_does_not_match_sasl_jid_results_in_stream_error,
two_users_can_log_and_chat,
too_big_stanza_rejected,
too_big_stanza_is_rejected,
too_big_opening_tag_is_rejected,
message_sent_to_malformed_jid_results_in_error,
verify_session_establishment_is_not_announced,
invalid_resource_fails_to_log
Expand Down Expand Up @@ -60,7 +62,8 @@ init_per_group(basic, Config) ->
Config1 = save_c2s_listener(Config),
Config2 = escalus_users:update_userspec(Config1, alice, connection_steps, Steps),
Config3 = escalus_users:update_userspec(Config2, bob, connection_steps, Steps),
configure_c2s_listener(Config3, #{backwards_compatible_session => false, max_stanza_size => 1024}),
configure_c2s_listener(Config3, #{backwards_compatible_session => false,
max_stanza_size => ?MAX_STANZA_SIZE}),
Config3;
init_per_group(backwards_compatible_session, Config) ->
Config.
Expand Down Expand Up @@ -128,15 +131,26 @@ two_users_can_log_and_chat(Config) ->
escalus:assert(is_chat_message, [<<"Hi!">>], escalus_client:wait_for_stanza(Alice))
end).

too_big_stanza_rejected(Config) ->
too_big_stanza_is_rejected(Config) ->
AliceSpec = escalus_fresh:create_fresh_user(Config, alice),
{ok, Alice, _Features} = escalus_connection:start(AliceSpec),
BigBody = base16:encode(crypto:strong_rand_bytes(1024)),
BigBody = base16:encode(crypto:strong_rand_bytes(?MAX_STANZA_SIZE)),
escalus_client:send(Alice, escalus_stanza:chat_to(Alice, BigBody)),
escalus:assert(is_stream_error, [<<"policy-violation">>, <<>>], escalus_client:wait_for_stanza(Alice)),
escalus:assert(is_stream_end, escalus_client:wait_for_stanza(Alice)),
true = escalus_connection:wait_for_close(Alice, timer:seconds(1)).

too_big_opening_tag_is_rejected(Config) ->
AliceSpec = escalus_fresh:create_fresh_user(Config, alice),
{ok, Alice, _Features} = escalus_connection:start(AliceSpec, []),
BigAttrs = [{<<"bigattr">>, base16:encode(crypto:strong_rand_bytes(?MAX_STANZA_SIZE))}],
escalus_client:send(Alice, #xmlel{name = <<"stream:stream">>, attrs = BigAttrs}),
escalus:assert(is_stream_start, escalus_client:wait_for_stanza(Alice)),
escalus:assert(is_stream_error, [<<"xml-not-well-formed">>, <<>>],
escalus_client:wait_for_stanza(Alice)),
escalus:assert(is_stream_end, escalus_client:wait_for_stanza(Alice)),
true = escalus_connection:wait_for_close(Alice, timer:seconds(1)).

message_sent_to_malformed_jid_results_in_error(Config) ->
escalus:fresh_story(Config, [{alice, 1}, {bob, 1}], fun(Alice, Bob) ->
% Alice sends message with malformed "to"
Expand Down
37 changes: 34 additions & 3 deletions big_tests/tests/websockets_SUITE.erl
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,14 @@
-include_lib("escalus/include/escalus.hrl").
-include_lib("common_test/include/ct.hrl").

-import(distributed_helper, [mim/0]).

%%--------------------------------------------------------------------
%% Suite configuration
%%--------------------------------------------------------------------

-define(REGISTRATION_TIMEOUT, 2). %% seconds
-define(MAX_STANZA_SIZE, 200).

all() ->
[metrics_test,
Expand All @@ -38,7 +41,8 @@ groups() ->
test_cases() ->
[chat_msg,
escape_chat_msg,
escape_attrs].
escape_attrs,
too_big_stanza_is_rejected].

suite() ->
escalus:suite().
Expand All @@ -49,9 +53,12 @@ suite() ->

init_per_suite(Config) ->
Config1 = escalus:init_per_suite(Config),
escalus:create_users(Config1, escalus:get_users([alice, geralt, geralt_s, carol])).
Config2 = setup_listeners(Config1),
escalus:create_users(Config2, escalus:get_users([alice, geralt, geralt_s, carol])).

end_per_suite(Config) ->
Listeners = ?config(original_listeners, Config),
[mongoose_helper:restart_listener(mim(), Listener) || Listener <- Listeners],
Config1 = escalus:delete_users(Config, escalus:get_users([alice, geralt, geralt_s, carol])),
escalus:end_per_suite(Config1).

Expand All @@ -63,7 +70,6 @@ init_per_group(GroupName, Config) ->
[{user, geralt} | Config]
end.


end_per_group(_GroupName, _Config) ->
ok.

Expand All @@ -73,6 +79,19 @@ init_per_testcase(CaseName, Config) ->
end_per_testcase(CaseName, Config) ->
escalus:end_per_testcase(CaseName, Config).

setup_listeners(Config) ->
Listeners = mongoose_helper:get_listeners(mim(), #{module => ejabberd_cowboy}),
[mongoose_helper:restart_listener(mim(), update_listener(Listener)) || Listener <- Listeners],
[{original_listeners, Listeners} | Config].

update_listener(Listener = #{handlers := Handlers}) ->
Listener#{handlers := lists:map(fun update_handler/1, Handlers)}.

update_handler(Handler = #{module := mod_websockets}) ->
Handler#{max_stanza_size := ?MAX_STANZA_SIZE};
update_handler(Handler) ->
Handler.

%%--------------------------------------------------------------------
%% Message tests
%%--------------------------------------------------------------------
Expand All @@ -96,6 +115,18 @@ metrics_test(Config) ->

end).

too_big_stanza_is_rejected(Config) ->
escalus:story(
Config, [{alice, 1}, {?config(user, Config), 1}],
fun(Alice, Geralt) ->
BigBody = base16:encode(crypto:strong_rand_bytes(?MAX_STANZA_SIZE)),
escalus_client:send(Geralt, escalus_stanza:chat_to(Alice, BigBody)),
escalus:assert(is_stream_error, [<<"policy-violation">>, <<>>], escalus_client:wait_for_stanza(Geralt)),
escalus:assert(is_stream_end, escalus_client:wait_for_stanza(Geralt)),
true = escalus_connection:wait_for_close(Geralt, timer:seconds(1)),
escalus_assert:has_no_stanzas(Alice)
end).

chat_msg(Config) ->
escalus:story(Config, [{alice, 1}, {?config(user, Config), 1}, {carol, 1}],
fun(Alice, Geralt, Carol) ->
Expand Down
2 changes: 1 addition & 1 deletion rebar.config
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@
[
%%% Stateless parsers
{base16, "2.0.1"},
{exml, "3.3.3", {pkg, hexml}},
{exml, "3.4.0", {pkg, hexml}},
{jiffy, "1.1.1"},
{jid, "2.0.0", {pkg, mongoose_jid}},
{tomerl, "0.5.0"},
Expand Down
6 changes: 3 additions & 3 deletions rebar.lock
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
{<<"eredis">>,{pkg,<<"eredis">>,<<"1.7.0">>},0},
{<<"erl_csv">>,{pkg,<<"erl_csv">>,<<"0.3.1">>},0},
{<<"erlcloud">>,{pkg,<<"erlcloud">>,<<"3.6.5">>},0},
{<<"exml">>,{pkg,<<"hexml">>,<<"3.3.3">>},0},
{<<"exml">>,{pkg,<<"hexml">>,<<"3.4.0">>},0},
{<<"exometer_core">>,
{git,"https://github.com/esl/exometer_core.git",
{ref,"123daa053a4abb3ff4bdbf52f08344da535294e9"}},
Expand Down Expand Up @@ -148,7 +148,7 @@
{<<"eredis">>, <<"7A9B2B51ECDE73AF3399B344C6C7FA5141E6C77DF5FACE86E41E8365A1E5B08F">>},
{<<"erl_csv">>, <<"5AD1BB8093D198191384F2E96EB879B08B23F14E5F6FAD8D80BDC3EB623DE8DA">>},
{<<"erlcloud">>, <<"75B93168BF6F9CD4573B261D8F83FD2C89F7809AFEAAADABFA39ECE3F75F3055">>},
{<<"exml">>, <<"C64FE46373886FD62F3F753D8031034E231DC0C138F9CD3539F738EF220F0960">>},
{<<"exml">>, <<"18F9B02107E14F6CCDEFBDB7FEB0706C56AD3AFD0DD524BDD1F0ECD98746B9BC">>},
{<<"fast_pbkdf2">>, <<"4F09D6C6C20DBEE1970E0A6AE91432E1B7731F88426C671D083BAC31FFA1FDAD">>},
{<<"fast_scram">>, <<"BD0B946911B07D36EC22AD950FF22F77F27B94E4E24452AF966597C6D8CB5E7F">>},
{<<"fast_tls">>, <<"85FA7F3112EA4FF5CCB4F3ABADC130A8C855AD74EB00869487399CB0C322D208">>},
Expand Down Expand Up @@ -212,7 +212,7 @@
{<<"eredis">>, <<"A49E7B11A2E1DF91EC3DA565DBD1A9530C95A5AC03127D3810D735F9EABF6F2E">>},
{<<"erl_csv">>, <<"21186276E59258F6F35F1CA2ECDFA995508B2E0055D502DCA1DCD09E3231F445">>},
{<<"erlcloud">>, <<"9E482E6B1C956A649AE878CBE46494BC36E6CAFA1C677B30158C0ED4BAD789E9">>},
{<<"exml">>, <<"CB54BF62E2902B52FE9CAF7E65176E764E8A10CCC51DE2DEDC0FC5C8D9F91AC6">>},
{<<"exml">>, <<"5F73224B784D45C743A949FC5AF4BB441B6B546B3D9883C0441D45401505ADD2">>},
{<<"fast_pbkdf2">>, <<"2900431E2E6402F23A92754448BBD949DA366BC9C984FDC791DDCFCC41042434">>},
{<<"fast_scram">>, <<"D45B746B8D17C0F73A94CBDB526E115A4AEDFECB4D42CA935BCB1195D783B4E1">>},
{<<"fast_tls">>, <<"AA08CCA89B4044E74F1F12E399817D8BEAEAE3EE006C98A893C0BFB1D81FBA51">>},
Expand Down
Loading