mirror of
https://github.com/rapid7/metasploit-framework
synced 2024-08-28 23:26:18 +02:00
Unify SSL cert generate interfaces
After this and rex-socket#19 the interfaces should be compatible again.
This commit is contained in:
parent
c00ef799b4
commit
991639c493
@ -45,11 +45,11 @@ module Ssl
|
||||
# identification by NIDS and the like.
|
||||
#
|
||||
# @return [String, String, Array]
|
||||
def self.ssl_generate_certificate(opts = {}, ksize = 2048)
|
||||
def self.ssl_generate_certificate(cert_vars: {}, ksize: 2048, **opts)
|
||||
yr = 24*3600*365
|
||||
vf = opts[:not_before] || Time.at(Time.now.to_i - rand(yr * 3) - yr)
|
||||
vt = opts[:not_after] || Time.at(vf.to_i + (rand(9)+1) * yr)
|
||||
cvars = opts[:cert_vars] || self.rand_vars
|
||||
cvars = self.rand_vars(cert_vars)
|
||||
subject = opts[:subject] || ssl_generate_subject(cvars)
|
||||
ctype = opts[:cert_type] || opts[:ca_cert].nil? ? :ca : :server
|
||||
key = opts[:key] || OpenSSL::PKey::RSA.new(ksize){ }
|
||||
|
@ -167,7 +167,7 @@ Gem::Specification.new do |spec|
|
||||
# Library for parsing and manipulating executable binaries
|
||||
spec.add_runtime_dependency 'rex-bin_tools'
|
||||
# Rex Socket Abstraction Layer
|
||||
spec.add_runtime_dependency 'rex-socket', '0.1.17'
|
||||
spec.add_runtime_dependency 'rex-socket'
|
||||
# Library for scanning a server's SSL/TLS capabilities
|
||||
spec.add_runtime_dependency 'rex-sslscan'
|
||||
# Library and tool for finding ROP gadgets in a supplied binary
|
||||
|
Loading…
Reference in New Issue
Block a user