Blame SOURCES/openscap-1.3.6-disable-sha1-md5-pr-1781.patch

02a573
From d687e50c61d3a06b99999942555803842f7c4526 Mon Sep 17 00:00:00 2001
02a573
From: =?UTF-8?q?Jan=20=C4=8Cern=C3=BD?= <jcerny@redhat.com>
02a573
Date: Thu, 15 Jul 2021 09:39:45 +0200
02a573
Subject: [PATCH 1/5] Allow disablement of SHA-1 and MD5
02a573
02a573
This patch adds 2 new CMake options `OPENSCAP_ENABLE_SHA1` and
02a573
`OPENSCAP_ENABLE_MD5`.  By setting these CMake options to `OFF` we can
02a573
disable SHA-1 and MD5 hashing algorithm in OpenSCAP. If they are set to
02a573
`OFF`, the code using SHA-1 and MD5 won't be built.  Linux distributions
02a573
that wish to disable SHA-1 and MD5 can use these CMake options in their
02a573
spec files from now on.
02a573
02a573
Conditional compilation using C preprocessor macros is used to achieve
02a573
it.  The approach with conditional compilation has been preferred over
02a573
the hard removal of the code because future versions of OpenSCAP can get
02a573
into currently stable Linux distributions where a removal would have to
02a573
be reverted by a downstream patch to avoid feature regression.
02a573
02a573
The consequence of disabling MD5 and SHA-1 is that filehash probe will
02a573
not be built but filehash_test is a deprecated OVAL test.  Second
02a573
consequence is that people won't be able to use SHA-1 and MD5 in their
02a573
filehash58_test. That means people will have to rewrite their SCAP
02a573
content to use SHA-256 or SHA-512 in their filehash58_objects.
02a573
02a573
Resolves: rhbz#1936619
02a573
---
02a573
 CMakeLists.txt                                |   7 +-
02a573
 config.h.in                                   |   3 +
02a573
 src/OVAL/probes/crapi/digest.c                |   8 ++
02a573
 src/OVAL/probes/crapi/digest.h                |   4 +
02a573
 src/OVAL/probes/crapi/md5.c                   |   4 +
02a573
 src/OVAL/probes/crapi/md5.h                   |   4 +
02a573
 src/OVAL/probes/crapi/sha1.c                  |   4 +
02a573
 src/OVAL/probes/crapi/sha1.h                  |   4 +
02a573
 .../probes/independent/filehash58_probe.c     |   8 ++
02a573
 tests/API/crypt/test_api_crypt.sh             |  34 ++++--
02a573
 tests/API/crypt/test_crapi_digest.c           | 101 +++++++-----------
02a573
 tests/API/crypt/test_crapi_mdigest.c          |  11 ++
02a573
 tests/probes/filehash/CMakeLists.txt          |   2 +-
02a573
 .../filehash58/check_filehash_simple.xml      |   6 +-
02a573
 .../filehash58/test_probes_filehash58.sh      |   4 +-
02a573
 tests/test_common.sh.in                       |   3 +
02a573
 16 files changed, 130 insertions(+), 77 deletions(-)
02a573
02a573
diff --git a/CMakeLists.txt b/CMakeLists.txt
02a573
index cc7b5e0059..9a15d591cf 100644
02a573
--- a/CMakeLists.txt
02a573
+++ b/CMakeLists.txt
02a573
@@ -251,11 +251,14 @@ if (WIN32)
02a573
 endif()
02a573
 cmake_dependent_option(ENABLE_PROBES_WINDOWS "build OVAL probes for the Windows OVAL tests" ${IS_WIN32} "ENABLE_PROBES" OFF)
02a573
 
02a573
+option(OPENSCAP_ENABLE_SHA1 "Enable using the SHA-1 algorithm" ON)
02a573
+option(OPENSCAP_ENABLE_MD5 "Enable using the MD5 algorithm" ON)
02a573
+
02a573
 # INDEPENDENT PROBES
02a573
 cmake_dependent_option(OPENSCAP_PROBE_INDEPENDENT_ENVIRONMENTVARIABLE "Independent environmentvariable probe" ON "ENABLE_PROBES_INDEPENDENT; NOT WIN32" OFF)
02a573
 cmake_dependent_option(OPENSCAP_PROBE_INDEPENDENT_ENVIRONMENTVARIABLE58 "Independent environmentvariable58 probe" ON "ENABLE_PROBES_INDEPENDENT; NOT WIN32" OFF)
02a573
 cmake_dependent_option(OPENSCAP_PROBE_INDEPENDENT_FAMILY "Independent family probe" ON "ENABLE_PROBES_INDEPENDENT" OFF)
02a573
-cmake_dependent_option(OPENSCAP_PROBE_INDEPENDENT_FILEHASH "Independent filehash probe" ON "ENABLE_PROBES_INDEPENDENT; CRYPTO_FOUND; NOT WIN32" OFF)
02a573
+cmake_dependent_option(OPENSCAP_PROBE_INDEPENDENT_FILEHASH "Independent filehash probe" ON "ENABLE_PROBES_INDEPENDENT; CRYPTO_FOUND; OPENSCAP_ENABLE_SHA1; OPENSCAP_ENABLE_MD5; NOT WIN32" OFF)
02a573
 cmake_dependent_option(OPENSCAP_PROBE_INDEPENDENT_FILEHASH58 "Independent filehash58 probe" ON "ENABLE_PROBES_INDEPENDENT; CRYPTO_FOUND; NOT WIN32" OFF)
02a573
 cmake_dependent_option(OPENSCAP_PROBE_INDEPENDENT_SQL "Independent sql probe" ON "ENABLE_PROBES_INDEPENDENT; OPENDBX_FOUND; NOT WIN32" OFF)
02a573
 cmake_dependent_option(OPENSCAP_PROBE_INDEPENDENT_SQL57 "Independent sql57 probe" ON "ENABLE_PROBES_INDEPENDENT; OPENDBX_FOUND; NOT WIN32" OFF)
02a573
@@ -371,6 +374,8 @@ message(STATUS " ")
02a573
 message(STATUS "OVAL:")
02a573
 message(STATUS "base probe support: ${ENABLE_PROBES}")
02a573
 message(STATUS "SEAP msgid bit-size: ${SEAP_MSGID_BITS}")
02a573
+message(STATUS "SHA-1: ${OPENSCAP_ENABLE_SHA1}")
02a573
+message(STATUS "MD5: ${OPENSCAP_ENABLE_MD5}")
02a573
 
02a573
 message(STATUS "")
02a573
 message(STATUS "Independent probes: ${ENABLE_PROBES_INDEPENDENT}")
02a573
diff --git a/config.h.in b/config.h.in
02a573
index 7fdbb0a752..1b72855822 100644
02a573
--- a/config.h.in
02a573
+++ b/config.h.in
02a573
@@ -133,6 +133,9 @@
02a573
 #cmakedefine PYTHON2_PATH "@PYTHON2_PATH@"
02a573
 #cmakedefine PYTHON3_PATH "@PYTHON3_PATH@"
02a573
 
02a573
+#cmakedefine OPENSCAP_ENABLE_SHA1
02a573
+#cmakedefine OPENSCAP_ENABLE_MD5
02a573
+
02a573
 #include "oscap_platforms.h"
02a573
 #include "compat.h"
02a573
 
02a573
diff --git a/src/OVAL/probes/crapi/digest.c b/src/OVAL/probes/crapi/digest.c
02a573
index c76963f8c4..fdd361813e 100644
02a573
--- a/src/OVAL/probes/crapi/digest.c
02a573
+++ b/src/OVAL/probes/crapi/digest.c
02a573
@@ -51,10 +51,14 @@ int crapi_digest_fd (int fd, crapi_alg_t alg, void *dst, size_t *size)
02a573
 	}
02a573
 
02a573
         switch (alg) {
02a573
+#ifdef OPENSCAP_ENABLE_MD5
02a573
         case CRAPI_DIGEST_MD5:
02a573
                 return crapi_md5_fd (fd, dst, size);
02a573
+#endif
02a573
+#ifdef OPENSCAP_ENABLE_SHA1
02a573
         case CRAPI_DIGEST_SHA1:
02a573
                 return crapi_sha1_fd (fd, dst, size);
02a573
+#endif
02a573
         case CRAPI_DIGEST_SHA224:
02a573
                 return crapi_sha224_fd (fd, dst, size);
02a573
         case CRAPI_DIGEST_SHA256:
02a573
@@ -100,18 +104,22 @@ int crapi_mdigest_fd (int fd, int num, ... /* crapi_alg_t alg, void *dst, size_t
02a573
                 size = va_arg (ap, size_t *);
02a573
 
02a573
                 switch (alg) {
02a573
+#ifdef OPENSCAP_ENABLE_MD5
02a573
                 case CRAPI_DIGEST_MD5:
02a573
                         ctbl[i].init   = &crapi_md5_init;
02a573
                         ctbl[i].update = &crapi_md5_update;
02a573
                         ctbl[i].fini   = &crapi_md5_fini;
02a573
                         ctbl[i].free   = &crapi_md5_free;
02a573
                         break;
02a573
+#endif
02a573
+#ifdef OPENSCAP_ENABLE_SHA1
02a573
                 case CRAPI_DIGEST_SHA1:
02a573
                         ctbl[i].init   = &crapi_sha1_init;
02a573
                         ctbl[i].update = &crapi_sha1_update;
02a573
                         ctbl[i].fini   = &crapi_sha1_fini;
02a573
                         ctbl[i].free   = &crapi_sha1_free;
02a573
                         break;
02a573
+#endif
02a573
                 case CRAPI_DIGEST_SHA224:
02a573
                         ctbl[i].init   = &crapi_sha224_init;
02a573
                         ctbl[i].update = &crapi_sha224_update;
02a573
diff --git a/src/OVAL/probes/crapi/digest.h b/src/OVAL/probes/crapi/digest.h
02a573
index 1ffd4ebb9d..3de55e4f94 100644
02a573
--- a/src/OVAL/probes/crapi/digest.h
02a573
+++ b/src/OVAL/probes/crapi/digest.h
02a573
@@ -27,8 +27,12 @@
02a573
 #include <stddef.h>
02a573
 
02a573
 typedef enum {
02a573
+#ifdef OPENSCAP_ENABLE_MD5
02a573
         CRAPI_DIGEST_MD5    = 0x01,
02a573
+#endif
02a573
+#ifdef OPENSCAP_ENABLE_SHA1
02a573
         CRAPI_DIGEST_SHA1   = 0x02,
02a573
+#endif
02a573
         CRAPI_DIGEST_SHA256 = 0x04,
02a573
         CRAPI_DIGEST_SHA512 = 0x08,
02a573
         CRAPI_DIGEST_RMD160 = 0x10,
02a573
diff --git a/src/OVAL/probes/crapi/md5.c b/src/OVAL/probes/crapi/md5.c
02a573
index 688165e3b2..8fc32af027 100644
02a573
--- a/src/OVAL/probes/crapi/md5.c
02a573
+++ b/src/OVAL/probes/crapi/md5.c
02a573
@@ -33,6 +33,8 @@
02a573
 #include "crapi.h"
02a573
 #include "md5.h"
02a573
 
02a573
+#ifdef OPENSCAP_ENABLE_MD5
02a573
+
02a573
 #if defined(HAVE_NSS3)
02a573
 #include <sechash.h>
02a573
 
02a573
@@ -230,3 +232,5 @@ int crapi_md5_fd (int fd, void *dst, size_t *size)
02a573
         }
02a573
         return (0);
02a573
 }
02a573
+
02a573
+#endif /* OPENSCAP_ENABLE_MD5 */
02a573
diff --git a/src/OVAL/probes/crapi/md5.h b/src/OVAL/probes/crapi/md5.h
02a573
index 6adf14a87b..15e82bb671 100644
02a573
--- a/src/OVAL/probes/crapi/md5.h
02a573
+++ b/src/OVAL/probes/crapi/md5.h
02a573
@@ -25,6 +25,8 @@
02a573
 
02a573
 #include <stddef.h>
02a573
 
02a573
+#ifdef OPENSCAP_ENABLE_MD5
02a573
+
02a573
 void *crapi_md5_init (void *dst, void *size);
02a573
 int   crapi_md5_update (void *ctxp, void *bptr, size_t blen);
02a573
 int   crapi_md5_fini (void *ctxp);
02a573
@@ -32,4 +34,6 @@ void  crapi_md5_free (void *ctxp);
02a573
 
02a573
 int crapi_md5_fd (int fd, void *dst, size_t *size);
02a573
 
02a573
+#endif /* OPENSCAP_ENABLE_MD5 */
02a573
+
02a573
 #endif /* CRAPI_MD5_H */
02a573
diff --git a/src/OVAL/probes/crapi/sha1.c b/src/OVAL/probes/crapi/sha1.c
02a573
index aee7916510..9a757d0274 100644
02a573
--- a/src/OVAL/probes/crapi/sha1.c
02a573
+++ b/src/OVAL/probes/crapi/sha1.c
02a573
@@ -33,6 +33,8 @@
02a573
 #include "crapi.h"
02a573
 #include "sha1.h"
02a573
 
02a573
+#ifdef OPENSCAP_ENABLE_SHA1
02a573
+
02a573
 #if defined(HAVE_NSS3)
02a573
 #include <sechash.h>
02a573
 
02a573
@@ -226,3 +228,5 @@ int crapi_sha1_fd (int fd, void *dst, size_t *size)
02a573
         
02a573
         return (0);
02a573
 }
02a573
+
02a573
+#endif /* OPENSCAP_ENABLE_SHA1 */
02a573
diff --git a/src/OVAL/probes/crapi/sha1.h b/src/OVAL/probes/crapi/sha1.h
02a573
index 5c31c7ce92..282046c6a9 100644
02a573
--- a/src/OVAL/probes/crapi/sha1.h
02a573
+++ b/src/OVAL/probes/crapi/sha1.h
02a573
@@ -25,6 +25,8 @@
02a573
 
02a573
 #include <stddef.h>
02a573
 
02a573
+#ifdef OPENSCAP_ENABLE_SHA1
02a573
+
02a573
 void *crapi_sha1_init (void *dst, void *size);
02a573
 int   crapi_sha1_update (void *ctxp, void *bptr, size_t blen);
02a573
 int   crapi_sha1_fini (void *ctxp);
02a573
@@ -32,4 +34,6 @@ void  crapi_sha1_free (void *ctxp);
02a573
 
02a573
 int crapi_sha1_fd (int fd, void *dst, size_t *size);
02a573
 
02a573
+#endif /* OPENSCAP_ENABLE_SHA1 */
02a573
+
02a573
 #endif /* CRAPI_SHA1_H */
02a573
diff --git a/src/OVAL/probes/independent/filehash58_probe.c b/src/OVAL/probes/independent/filehash58_probe.c
02a573
index ff1e065746..895d8f92f4 100644
02a573
--- a/src/OVAL/probes/independent/filehash58_probe.c
02a573
+++ b/src/OVAL/probes/independent/filehash58_probe.c
02a573
@@ -60,8 +60,12 @@
02a573
 #define CRAPI_INVALID -1
02a573
 
02a573
 static const struct oscap_string_map CRAPI_ALG_MAP[] = {
02a573
+#ifdef OPENSCAP_ENABLE_MD5
02a573
 	{CRAPI_DIGEST_MD5, "MD5"},
02a573
+#endif
02a573
+#ifdef OPENSCAP_ENABLE_SHA1
02a573
 	{CRAPI_DIGEST_SHA1, "SHA-1"},
02a573
+#endif
02a573
 	{CRAPI_DIGEST_SHA224, "SHA-224"},
02a573
 	{CRAPI_DIGEST_SHA256, "SHA-256"},
02a573
 	{CRAPI_DIGEST_SHA384, "SHA-384"},
02a573
@@ -71,8 +75,12 @@ static const struct oscap_string_map CRAPI_ALG_MAP[] = {
02a573
 };
02a573
 
02a573
 static const struct oscap_string_map CRAPI_ALG_MAP_SIZE[] = {
02a573
+#ifdef OPENSCAP_ENABLE_MD5
02a573
 	{16, "MD5"},
02a573
+#endif
02a573
+#ifdef OPENSCAP_ENABLE_SHA1
02a573
 	{20, "SHA-1"},
02a573
+#endif
02a573
 	{28, "SHA-224"},
02a573
 	{32, "SHA-256"},
02a573
 	{48, "SHA-384"},
02a573
diff --git a/tests/API/crypt/test_api_crypt.sh b/tests/API/crypt/test_api_crypt.sh
02a573
index e5e9d361f0..937f7eaf91 100755
02a573
--- a/tests/API/crypt/test_api_crypt.sh
02a573
+++ b/tests/API/crypt/test_api_crypt.sh
02a573
@@ -21,9 +21,8 @@ function test_crapi_digest {
02a573
     local TEMPDIR="$(make_temp_dir /tmp tmp)"
02a573
 
02a573
     local ret_val=0;
02a573
-    local sum_md5="";
02a573
-    local sum_sha1="";
02a573
-    local sum_sha256="";
02a573
+    local sum=""
02a573
+    local algo="$1"
02a573
 
02a573
     dd if=/dev/urandom of="${TEMPDIR}/a" count=1   bs=1k || return 2
02a573
     dd if=/dev/urandom of="${TEMPDIR}/b" count=123 bs=1  || return 2
02a573
@@ -33,16 +32,21 @@ function test_crapi_digest {
02a573
     dd if=/dev/urandom of="${TEMPDIR}/f" count=312 bs=1  || return 2
02a573
     
02a573
     for file in a b c d e f; do
02a573
-        sum_md5=$((md5sum "${TEMPDIR}/${file}" || openssl md5 "${TEMPDIR}/${file}") | sed -n 's|^.*\([0-9a-f]\{32\}\).*$|\1|p')
02a573
-        sum_sha1=$((sha1sum "${TEMPDIR}/${file}" || openssl sha1 "${TEMPDIR}/${file}") | sed -n 's|^.*\([0-9a-f]\{40\}\).*$|\1|p')
02a573
-        sum_sha256=$((sha256sum "${TEMPDIR}/${file}" || openssl sha256 "${TEMPDIR}/${file}") | sed -n 's|^.*\([0-9a-f]\{64\}\).*$|\1|p')
02a573
+        if [[ "$algo" == "md5" ]] ; then
02a573
+            sum=$((md5sum "${TEMPDIR}/${file}" || openssl md5 "${TEMPDIR}/${file}") | sed -n 's|^.*\([0-9a-f]\{32\}\).*$|\1|p')
02a573
+        elif [[ "$algo" == "sha1" ]] ; then
02a573
+            sum=$((sha1sum "${TEMPDIR}/${file}" || openssl sha1 "${TEMPDIR}/${file}") | sed -n 's|^.*\([0-9a-f]\{40\}\).*$|\1|p')
02a573
+        elif [[ "$algo" == "sha256" ]] ; then
02a573
+            sum=$((sha256sum "${TEMPDIR}/${file}" || openssl sha256 "${TEMPDIR}/${file}") | sed -n 's|^.*\([0-9a-f]\{64\}\).*$|\1|p')
02a573
+        else
02a573
+            return 2
02a573
+        fi
02a573
 
02a573
-        if [[ "$sum_md5" == "" || "$sum_sha1" == "" || "$sum_sha256" == "" ]]; then
02a573
+        if [[ "$sum" == "" ]]; then
02a573
             return 2
02a573
         fi
02a573
 
02a573
-        ./test_crapi_digest "${TEMPDIR}/${file}" "$sum_md5" "$sum_sha1" "$sum_sha256" || return 1
02a573
-        #echo "$file: ret $?, 5: $sum_md5, 1: $sum_sha1, $sum_sha256"
02a573
+        ./test_crapi_digest "${TEMPDIR}/${file}" "$sum" "$algo" || return 1
02a573
     done
02a573
 
02a573
     rm -rf "$TEMPDIR"
02a573
@@ -88,8 +92,16 @@ function test_crapi_mdigest {
02a573
 test_init
02a573
 
02a573
 if [ -z ${CUSTOM_OSCAP+x} ] ; then
02a573
-    test_run "test_crapi_digest" test_crapi_digest
02a573
-    test_run "test_crapi_mdigest" test_crapi_mdigest
02a573
+    if [[ "$OPENSCAP_ENABLE_MD5" == "ON" ]] ; then
02a573
+        test_run "test_crapi_digest_md5" test_crapi_digest md5
02a573
+    fi
02a573
+    if [[ "$OPENSCAP_ENABLE_SHA1" == "ON" ]] ; then
02a573
+        test_run "test_crapi_digest_sha1" test_crapi_digest sha1
02a573
+    fi
02a573
+    test_run "test_crapi_digest_sha256" test_crapi_digest sha256
02a573
+    if [[ "$OPENSCAP_ENABLE_MD5" == "ON"  && "$OPENSCAP_ENABLE_SHA1" == "ON" ]] ; then
02a573
+        test_run "test_crapi_mdigest" test_crapi_mdigest
02a573
+    fi
02a573
 fi
02a573
 
02a573
 test_exit
02a573
diff --git a/tests/API/crypt/test_crapi_digest.c b/tests/API/crypt/test_crapi_digest.c
02a573
index 41ef8fbaa5..e0ccf5b2a2 100644
02a573
--- a/tests/API/crypt/test_crapi_digest.c
02a573
+++ b/tests/API/crypt/test_crapi_digest.c
02a573
@@ -58,88 +58,69 @@ static int mem2hex (uint8_t *mem, size_t mlen, char *str, size_t slen)
02a573
 
02a573
 int main (int argc, char *argv[])
02a573
 {
02a573
-        uint8_t md5_dst[16];
02a573
-        size_t  md5_dstlen = sizeof md5_dst;
02a573
-
02a573
-        uint8_t sha1_dst[20];
02a573
-        size_t  sha1_dstlen = sizeof sha1_dst;
02a573
-
02a573
-        uint8_t sha256_dst[32];
02a573
-        size_t  sha256_dstlen = sizeof sha256_dst;
02a573
-
02a573
-        char *orig_md5sum,  comp_md5sum[(sizeof md5_dst * 2) + 1];
02a573
-        char *orig_sha1sum, comp_sha1sum[(sizeof sha1_dst * 2) + 1];
02a573
-        char *orig_sha256sum, comp_sha256sum[(sizeof sha256_dst * 2) + 1];
02a573
-        char *filename;
02a573
-        int   fd;
02a573
-
02a573
-        if (argc != 5) {
02a573
-                fprintf (stderr, "Usage: %s <file> <md5sum> <sha1sum> <sha256sum>\n", argv[0]);
02a573
+	if (argc != 4) {
02a573
+		fprintf (stderr, "Usage: %s <file> <checksum> <algorithm>\n", argv[0]);
02a573
                 return (1);
02a573
         }
02a573
 
02a573
-        filename     = argv[1];
02a573
-        orig_md5sum  = argv[2];
02a573
-        orig_sha1sum = argv[3];
02a573
-        orig_sha256sum = argv[4];
02a573
-
02a573
-        if (crapi_init (NULL) != 0) {
02a573
-                fprintf (stderr, "crapi_init() != 0\n");
02a573
-                abort ();
02a573
-        }
02a573
-        
02a573
-        fd = open (filename, O_RDONLY);
02a573
-        
02a573
-        if (fd < 0) {
02a573
-                perror ("open");
02a573
-                return (2);
02a573
-        }
02a573
+	char *filename = argv[1];
02a573
+	char *orig_sum = argv[2];
02a573
+	char *algorithm_str = argv[3];
02a573
 
02a573
-        if (crapi_digest_fd (fd, CRAPI_DIGEST_MD5, &md5_dst, &md5_dstlen) != 0) {
02a573
-                fprintf (stderr, "crapi_digest() != 0\n");
02a573
-                abort ();
02a573
-        }
02a573
+	crapi_alg_t algorithm;
02a573
+	size_t dstlen = 0;
02a573
 
02a573
-        mem2hex (md5_dst, md5_dstlen, comp_md5sum, sizeof comp_md5sum);
02a573
+	if (!strcmp(algorithm_str, "md5")) {
02a573
+#ifdef OPENSCAP_ENABLE_MD5
02a573
+		algorithm = CRAPI_DIGEST_MD5;
02a573
+		dstlen = 16;
02a573
+#else
02a573
+		return 1;
02a573
+#endif
02a573
+	} else if (!strcmp(algorithm_str, "sha1")) {
02a573
+#ifdef OPENSCAP_ENABLE_SHA1
02a573
+		algorithm = CRAPI_DIGEST_SHA1;
02a573
+		dstlen = 20;
02a573
+#else
02a573
+		return 1;
02a573
+#endif
02a573
+	} else if (!strcmp(algorithm_str, "sha256")) {
02a573
+		algorithm = CRAPI_DIGEST_SHA256;
02a573
+		dstlen = 32;
02a573
+	} else {
02a573
+		return 1;
02a573
+	}
02a573
 
02a573
-        if (strcmp (orig_md5sum, comp_md5sum) != 0) {
02a573
-                fprintf (stderr, "crapi_digest::MD5(%s) != %s (== %s)\n", filename, orig_md5sum, comp_md5sum);
02a573
-                abort ();
02a573
-        }
02a573
+	int fd = open(filename, O_RDONLY);
02a573
 
02a573
-        if (lseek (fd, 0, SEEK_SET) == (off_t)-1) {
02a573
-                perror ("lseek");
02a573
+        if (fd < 0) {
02a573
+                perror ("open");
02a573
                 return (2);
02a573
         }
02a573
 
02a573
-        if (crapi_digest_fd (fd, CRAPI_DIGEST_SHA1, &sha1_dst, &sha1_dstlen) != 0) {
02a573
-                fprintf (stderr, "crapi_digest() != 0\n");
02a573
+        if (crapi_init (NULL) != 0) {
02a573
+                fprintf (stderr, "crapi_init() != 0\n");
02a573
                 abort ();
02a573
         }
02a573
 
02a573
-        mem2hex (sha1_dst, sha1_dstlen, comp_sha1sum, sizeof comp_sha1sum);
02a573
-
02a573
-        if (strcmp (orig_sha1sum, comp_sha1sum) != 0) {
02a573
-                fprintf (stderr, "crapi_digest::SHA1(%s) != %s (== %s)\n", filename, orig_sha1sum, comp_sha1sum);
02a573
-                abort ();
02a573
-        }
02a573
+	uint8_t *dst = malloc(dstlen);
02a573
 
02a573
-        if (lseek (fd, 0, SEEK_SET) == (off_t)-1) {
02a573
-                perror ("lseek");
02a573
-                return (2);
02a573
-        }
02a573
+		size_t comp_sum_len = (dstlen * 2) + 1;
02a573
+		char *comp_sum = malloc(comp_sum_len);
02a573
 
02a573
-        if (crapi_digest_fd (fd, CRAPI_DIGEST_SHA256, &sha256_dst, &sha256_dstlen) != 0) {
02a573
+	if (crapi_digest_fd(fd, algorithm, dst, &dstlen) != 0) {
02a573
                 fprintf (stderr, "crapi_digest() != 0\n");
02a573
                 abort ();
02a573
         }
02a573
 
02a573
-        mem2hex (sha256_dst, sha256_dstlen, comp_sha256sum, sizeof comp_sha256sum);
02a573
+	mem2hex (dst, dstlen, comp_sum, comp_sum_len);
02a573
 
02a573
-        if (strcmp (orig_sha256sum, comp_sha256sum) != 0) {
02a573
-                fprintf (stderr, "crapi_digest::SHA256(%s) != %s (== %s)\n", filename, orig_sha256sum, comp_sha256sum);
02a573
+	if (strcmp(orig_sum, comp_sum) != 0) {
02a573
+		fprintf (stderr, "crapi_digest::%s(%s) != %s (== %s)\n", algorithm_str, filename, orig_sum, comp_sum);
02a573
                 abort ();
02a573
         }
02a573
+	free(dst);
02a573
+	free(comp_sum);
02a573
 
02a573
         close (fd);
02a573
         
02a573
diff --git a/tests/API/crypt/test_crapi_mdigest.c b/tests/API/crypt/test_crapi_mdigest.c
02a573
index 9c5d31dfb3..200a2bbd9e 100644
02a573
--- a/tests/API/crypt/test_crapi_mdigest.c
02a573
+++ b/tests/API/crypt/test_crapi_mdigest.c
02a573
@@ -24,6 +24,8 @@
02a573
 #include <config.h>
02a573
 #endif
02a573
 
02a573
+#if (defined OPENSCAP_ENABLE_MD5 && defined OPENSCAP_ENABLE_SHA1)
02a573
+
02a573
 #include <stdio.h>
02a573
 #include <stdint.h>
02a573
 #include <stdlib.h>
02a573
@@ -127,3 +129,12 @@ int main (int argc, char *argv[])
02a573
         
02a573
         return (0);
02a573
 }
02a573
+
02a573
+#else
02a573
+
02a573
+int main (int argc, char *argv[])
02a573
+{
02a573
+        return 1;
02a573
+}
02a573
+
02a573
+#endif
02a573
diff --git a/tests/probes/filehash/CMakeLists.txt b/tests/probes/filehash/CMakeLists.txt
02a573
index e9d579c44c..cd04df4f30 100644
02a573
--- a/tests/probes/filehash/CMakeLists.txt
02a573
+++ b/tests/probes/filehash/CMakeLists.txt
02a573
@@ -1,3 +1,3 @@
02a573
-if(ENABLE_PROBES_INDEPENDENT)
02a573
+if(OPENSCAP_PROBE_INDEPENDENT_FILEHASH)
02a573
 	add_oscap_test("test_probes_filehash.sh")
02a573
 endif()
02a573
diff --git a/tests/probes/filehash58/check_filehash_simple.xml b/tests/probes/filehash58/check_filehash_simple.xml
02a573
index 2f6fa877e6..33e6343c73 100644
02a573
--- a/tests/probes/filehash58/check_filehash_simple.xml
02a573
+++ b/tests/probes/filehash58/check_filehash_simple.xml
02a573
@@ -28,13 +28,13 @@
02a573
   <ns0:objects>
02a573
     <ns3:filehash58_object id="oval:ssg-concerned_file:obj:1" version="1">
02a573
       <ns3:filepath>/oval-test</ns3:filepath>
02a573
-      <ns3:hash_type>SHA-1</ns3:hash_type>
02a573
+      <ns3:hash_type>SHA-256</ns3:hash_type>
02a573
     </ns3:filehash58_object>
02a573
   </ns0:objects>
02a573
   <ns0:states>
02a573
     <ns3:filehash58_state id="oval:ssg-hash_value:ste:1" version="1">
02a573
-      <ns3:hash_type>SHA-1</ns3:hash_type>
02a573
-      <ns3:hash>f1d2d2f924e986ac86fdf7b36c94bcdf32beec15</ns3:hash>
02a573
+      <ns3:hash_type>SHA-256</ns3:hash_type>
02a573
+      <ns3:hash>b5bb9d8014a0f9b1d61e21e796d78dccdf1352f23cd32812f4850b878ae4944c</ns3:hash>
02a573
     </ns3:filehash58_state>
02a573
   </ns0:states>
02a573
 </ns0:oval_definitions>
02a573
diff --git a/tests/probes/filehash58/test_probes_filehash58.sh b/tests/probes/filehash58/test_probes_filehash58.sh
02a573
index 5d9c513f29..06ee64446d 100755
02a573
--- a/tests/probes/filehash58/test_probes_filehash58.sh
02a573
+++ b/tests/probes/filehash58/test_probes_filehash58.sh
02a573
@@ -96,7 +96,9 @@ function test_probes_filehash58_chroot_fail {
02a573
 
02a573
 test_init
02a573
 
02a573
-test_run "test_probes_filehash58" test_probes_filehash58
02a573
+if [[ "$OPENSCAP_ENABLE_MD5" == "ON" && "$OPENSCAP_ENABLE_SHA1" == "ON" ]] ; then
02a573
+    test_run "test_probes_filehash58" test_probes_filehash58
02a573
+fi
02a573
 
02a573
 test_run "test_probes_filehash58_chroot_fail" test_probes_filehash58_chroot_fail
02a573
 
02a573
diff --git a/tests/test_common.sh.in b/tests/test_common.sh.in
02a573
index b562855271..ef3675c1bf 100755
02a573
--- a/tests/test_common.sh.in
02a573
+++ b/tests/test_common.sh.in
02a573
@@ -329,3 +329,6 @@ die() {
02a573
 }
02a573
 
02a573
 export -f assert_exists
02a573
+
02a573
+export OPENSCAP_ENABLE_MD5="@OPENSCAP_ENABLE_MD5@"
02a573
+export OPENSCAP_ENABLE_SHA1="@OPENSCAP_ENABLE_SHA1@"
02a573
02a573
From d7a800d3c9ffae2062a81e656e6013b8021b3d16 Mon Sep 17 00:00:00 2001
02a573
From: =?UTF-8?q?Jan=20=C4=8Cern=C3=BD?= <jcerny@redhat.com>
02a573
Date: Thu, 15 Jul 2021 13:30:28 +0200
02a573
Subject: [PATCH 2/5] Another test for filehash58 probe
02a573
02a573
It renames the existing test case and also creates a new test case which
02a573
is almost identical with the existing test case but it uses different
02a573
hashing algorithms in the filehash58_test.  The reason for creating it
02a573
is that the existing test case uses the SHA-1 and MD5 alorithms. But we
02a573
introduced CMake options OPENSCAP_ENABLE_SHA1 and OPENSCAP_ENABLE_MD5
02a573
which allow to not build support for these algorithms. If OpenSCAP will
02a573
be built with these options the existing tests would be disabled and we
02a573
wouldn't test the filehash58 probe. We can expect that some downstreams
02a573
will turn the options OFF so they need an alternative test instead.
02a573
---
02a573
 .../filehash58/test_probes_filehash58.sh      |   40 +-
02a573
 .../test_probes_filehash58_new_algos.xml.sh   | 1064 +++++++++++++++++
02a573
 ...> test_probes_filehash58_old_algos.xml.sh} |    0
02a573
 3 files changed, 1099 insertions(+), 5 deletions(-)
02a573
 create mode 100644 tests/probes/filehash58/test_probes_filehash58_new_algos.xml.sh
02a573
 rename tests/probes/filehash58/{test_probes_filehash58.xml.sh => test_probes_filehash58_old_algos.xml.sh} (100%)
02a573
02a573
diff --git a/tests/probes/filehash58/test_probes_filehash58.sh b/tests/probes/filehash58/test_probes_filehash58.sh
02a573
index 06ee64446d..459654546a 100755
02a573
--- a/tests/probes/filehash58/test_probes_filehash58.sh
02a573
+++ b/tests/probes/filehash58/test_probes_filehash58.sh
02a573
@@ -16,19 +16,19 @@
02a573
 
02a573
 # Test Cases.
02a573
 
02a573
-function test_probes_filehash58 {
02a573
+function test_probes_filehash58_old_algos {
02a573
 
02a573
     probecheck "filehash58" || return 255
02a573
     require "md5sum" || return 255
02a573
     require "sha1sum" || return 255
02a573
 
02a573
     local ret_val=0;
02a573
-    local DF="test_probes_filehash58.xml"
02a573
+    local DF="test_probes_filehash58_old_algos.xml"
02a573
     local RF="results.xml"
02a573
 
02a573
     [ -f $RF ] && rm -f $RF
02a573
 
02a573
-    bash ${srcdir}/test_probes_filehash58.xml.sh > $DF
02a573
+    bash ${srcdir}/test_probes_filehash58_old_algos.xml.sh > $DF
02a573
     $OSCAP oval eval --results $RF $DF
02a573
     
02a573
     if [ -f $RF ]; then
02a573
@@ -38,7 +38,35 @@ function test_probes_filehash58 {
02a573
 	ret_val=1
02a573
     fi
02a573
 
02a573
-    # The file was created as a side-effect of test_probes_filehash58.xml.sh
02a573
+    # The file was created as a side-effect of test_probes_filehash58_old_algos.xml.sh
02a573
+    [ $ret_val -eq 0 ] && rm -f /tmp/test_probes_filehash58.tmp
02a573
+
02a573
+    return $ret_val
02a573
+}
02a573
+
02a573
+function test_probes_filehash58_new_algos {
02a573
+
02a573
+    probecheck "filehash58" || return 255
02a573
+    require "sha256sum" || return 255
02a573
+    require "sha512sum" || return 255
02a573
+
02a573
+    local ret_val=0
02a573
+    local DF="test_probes_filehash58_new_algos.xml"
02a573
+    local RF="results.xml"
02a573
+
02a573
+    [ -f $RF ] && rm -f $RF
02a573
+
02a573
+    bash ${srcdir}/test_probes_filehash58_new_algos.xml.sh > $DF
02a573
+    $OSCAP oval eval --results $RF $DF
02a573
+
02a573
+    if [ -f $RF ]; then
02a573
+        verify_results "def" $DF $RF 13 && verify_results "tst" $DF $RF 120
02a573
+        ret_val=$?
02a573
+    else
02a573
+        ret_val=1
02a573
+    fi
02a573
+
02a573
+    # The file was created as a side-effect of test_probes_filehash58_new_algos.xml.sh
02a573
     [ $ret_val -eq 0 ] && rm -f /tmp/test_probes_filehash58.tmp
02a573
 
02a573
     return $ret_val
02a573
@@ -97,9 +125,11 @@ function test_probes_filehash58_chroot_fail {
02a573
 test_init
02a573
 
02a573
 if [[ "$OPENSCAP_ENABLE_MD5" == "ON" && "$OPENSCAP_ENABLE_SHA1" == "ON" ]] ; then
02a573
-    test_run "test_probes_filehash58" test_probes_filehash58
02a573
+    test_run "test_probes_filehash58_old_algos" test_probes_filehash58_old_algos
02a573
 fi
02a573
 
02a573
+test_run "test_probes_filehash58_new_algos" test_probes_filehash58_new_algos
02a573
+
02a573
 test_run "test_probes_filehash58_chroot_fail" test_probes_filehash58_chroot_fail
02a573
 
02a573
 test_run "test_probes_filehash58_chroot_pass" test_probes_filehash58_chroot_pass
02a573
diff --git a/tests/probes/filehash58/test_probes_filehash58_new_algos.xml.sh b/tests/probes/filehash58/test_probes_filehash58_new_algos.xml.sh
02a573
new file mode 100644
02a573
index 0000000000..d120a0d114
02a573
--- /dev/null
02a573
+++ b/tests/probes/filehash58/test_probes_filehash58_new_algos.xml.sh
02a573
@@ -0,0 +1,1064 @@
02a573
+#!/usr/bin/env bash
02a573
+
02a573
+echo "Test Probes: FILEHASH test" > /tmp/test_probes_filehash58.tmp
02a573
+
02a573
+cat <
02a573
+
02a573
+<oval_definitions xmlns:oval-def="http://oval.mitre.org/XMLSchema/oval-definitions-5" xmlns:oval="http://oval.mitre.org/XMLSchema/oval-common-5" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:ind-def="http://oval.mitre.org/XMLSchema/oval-definitions-5#independent" xmlns:unix-def="http://oval.mitre.org/XMLSchema/oval-definitions-5#unix" xmlns:lin-def="http://oval.mitre.org/XMLSchema/oval-definitions-5#linux" xmlns="http://oval.mitre.org/XMLSchema/oval-definitions-5" xsi:schemaLocation="http://oval.mitre.org/XMLSchema/oval-definitions-5#unix unix-definitions-schema.xsd http://oval.mitre.org/XMLSchema/oval-definitions-5#independent independent-definitions-schema.xsd http://oval.mitre.org/XMLSchema/oval-definitions-5#linux linux-definitions-schema.xsd http://oval.mitre.org/XMLSchema/oval-definitions-5 oval-definitions-schema.xsd http://oval.mitre.org/XMLSchema/oval-common-5 oval-common-schema.xsd">
02a573
+
02a573
+      <generator>
02a573
+            <oval:product_name>filehash58</oval:product_name>
02a573
+            <oval:product_version>1.0</oval:product_version>
02a573
+            <oval:schema_version>5.11</oval:schema_version>
02a573
+            <oval:timestamp>2011-07-14T00:00:00-00:00</oval:timestamp>
02a573
+      </generator>
02a573
+
02a573
+  <definitions>
02a573
+
02a573
+    <definition class="compliance" version="1" id="oval:1:def:1">  
02a573
+      <metadata>
02a573
+        <title></title>
02a573
+        <description></description>
02a573
+      </metadata>
02a573
+      <criteria>
02a573
+        <criteria operator="AND">
02a573
+          <criterion test_ref="oval:1:tst:1"/>
02a573
+          <criterion test_ref="oval:1:tst:2"/>
02a573
+          <criterion test_ref="oval:1:tst:3"/>
02a573
+          <criterion test_ref="oval:1:tst:4"/>
02a573
+          <criterion test_ref="oval:1:tst:5"/>
02a573
+          <criterion test_ref="oval:1:tst:6"/>
02a573
+          <criterion test_ref="oval:1:tst:7"/>
02a573
+          <criterion test_ref="oval:1:tst:8"/>
02a573
+          <criterion test_ref="oval:1:tst:9"/>
02a573
+          <criterion test_ref="oval:1:tst:10"/>
02a573
+          <criterion test_ref="oval:1:tst:11"/>
02a573
+          <criterion test_ref="oval:1:tst:12"/>
02a573
+          <criterion test_ref="oval:1:tst:13"/>
02a573
+          <criterion test_ref="oval:1:tst:14"/>
02a573
+          <criterion test_ref="oval:1:tst:15"/>
02a573
+          <criterion test_ref="oval:1:tst:16"/>
02a573
+          <criterion test_ref="oval:1:tst:17"/>
02a573
+          <criterion test_ref="oval:1:tst:18"/>
02a573
+          <criterion test_ref="oval:1:tst:19"/>
02a573
+          <criterion test_ref="oval:1:tst:20"/>
02a573
+          <criterion test_ref="oval:1:tst:21"/>
02a573
+          <criterion test_ref="oval:1:tst:22"/>
02a573
+          <criterion test_ref="oval:1:tst:23"/>
02a573
+          <criterion test_ref="oval:1:tst:24"/>
02a573
+          <criterion test_ref="oval:1:tst:25"/>
02a573
+          <criterion test_ref="oval:1:tst:26"/>
02a573
+          <criterion test_ref="oval:1:tst:27"/>
02a573
+          <criterion test_ref="oval:1:tst:28"/>
02a573
+          <criterion test_ref="oval:1:tst:29"/>
02a573
+          <criterion test_ref="oval:1:tst:30"/>
02a573
+          <criterion test_ref="oval:1:tst:31"/>
02a573
+          <criterion test_ref="oval:1:tst:32"/>
02a573
+          <criterion test_ref="oval:1:tst:33"/>
02a573
+          <criterion test_ref="oval:1:tst:34"/>
02a573
+          <criterion test_ref="oval:1:tst:35"/>
02a573
+          <criterion test_ref="oval:1:tst:36"/>
02a573
+          <criterion test_ref="oval:1:tst:37"/>
02a573
+          <criterion test_ref="oval:1:tst:38"/>
02a573
+          <criterion test_ref="oval:1:tst:39"/>
02a573
+          <criterion test_ref="oval:1:tst:40"/>
02a573
+          <criterion test_ref="oval:1:tst:41"/>
02a573
+          <criterion test_ref="oval:1:tst:42"/>
02a573
+          <criterion test_ref="oval:1:tst:43"/>
02a573
+          <criterion test_ref="oval:1:tst:44"/>
02a573
+          <criterion test_ref="oval:1:tst:45"/>
02a573
+          <criterion test_ref="oval:1:tst:46"/>
02a573
+          <criterion test_ref="oval:1:tst:47"/>
02a573
+          <criterion test_ref="oval:1:tst:48"/>
02a573
+          <criterion test_ref="oval:1:tst:49"/>
02a573
+          <criterion test_ref="oval:1:tst:50"/>
02a573
+          <criterion test_ref="oval:1:tst:51"/>
02a573
+          <criterion test_ref="oval:1:tst:52"/>
02a573
+          <criterion test_ref="oval:1:tst:53"/>
02a573
+          <criterion test_ref="oval:1:tst:54"/>
02a573
+          <criterion test_ref="oval:1:tst:55"/>
02a573
+          <criterion test_ref="oval:1:tst:56"/>
02a573
+          <criterion test_ref="oval:1:tst:57"/>
02a573
+          <criterion test_ref="oval:1:tst:58"/>
02a573
+          <criterion test_ref="oval:1:tst:59"/>
02a573
+          <criterion test_ref="oval:1:tst:60"/>
02a573
+          <criterion test_ref="oval:1:tst:61"/>
02a573
+          <criterion test_ref="oval:1:tst:62"/>
02a573
+          <criterion test_ref="oval:1:tst:63"/>
02a573
+          <criterion test_ref="oval:1:tst:64"/>
02a573
+          <criterion test_ref="oval:1:tst:65"/>
02a573
+          <criterion test_ref="oval:1:tst:66"/>
02a573
+          <criterion test_ref="oval:1:tst:67"/>
02a573
+          <criterion test_ref="oval:1:tst:68"/>
02a573
+          <criterion test_ref="oval:1:tst:69"/>
02a573
+          <criterion test_ref="oval:1:tst:70"/>
02a573
+          <criterion test_ref="oval:1:tst:71"/>
02a573
+          <criterion test_ref="oval:1:tst:72"/>
02a573
+          <criterion test_ref="oval:1:tst:73"/>
02a573
+          <criterion test_ref="oval:1:tst:74"/>
02a573
+          <criterion test_ref="oval:1:tst:75"/>
02a573
+          <criterion test_ref="oval:1:tst:76"/>
02a573
+          <criterion test_ref="oval:1:tst:77"/>
02a573
+          <criterion test_ref="oval:1:tst:78"/>
02a573
+          <criterion test_ref="oval:1:tst:79"/>
02a573
+          <criterion test_ref="oval:1:tst:80"/>
02a573
+          <criterion test_ref="oval:1:tst:81"/>
02a573
+          <criterion test_ref="oval:1:tst:82"/>
02a573
+          <criterion test_ref="oval:1:tst:83"/>
02a573
+          <criterion test_ref="oval:1:tst:84"/>
02a573
+          <criterion test_ref="oval:1:tst:85"/>
02a573
+          <criterion test_ref="oval:1:tst:86"/>
02a573
+          <criterion test_ref="oval:1:tst:87"/>
02a573
+          <criterion test_ref="oval:1:tst:88"/>
02a573
+          <criterion test_ref="oval:1:tst:89"/>
02a573
+          <criterion test_ref="oval:1:tst:90"/>
02a573
+          <criterion test_ref="oval:1:tst:91"/>
02a573
+          <criterion test_ref="oval:1:tst:92"/>
02a573
+          <criterion test_ref="oval:1:tst:93"/>
02a573
+          <criterion test_ref="oval:1:tst:94"/>
02a573
+          <criterion test_ref="oval:1:tst:95"/>
02a573
+          <criterion test_ref="oval:1:tst:96"/>
02a573
+          <criterion test_ref="oval:1:tst:97"/>
02a573
+          <criterion test_ref="oval:1:tst:98"/>
02a573
+          <criterion test_ref="oval:1:tst:99"/>
02a573
+          <criterion test_ref="oval:1:tst:100"/>
02a573
+          <criterion test_ref="oval:1:tst:101"/>
02a573
+          <criterion test_ref="oval:1:tst:102"/>
02a573
+          <criterion test_ref="oval:1:tst:103"/>
02a573
+          <criterion test_ref="oval:1:tst:104"/>
02a573
+          <criterion test_ref="oval:1:tst:105"/>
02a573
+          <criterion test_ref="oval:1:tst:106"/>
02a573
+          <criterion test_ref="oval:1:tst:107"/>
02a573
+          <criterion test_ref="oval:1:tst:108"/>
02a573
+          <criterion test_ref="oval:1:tst:109"/>
02a573
+          <criterion test_ref="oval:1:tst:110"/>
02a573
+          <criterion test_ref="oval:1:tst:111"/>
02a573
+          <criterion test_ref="oval:1:tst:112"/>
02a573
+          <criterion test_ref="oval:1:tst:113"/>
02a573
+          <criterion test_ref="oval:1:tst:114"/>
02a573
+          <criterion test_ref="oval:1:tst:115"/>
02a573
+          <criterion test_ref="oval:1:tst:116"/>
02a573
+          <criterion test_ref="oval:1:tst:117"/>
02a573
+          <criterion test_ref="oval:1:tst:118"/>
02a573
+          <criterion test_ref="oval:1:tst:119"/>
02a573
+          <criterion test_ref="oval:1:tst:120"/>
02a573
+         </criteria>
02a573
+      </criteria>
02a573
+    </definition>
02a573
+
02a573
+    <definition class="compliance" version="1" id="oval:1:def:2">  
02a573
+      <metadata>
02a573
+        <title></title>
02a573
+        <description></description>
02a573
+      </metadata>
02a573
+      <criteria>
02a573
+	<criteria operator="AND">
02a573
+          <criterion test_ref="oval:1:tst:1"/>
02a573
+          <criterion test_ref="oval:1:tst:5"/>
02a573
+        </criteria>
02a573
+      </criteria>
02a573
+    </definition>
02a573
+
02a573
+    <definition class="compliance" version="1" id="oval:1:def:3">  
02a573
+      <metadata>
02a573
+        <title></title>
02a573
+        <description></description>
02a573
+      </metadata>
02a573
+      <criteria>
02a573
+	<criteria operator="AND">
02a573
+          <criterion test_ref="oval:1:tst:1"/>
02a573
+          <criterion test_ref="oval:1:tst:1"/>
02a573
+        </criteria>
02a573
+      </criteria>
02a573
+    </definition>
02a573
+
02a573
+    <definition class="compliance" version="1" id="oval:1:def:4">  
02a573
+      <metadata>
02a573
+        <title></title>
02a573
+        <description></description>
02a573
+      </metadata>
02a573
+      <criteria>
02a573
+	<criteria operator="AND">
02a573
+          <criterion test_ref="oval:1:tst:5"/>
02a573
+          <criterion test_ref="oval:1:tst:5"/>
02a573
+        </criteria>
02a573
+      </criteria>
02a573
+    </definition>
02a573
+
02a573
+    <definition class="compliance" version="1" id="oval:1:def:5">  
02a573
+      <metadata>
02a573
+        <title></title>
02a573
+        <description></description>
02a573
+      </metadata>
02a573
+      <criteria>
02a573
+	<criteria operator="OR">
02a573
+          <criterion test_ref="oval:1:tst:1"/>
02a573
+          <criterion test_ref="oval:1:tst:5"/>
02a573
+        </criteria>
02a573
+      </criteria>
02a573
+    </definition>
02a573
+
02a573
+    <definition class="compliance" version="1" id="oval:1:def:6">  
02a573
+      <metadata>
02a573
+        <title></title>
02a573
+        <description></description>
02a573
+      </metadata>
02a573
+      <criteria>
02a573
+	<criteria operator="OR">
02a573
+          <criterion test_ref="oval:1:tst:1"/>
02a573
+          <criterion test_ref="oval:1:tst:1"/>
02a573
+        </criteria>
02a573
+      </criteria>
02a573
+    </definition>
02a573
+
02a573
+    <definition class="compliance" version="1" id="oval:1:def:7">  
02a573
+      <metadata>
02a573
+        <title></title>
02a573
+        <description></description>
02a573
+      </metadata>
02a573
+      <criteria>
02a573
+	<criteria operator="OR">
02a573
+          <criterion test_ref="oval:1:tst:5"/>
02a573
+          <criterion test_ref="oval:1:tst:5"/>
02a573
+        </criteria>
02a573
+      </criteria>
02a573
+    </definition>
02a573
+
02a573
+    <definition class="compliance" version="1" id="oval:1:def:8">  
02a573
+      <metadata>
02a573
+        <title></title>
02a573
+        <description></description>
02a573
+      </metadata>
02a573
+      <criteria>
02a573
+	<criteria operator="XOR">
02a573
+          <criterion test_ref="oval:1:tst:1"/>
02a573
+          <criterion test_ref="oval:1:tst:5"/>
02a573
+        </criteria>
02a573
+      </criteria>
02a573
+    </definition>
02a573
+
02a573
+    <definition class="compliance" version="1" id="oval:1:def:9">  
02a573
+      <metadata>
02a573
+        <title></title>
02a573
+        <description></description>
02a573
+      </metadata>
02a573
+      <criteria>
02a573
+	<criteria operator="XOR">
02a573
+          <criterion test_ref="oval:1:tst:1"/>
02a573
+          <criterion test_ref="oval:1:tst:1"/>
02a573
+        </criteria>
02a573
+      </criteria>
02a573
+    </definition>
02a573
+
02a573
+    <definition class="compliance" version="1" id="oval:1:def:10">  
02a573
+      <metadata>
02a573
+        <title></title>
02a573
+        <description></description>
02a573
+      </metadata>
02a573
+      <criteria>
02a573
+	<criteria operator="XOR">
02a573
+          <criterion test_ref="oval:1:tst:5"/>
02a573
+          <criterion test_ref="oval:1:tst:5"/>
02a573
+        </criteria>
02a573
+      </criteria>
02a573
+    </definition>
02a573
+
02a573
+    <definition class="compliance" version="1" id="oval:1:def:11">  
02a573
+      <metadata>
02a573
+        <title></title>
02a573
+        <description></description>
02a573
+      </metadata>
02a573
+      <criteria>
02a573
+	<criteria operator="ONE">
02a573
+          <criterion test_ref="oval:1:tst:1"/>
02a573
+          <criterion test_ref="oval:1:tst:5"/>
02a573
+        </criteria>
02a573
+      </criteria>
02a573
+    </definition>
02a573
+
02a573
+    <definition class="compliance" version="1" id="oval:1:def:12">  
02a573
+      <metadata>
02a573
+        <title></title>
02a573
+        <description></description>
02a573
+      </metadata>
02a573
+      <criteria>
02a573
+	<criteria operator="ONE">
02a573
+          <criterion test_ref="oval:1:tst:1"/>
02a573
+          <criterion test_ref="oval:1:tst:1"/>
02a573
+        </criteria>
02a573
+      </criteria>
02a573
+    </definition>
02a573
+
02a573
+    <definition class="compliance" version="1" id="oval:1:def:13">  
02a573
+      <metadata>
02a573
+        <title></title>
02a573
+        <description></description>
02a573
+      </metadata>
02a573
+      <criteria>
02a573
+	<criteria operator="ONE">
02a573
+          <criterion test_ref="oval:1:tst:5"/>
02a573
+          <criterion test_ref="oval:1:tst:5"/>
02a573
+        </criteria>
02a573
+      </criteria>
02a573
+    </definition>
02a573
+
02a573
+  </definitions>
02a573
+
02a573
+  <tests>
02a573
+
02a573
+    
02a573
+
02a573
+    
02a573
+
02a573
+    <filehash58_test version="1" id="oval:1:tst:1" check="all" comment="true" xmlns="http://oval.mitre.org/XMLSchema/oval-definitions-5#independent">
02a573
+      <object object_ref="oval:1:obj:1"/>
02a573
+    </filehash58_test>
02a573
+
02a573
+    
02a573
+
02a573
+    <filehash58_test version="1" id="oval:1:tst:2" check="at least one" comment="true" xmlns="http://oval.mitre.org/XMLSchema/oval-definitions-5#independent">
02a573
+      <object object_ref="oval:1:obj:1"/>
02a573
+    </filehash58_test>
02a573
+
02a573
+    
02a573
+
02a573
+    <filehash58_test version="1" id="oval:1:tst:3" check="none satisfy" comment="true" xmlns="http://oval.mitre.org/XMLSchema/oval-definitions-5#independent">
02a573
+      <object object_ref="oval:1:obj:1"/>
02a573
+    </filehash58_test>
02a573
+
02a573
+    
02a573
+
02a573
+    <filehash58_test version="1" id="oval:1:tst:4" check="only one" comment="true" xmlns="http://oval.mitre.org/XMLSchema/oval-definitions-5#independent">
02a573
+      <object object_ref="oval:1:obj:1"/>
02a573
+    </filehash58_test>
02a573
+
02a573
+    
02a573
+
02a573
+    <filehash58_test version="1" id="oval:1:tst:5" check="all" comment="false" xmlns="http://oval.mitre.org/XMLSchema/oval-definitions-5#independent">
02a573
+      <object object_ref="oval:1:obj:2"/>
02a573
+    </filehash58_test>
02a573
+
02a573
+    
02a573
+
02a573
+    <filehash58_test version="1" id="oval:1:tst:6" check="at least one" comment="false" xmlns="http://oval.mitre.org/XMLSchema/oval-definitions-5#independent">
02a573
+      <object object_ref="oval:1:obj:2"/>
02a573
+    </filehash58_test>
02a573
+
02a573
+    
02a573
+
02a573
+    <filehash58_test version="1" id="oval:1:tst:7" check="none satisfy" comment="false" xmlns="http://oval.mitre.org/XMLSchema/oval-definitions-5#independent">
02a573
+      <object object_ref="oval:1:obj:2"/>
02a573
+    </filehash58_test>
02a573
+
02a573
+    
02a573
+
02a573
+    <filehash58_test version="1" id="oval:1:tst:8" check="only one" comment="false" xmlns="http://oval.mitre.org/XMLSchema/oval-definitions-5#independent">
02a573
+      <object object_ref="oval:1:obj:2"/>
02a573
+    </filehash58_test>
02a573
+
02a573
+    
02a573
+
02a573
+    
02a573
+
02a573
+    <filehash58_test version="1" id="oval:1:tst:9" check_existence="all_exist" check="all" comment="true" xmlns="http://oval.mitre.org/XMLSchema/oval-definitions-5#independent">
02a573
+      <object object_ref="oval:1:obj:1"/>
02a573
+    </filehash58_test>
02a573
+
02a573
+    
02a573
+
02a573
+    <filehash58_test version="1" id="oval:1:tst:10" check_existence="all_exist" check="at least one" comment="true" xmlns="http://oval.mitre.org/XMLSchema/oval-definitions-5#independent">
02a573
+      <object object_ref="oval:1:obj:1"/>
02a573
+    </filehash58_test>
02a573
+
02a573
+    
02a573
+
02a573
+    <filehash58_test version="1" id="oval:1:tst:11" check_existence="all_exist" check="none satisfy" comment="true" xmlns="http://oval.mitre.org/XMLSchema/oval-definitions-5#independent">
02a573
+      <object object_ref="oval:1:obj:1"/>
02a573
+    </filehash58_test>
02a573
+
02a573
+    
02a573
+
02a573
+    <filehash58_test version="1" id="oval:1:tst:12" check_existence="all_exist" check="only one" comment="true" xmlns="http://oval.mitre.org/XMLSchema/oval-definitions-5#independent">
02a573
+      <object object_ref="oval:1:obj:1"/>
02a573
+    </filehash58_test>
02a573
+
02a573
+    
02a573
+
02a573
+    <filehash58_test version="1" id="oval:1:tst:13" check_existence="at_least_one_exists" check="all" comment="true" xmlns="http://oval.mitre.org/XMLSchema/oval-definitions-5#independent">
02a573
+      <object object_ref="oval:1:obj:1"/>
02a573
+    </filehash58_test>
02a573
+
02a573
+    
02a573
+
02a573
+    <filehash58_test version="1" id="oval:1:tst:14" check_existence="at_least_one_exists" check="at least one" comment="true" xmlns="http://oval.mitre.org/XMLSchema/oval-definitions-5#independent">
02a573
+      <object object_ref="oval:1:obj:1"/>
02a573
+    </filehash58_test>
02a573
+
02a573
+    
02a573
+
02a573
+    <filehash58_test version="1" id="oval:1:tst:15" check_existence="at_least_one_exists" check="none satisfy" comment="true" xmlns="http://oval.mitre.org/XMLSchema/oval-definitions-5#independent">
02a573
+      <object object_ref="oval:1:obj:1"/>
02a573
+    </filehash58_test>
02a573
+
02a573
+    
02a573
+
02a573
+    <filehash58_test version="1" id="oval:1:tst:16" check_existence="at_least_one_exists" check="only one" comment="true" xmlns="http://oval.mitre.org/XMLSchema/oval-definitions-5#independent">
02a573
+      <object object_ref="oval:1:obj:1"/>
02a573
+    </filehash58_test>
02a573
+
02a573
+    
02a573
+
02a573
+    <filehash58_test version="1" id="oval:1:tst:17" check_existence="any_exist" check="all" comment="true" xmlns="http://oval.mitre.org/XMLSchema/oval-definitions-5#independent">
02a573
+      <object object_ref="oval:1:obj:1"/>
02a573
+    </filehash58_test>
02a573
+
02a573
+    
02a573
+
02a573
+    <filehash58_test version="1" id="oval:1:tst:18" check_existence="any_exist" check="at least one" comment="true" xmlns="http://oval.mitre.org/XMLSchema/oval-definitions-5#independent">
02a573
+      <object object_ref="oval:1:obj:1"/>
02a573
+    </filehash58_test>
02a573
+
02a573
+    
02a573
+
02a573
+    <filehash58_test version="1" id="oval:1:tst:19" check_existence="any_exist" check="none satisfy" comment="true" xmlns="http://oval.mitre.org/XMLSchema/oval-definitions-5#independent">
02a573
+      <object object_ref="oval:1:obj:1"/>
02a573
+    </filehash58_test>
02a573
+
02a573
+    
02a573
+
02a573
+    <filehash58_test version="1" id="oval:1:tst:20" check_existence="any_exist" check="only one" comment="true" xmlns="http://oval.mitre.org/XMLSchema/oval-definitions-5#independent">
02a573
+      <object object_ref="oval:1:obj:1"/>
02a573
+    </filehash58_test>
02a573
+
02a573
+    
02a573
+
02a573
+    <filehash58_test version="1" id="oval:1:tst:21" check_existence="none_exist" check="all" comment="false" xmlns="http://oval.mitre.org/XMLSchema/oval-definitions-5#independent">
02a573
+      <object object_ref="oval:1:obj:1"/>
02a573
+    </filehash58_test>
02a573
+
02a573
+    
02a573
+
02a573
+    <filehash58_test version="1" id="oval:1:tst:22" check_existence="none_exist" check="at least one" comment="false" xmlns="http://oval.mitre.org/XMLSchema/oval-definitions-5#independent">
02a573
+      <object object_ref="oval:1:obj:1"/>
02a573
+    </filehash58_test>
02a573
+
02a573
+    
02a573
+
02a573
+    <filehash58_test version="1" id="oval:1:tst:23" check_existence="none_exist" check="none satisfy" comment="false" xmlns="http://oval.mitre.org/XMLSchema/oval-definitions-5#independent">
02a573
+      <object object_ref="oval:1:obj:1"/>
02a573
+    </filehash58_test>
02a573
+
02a573
+    
02a573
+
02a573
+    <filehash58_test version="1" id="oval:1:tst:24" check_existence="none_exist" check="only one" comment="false" xmlns="http://oval.mitre.org/XMLSchema/oval-definitions-5#independent">
02a573
+      <object object_ref="oval:1:obj:1"/>
02a573
+    </filehash58_test>
02a573
+
02a573
+    
02a573
+
02a573
+    <filehash58_test version="1" id="oval:1:tst:25" check_existence="only_one_exists" check="all" comment="true" xmlns="http://oval.mitre.org/XMLSchema/oval-definitions-5#independent">
02a573
+      <object object_ref="oval:1:obj:1"/>
02a573
+    </filehash58_test>
02a573
+
02a573
+    
02a573
+
02a573
+    <filehash58_test version="1" id="oval:1:tst:26" check_existence="only_one_exists" check="at least one" comment="true" xmlns="http://oval.mitre.org/XMLSchema/oval-definitions-5#independent">
02a573
+      <object object_ref="oval:1:obj:1"/>
02a573
+    </filehash58_test>
02a573
+
02a573
+    
02a573
+
02a573
+    <filehash58_test version="1" id="oval:1:tst:27" check_existence="only_one_exists" check="none satisfy" comment="true" xmlns="http://oval.mitre.org/XMLSchema/oval-definitions-5#independent">
02a573
+      <object object_ref="oval:1:obj:1"/>
02a573
+    </filehash58_test>
02a573
+
02a573
+    
02a573
+
02a573
+    <filehash58_test version="1" id="oval:1:tst:28" check_existence="only_one_exists" check="only one" comment="true" xmlns="http://oval.mitre.org/XMLSchema/oval-definitions-5#independent">
02a573
+      <object object_ref="oval:1:obj:1"/>
02a573
+    </filehash58_test>
02a573
+
02a573
+    
02a573
+
02a573
+    <filehash58_test version="1" id="oval:1:tst:29" check_existence="all_exist" check="all" comment="false" xmlns="http://oval.mitre.org/XMLSchema/oval-definitions-5#independent">
02a573
+      <object object_ref="oval:1:obj:2"/>
02a573
+    </filehash58_test>
02a573
+
02a573
+    
02a573
+
02a573
+    <filehash58_test version="1" id="oval:1:tst:30" check_existence="all_exist" check="at least one" comment="false" xmlns="http://oval.mitre.org/XMLSchema/oval-definitions-5#independent">
02a573
+      <object object_ref="oval:1:obj:2"/>
02a573
+    </filehash58_test>
02a573
+
02a573
+    
02a573
+
02a573
+    <filehash58_test version="1" id="oval:1:tst:31" check_existence="all_exist" check="none satisfy" comment="false" xmlns="http://oval.mitre.org/XMLSchema/oval-definitions-5#independent">
02a573
+      <object object_ref="oval:1:obj:2"/>
02a573
+    </filehash58_test>
02a573
+
02a573
+    
02a573
+
02a573
+    <filehash58_test version="1" id="oval:1:tst:32" check_existence="all_exist" check="only one" comment="false" xmlns="http://oval.mitre.org/XMLSchema/oval-definitions-5#independent">
02a573
+      <object object_ref="oval:1:obj:2"/>
02a573
+    </filehash58_test>
02a573
+
02a573
+    
02a573
+
02a573
+    <filehash58_test version="1" id="oval:1:tst:33" check_existence="at_least_one_exists" check="all" comment="false" xmlns="http://oval.mitre.org/XMLSchema/oval-definitions-5#independent">
02a573
+      <object object_ref="oval:1:obj:2"/>
02a573
+    </filehash58_test>
02a573
+
02a573
+    
02a573
+
02a573
+    <filehash58_test version="1" id="oval:1:tst:34" check_existence="at_least_one_exists" check="at least one" comment="false" xmlns="http://oval.mitre.org/XMLSchema/oval-definitions-5#independent">
02a573
+      <object object_ref="oval:1:obj:2"/>
02a573
+    </filehash58_test>
02a573
+
02a573
+    
02a573
+
02a573
+    <filehash58_test version="1" id="oval:1:tst:35" check_existence="at_least_one_exists" check="none satisfy" comment="false" xmlns="http://oval.mitre.org/XMLSchema/oval-definitions-5#independent">
02a573
+      <object object_ref="oval:1:obj:2"/>
02a573
+    </filehash58_test>
02a573
+
02a573
+    
02a573
+
02a573
+    <filehash58_test version="1" id="oval:1:tst:36" check_existence="at_least_one_exists" check="only one" comment="false" xmlns="http://oval.mitre.org/XMLSchema/oval-definitions-5#independent">
02a573
+      <object object_ref="oval:1:obj:2"/>
02a573
+    </filehash58_test>
02a573
+
02a573
+    
02a573
+
02a573
+    <filehash58_test version="1" id="oval:1:tst:37" check_existence="any_exist" check="all" comment="true" xmlns="http://oval.mitre.org/XMLSchema/oval-definitions-5#independent">
02a573
+      <object object_ref="oval:1:obj:2"/>
02a573
+    </filehash58_test>
02a573
+
02a573
+    
02a573
+
02a573
+    <filehash58_test version="1" id="oval:1:tst:38" check_existence="any_exist" check="at least one" comment="true" xmlns="http://oval.mitre.org/XMLSchema/oval-definitions-5#independent">
02a573
+      <object object_ref="oval:1:obj:2"/>
02a573
+    </filehash58_test>
02a573
+
02a573
+    
02a573
+
02a573
+    <filehash58_test version="1" id="oval:1:tst:39" check_existence="any_exist" check="none satisfy" comment="true" xmlns="http://oval.mitre.org/XMLSchema/oval-definitions-5#independent">
02a573
+      <object object_ref="oval:1:obj:2"/>
02a573
+    </filehash58_test>
02a573
+
02a573
+    
02a573
+
02a573
+    <filehash58_test version="1" id="oval:1:tst:40" check_existence="any_exist" check="only one" comment="true" xmlns="http://oval.mitre.org/XMLSchema/oval-definitions-5#independent">
02a573
+      <object object_ref="oval:1:obj:2"/>
02a573
+    </filehash58_test>
02a573
+
02a573
+    
02a573
+
02a573
+    <filehash58_test version="1" id="oval:1:tst:41" check_existence="none_exist" check="all" comment="true" xmlns="http://oval.mitre.org/XMLSchema/oval-definitions-5#independent">
02a573
+      <object object_ref="oval:1:obj:2"/>
02a573
+    </filehash58_test>
02a573
+
02a573
+    
02a573
+
02a573
+    <filehash58_test version="1" id="oval:1:tst:42" check_existence="none_exist" check="at least one" comment="true" xmlns="http://oval.mitre.org/XMLSchema/oval-definitions-5#independent">
02a573
+      <object object_ref="oval:1:obj:2"/>
02a573
+    </filehash58_test>
02a573
+
02a573
+    
02a573
+
02a573
+    <filehash58_test version="1" id="oval:1:tst:43" check_existence="none_exist" check="none satisfy" comment="true" xmlns="http://oval.mitre.org/XMLSchema/oval-definitions-5#independent">
02a573
+      <object object_ref="oval:1:obj:2"/>
02a573
+    </filehash58_test>
02a573
+
02a573
+    
02a573
+
02a573
+    <filehash58_test version="1" id="oval:1:tst:44" check_existence="none_exist" check="only one" comment="true" xmlns="http://oval.mitre.org/XMLSchema/oval-definitions-5#independent">
02a573
+      <object object_ref="oval:1:obj:2"/>
02a573
+    </filehash58_test>
02a573
+
02a573
+    
02a573
+
02a573
+    <filehash58_test version="1" id="oval:1:tst:45" check_existence="only_one_exists" check="all" comment="false" xmlns="http://oval.mitre.org/XMLSchema/oval-definitions-5#independent">
02a573
+      <object object_ref="oval:1:obj:2"/>
02a573
+    </filehash58_test>
02a573
+
02a573
+    
02a573
+
02a573
+    <filehash58_test version="1" id="oval:1:tst:46" check_existence="only_one_exists" check="at least one" comment="false" xmlns="http://oval.mitre.org/XMLSchema/oval-definitions-5#independent">
02a573
+      <object object_ref="oval:1:obj:2"/>
02a573
+    </filehash58_test>
02a573
+
02a573
+    
02a573
+
02a573
+    <filehash58_test version="1" id="oval:1:tst:47" check_existence="only_one_exists" check="none satisfy" comment="false" xmlns="http://oval.mitre.org/XMLSchema/oval-definitions-5#independent">
02a573
+      <object object_ref="oval:1:obj:2"/>
02a573
+    </filehash58_test>
02a573
+
02a573
+    
02a573
+
02a573
+    <filehash58_test version="1" id="oval:1:tst:48" check_existence="only_one_exists" check="only one" comment="false" xmlns="http://oval.mitre.org/XMLSchema/oval-definitions-5#independent">
02a573
+      <object object_ref="oval:1:obj:2"/>
02a573
+    </filehash58_test>
02a573
+
02a573
+    
02a573
+
02a573
+    
02a573
+
02a573
+    <filehash58_test version="1" id="oval:1:tst:49" check="all" comment="true" xmlns="http://oval.mitre.org/XMLSchema/oval-definitions-5#independent">
02a573
+      <object object_ref="oval:1:obj:1"/>
02a573
+      <state state_ref="oval:1:ste:1"/>
02a573
+    </filehash58_test>
02a573
+
02a573
+    <filehash58_test version="1" id="oval:1:tst:50" check="all" comment="false" xmlns="http://oval.mitre.org/XMLSchema/oval-definitions-5#independent">
02a573
+      <object object_ref="oval:1:obj:1"/>
02a573
+      <state state_ref="oval:1:ste:2"/>
02a573
+    </filehash58_test>
02a573
+
02a573
+    <filehash58_test version="1" id="oval:1:tst:51" check="all" comment="false" xmlns="http://oval.mitre.org/XMLSchema/oval-definitions-5#independent">
02a573
+      <object object_ref="oval:1:obj:1"/>
02a573
+      <state state_ref="oval:1:ste:3"/>
02a573
+    </filehash58_test>
02a573
+
02a573
+    
02a573
+
02a573
+    <filehash58_test version="1" id="oval:1:tst:52" check="at least one" comment="true" xmlns="http://oval.mitre.org/XMLSchema/oval-definitions-5#independent">
02a573
+      <object object_ref="oval:1:obj:1"/>
02a573
+      <state state_ref="oval:1:ste:1"/>
02a573
+    </filehash58_test>
02a573
+
02a573
+    <filehash58_test version="1" id="oval:1:tst:53" check="at least one" comment="false" xmlns="http://oval.mitre.org/XMLSchema/oval-definitions-5#independent">
02a573
+      <object object_ref="oval:1:obj:1"/>
02a573
+      <state state_ref="oval:1:ste:2"/>
02a573
+    </filehash58_test>
02a573
+
02a573
+    <filehash58_test version="1" id="oval:1:tst:54" check="at least one" comment="false" xmlns="http://oval.mitre.org/XMLSchema/oval-definitions-5#independent">
02a573
+      <object object_ref="oval:1:obj:1"/>
02a573
+      <state state_ref="oval:1:ste:3"/>
02a573
+    </filehash58_test>
02a573
+
02a573
+    
02a573
+
02a573
+    <filehash58_test version="1" id="oval:1:tst:55" check="none satisfy" comment="false" xmlns="http://oval.mitre.org/XMLSchema/oval-definitions-5#independent">
02a573
+      <object object_ref="oval:1:obj:1"/>
02a573
+      <state state_ref="oval:1:ste:1"/>
02a573
+    </filehash58_test>
02a573
+
02a573
+    <filehash58_test version="1" id="oval:1:tst:56" check="none satisfy" comment="true" xmlns="http://oval.mitre.org/XMLSchema/oval-definitions-5#independent">
02a573
+      <object object_ref="oval:1:obj:1"/>
02a573
+      <state state_ref="oval:1:ste:2"/>
02a573
+    </filehash58_test>
02a573
+
02a573
+    <filehash58_test version="1" id="oval:1:tst:57" check="none satisfy" comment="true" xmlns="http://oval.mitre.org/XMLSchema/oval-definitions-5#independent">
02a573
+      <object object_ref="oval:1:obj:1"/>
02a573
+      <state state_ref="oval:1:ste:3"/>
02a573
+    </filehash58_test>
02a573
+
02a573
+    
02a573
+
02a573
+    <filehash58_test version="1" id="oval:1:tst:58" check="only one" comment="true" xmlns="http://oval.mitre.org/XMLSchema/oval-definitions-5#independent">
02a573
+      <object object_ref="oval:1:obj:1"/>
02a573
+      <state state_ref="oval:1:ste:1"/>
02a573
+    </filehash58_test>
02a573
+
02a573
+    <filehash58_test version="1" id="oval:1:tst:59" check="only one" comment="false" xmlns="http://oval.mitre.org/XMLSchema/oval-definitions-5#independent">
02a573
+      <object object_ref="oval:1:obj:1"/>
02a573
+      <state state_ref="oval:1:ste:2"/>
02a573
+    </filehash58_test>
02a573
+
02a573
+    <filehash58_test version="1" id="oval:1:tst:60" check="only one" comment="false" xmlns="http://oval.mitre.org/XMLSchema/oval-definitions-5#independent">
02a573
+      <object object_ref="oval:1:obj:1"/>
02a573
+      <state state_ref="oval:1:ste:3"/>
02a573
+    </filehash58_test>
02a573
+
02a573
+    
02a573
+
02a573
+    
02a573
+
02a573
+    <filehash58_test version="1" id="oval:1:tst:61" check_existence="all_exist" check="all" comment="true" xmlns="http://oval.mitre.org/XMLSchema/oval-definitions-5#independent">
02a573
+      <object object_ref="oval:1:obj:1"/>
02a573
+      <state state_ref="oval:1:ste:1"/>
02a573
+    </filehash58_test>
02a573
+
02a573
+    <filehash58_test version="1" id="oval:1:tst:62" check_existence="all_exist" check="all" comment="false" xmlns="http://oval.mitre.org/XMLSchema/oval-definitions-5#independent">
02a573
+      <object object_ref="oval:1:obj:1"/>
02a573
+      <state state_ref="oval:1:ste:2"/>
02a573
+    </filehash58_test>
02a573
+
02a573
+    <filehash58_test version="1" id="oval:1:tst:63" check_existence="all_exist" check="all" comment="false" xmlns="http://oval.mitre.org/XMLSchema/oval-definitions-5#independent">
02a573
+      <object object_ref="oval:1:obj:1"/>
02a573
+      <state state_ref="oval:1:ste:3"/>
02a573
+    </filehash58_test>
02a573
+
02a573
+    
02a573
+
02a573
+    <filehash58_test version="1" id="oval:1:tst:64" check_existence="all_exist" check="at least one" comment="true" xmlns="http://oval.mitre.org/XMLSchema/oval-definitions-5#independent">
02a573
+      <object object_ref="oval:1:obj:1"/>
02a573
+      <state state_ref="oval:1:ste:1"/>
02a573
+    </filehash58_test>
02a573
+
02a573
+    <filehash58_test version="1" id="oval:1:tst:65" check_existence="all_exist" check="at least one" comment="false" xmlns="http://oval.mitre.org/XMLSchema/oval-definitions-5#independent">
02a573
+      <object object_ref="oval:1:obj:1"/>
02a573
+      <state state_ref="oval:1:ste:2"/>
02a573
+    </filehash58_test>
02a573
+
02a573
+    <filehash58_test version="1" id="oval:1:tst:66" check_existence="all_exist" check="at least one" comment="false" xmlns="http://oval.mitre.org/XMLSchema/oval-definitions-5#independent">
02a573
+      <object object_ref="oval:1:obj:1"/>
02a573
+      <state state_ref="oval:1:ste:3"/>
02a573
+    </filehash58_test>
02a573
+
02a573
+    
02a573
+
02a573
+    <filehash58_test version="1" id="oval:1:tst:67" check_existence="all_exist" check="none satisfy" comment="false" xmlns="http://oval.mitre.org/XMLSchema/oval-definitions-5#independent">
02a573
+      <object object_ref="oval:1:obj:1"/>
02a573
+      <state state_ref="oval:1:ste:1"/>
02a573
+    </filehash58_test>
02a573
+
02a573
+    <filehash58_test version="1" id="oval:1:tst:68" check_existence="all_exist" check="none satisfy" comment="true" xmlns="http://oval.mitre.org/XMLSchema/oval-definitions-5#independent">
02a573
+      <object object_ref="oval:1:obj:1"/>
02a573
+      <state state_ref="oval:1:ste:2"/>
02a573
+    </filehash58_test>
02a573
+
02a573
+    <filehash58_test version="1" id="oval:1:tst:69" check_existence="all_exist" check="none satisfy" comment="true" xmlns="http://oval.mitre.org/XMLSchema/oval-definitions-5#independent">
02a573
+      <object object_ref="oval:1:obj:1"/>
02a573
+      <state state_ref="oval:1:ste:3"/>
02a573
+    </filehash58_test>
02a573
+
02a573
+    
02a573
+
02a573
+    <filehash58_test version="1" id="oval:1:tst:70" check_existence="all_exist" check="only one" comment="true" xmlns="http://oval.mitre.org/XMLSchema/oval-definitions-5#independent">
02a573
+      <object object_ref="oval:1:obj:1"/>
02a573
+      <state state_ref="oval:1:ste:1"/>
02a573
+    </filehash58_test>
02a573
+
02a573
+    <filehash58_test version="1" id="oval:1:tst:71" check_existence="all_exist" check="only one" comment="false" xmlns="http://oval.mitre.org/XMLSchema/oval-definitions-5#independent">
02a573
+      <object object_ref="oval:1:obj:1"/>
02a573
+      <state state_ref="oval:1:ste:2"/>
02a573
+    </filehash58_test>
02a573
+
02a573
+    <filehash58_test version="1" id="oval:1:tst:72" check_existence="all_exist" check="only one" comment="false" xmlns="http://oval.mitre.org/XMLSchema/oval-definitions-5#independent">
02a573
+      <object object_ref="oval:1:obj:1"/>
02a573
+      <state state_ref="oval:1:ste:3"/>
02a573
+    </filehash58_test>
02a573
+
02a573
+    
02a573
+
02a573
+    <filehash58_test version="1" id="oval:1:tst:73" check_existence="any_exist" check="all" comment="true" xmlns="http://oval.mitre.org/XMLSchema/oval-definitions-5#independent">
02a573
+      <object object_ref="oval:1:obj:1"/>
02a573
+      <state state_ref="oval:1:ste:1"/>
02a573
+    </filehash58_test>
02a573
+
02a573
+    <filehash58_test version="1" id="oval:1:tst:74" check_existence="any_exist" check="all" comment="false" xmlns="http://oval.mitre.org/XMLSchema/oval-definitions-5#independent">
02a573
+      <object object_ref="oval:1:obj:1"/>
02a573
+      <state state_ref="oval:1:ste:2"/>
02a573
+    </filehash58_test>
02a573
+
02a573
+    <filehash58_test version="1" id="oval:1:tst:75" check_existence="any_exist" check="all" comment="false" xmlns="http://oval.mitre.org/XMLSchema/oval-definitions-5#independent">
02a573
+      <object object_ref="oval:1:obj:1"/>
02a573
+      <state state_ref="oval:1:ste:3"/>
02a573
+    </filehash58_test>
02a573
+
02a573
+    
02a573
+
02a573
+    <filehash58_test version="1" id="oval:1:tst:76" check_existence="any_exist" check="at least one" comment="true" xmlns="http://oval.mitre.org/XMLSchema/oval-definitions-5#independent">
02a573
+      <object object_ref="oval:1:obj:1"/>
02a573
+      <state state_ref="oval:1:ste:1"/>
02a573
+    </filehash58_test>
02a573
+
02a573
+    <filehash58_test version="1" id="oval:1:tst:77" check_existence="any_exist" check="at least one" comment="false" xmlns="http://oval.mitre.org/XMLSchema/oval-definitions-5#independent">
02a573
+      <object object_ref="oval:1:obj:1"/>
02a573
+      <state state_ref="oval:1:ste:2"/>
02a573
+    </filehash58_test>
02a573
+
02a573
+    <filehash58_test version="1" id="oval:1:tst:78" check_existence="any_exist" check="at least one" comment="false" xmlns="http://oval.mitre.org/XMLSchema/oval-definitions-5#independent">
02a573
+      <object object_ref="oval:1:obj:1"/>
02a573
+      <state state_ref="oval:1:ste:3"/>
02a573
+    </filehash58_test>
02a573
+
02a573
+    
02a573
+
02a573
+    <filehash58_test version="1" id="oval:1:tst:79" check_existence="any_exist" check="none satisfy" comment="false" xmlns="http://oval.mitre.org/XMLSchema/oval-definitions-5#independent">
02a573
+      <object object_ref="oval:1:obj:1"/>
02a573
+      <state state_ref="oval:1:ste:1"/>
02a573
+    </filehash58_test>
02a573
+
02a573
+    <filehash58_test version="1" id="oval:1:tst:80" check_existence="any_exist" check="none satisfy" comment="true" xmlns="http://oval.mitre.org/XMLSchema/oval-definitions-5#independent">
02a573
+      <object object_ref="oval:1:obj:1"/>
02a573
+      <state state_ref="oval:1:ste:2"/>
02a573
+    </filehash58_test>
02a573
+
02a573
+    <filehash58_test version="1" id="oval:1:tst:81" check_existence="any_exist" check="none satisfy" comment="true" xmlns="http://oval.mitre.org/XMLSchema/oval-definitions-5#independent">
02a573
+      <object object_ref="oval:1:obj:1"/>
02a573
+      <state state_ref="oval:1:ste:3"/>
02a573
+    </filehash58_test>
02a573
+
02a573
+    
02a573
+
02a573
+    <filehash58_test version="1" id="oval:1:tst:82" check_existence="any_exist" check="only one" comment="true" xmlns="http://oval.mitre.org/XMLSchema/oval-definitions-5#independent">
02a573
+      <object object_ref="oval:1:obj:1"/>
02a573
+      <state state_ref="oval:1:ste:1"/>
02a573
+    </filehash58_test>
02a573
+
02a573
+    <filehash58_test version="1" id="oval:1:tst:83" check_existence="any_exist" check="only one" comment="false" xmlns="http://oval.mitre.org/XMLSchema/oval-definitions-5#independent">
02a573
+      <object object_ref="oval:1:obj:1"/>
02a573
+      <state state_ref="oval:1:ste:2"/>
02a573
+    </filehash58_test>
02a573
+
02a573
+    <filehash58_test version="1" id="oval:1:tst:84" check_existence="any_exist" check="only one" comment="false" xmlns="http://oval.mitre.org/XMLSchema/oval-definitions-5#independent">
02a573
+      <object object_ref="oval:1:obj:1"/>
02a573
+      <state state_ref="oval:1:ste:3"/>
02a573
+    </filehash58_test>
02a573
+
02a573
+    
02a573
+
02a573
+    <filehash58_test version="1" id="oval:1:tst:85" check_existence="at_least_one_exists" check="all" comment="true" xmlns="http://oval.mitre.org/XMLSchema/oval-definitions-5#independent">
02a573
+      <object object_ref="oval:1:obj:1"/>
02a573
+      <state state_ref="oval:1:ste:1"/>
02a573
+    </filehash58_test>
02a573
+
02a573
+    <filehash58_test version="1" id="oval:1:tst:86" check_existence="at_least_one_exists" check="all" comment="false" xmlns="http://oval.mitre.org/XMLSchema/oval-definitions-5#independent">
02a573
+      <object object_ref="oval:1:obj:1"/>
02a573
+      <state state_ref="oval:1:ste:2"/>
02a573
+    </filehash58_test>
02a573
+
02a573
+    <filehash58_test version="1" id="oval:1:tst:87" check_existence="at_least_one_exists" check="all" comment="false" xmlns="http://oval.mitre.org/XMLSchema/oval-definitions-5#independent">
02a573
+      <object object_ref="oval:1:obj:1"/>
02a573
+      <state state_ref="oval:1:ste:3"/>
02a573
+    </filehash58_test>
02a573
+
02a573
+    
02a573
+
02a573
+    <filehash58_test version="1" id="oval:1:tst:88" check_existence="at_least_one_exists" check="at least one" comment="true" xmlns="http://oval.mitre.org/XMLSchema/oval-definitions-5#independent">
02a573
+      <object object_ref="oval:1:obj:1"/>
02a573
+      <state state_ref="oval:1:ste:1"/>
02a573
+    </filehash58_test>
02a573
+
02a573
+    <filehash58_test version="1" id="oval:1:tst:89" check_existence="at_least_one_exists" check="at least one" comment="false" xmlns="http://oval.mitre.org/XMLSchema/oval-definitions-5#independent">
02a573
+      <object object_ref="oval:1:obj:1"/>
02a573
+      <state state_ref="oval:1:ste:2"/>
02a573
+    </filehash58_test>
02a573
+
02a573
+    <filehash58_test version="1" id="oval:1:tst:90" check_existence="at_least_one_exists" check="at least one" comment="false" xmlns="http://oval.mitre.org/XMLSchema/oval-definitions-5#independent">
02a573
+      <object object_ref="oval:1:obj:1"/>
02a573
+      <state state_ref="oval:1:ste:3"/>
02a573
+    </filehash58_test>
02a573
+
02a573
+    
02a573
+
02a573
+    <filehash58_test version="1" id="oval:1:tst:91" check_existence="at_least_one_exists" check="none satisfy" comment="false" xmlns="http://oval.mitre.org/XMLSchema/oval-definitions-5#independent">
02a573
+      <object object_ref="oval:1:obj:1"/>
02a573
+      <state state_ref="oval:1:ste:1"/>
02a573
+    </filehash58_test>
02a573
+
02a573
+    <filehash58_test version="1" id="oval:1:tst:92" check_existence="at_least_one_exists" check="none satisfy" comment="true" xmlns="http://oval.mitre.org/XMLSchema/oval-definitions-5#independent">
02a573
+      <object object_ref="oval:1:obj:1"/>
02a573
+      <state state_ref="oval:1:ste:2"/>
02a573
+    </filehash58_test>
02a573
+
02a573
+    <filehash58_test version="1" id="oval:1:tst:93" check_existence="at_least_one_exists" check="none satisfy" comment="true" xmlns="http://oval.mitre.org/XMLSchema/oval-definitions-5#independent">
02a573
+      <object object_ref="oval:1:obj:1"/>
02a573
+      <state state_ref="oval:1:ste:3"/>
02a573
+    </filehash58_test>
02a573
+
02a573
+    
02a573
+
02a573
+    <filehash58_test version="1" id="oval:1:tst:94" check_existence="at_least_one_exists" check="only one" comment="true" xmlns="http://oval.mitre.org/XMLSchema/oval-definitions-5#independent">
02a573
+      <object object_ref="oval:1:obj:1"/>
02a573
+      <state state_ref="oval:1:ste:1"/>
02a573
+    </filehash58_test>
02a573
+
02a573
+    <filehash58_test version="1" id="oval:1:tst:95" check_existence="at_least_one_exists" check="only one" comment="false" xmlns="http://oval.mitre.org/XMLSchema/oval-definitions-5#independent">
02a573
+      <object object_ref="oval:1:obj:1"/>
02a573
+      <state state_ref="oval:1:ste:2"/>
02a573
+    </filehash58_test>
02a573
+
02a573
+    <filehash58_test version="1" id="oval:1:tst:96" check_existence="at_least_one_exists" check="only one" comment="false" xmlns="http://oval.mitre.org/XMLSchema/oval-definitions-5#independent">
02a573
+      <object object_ref="oval:1:obj:1"/>
02a573
+      <state state_ref="oval:1:ste:3"/>
02a573
+    </filehash58_test>
02a573
+
02a573
+    
02a573
+
02a573
+    <filehash58_test version="1" id="oval:1:tst:97" check_existence="none_exist" check="all" comment="false" xmlns="http://oval.mitre.org/XMLSchema/oval-definitions-5#independent">
02a573
+      <object object_ref="oval:1:obj:1"/>
02a573
+    </filehash58_test>
02a573
+
02a573
+    <filehash58_test version="1" id="oval:1:tst:98" check_existence="none_exist" check="all" comment="false" xmlns="http://oval.mitre.org/XMLSchema/oval-definitions-5#independent">
02a573
+      <object object_ref="oval:1:obj:1"/>
02a573
+    </filehash58_test>
02a573
+
02a573
+    <filehash58_test version="1" id="oval:1:tst:99" check_existence="none_exist" check="all" comment="false" xmlns="http://oval.mitre.org/XMLSchema/oval-definitions-5#independent">
02a573
+      <object object_ref="oval:1:obj:1"/>
02a573
+    </filehash58_test>
02a573
+
02a573
+    
02a573
+
02a573
+    <filehash58_test version="1" id="oval:1:tst:100" check_existence="none_exist" check="at least one" comment="false" xmlns="http://oval.mitre.org/XMLSchema/oval-definitions-5#independent">
02a573
+      <object object_ref="oval:1:obj:1"/>
02a573
+    </filehash58_test>
02a573
+
02a573
+    <filehash58_test version="1" id="oval:1:tst:101" check_existence="none_exist" check="at least one" comment="false" xmlns="http://oval.mitre.org/XMLSchema/oval-definitions-5#independent">
02a573
+      <object object_ref="oval:1:obj:1"/>
02a573
+    </filehash58_test>
02a573
+
02a573
+    <filehash58_test version="1" id="oval:1:tst:102" check_existence="none_exist" check="at least one" comment="false" xmlns="http://oval.mitre.org/XMLSchema/oval-definitions-5#independent">
02a573
+      <object object_ref="oval:1:obj:1"/>
02a573
+    </filehash58_test>
02a573
+
02a573
+    
02a573
+
02a573
+    <filehash58_test version="1" id="oval:1:tst:103" check_existence="none_exist" check="none satisfy" comment="false" xmlns="http://oval.mitre.org/XMLSchema/oval-definitions-5#independent">
02a573
+      <object object_ref="oval:1:obj:1"/>
02a573
+    </filehash58_test>
02a573
+
02a573
+    <filehash58_test version="1" id="oval:1:tst:104" check_existence="none_exist" check="none satisfy" comment="false" xmlns="http://oval.mitre.org/XMLSchema/oval-definitions-5#independent">
02a573
+      <object object_ref="oval:1:obj:1"/>
02a573
+    </filehash58_test>
02a573
+
02a573
+    <filehash58_test version="1" id="oval:1:tst:105" check_existence="none_exist" check="none satisfy" comment="false" xmlns="http://oval.mitre.org/XMLSchema/oval-definitions-5#independent">
02a573
+      <object object_ref="oval:1:obj:1"/>
02a573
+    </filehash58_test>
02a573
+
02a573
+    
02a573
+
02a573
+    <filehash58_test version="1" id="oval:1:tst:106" check_existence="none_exist" check="only one" comment="false" xmlns="http://oval.mitre.org/XMLSchema/oval-definitions-5#independent">
02a573
+      <object object_ref="oval:1:obj:1"/>
02a573
+    </filehash58_test>
02a573
+
02a573
+    <filehash58_test version="1" id="oval:1:tst:107" check_existence="none_exist" check="only one" comment="false" xmlns="http://oval.mitre.org/XMLSchema/oval-definitions-5#independent">
02a573
+      <object object_ref="oval:1:obj:1"/>
02a573
+    </filehash58_test>
02a573
+
02a573
+    <filehash58_test version="1" id="oval:1:tst:108" check_existence="none_exist" check="only one" comment="false" xmlns="http://oval.mitre.org/XMLSchema/oval-definitions-5#independent">
02a573
+      <object object_ref="oval:1:obj:1"/>
02a573
+    </filehash58_test>
02a573
+
02a573
+    
02a573
+
02a573
+    <filehash58_test version="1" id="oval:1:tst:109" check_existence="only_one_exists" check="all" comment="true" xmlns="http://oval.mitre.org/XMLSchema/oval-definitions-5#independent">
02a573
+      <object object_ref="oval:1:obj:1"/>
02a573
+      <state state_ref="oval:1:ste:1"/>
02a573
+    </filehash58_test>
02a573
+
02a573
+    <filehash58_test version="1" id="oval:1:tst:110" check_existence="only_one_exists" check="all" comment="false" xmlns="http://oval.mitre.org/XMLSchema/oval-definitions-5#independent">
02a573
+      <object object_ref="oval:1:obj:1"/>
02a573
+      <state state_ref="oval:1:ste:2"/>
02a573
+    </filehash58_test>
02a573
+
02a573
+    <filehash58_test version="1" id="oval:1:tst:111" check_existence="only_one_exists" check="all" comment="false" xmlns="http://oval.mitre.org/XMLSchema/oval-definitions-5#independent">
02a573
+      <object object_ref="oval:1:obj:1"/>
02a573
+      <state state_ref="oval:1:ste:3"/>
02a573
+    </filehash58_test>
02a573
+
02a573
+    
02a573
+
02a573
+    <filehash58_test version="1" id="oval:1:tst:112" check_existence="only_one_exists" check="at least one" comment="true" xmlns="http://oval.mitre.org/XMLSchema/oval-definitions-5#independent">
02a573
+      <object object_ref="oval:1:obj:1"/>
02a573
+      <state state_ref="oval:1:ste:1"/>
02a573
+    </filehash58_test>
02a573
+
02a573
+    <filehash58_test version="1" id="oval:1:tst:113" check_existence="only_one_exists" check="at least one" comment="false" xmlns="http://oval.mitre.org/XMLSchema/oval-definitions-5#independent">
02a573
+      <object object_ref="oval:1:obj:1"/>
02a573
+      <state state_ref="oval:1:ste:2"/>
02a573
+    </filehash58_test>
02a573
+
02a573
+    <filehash58_test version="1" id="oval:1:tst:114" check_existence="only_one_exists" check="at least one" comment="false" xmlns="http://oval.mitre.org/XMLSchema/oval-definitions-5#independent">
02a573
+      <object object_ref="oval:1:obj:1"/>
02a573
+      <state state_ref="oval:1:ste:3"/>
02a573
+    </filehash58_test>
02a573
+
02a573
+    
02a573
+
02a573
+    <filehash58_test version="1" id="oval:1:tst:115" check_existence="only_one_exists" check="none satisfy" comment="false" xmlns="http://oval.mitre.org/XMLSchema/oval-definitions-5#independent">
02a573
+      <object object_ref="oval:1:obj:1"/>
02a573
+      <state state_ref="oval:1:ste:1"/>
02a573
+    </filehash58_test>
02a573
+
02a573
+    <filehash58_test version="1" id="oval:1:tst:116" check_existence="only_one_exists" check="none satisfy" comment="true" xmlns="http://oval.mitre.org/XMLSchema/oval-definitions-5#independent">
02a573
+      <object object_ref="oval:1:obj:1"/>
02a573
+      <state state_ref="oval:1:ste:2"/>
02a573
+    </filehash58_test>
02a573
+
02a573
+    <filehash58_test version="1" id="oval:1:tst:117" check_existence="only_one_exists" check="none satisfy" comment="true" xmlns="http://oval.mitre.org/XMLSchema/oval-definitions-5#independent">
02a573
+      <object object_ref="oval:1:obj:1"/>
02a573
+      <state state_ref="oval:1:ste:3"/>
02a573
+    </filehash58_test>
02a573
+
02a573
+    
02a573
+
02a573
+    <filehash58_test version="1" id="oval:1:tst:118" check_existence="only_one_exists" check="only one" comment="true" xmlns="http://oval.mitre.org/XMLSchema/oval-definitions-5#independent">
02a573
+      <object object_ref="oval:1:obj:1"/>
02a573
+      <state state_ref="oval:1:ste:1"/>
02a573
+    </filehash58_test>
02a573
+
02a573
+    <filehash58_test version="1" id="oval:1:tst:119" check_existence="only_one_exists" check="only one" comment="false" xmlns="http://oval.mitre.org/XMLSchema/oval-definitions-5#independent">
02a573
+      <object object_ref="oval:1:obj:1"/>
02a573
+      <state state_ref="oval:1:ste:2"/>
02a573
+    </filehash58_test>
02a573
+
02a573
+    <filehash58_test version="1" id="oval:1:tst:120" check_existence="only_one_exists" check="only one" comment="false" xmlns="http://oval.mitre.org/XMLSchema/oval-definitions-5#independent">
02a573
+      <object object_ref="oval:1:obj:1"/>
02a573
+      <state state_ref="oval:1:ste:3"/>
02a573
+    </filehash58_test>
02a573
+
02a573
+  </tests>
02a573
+
02a573
+  <objects>
02a573
+
02a573
+    
02a573
+    <filehash58_object version="1" id="oval:1:obj:1" xmlns="http://oval.mitre.org/XMLSchema/oval-definitions-5#independent">
02a573
+      <path>/tmp</path>
02a573
+      <filename>test_probes_filehash58.tmp</filename>
02a573
+      <hash_type>SHA-512</hash_type>
02a573
+    </filehash58_object>
02a573
+
02a573
+    
02a573
+    <filehash58_object version="1" id="oval:1:obj:2" xmlns="http://oval.mitre.org/XMLSchema/oval-definitions-5#independent">
02a573
+      <path>/tmp</path>
02a573
+      <filename>test_probes_filehash58.invalid</filename>
02a573
+      <hash_type>SHA-512</hash_type>
02a573
+    </filehash58_object>
02a573
+
02a573
+  </objects>
02a573
+
02a573
+  <states>
02a573
+
02a573
+    
02a573
+    <filehash58_state version="1" id="oval:1:ste:1" xmlns="http://oval.mitre.org/XMLSchema/oval-definitions-5#independent">
02a573
+
02a573
+      <filepath>/tmp/test_probes_filehash58.tmp</filepath>
02a573
+      <path>/tmp</path>
02a573
+      <filename>test_probes_filehash58.tmp</filename>
02a573
+      <hash_type>SHA-512</hash_type>
02a573
+      <hash>`sha512sum /tmp/test_probes_filehash58.tmp | awk '{print $1}'`</hash>
02a573
+    </filehash58_state>
02a573
+
02a573
+    
02a573
+    <filehash58_state version="1" id="oval:1:ste:2" xmlns="http://oval.mitre.org/XMLSchema/oval-definitions-5#independent">
02a573
+      <path>/tmp</path>
02a573
+      <filename>test_probes_filehash58.tmp</filename>
02a573
+      <hash_type>SHA-512</hash_type>
02a573
+      <hash>ce66ae981bfdcb0a5b63e296792662caf3e9c0414d1053593876f38fc1afdaffb89fdbe016a21e7357209fbaa611644307d589780cca97c04df0052bc903af22</hash>
02a573
+    </filehash58_state>
02a573
+
02a573
+    
02a573
+    <filehash58_state version="1" id="oval:1:ste:3" xmlns="http://oval.mitre.org/XMLSchema/oval-definitions-5#independent">
02a573
+      <path>/tmp</path>
02a573
+      <filename>test_probes_filehash58.tmp</filename>
02a573
+      <hash_type var_ref="oval:1:var:1" var_check="at least one"/>
02a573
+      <hash var_ref="oval:1:var:4" var_check="at least one"/>
02a573
+    </filehash58_state>
02a573
+
02a573
+  </states>
02a573
+
02a573
+  <variables>
02a573
+    <constant_variable id="oval:1:var:1" version="1" comment="several hash algorithms in one variable" datatype="string">
02a573
+      <value>SHA-256</value>
02a573
+      <value>SHA-512</value>
02a573
+    </constant_variable>
02a573
+    <constant_variable id="oval:1:var:4" version="1" comment="several hash algorithms in one variable" datatype="string">
02a573
+      <value>`sha256sum /tmp/test_probes_filehash58.tmp | awk '{print $1}'`</value>
02a573
+      <value>0bdf537d823dfb9194c25f2a444ac38fc177fc3ed2160acf7c15e3a07ccc600a8303e2a0e8ce50659395e0ab02910404e2134997b105794a167387de45f24768</value>
02a573
+    </constant_variable>
02a573
+  </variables>
02a573
+
02a573
+
02a573
+</oval_definitions>
02a573
+EOF
02a573
diff --git a/tests/probes/filehash58/test_probes_filehash58.xml.sh b/tests/probes/filehash58/test_probes_filehash58_old_algos.xml.sh
02a573
similarity index 100%
02a573
rename from tests/probes/filehash58/test_probes_filehash58.xml.sh
02a573
rename to tests/probes/filehash58/test_probes_filehash58_old_algos.xml.sh
02a573
02a573
From 02a404bd0663e9e8191af6ea89bcaff5833eaaec Mon Sep 17 00:00:00 2001
02a573
From: =?UTF-8?q?Jan=20=C4=8Cern=C3=BD?= <jcerny@redhat.com>
02a573
Date: Wed, 21 Jul 2021 10:49:06 +0200
02a573
Subject: [PATCH 3/5] Show supported crypto in oscap --version output
02a573
02a573
It will allow users to discover which hash algorithms are supported
02a573
by our probes.
02a573
---
02a573
 src/OVAL/probes/probe-table.c | 15 +++++++++++++++
02a573
 1 file changed, 15 insertions(+)
02a573
02a573
diff --git a/src/OVAL/probes/probe-table.c b/src/OVAL/probes/probe-table.c
02a573
index f7ca47702a..dd434ae6f2 100644
02a573
--- a/src/OVAL/probes/probe-table.c
02a573
+++ b/src/OVAL/probes/probe-table.c
02a573
@@ -391,6 +391,21 @@ void probe_table_list(FILE *output)
02a573
 		fprintf(output, "%-14s", oval_family_get_text(oval_subtype_get_family(type)));
02a573
 		fprintf(output, "%-29s", oval_subtype_get_text(type));
02a573
 		fprintf(output, "probe_%s", oval_subtype_get_text(type));
02a573
+#if (defined(OPENSCAP_ENABLE_MD5) && defined(OPENSCAP_ENABLE_SHA1))
02a573
+		if (type == OVAL_INDEPENDENT_FILE_HASH) {
02a573
+			fprintf(output, " (MD5, SHA-1)");
02a573
+		}
02a573
+#endif
02a573
+		if (type == OVAL_INDEPENDENT_FILE_HASH58) {
02a573
+			fprintf(output, " (");
02a573
+#ifdef OPENSCAP_ENABLE_MD5
02a573
+			fprintf(output, "MD5, ");
02a573
+#endif
02a573
+#ifdef OPENSCAP_ENABLE_SHA1
02a573
+			fprintf(output, "SHA-1, ");
02a573
+#endif
02a573
+			fprintf(output, "SHA-224, SHA-256, SHA-384, SHA-512)");
02a573
+		}
02a573
 		fprintf(output, "\n");
02a573
 		entry++;
02a573
 	}
02a573
02a573
From df30597efbf7caa47e7b143dae518da01246e512 Mon Sep 17 00:00:00 2001
02a573
From: =?UTF-8?q?Jan=20=C4=8Cern=C3=BD?= <jcerny@redhat.com>
02a573
Date: Wed, 21 Jul 2021 14:34:16 +0200
02a573
Subject: [PATCH 4/5] Remove unused CRAPI_DIGEST_CNT
02a573
02a573
This constant isn't used anywhere. Moerover, after introducing
02a573
preprocessor variables OPENSCAP_ENABLE_MD5 and OPENSCAP_ENABLE_SHA1
02a573
which affect the count supported crypto algorithms this value
02a573
could dynamically differ from 7.
02a573
---
02a573
 src/OVAL/probes/crapi/digest.h | 2 --
02a573
 1 file changed, 2 deletions(-)
02a573
02a573
diff --git a/src/OVAL/probes/crapi/digest.h b/src/OVAL/probes/crapi/digest.h
02a573
index 3de55e4f94..0d66db1336 100644
02a573
--- a/src/OVAL/probes/crapi/digest.h
02a573
+++ b/src/OVAL/probes/crapi/digest.h
02a573
@@ -40,8 +40,6 @@ typedef enum {
02a573
         CRAPI_DIGEST_SHA384 = 0x40
02a573
 } crapi_alg_t;
02a573
 
02a573
-#define CRAPI_DIGEST_CNT 7
02a573
-
02a573
 #include "md5.h"
02a573
 #include "sha1.h"
02a573
 #include "sha2.h"
02a573
02a573
From 741bffe331b9a1b737440d4b9dce9a1775cc8345 Mon Sep 17 00:00:00 2001
02a573
From: =?UTF-8?q?Jan=20=C4=8Cern=C3=BD?= <jcerny@redhat.com>
02a573
Date: Wed, 21 Jul 2021 14:42:45 +0200
02a573
Subject: [PATCH 5/5] Raise an error when using unsupported hash types
02a573
02a573
The OVAL content can have a hash algorithm in `hash_type` element that
02a573
is allowed by the OVAL specification but isn't currently supported in
02a573
OpenSCAP. At this moment, this can happen if OpenSCAP is compiled
02a573
without SHA-1 or MD5 support by setting OPENSCAP_ENABLE_SHA1 or
02a573
OPENSCAP_ENABLE_MD5 to OFF. In this situation we should warn the user,
02a573
for example show a warning and add a message element to the OVAL
02a573
results.
02a573
02a573
To do that, we need to be able to iterate over all hash types specified
02a573
in the OVAL specification, not only over the supported ones, because we
02a573
need to distinguish between a no match, a match of supported algorithm
02a573
and a match of an unsupported algorithm. Therefore we need to list them
02a573
explicitly.
02a573
02a573
The CRAPI_INVALID value has been replaced by 0 because it used to be a
02a573
-1 but a negative value can't be compared with an enum. That would cause
02a573
a compiler warning.
02a573
---
02a573
 .../probes/independent/filehash58_probe.c     | 109 +++++++++++-------
02a573
 1 file changed, 69 insertions(+), 40 deletions(-)
02a573
02a573
diff --git a/src/OVAL/probes/independent/filehash58_probe.c b/src/OVAL/probes/independent/filehash58_probe.c
02a573
index 895d8f92f4..53535d7069 100644
02a573
--- a/src/OVAL/probes/independent/filehash58_probe.c
02a573
+++ b/src/OVAL/probes/independent/filehash58_probe.c
02a573
@@ -54,11 +54,22 @@
02a573
 #include "util.h"
02a573
 #include "probe/entcmp.h"
02a573
 #include "filehash58_probe.h"
02a573
+#include "oscap_helpers.h"
02a573
 
02a573
 #define FILE_SEPARATOR '/'
02a573
 
02a573
-#define CRAPI_INVALID -1
02a573
+/* List of hash types listed in OVAL specification */
02a573
+static const char *OVAL_FILEHASH58_HASH_TYPES[] = {
02a573
+	"MD5",
02a573
+	"SHA-1",
02a573
+	"SHA-224",
02a573
+	"SHA-256",
02a573
+	"SHA-384",
02a573
+	"SHA-512",
02a573
+	NULL
02a573
+};
02a573
 
02a573
+/* List of hash types supported by OpenSCAP */
02a573
 static const struct oscap_string_map CRAPI_ALG_MAP[] = {
02a573
 #ifdef OPENSCAP_ENABLE_MD5
02a573
 	{CRAPI_DIGEST_MD5, "MD5"},
02a573
@@ -71,7 +82,7 @@ static const struct oscap_string_map CRAPI_ALG_MAP[] = {
02a573
 	{CRAPI_DIGEST_SHA384, "SHA-384"},
02a573
 	{CRAPI_DIGEST_SHA512, "SHA-512"},
02a573
 	/* {CRAPI_DIGEST_RMD160, "RMD-160"}, OVAL doesn't support this */
02a573
-	{CRAPI_INVALID, NULL}
02a573
+	{0, NULL}
02a573
 };
02a573
 
02a573
 static const struct oscap_string_map CRAPI_ALG_MAP_SIZE[] = {
02a573
@@ -165,45 +176,64 @@ static int filehash58_cb(const char *prefix, const char *p, const char *f, const
02a573
 		probe_item_add_msg(itm, OVAL_MESSAGE_LEVEL_ERROR,
02a573
 			"Can't open \"%s\": errno=%d, %s.", pbuf, errno, strerror (errno));
02a573
 		probe_item_setstatus(itm, SYSCHAR_STATUS_ERROR);
02a573
-	} else {
02a573
-		uint8_t hash_dst[1025];
02a573
-		size_t  hash_dstlen = sizeof hash_dst;
02a573
-		char    hash_str[2051];
02a573
 
02a573
-		crapi_alg_t hash_type;
02a573
+		probe_item_collect(ctx, itm);
02a573
+		return 0;
02a573
+	}
02a573
 
02a573
-		hash_type = oscap_string_to_enum(CRAPI_ALG_MAP, h);
02a573
-		hash_dstlen = oscap_string_to_enum(CRAPI_ALG_MAP_SIZE, h);
02a573
+	uint8_t hash_dst[1025];
02a573
+	size_t hash_dstlen = sizeof(hash_dst);
02a573
+	char hash_str[2051];
02a573
+	crapi_alg_t hash_type;
02a573
 
02a573
-		/*
02a573
-		 * Compute hash value
02a573
-		 */
02a573
-		if (crapi_mdigest_fd (fd, 1, hash_type, hash_dst, &hash_dstlen) != 0) {
02a573
-			close (fd);
02a573
-			return (-1);
02a573
-		}
02a573
+	hash_type = oscap_string_to_enum(CRAPI_ALG_MAP, h);
02a573
+	if (hash_type == 0) {
02a573
+		char *msg = oscap_sprintf("This version of OpenSCAP doesn't support the '%s' hash algorithm.", h);
02a573
+		dW(msg);
02a573
+		itm = probe_item_create (OVAL_INDEPENDENT_FILE_HASH58, NULL,
02a573
+			"filepath", OVAL_DATATYPE_STRING, pbuf,
02a573
+			"path", OVAL_DATATYPE_STRING, p,
02a573
+			"filename", OVAL_DATATYPE_STRING, f,
02a573
+			"hash_type", OVAL_DATATYPE_STRING, h,
02a573
+			NULL);
02a573
+		probe_item_add_msg(itm, OVAL_MESSAGE_LEVEL_ERROR, msg);
02a573
+		free(msg);
02a573
+		probe_item_setstatus(itm, SYSCHAR_STATUS_ERROR);
02a573
+		probe_item_collect(ctx, itm);
02a573
+		close(fd);
02a573
+		return 0;
02a573
+	}
02a573
+
02a573
+	hash_dstlen = oscap_string_to_enum(CRAPI_ALG_MAP_SIZE, h);
02a573
 
02a573
+	/*
02a573
+	 * Compute hash value
02a573
+	 */
02a573
+	if (crapi_mdigest_fd(fd, 1, hash_type, hash_dst, &hash_dstlen) != 0) {
02a573
 		close (fd);
02a573
+		return (-1);
02a573
+	}
02a573
 
02a573
-		hash_str[0] = '\0';
02a573
-		mem2hex (hash_dst, hash_dstlen, hash_str, sizeof hash_str);
02a573
+	close (fd);
02a573
 
02a573
-		/*
02a573
-		 * Create and add the item
02a573
-		 */
02a573
-		itm = probe_item_create(OVAL_INDEPENDENT_FILE_HASH58, NULL,
02a573
-					"filepath", OVAL_DATATYPE_STRING, pbuf,
02a573
-					"path",     OVAL_DATATYPE_STRING, p,
02a573
-					"filename", OVAL_DATATYPE_STRING, f,
02a573
-					"hash_type",OVAL_DATATYPE_STRING, h,
02a573
-					"hash",     OVAL_DATATYPE_STRING, hash_str,
02a573
-					NULL);
02a573
+	hash_str[0] = '\0';
02a573
+	mem2hex(hash_dst, hash_dstlen, hash_str, sizeof(hash_str));
02a573
 
02a573
-		if (hash_dstlen == 0) {
02a573
-			probe_item_add_msg(itm, OVAL_MESSAGE_LEVEL_ERROR,
02a573
-					   "Unable to compute %s hash value of \"%s\".", h, pbuf);
02a573
-			probe_item_setstatus(itm, SYSCHAR_STATUS_ERROR);
02a573
-		}
02a573
+	/*
02a573
+	 * Create and add the item
02a573
+	 */
02a573
+	itm = probe_item_create(OVAL_INDEPENDENT_FILE_HASH58, NULL,
02a573
+		"filepath", OVAL_DATATYPE_STRING, pbuf,
02a573
+		"path", OVAL_DATATYPE_STRING, p,
02a573
+		"filename", OVAL_DATATYPE_STRING, f,
02a573
+		"hash_type",OVAL_DATATYPE_STRING, h,
02a573
+		"hash", OVAL_DATATYPE_STRING, hash_str,
02a573
+		NULL);
02a573
+
02a573
+	if (hash_dstlen == 0) {
02a573
+		probe_item_add_msg(itm, OVAL_MESSAGE_LEVEL_ERROR,
02a573
+			"Unable to compute %s hash value of \"%s\".", h, pbuf);
02a573
+		probe_item_setstatus(itm, SYSCHAR_STATUS_ERROR);
02a573
 	}
02a573
 
02a573
 	probe_item_collect(ctx, itm);
02a573
@@ -300,15 +330,14 @@ int filehash58_probe_main(probe_ctx *ctx, void *arg)
02a573
 	if ((ofts = oval_fts_open_prefixed(prefix, path, filename, filepath, behaviors, probe_ctx_getresult(ctx))) != NULL) {
02a573
 		while ((ofts_ent = oval_fts_read(ofts)) != NULL) {
02a573
 			/* find hash types to compare with entity, think "not satisfy" */
02a573
-			const struct oscap_string_map *p = CRAPI_ALG_MAP;
02a573
-			while (p->value != CRAPI_INVALID) {
02a573
-				SEXP_t *crapi_hash_type_sexp = SEXP_string_new(p->string, strlen(p->string));
02a573
-				if (probe_entobj_cmp(hash_type, crapi_hash_type_sexp) == OVAL_RESULT_TRUE) {
02a573
-					filehash58_cb(prefix, ofts_ent->path, ofts_ent->file, p->string, ctx);
02a573
+			for (int i = 0; OVAL_FILEHASH58_HASH_TYPES[i] != NULL; i++) {
02a573
+				const char *oval_filehash58_hash_type = OVAL_FILEHASH58_HASH_TYPES[i];
02a573
+				SEXP_t *oval_filehash58_hash_type_sexp = SEXP_string_new(oval_filehash58_hash_type, strlen(oval_filehash58_hash_type));
02a573
+				if (probe_entobj_cmp(hash_type, oval_filehash58_hash_type_sexp) == OVAL_RESULT_TRUE) {
02a573
+					filehash58_cb(prefix, ofts_ent->path, ofts_ent->file, oval_filehash58_hash_type, ctx);
02a573
 				}
02a573
 
02a573
-				SEXP_free(crapi_hash_type_sexp);
02a573
-				p++;
02a573
+				SEXP_free(oval_filehash58_hash_type_sexp);
02a573
 			}
02a573
 			oval_ftsent_free(ofts_ent);
02a573
 		}