acvptool: support non-interactive mode.

Most people won't need the interactive mode and it's use of x/crypto can
be problematic in some contexts.

Change-Id: I33e0178726ee485f3967c0b71c9d538524af9286
Reviewed-on: https://boringssl-review.googlesource.com/c/boringssl/+/40504
Commit-Queue: David Benjamin <davidben@google.com>
Reviewed-by: David Benjamin <davidben@google.com>
diff --git a/util/fipstools/acvp/acvptool/acvp.go b/util/fipstools/acvp/acvptool/acvp.go
index 40c9eba..14ed6a9 100644
--- a/util/fipstools/acvp/acvptool/acvp.go
+++ b/util/fipstools/acvp/acvptool/acvp.go
@@ -288,7 +288,11 @@
 	}
 
 	if len(*runFlag) == 0 {
-		runInteractive(server, config)
+		if interactiveModeSupported {
+			runInteractive(server, config)
+		} else {
+			log.Fatalf("no arguments given but interactive mode not supported")
+		}
 		return
 	}
 
diff --git a/util/fipstools/acvp/acvptool/interactive.go b/util/fipstools/acvp/acvptool/interactive.go
index 7ba2747..703b41b 100644
--- a/util/fipstools/acvp/acvptool/interactive.go
+++ b/util/fipstools/acvp/acvptool/interactive.go
@@ -12,6 +12,8 @@
 // OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
 // CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
 
+// +build interactive
+
 package main
 
 import (
@@ -35,6 +37,8 @@
 	"golang.org/x/crypto/ssh/terminal"
 )
 
+const interactiveModeSupported = true
+
 func updateTerminalSize(term *terminal.Terminal) {
 	width, height, err := terminal.GetSize(0)
 	if err != nil {
diff --git a/util/fipstools/acvp/acvptool/nointeractive.go b/util/fipstools/acvp/acvptool/nointeractive.go
new file mode 100644
index 0000000..06c8890
--- /dev/null
+++ b/util/fipstools/acvp/acvptool/nointeractive.go
@@ -0,0 +1,27 @@
+// Copyright (c) 2020, Google Inc.
+//
+// Permission to use, copy, modify, and/or distribute this software for any
+// purpose with or without fee is hereby granted, provided that the above
+// copyright notice and this permission notice appear in all copies.
+//
+// THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
+// WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
+// MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
+// SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+// WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION
+// OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
+// CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+
+// +build !interactive
+
+package main
+
+import (
+	"boringssl.googlesource.com/boringssl/util/fipstools/acvp/acvptool/acvp"
+)
+
+const interactiveModeSupported = false
+
+func runInteractive(*acvp.Server, Config) {
+	panic("not supported")
+}