Skip to content

Commit 6eb334c

Browse files
David MaloneyDavid Maloney
authored andcommitted
a little more coverage
1 parent d909c00 commit 6eb334c

File tree

2 files changed

+17
-1
lines changed

2 files changed

+17
-1
lines changed

lib/rex/sslscan/scanner.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ def initialize(host,port = 443,context = {},timeout=5)
2323
@port = port
2424
@timeout = timeout
2525
@context = context
26-
if check_opensslv2
26+
if check_opensslv2 == true
2727
@supported_versions = [:SSLv2, :SSLv3, :TLSv1]
2828
@sslv2 = true
2929
else

spec/lib/rex/sslscan/scanner_spec.rb

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,22 @@
8585
result = subject.scan
8686
result.class.should == Rex::SSLScan::Result
8787
end
88+
89+
context "if SSLv2 is not available locally" do
90+
before(:each) do
91+
subject.stub(:check_opensslv2).and_return(false)
92+
subject.send(:initialize, 'google.com', 443)
93+
end
94+
it "should mark SSLv2 as unsupported" do
95+
subject.supported_versions.should_not include :SSLv2
96+
subject.sslv2.should == false
97+
end
98+
99+
it "should not test any SSLv2 ciphers" do
100+
res = subject.scan
101+
res.sslv2.should == []
102+
end
103+
end
88104
end
89105

90106
end

0 commit comments

Comments
 (0)