<def-group>
  <definition class="compliance" id="{{{ rule_id }}}" version="1">
    {{{ oval_metadata("The password hashing algorithm should be set correctly in /etc/libuser.conf.") }}}
    <criteria operator="AND">
      <criterion test_ref="test_set_password_hashing_algorithm_libuserconf" />
    </criteria>
  </definition>

  <ind:textfilecontent54_test id="test_set_password_hashing_algorithm_libuserconf" version="2"
    check="all" check_existence="at_least_one_exists"
    comment="check if /etc/libuser.conf hashing algorithm option is correct">
    <ind:object object_ref="object_set_password_hashing_algorithm_libuserconf"/>
    <ind:state state_ref="state_set_password_hashing_algorithm_libuserconf"/>
  </ind:textfilecontent54_test>

  <ind:textfilecontent54_object id="object_set_password_hashing_algorithm_libuserconf" version="2"
    comment="only one hashing algorithm option for pam_unix.so is found in /etc/libuser.conf">
    <ind:filepath>/etc/libuser.conf</ind:filepath>
    <ind:pattern operation="pattern match">^[\s]*crypt_style[\s]*=[\s]*(\w*)[\s]*$</ind:pattern>
    <ind:instance datatype="int">1</ind:instance>
  </ind:textfilecontent54_object>

  <ind:textfilecontent54_state id="state_set_password_hashing_algorithm_libuserconf" version="1">
    <ind:subexpression operation="equals" datatype="string" var_ref="var_password_hashing_algorithm_pam"/>
  </ind:textfilecontent54_state>

  <external_variable id="var_password_hashing_algorithm_pam" datatype="string" version="1"
    comment="hashing algorithm for pam_unix.so"/>
</def-group>
