allow for balnk passwords

have to alter validation slightly
to allow for blank passwords
bug/bundler_fix
David Maloney 2014-04-21 18:57:28 -05:00
parent fd1777a79f
commit 1a6ef8dced
No known key found for this signature in database
GPG Key ID: DEDBA9DC3A913DB2
2 changed files with 13 additions and 1 deletions

View File

@ -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"

View File

@ -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