Have run_cavp.go create “resp” directories as needed.

Change-Id: Icb3003d71e3d61eb98fb8835bd567e383f22affc
Reviewed-on: https://boringssl-review.googlesource.com/17004
Commit-Queue: David Benjamin <davidben@google.com>
Reviewed-by: David Benjamin <davidben@google.com>
CQ-Verified: CQ bot account: commit-bot@chromium.org <commit-bot@chromium.org>
diff --git a/fipstools/run_cavp.go b/fipstools/run_cavp.go
index 92ddc1b..e5c67c0 100644
--- a/fipstools/run_cavp.go
+++ b/fipstools/run_cavp.go
@@ -348,7 +348,11 @@
 	args = append(args, test.args...)
 	args = append(args, filepath.Join(suite.getDirectory(), "req", test.inFile+".req"))
 
-	outPath := filepath.Join(suite.getDirectory(), "resp", test.inFile+".rsp")
+	respDir := filepath.Join(suite.getDirectory(), "resp")
+	if err := os.Mkdir(respDir, 0755); err != nil && !os.IsExist(err) {
+		return fmt.Errorf("cannot create resp directory: %s", err)
+	}
+	outPath := filepath.Join(respDir, test.inFile+".rsp")
 	outFile, err := os.OpenFile(outPath, os.O_CREATE|os.O_TRUNC|os.O_WRONLY, 0644)
 	if err != nil {
 		return fmt.Errorf("cannot open output file for %q %q: %s", suite.getDirectory(), test.inFile, err)