revert: keep original API class names in message.rb

This commit is contained in:
vatsalgargg
2026-03-23 19:03:06 +05:30
parent 37f9ae4f0b
commit 5af9d70df4
2 changed files with 15 additions and 15 deletions
+5 -5
View File
@@ -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
+10 -10
View File
@@ -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