fips-checksums.sh 981 B

12345678910111213141516171819202122232425262728293031
  1. #! /bin/sh
  2. HERE=`dirname $0`
  3. for f in "$@"; do
  4. # It's worth nothing that 'openssl sha256 -r' assumes that all input
  5. # is binary. This isn't quite true, and we know better, so we convert
  6. # the '*stdin' marker to the filename preceded by a space. See the
  7. # sha1sum manual for a specification of the format.
  8. case "$f" in
  9. *.c | *.c.in | *.h | *.h.in | *.inc)
  10. cat "$f" \
  11. | $HERE/lang-compress.pl 'C' \
  12. | unifdef -DFIPS_MODULE=1 \
  13. | openssl sha256 -r \
  14. | sed -e "s| \\*stdin| $f|"
  15. ;;
  16. *.pl )
  17. cat "$f" \
  18. | $HERE/lang-compress.pl 'perl' \
  19. | openssl sha256 -r \
  20. | sed -e "s| \\*stdin| $f|"
  21. ;;
  22. *.S )
  23. cat "$f" \
  24. | $HERE/lang-compress.pl 'S' \
  25. | openssl sha256 -r \
  26. | sed -e "s| \\*stdin| $f|"
  27. ;;
  28. esac
  29. done