Also probe aggregated API ports in new ciphers test

Co-authored-by: Joshua Casey <joshuatcasey@gmail.com>
This commit is contained in:
Ryan Richard
2024-06-14 13:27:38 -07:00
co-authored by Joshua Casey
parent 75ff3efb59
commit 1f8ac0ff23
7 changed files with 221 additions and 120 deletions
+5 -2
View File
@@ -38,13 +38,16 @@ func RunNmapSSLEnum(t *testing.T, host string, port uint16) (string, string) {
var stdout, stderr bytes.Buffer
//nolint:gosec // we are not performing malicious argument injection against ourselves
cmd := exec.CommandContext(ctx, "nmap", "--script", "ssl-enum-ciphers",
cmd := exec.CommandContext(ctx,
"nmap",
"-Pn",
"--script", "+ssl-enum-ciphers",
"-p", strconv.FormatUint(uint64(port), 10),
host,
)
cmd.Stdout = &stdout
cmd.Stderr = &stderr
t.Log("Running cmd: " + strings.Join(cmd.Args, " "))
require.NoErrorf(t, cmd.Run(), "stderr:\n%s\n\nstdout:\n%s\n\n", stderr.String(), stdout.String())
return stdout.String(), stderr.String()
@@ -5,12 +5,8 @@
package testlib
import "crypto/tls"
// Because of a bug in nmap, the cipher suite preference is
// incorrectly shown as 'client' in some cases.
// in fips-only mode, it correctly shows the cipher preference
// as 'server', while in non-fips mode it shows as 'client'.
const DefaultCipherSuitePreference = "server"
const MaxTLSVersion = tls.VersionTLS12
@@ -5,12 +5,8 @@
package testlib
import "crypto/tls"
// Because of a bug in nmap, the cipher suite preference is
// incorrectly shown as 'client' in some cases.
// in fips-only mode, it correctly shows the cipher preference
// as 'server', while in non-fips mode it shows as 'client'.
const DefaultCipherSuitePreference = "client"
const MaxTLSVersion = tls.VersionTLS13