rabbitmq / rabbitmq-amqp1.0-client

Erlang AMQP 1.0 client
Other
20 stars 29 forks source link

sasl_outcome supports more error codes #48

Closed bougueil closed 4 years ago

bougueil commented 4 years ago

sasl_outcome currently supports only code = 0 or 1 This fix makes sure sasl_outcome supports all codes from the AMQP10 specification

Otherwise rabbitmq-amqp1.0-client crashes with: ** (FunctionClauseError) no function clause matching in :amqp10_client_connection.sasl_init_sent/2 (amqp10_client 0.0.0) src/amqp10_client_connection.erl:198: :amqp10_client_connection.sasl_init_sent({:"v1_0.sasl_outcome", {:ubyte, 2}, :undefined}, {:state, 1, #PID<0.5204.0>, #Reference<0.1566087877.927203329.110289>, #PID ...

pivotal-issuemaster commented 4 years ago

@bougueil Please sign the Contributor License Agreement!

Click here to manually synchronize the status of this Pull Request.

See the FAQ for frequently asked questions.

pivotal-issuemaster commented 4 years ago

@bougueil Thank you for signing the Contributor License Agreement!

michaelklishin commented 4 years ago

FTR, this is covered in section 5.3.3.6 of the AMQP 1.0 Security document document.

michaelklishin commented 4 years ago

Thank you!

bougueil commented 4 years ago

thank you all !

michaelklishin commented 4 years ago

Backported to v3.8.x (and v3.7.x, just in case).

bougueil commented 4 years ago

hi @michaelklishin seems there are other issues with sasl_outcome .

frame_reader_bug_sasl_outcome.txt

michaelklishin commented 4 years ago

The exception says that the client attempted to configure an already closed socket ({error,closed}). We can be more defensive there but it's mostly log noise.

bougueil commented 4 years ago

Thank you.