diff --git a/util/fipstools/acvp/acvptool/acvp.go b/util/fipstools/acvp/acvptool/acvp.go index f4975327b..f477d659a 100644 --- a/util/fipstools/acvp/acvptool/acvp.go +++ b/util/fipstools/acvp/acvptool/acvp.go @@ -178,18 +178,20 @@ func trimLeadingSlash(s string) string { return s } -// looksLikeHeaderElement returns true iff element looks like it's a header, -// not a test. Some ACVP files contain a header as the first element that -// should be duplicated into the response, and some don't. If the element -// contains a "url" field then we guess that it's a header. +// looksLikeHeaderElement returns true iff element looks like it's a header, not +// a test. Some ACVP files contain a header as the first element that should be +// duplicated into the response, and some don't. If the element contains +// a "url" field, or if it's missing an "algorithm" field, then we guess that +// it's a header. func looksLikeHeaderElement(element json.RawMessage) bool { var headerFields struct { URL string `json:"url"` + Algorithm string `json:"algorithm"` } if err := json.Unmarshal(element, &headerFields); err != nil { return false } - return len(headerFields.URL) > 0 + return len(headerFields.URL) > 0 || len(headerFields.Algorithm) == 0 } // processFile reads a file containing vector sets, at least in the format diff --git a/util/fipstools/acvp/acvptool/test/expected/ACVP-AES-GCM.bz2 b/util/fipstools/acvp/acvptool/test/expected/ACVP-AES-GCM.bz2 index df90c7778..d50948dac 100644 Binary files a/util/fipstools/acvp/acvptool/test/expected/ACVP-AES-GCM.bz2 and b/util/fipstools/acvp/acvptool/test/expected/ACVP-AES-GCM.bz2 differ diff --git a/util/fipstools/acvp/acvptool/test/vectors/ACVP-AES-GCM.bz2 b/util/fipstools/acvp/acvptool/test/vectors/ACVP-AES-GCM.bz2 index 1d49d05f4..719bcc06f 100644 Binary files a/util/fipstools/acvp/acvptool/test/vectors/ACVP-AES-GCM.bz2 and b/util/fipstools/acvp/acvptool/test/vectors/ACVP-AES-GCM.bz2 differ