19f5dd0b8dc4eff3373a0ac9ea17c2440628fd4cSumit Bosednl Check for tools needed to run the test CA
19f5dd0b8dc4eff3373a0ac9ea17c2440628fd4cSumit BoseAC_DEFUN([AM_CHECK_TEST_CA],
19f5dd0b8dc4eff3373a0ac9ea17c2440628fd4cSumit Bose AC_PATH_PROG([OPENSSL], [openssl])
19f5dd0b8dc4eff3373a0ac9ea17c2440628fd4cSumit Bose if test ! -x "$OPENSSL"; then
19f5dd0b8dc4eff3373a0ac9ea17c2440628fd4cSumit Bose AC_MSG_NOTICE([Could not find openssl])
19f5dd0b8dc4eff3373a0ac9ea17c2440628fd4cSumit Bose AC_PATH_PROG([SSH_KEYGEN], [ssh-keygen])
19f5dd0b8dc4eff3373a0ac9ea17c2440628fd4cSumit Bose if test ! -x "$SSH_KEYGEN"; then
19f5dd0b8dc4eff3373a0ac9ea17c2440628fd4cSumit Bose AC_MSG_NOTICE([Could not find ssh-keygen])
19f5dd0b8dc4eff3373a0ac9ea17c2440628fd4cSumit Bose AC_MSG_CHECKING([for -m option of ssh-keygen])
19f5dd0b8dc4eff3373a0ac9ea17c2440628fd4cSumit Bose if AC_RUN_LOG([$SSH_KEYGEN --help 2>&1 |grep -- '-m ' > /dev/null]); then
19f5dd0b8dc4eff3373a0ac9ea17c2440628fd4cSumit Bose AC_MSG_RESULT([yes])
19f5dd0b8dc4eff3373a0ac9ea17c2440628fd4cSumit Bose SSH_KEYGEN=""
19f5dd0b8dc4eff3373a0ac9ea17c2440628fd4cSumit Bose AC_MSG_RESULT([no])
19f5dd0b8dc4eff3373a0ac9ea17c2440628fd4cSumit Bose if test x$cryptolib = xnss; then
19f5dd0b8dc4eff3373a0ac9ea17c2440628fd4cSumit Bose AC_PATH_PROG([CERTUTIL], [certutil])
19f5dd0b8dc4eff3373a0ac9ea17c2440628fd4cSumit Bose if test ! -x "$CERTUTIL"; then
19f5dd0b8dc4eff3373a0ac9ea17c2440628fd4cSumit Bose AC_MSG_NOTICE([Could not find certutil])
19f5dd0b8dc4eff3373a0ac9ea17c2440628fd4cSumit Bose AC_PATH_PROG([PK12UTIL], [pk12util])
19f5dd0b8dc4eff3373a0ac9ea17c2440628fd4cSumit Bose if test ! -x "$PK12UTIL"; then
19f5dd0b8dc4eff3373a0ac9ea17c2440628fd4cSumit Bose AC_MSG_NOTICE([Could not find pk12util])
19f5dd0b8dc4eff3373a0ac9ea17c2440628fd4cSumit Bose AM_CONDITIONAL([BUILD_TEST_CA], [test -x "$OPENSSL" -a -x "$SSH_KEYGEN" -a -x "$CERTUTIL" -a -x "$PK12UTIL"])
19f5dd0b8dc4eff3373a0ac9ea17c2440628fd4cSumit Bose AM_CONDITIONAL([BUILD_TEST_CA], [test -x "$OPENSSL" -a -x "$SSH_KEYGEN"])
19f5dd0b8dc4eff3373a0ac9ea17c2440628fd4cSumit Bose AM_COND_IF([BUILD_TEST_CA],
19f5dd0b8dc4eff3373a0ac9ea17c2440628fd4cSumit Bose [AC_DEFINE_UNQUOTED(HAVE_TEST_CA, 1,
19f5dd0b8dc4eff3373a0ac9ea17c2440628fd4cSumit Bose [Build with certificates from test CA])],
19f5dd0b8dc4eff3373a0ac9ea17c2440628fd4cSumit Bose [AC_MSG_WARN([Test CA cannot be build, skiping some tests])])