{{%- if 'sle' in product %}}
  {{%- set openssl_cnf_path="/etc/ssl/openssl.cnf" %}}
{{%- else %}}
  {{%- set openssl_cnf_path="/etc/pki/tls/openssl.cnf" %}}
{{%- endif %}}
<def-group>
  <definition class="compliance" id="configure_openssl_crypto_policy" version="1">
    {{{ oval_metadata("OpenSSL should be configured to use the system-wide crypto policy setting.") }}}
    <criteria>
      <criterion test_ref="test_configure_openssl_crypto_policy"
      comment="Check that the configuration mandates usage of system-wide crypto policies." />
    </criteria>
  </definition>

  <ind:textfilecontent54_test id="test_configure_openssl_crypto_policy"
  comment="Check that the configuration mandates usage of system-wide crypto policies."
  check="all" check_existence="all_exist" version="1">
    <ind:object object_ref="object_configure_openssl_crypto_policy" />
  </ind:textfilecontent54_test>

  <ind:textfilecontent54_object id="object_configure_openssl_crypto_policy"
  version="1">
    <ind:filepath>{{{ openssl_cnf_path }}}</ind:filepath>
    <ind:pattern operation="pattern match">^\s*\[\s*crypto_policy\s*\]\s*\n*\s*\.include\s*(?:=\s*)?/etc/crypto-policies/back-ends/opensslcnf.config\s*$</ind:pattern>
    <ind:instance datatype="int" operation="greater than or equal">1</ind:instance>
  </ind:textfilecontent54_object>
</def-group>

