allow for balnk passwords
have to alter validation slightly to allow for blank passwordsbug/bundler_fix
parent
fd1777a79f
commit
1a6ef8dced
|
@ -27,7 +27,7 @@ module Metasploit
|
|||
|
||||
# If we have no public we MUST have a private (e.g. SNMP Community String)
|
||||
validates :private,
|
||||
presence: true,
|
||||
exclusion: { in: [nil] },
|
||||
if: "public.nil? or paired"
|
||||
|
||||
|
||||
|
|
|
@ -52,6 +52,18 @@ describe Metasploit::Framework::LoginScanner::CredDetail do
|
|||
cred_detail.private = 'toor'
|
||||
expect(cred_detail).to_not be_valid
|
||||
end
|
||||
|
||||
it 'is invalid with empty string for public' do
|
||||
cred_detail.public = ''
|
||||
cred_detail.private = 'toor'
|
||||
expect(cred_detail).to_not be_valid
|
||||
end
|
||||
|
||||
it 'is valid with empty string for private' do
|
||||
cred_detail.public = 'root'
|
||||
cred_detail.private = ''
|
||||
expect(cred_detail).to be_valid
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue