Skip to content

Commit

Permalink
Implement cleartext auth plugin
Browse files Browse the repository at this point in the history
  • Loading branch information
composerinteralia committed Apr 12, 2024
1 parent 24cf12a commit 0095475
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion lib/nocturne/protocol/connection.rb
Original file line number Diff line number Diff line change
Expand Up @@ -72,8 +72,12 @@ def client_handshake

def auth_switch(plugin, data)
@sock.write_packet do |packet|
if plugin == "mysql_native_password"
case plugin
when "mysql_native_password"
packet.str(mysql_native_password(data)) if password?
when "mysql_clear_password"
raise "cleartext plugin not enabled" unless @options[:enable_cleartext_plugin]
packet.str(@options[:password]) if password?
else
raise "unknown auth plugin"
end
Expand Down

0 comments on commit 0095475

Please sign in to comment.