Sha256: 4c11054a1d3946d1841bc5b523e85d50fbe2fb098a1a74be916abe7f5df425f2

Contents?: true

Size: 821 Bytes

Versions: 67

Compression:

Stored size: 821 Bytes

Contents

FactoryGirl.define do
  factory :metasploit_credential_ssh_key,
          class: Metasploit::Credential::SSHKey do
    ignore do
      key_type { generate :metasploit_credential_ssh_key_key_type }
      # key size tuned for speed.  DO NOT use for production, it is below current recommended key size of 2048
      key_size { 512 }
    end

    data {
      key_class = OpenSSL::PKey.const_get(key_type)
      key_class.generate(key_size).to_s
    }

    factory :metasploit_credential_dsa_key do
      ignore do
        key_type :DSA
      end
    end

    factory :metasploit_credential_rsa_key do
      ignore do
        key_type :RSA
      end
    end
  end

  metasploit_credential_ssh_key_key_types = [:DSA, :RSA]
  sequence :metasploit_credential_ssh_key_key_type, metasploit_credential_ssh_key_key_types.cycle
end

Version data entries

67 entries across 67 versions & 1 rubygems

Version Path
metasploit-credential-0.13.5 spec/factories/metasploit/credential/ssh_keys.rb
metasploit-credential-0.13.3 spec/factories/metasploit/credential/ssh_keys.rb
metasploit-credential-0.13.2 spec/factories/metasploit/credential/ssh_keys.rb
metasploit-credential-0.13.1 spec/factories/metasploit/credential/ssh_keys.rb
metasploit-credential-0.13.0 spec/factories/metasploit/credential/ssh_keys.rb
metasploit-credential-0.12.0 spec/factories/metasploit/credential/ssh_keys.rb
metasploit-credential-0.10.2 spec/factories/metasploit/credential/ssh_keys.rb
metasploit-credential-0.10.1 spec/factories/metasploit/credential/ssh_keys.rb
metasploit-credential-0.10.1-java spec/factories/metasploit/credential/ssh_keys.rb
metasploit-credential-0.10.1.pre.dep.pre.railties spec/factories/metasploit/credential/ssh_keys.rb
metasploit-credential-0.10.0.pre.dep.pre.railties spec/factories/metasploit/credential/ssh_keys.rb
metasploit-credential-0.9.1 spec/factories/metasploit/credential/ssh_keys.rb
metasploit-credential-0.9.0 spec/factories/metasploit/credential/ssh_keys.rb
metasploit-credential-0.9.0-java spec/factories/metasploit/credential/ssh_keys.rb
metasploit-credential-0.8.9 spec/factories/metasploit/credential/ssh_keys.rb
metasploit-credential-0.8.8 spec/factories/metasploit/credential/ssh_keys.rb
metasploit-credential-0.8.7-java spec/factories/metasploit/credential/ssh_keys.rb
metasploit-credential-0.8.7 spec/factories/metasploit/credential/ssh_keys.rb
metasploit-credential-0.8.6 spec/factories/metasploit/credential/ssh_keys.rb
metasploit-credential-0.8.6.pre.realm.pre.uniqueness spec/factories/metasploit/credential/ssh_keys.rb