Skip to content

Commit 3c1ce50

Browse files
committed
Replaced camel case states with snail_case
1 parent 9d848c8 commit 3c1ce50

File tree

1 file changed

+13
-13
lines changed

1 file changed

+13
-13
lines changed

lib/msf/core/exploit/tincd.rb

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ def initialize(info = {})
4444
# Setting up variables and calling cipher inits with file paths from configuration
4545
#
4646
def setup_ciphers
47-
@state = :idState
47+
@state = :id_state
4848
@buffer = ''
4949
@inbuffer = ''
5050
@encryption_queue = []
@@ -73,12 +73,12 @@ def send_recv(packet_payload)
7373
begin
7474
# send the first message
7575
id
76-
# Condition to get out of the while loop: ackState to false. Unsafe? Maybe a timeout?
76+
# Condition to get out of the while loop: ack_state to false. Unsafe? Maybe a timeout?
7777
while @keep_reading_socket
7878
process_data(sock.get_once)
7979
end
8080
rescue Errno::ECONNRESET
81-
if @state == :metakeyState
81+
if @state == :metakey_state
8282
fail 'Server reset the connection. Probably rejecting '\
8383
'the private key and/or client name (e.g. client name not associated '\
8484
'with client public key on server side). '\
@@ -138,15 +138,15 @@ def process_data(data)
138138
@inbuffer += data
139139
end
140140
case @state
141-
when :idState
141+
when :id_state
142142
if line?
143143
data = read_line
144144
vprint_status("Received ID from server: [#{data[0..30]}]")
145-
@state = :metakeyState
145+
@state = :metakey_state
146146
# next expected state
147147
metakey
148148
end
149-
when :metakeyState
149+
when :metakey_state
150150
if line?
151151
data = read_line
152152
vprint_status("Received Metakey from server: [#{data[0..30]}...]")
@@ -174,10 +174,10 @@ def process_data(data)
174174
# don't forget, it *does* matter if you do a
175175
# @bf_dec_cipher.reset or not, we're in OFB mode. DON'T.
176176
vprint_status('Metakey handshake/exchange completed')
177-
@state = :challengeState
177+
@state = :challenge_state
178178
challenge
179179
end
180-
when :challengeState
180+
when :challenge_state
181181
need_len = 2 * @client_key_len + 3
182182
if @inbuffer.length >= need_len
183183
data = pop_inbuffer_and_decrypt(need_len)
@@ -188,25 +188,25 @@ def process_data(data)
188188
challenge2 = data[1][0...2 * @client_key_len]
189189
challenge2 = [challenge2].pack('H*')
190190
fail "Error in protocol. challenge2 length should be #{@client_key_len}." unless challenge2.length == @client_key_len
191-
@state = :challengeReplyState
191+
@state = :challenge_reply_state
192192
challenge_reply(challenge2)
193193
end
194-
when :challengeReplyState
194+
when :challenge_reply_state
195195
need_len = 43
196196
if @inbuffer.length >= need_len
197197
data = pop_inbuffer_and_decrypt(need_len)
198198
vprint_status("Received challenge reply from server:"\
199199
" [#{data.unpack('H*')[0][0..30]}...]")
200-
@state = :ackState
200+
@state = :ack_state
201201
ack
202202
end
203-
when :ackState
203+
when :ack_state
204204
need_len = 12
205205
if @inbuffer.length >= need_len
206206
data = pop_inbuffer_and_decrypt(need_len)
207207
vprint_status("Received ack (server accepted challenge response):"\
208208
"[#{data.unpack('H*')[0][0..30]}...]")
209-
@state = :doneState
209+
@state = :done_state
210210
send_packet
211211
end
212212
end

0 commit comments

Comments
 (0)