check-fips.sh 524 B

12345678910111213141516
  1. # Pass the path to the executable to check for FIPS compliance
  2. exe=$1
  3. if [ "$(go tool nm "${exe}" | grep -c '_Cfunc__goboringcrypto_')" -eq 0 ]; then
  4. # Asserts that executable is using FIPS-compliant boringcrypto
  5. echo "${exe}: missing goboring symbols" >&2
  6. exit 1
  7. fi
  8. if [ "$(go tool nm "${exe}" | grep -c 'crypto/internal/boring/sig.FIPSOnly')" -eq 0 ]; then
  9. # Asserts that executable is using FIPS-only schemes
  10. echo "${exe}: missing fipsonly symbols" >&2
  11. exit 1
  12. fi
  13. echo "${exe} is FIPS-compliant"