Skip to content

Commit ab322d9

Browse files
committed
Add minor review improvements for code readability and future travelers
1 parent a55aa84 commit ab322d9

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

modules/auxiliary/gather/impersonate_ssl.rb

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -181,11 +181,12 @@ def run
181181
ef.create_extension('subjectKeyIdentifier', 'hash'),
182182
]
183183

184-
# add additional SAN entries to the new cert
184+
# Add additional SAN entries to the new cert. See https://support.f5.com/csp/article/K13471
185+
# for an example of how this added SAN field is expected to look like in a certificate.
185186
if !datastore['ADD_SAN'].nil? && !datastore['ADD_SAN'].empty?
186187
sans = datastore['ADD_SAN'].to_s.split(/,/)
187188
sans.map! do |san|
188-
san = san =~ Resolv::IPv4::Regex || san =~ Resolv::IPv6::Regex ? "IP:#{san}" : "DNS:#{san}"
189+
san = (san =~ Resolv::IPv4::Regex || san =~ Resolv::IPv6::Regex) ? "IP:#{san}" : "DNS:#{san}"
189190
end
190191
new_cert.add_extension(ef.create_extension('subjectAltName', sans.join(','), false))
191192
print_status("Adding #{datastore['ADD_SAN']} to the certificate subject alternative names")

0 commit comments

Comments
 (0)