1
mirror of https://github.com/rapid7/metasploit-framework synced 2024-10-29 18:07:27 +01:00

Unify SSL cert generate interfaces

After this and rex-socket#19 the interfaces should be compatible again.
This commit is contained in:
Adam Cammack 2019-08-30 00:01:55 -05:00
parent c00ef799b4
commit 991639c493
No known key found for this signature in database
GPG Key ID: C9378BA088092D66
2 changed files with 3 additions and 3 deletions

View File

@ -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){ }

View File

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