Skip to content

Commit 8b6b2fb

Browse files
David MaloneyDavid Maloney
authored andcommitted
bad error handling fixed
1 parent dc7c02e commit 8b6b2fb

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

lib/rex/sslscan/scanner.rb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -183,12 +183,12 @@ def validate_params(ssl_version, cipher)
183183
unless @supported_versions.include? ssl_version
184184
raise StandardError, "SSL Version must be one of: #{@supported_versions.to_s}"
185185
end
186-
begin
186+
if ssl_version == :SSLv2 and sslv2 == false
187+
raise StandardError, "Your OS hates freedom! Your OpenSSL libs are compiled without SSLv2 support!"
188+
else
187189
unless OpenSSL::SSL::SSLContext.new(ssl_version).ciphers.flatten.include? cipher
188190
raise StandardError, "Must be a valid SSL Cipher for #{version}!"
189191
end
190-
rescue
191-
raise StandardError, "Your OS hates freedom! Your OpenSSL libs are compiled without SSLv2 support!"
192192
end
193193
end
194194

0 commit comments

Comments
 (0)