forked from OpenSCAP/openscap
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Raise an error when using unsupported hash types
The OVAL content can have a hash algorithm in `hash_type` element that is allowed by the OVAL specification but isn't currently supported in OpenSCAP. At this moment, this can happen if OpenSCAP is compiled without SHA-1 or MD5 support by setting OPENSCAP_ENABLE_SHA1 or OPENSCAP_ENABLE_MD5 to OFF. In this situation we should warn the user, for example show a warning and add a message element to the OVAL results. To do that, we need to be able to iterate over all hash types specified in the OVAL specification, not only over the supported ones, because we need to distinguish between a no match, a match of supported algorithm and a match of an unsupported algorithm. Therefore we need to list them explicitly. The CRAPI_INVALID value has been replaced by 0 because it used to be a -1 but a negative value can't be compared with an enum. That would cause a compiler warning.
- Loading branch information
Showing
1 changed file
with
69 additions
and
40 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters