dictionarylockout.sh 850 B

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. # SPDX-License-Identifier: BSD-3-Clause
  2. ###this script use for test the implementation tpm2 dictionarylockout
  3. source helpers.sh
  4. out=out.yaml
  5. cleanup() {
  6. rm -f $out
  7. shut_down
  8. }
  9. trap cleanup EXIT
  10. start_up
  11. tpm2 dictionarylockout -Q -V -c &>/dev/null
  12. tpm2 dictionarylockout -s -n 5 -t 6 -l 7
  13. tpm2 getcap properties-variable > $out
  14. v=$(yaml_get_kv "$out" "TPM2_PT_MAX_AUTH_FAIL")
  15. if [ $v -ne 5 ];then
  16. echo "Failure: setting up the number of allowed tries in the lockout \
  17. parameters"
  18. exit 1
  19. fi
  20. v=$(yaml_get_kv "$out" "TPM2_PT_LOCKOUT_INTERVAL")
  21. if [ $v -ne 6 ];then
  22. echo "Failure: setting up the lockout period in the lockout parameters"
  23. exit 1
  24. fi
  25. v=$(yaml_get_kv "$out" "TPM2_PT_LOCKOUT_RECOVERY")
  26. if [ $v -ne 7 ];then
  27. echo "Failure: setting up the lockout recovery period in the lockout \
  28. parameters"
  29. exit 1
  30. fi
  31. exit 0