Skip to content

Commit c41bfa9

Browse files
committed
Whitespace
1 parent 06443ea commit c41bfa9

File tree

2 files changed

+42
-42
lines changed

2 files changed

+42
-42
lines changed

lib/rex/sslscan/result.rb

Lines changed: 33 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -52,15 +52,15 @@ def strong_ciphers
5252
# @raise [ArgumentError] if the version supplied is invalid
5353
# @return [Array] An array of accepted cipher details matching the supplied versions
5454
def accepted(version = :all)
55-
enum_ciphers(:accepted, version)
55+
enum_ciphers(:accepted, version)
5656
end
5757

5858
# Returns all rejected ciphers matching the supplied version
5959
# @param version [Symbol, Array] The SSL Version to filter on
6060
# @raise [ArgumentError] if the version supplied is invalid
6161
# @return [Array] An array of rejected cipher details matching the supplied versions
6262
def rejected(version = :all)
63-
enum_ciphers(:rejected, version)
63+
enum_ciphers(:rejected, version)
6464
end
6565

6666
def each_accepted(version = :all)
@@ -160,41 +160,41 @@ def to_s
160160
table.rows.sort_by!{|row| [row[0],row[2],row[3]]}
161161
text = "#{table.to_s}"
162162
if @cert
163-
text <<" \n\n #{@cert.to_text}"
163+
text << " \n\n #{@cert.to_text}"
164164
end
165165
if openssl_sslv2 == false
166166
text << "\n\n *** WARNING: Your OS hates freedom! Your OpenSSL libs are compiled without SSLv2 support!"
167167
end
168168
text
169-
end
170-
171-
protected
172-
173-
# @param [Symbol] state Either :accepted or :rejected
174-
# @param [Symbol, Array] version The SSL Version to filter on (:SSLv2:SSLv3,:TLSv1, :all)
175-
# @return [Set] The Set of cipher results matching the filter criteria
176-
def enum_ciphers(state, version = :all)
177-
case version
178-
when Symbol
179-
case version
180-
when :all
181-
return @ciphers.select{|cipher| cipher[:status] == state}
182-
when :SSLv2, :SSLv3, :TLSv1
183-
return @ciphers.select{|cipher| cipher[:status] == state and cipher[:version] == version}
184-
else
185-
raise ArgumentError, "Invalid SSL Version Supplied: #{version}"
186-
end
187-
when Array
188-
version = version.reject{|v| !(@supported_versions.include? v)}
189-
if version.empty?
190-
return @ciphers.select{|cipher| cipher[:status] == state}
191-
else
192-
return @ciphers.select{|cipher| cipher[:status] == state and version.include? cipher[:version]}
193-
end
194-
else
195-
raise ArgumentError, "Was expecting Symbol or Array and got #{version.class}"
196-
end
197-
end
169+
end
170+
171+
protected
198172

173+
# @param [Symbol] state Either :accepted or :rejected
174+
# @param [Symbol, Array] version The SSL Version to filter on (:SSLv2:SSLv3,:TLSv1, :all)
175+
# @return [Set] The Set of cipher results matching the filter criteria
176+
def enum_ciphers(state, version = :all)
177+
case version
178+
when Symbol
179+
case version
180+
when :all
181+
return @ciphers.select{|cipher| cipher[:status] == state}
182+
when :SSLv2, :SSLv3, :TLSv1
183+
return @ciphers.select{|cipher| cipher[:status] == state and cipher[:version] == version}
184+
else
185+
raise ArgumentError, "Invalid SSL Version Supplied: #{version}"
186+
end
187+
when Array
188+
version = version.reject{|v| !(@supported_versions.include? v)}
189+
if version.empty?
190+
return @ciphers.select{|cipher| cipher[:status] == state}
191+
else
192+
return @ciphers.select{|cipher| cipher[:status] == state and version.include? cipher[:version]}
193+
end
194+
else
195+
raise ArgumentError, "Was expecting Symbol or Array and got #{version.class}"
196+
end
197+
end
198+
199+
end
199200
end
200-
end

lib/rex/sslscan/scanner.rb

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ class Scanner
99
attr_accessor :host
1010
attr_accessor :port
1111
attr_accessor :timeout
12-
12+
1313
attr_reader :supported_versions
1414
attr_reader :sslv2
1515

@@ -81,7 +81,7 @@ def test_ssl
8181
'SSLVersion' => :SSLv23,
8282
'Timeout' => @timeout
8383
)
84-
rescue ::Exception => e
84+
rescue ::Exception => e
8585
return :rejected
8686
ensure
8787
if scan_client
@@ -101,7 +101,7 @@ def test_tls
101101
'SSLVersion' => :TLSv1,
102102
'Timeout' => @timeout
103103
)
104-
rescue ::Exception => e
104+
rescue ::Exception => e
105105
return :rejected
106106
ensure
107107
if scan_client
@@ -127,14 +127,14 @@ def test_cipher(ssl_version, cipher)
127127
'SSLCipher' => cipher,
128128
'Timeout' => @timeout
129129
)
130-
rescue ::Exception => e
130+
rescue ::Exception => e
131131
return :rejected
132132
ensure
133133
if scan_client
134134
scan_client.close
135135
end
136136
end
137-
137+
138138
return :accepted
139139
end
140140

@@ -160,7 +160,7 @@ def get_cert(ssl_version, cipher)
160160
else
161161
return nil
162162
end
163-
rescue ::Exception => e
163+
rescue ::Exception => e
164164
return nil
165165
ensure
166166
if scan_client
@@ -172,7 +172,7 @@ def get_cert(ssl_version, cipher)
172172

173173
protected
174174

175-
# Validates that the SSL Version and Cipher are valid both seperately and
175+
# Validates that the SSL Version and Cipher are valid both seperately and
176176
# together as part of an SSL Context.
177177
# @param ssl_version [Symbol] The SSL version to use (:SSLv2, :SSLv3, :TLSv1)
178178
# @param cipher [String] The SSL Cipher to use
@@ -193,7 +193,7 @@ def validate_params(ssl_version, cipher)
193193
end
194194

195195
def check_opensslv2
196-
begin
196+
begin
197197
OpenSSL::SSL::SSLContext.new(:SSLv2)
198198
rescue
199199
return false
@@ -202,4 +202,4 @@ def check_opensslv2
202202
end
203203

204204
end
205-
end
205+
end

0 commit comments

Comments
 (0)