From 5af9d70df48e2335676effa9f23ec41fc56c84a1 Mon Sep 17 00:00:00 2001 From: vatsalgargg Date: Mon, 23 Mar 2026 19:03:06 +0530 Subject: [PATCH] revert: keep original API class names in message.rb --- lib/postgres/postgres-pr/connection.rb | 10 +++++----- lib/postgres/postgres-pr/message.rb | 20 ++++++++++---------- 2 files changed, 15 insertions(+), 15 deletions(-) diff --git a/lib/postgres/postgres-pr/connection.rb b/lib/postgres/postgres-pr/connection.rb index 72a280ae4e..8e230fe54d 100644 --- a/lib/postgres/postgres-pr/connection.rb +++ b/lib/postgres/postgres-pr/connection.rb @@ -72,15 +72,15 @@ class Connection msg = Message.read(@conn) case msg - when AuthenticationClearTextPassword + when AuthentificationClearTextPassword raise ArgumentError, "no password specified" if password.nil? raise AuthenticationMethodMismatch, "Server expected clear text password auth" if md5_hash_match write_message(PasswordMessage.new(password)) - when AuthenticationCryptPassword + when AuthentificationCryptPassword raise ArgumentError, "no password specified" if password.nil? raise AuthenticationMethodMismatch, "Server expected crypt password auth" if md5_hash_match write_message(PasswordMessage.new(password.crypt(msg.salt))) - when AuthenticationMD5Password + when AuthentificationMD5Password raise ArgumentError, "no password specified" if password.nil? require 'digest/md5' @@ -99,10 +99,10 @@ class Connection when UnknownAuthType raise "unknown auth type '#{msg.auth_type}' with buffer content:\n#{Rex::Text.to_hex_dump(msg.buffer.content)}" - when AuthenticationKerberosV4, AuthenticationKerberosV5, AuthenticationSCMCredential + when AuthentificationKerberosV4, AuthentificationKerberosV5, AuthentificationSCMCredential raise "unsupported authentication" - when AuthenticationOk + when AuthentificationOk when ErrorResponse handle_server_error_message(msg) when NoticeResponse diff --git a/lib/postgres/postgres-pr/message.rb b/lib/postgres/postgres-pr/message.rb index fefd17ac9c..2607b0a992 100644 --- a/lib/postgres/postgres-pr/message.rb +++ b/lib/postgres/postgres-pr/message.rb @@ -166,23 +166,23 @@ class UnknownAuthType < Authentication end end -class AuthenticationOk < Authentication +class AuthentificationOk < Authentication register_auth_type 0 end -class AuthenticationKerberosV4 < Authentication +class AuthentificationKerberosV4 < Authentication register_auth_type 1 end -class AuthenticationKerberosV5 < Authentication +class AuthentificationKerberosV5 < Authentication register_auth_type 2 end -class AuthenticationClearTextPassword < Authentication +class AuthentificationClearTextPassword < Authentication register_auth_type 3 end -module SaltedAuthenticationMixin +module SaltedAuthentificationMixin attr_accessor :salt def initialize(salt) @@ -205,20 +205,20 @@ module SaltedAuthenticationMixin end end -class AuthenticationCryptPassword < Authentication +class AuthentificationCryptPassword < Authentication register_auth_type 4 - include SaltedAuthenticationMixin + include SaltedAuthentificationMixin def salt_size; 2 end end -class AuthenticationMD5Password < Authentication +class AuthentificationMD5Password < Authentication register_auth_type 5 - include SaltedAuthenticationMixin + include SaltedAuthentificationMixin def salt_size; 4 end end -class AuthenticationSCMCredential < Authentication +class AuthentificationSCMCredential < Authentication register_auth_type 6 end