summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDarren Tucker <dtucker@dtucker.net>2019-11-02 16:39:38 +1100
committerDarren Tucker <dtucker@dtucker.net>2019-11-02 16:39:38 +1100
commitf5cc5816aaddb8eca3cba193f53e99d6a0b37d05 (patch)
tree806820158e00a433744f3742d8eafe10fe8faf93
parentad38406fc95fa223b0ef2edf8ff50508f8ab1cb6 (diff)
Only enable U2F if OpenSSL supports ECC.
This requires moving the U2F bits to below the OpenSSL parts so we have the required information. ok djm@
-rw-r--r--configure.ac74
1 files changed, 40 insertions, 34 deletions
diff --git a/configure.ac b/configure.ac
index 4baaa62a8..bc28d0748 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1909,44 +1909,10 @@ AC_ARG_ENABLE([security-key],
1909 ] 1909 ]
1910) 1910)
1911 1911
1912# PKCS11/U2F depend on OpenSSL and dlopen().
1913AC_SEARCH_LIBS([dlopen], [dl]) 1912AC_SEARCH_LIBS([dlopen], [dl])
1914AC_CHECK_FUNCS([dlopen]) 1913AC_CHECK_FUNCS([dlopen])
1915AC_CHECK_DECL([RTLD_NOW], [], [], [#include <dlfcn.h>]) 1914AC_CHECK_DECL([RTLD_NOW], [], [], [#include <dlfcn.h>])
1916 1915
1917enable_pkcs11=yes
1918enable_sk=yes
1919if test "x$openssl" != "xyes" ; then
1920 enable_pkcs11="disabled; missing libcrypto"
1921 enable_sk="disabled; missing libcrypto"
1922fi
1923if test "x$ac_cv_func_dlopen" != "xyes" ; then
1924 enable_pkcs11="disabled; missing dlopen(3)"
1925 enable_sk="disabled; missing dlopen(3)"
1926fi
1927if test "x$ac_cv_have_decl_RTLD_NOW" != "xyes" ; then
1928 enable_pkcs11="disabled; missing RTLD_NOW"
1929 enable_sk="disabled; missing RTLD_NOW"
1930fi
1931if test ! -z "$disable_pkcs11" ; then
1932 enable_pkcs11="disabled by user"
1933fi
1934if test ! -z "$disable_sk" ; then
1935 enable_sk="disabled by user"
1936fi
1937
1938AC_MSG_CHECKING([whether to enable PKCS11])
1939if test "x$enable_pkcs11" = "xyes" ; then
1940 AC_DEFINE([ENABLE_PKCS11], [], [Enable for PKCS#11 support])
1941fi
1942AC_MSG_RESULT([$enable_pkcs11])
1943
1944AC_MSG_CHECKING([whether to enable U2F])
1945if test "x$enable_sk" = "xyes" ; then
1946 AC_DEFINE([ENABLE_SK], [], [Enable for U2F/FIDO support])
1947fi
1948AC_MSG_RESULT([$enable_sk])
1949
1950# IRIX has a const char return value for gai_strerror() 1916# IRIX has a const char return value for gai_strerror()
1951AC_CHECK_FUNCS([gai_strerror], [ 1917AC_CHECK_FUNCS([gai_strerror], [
1952 AC_DEFINE([HAVE_GAI_STRERROR]) 1918 AC_DEFINE([HAVE_GAI_STRERROR])
@@ -3015,6 +2981,9 @@ if test "x$openssl" = "xyes" ; then
3015 test x$enable_nistp521 = x1; then 2981 test x$enable_nistp521 = x1; then
3016 AC_DEFINE(OPENSSL_HAS_ECC, [1], [OpenSSL has ECC]) 2982 AC_DEFINE(OPENSSL_HAS_ECC, [1], [OpenSSL has ECC])
3017 AC_CHECK_FUNCS([EC_KEY_METHOD_new]) 2983 AC_CHECK_FUNCS([EC_KEY_METHOD_new])
2984 openssl_ecc=yes
2985 else
2986 openssl_ecc=no
3018 fi 2987 fi
3019 if test x$enable_nistp256 = x1; then 2988 if test x$enable_nistp256 = x1; then
3020 AC_DEFINE([OPENSSL_HAS_NISTP256], [1], 2989 AC_DEFINE([OPENSSL_HAS_NISTP256], [1],
@@ -3055,6 +3024,43 @@ else
3055 AC_CHECK_FUNCS([crypt]) 3024 AC_CHECK_FUNCS([crypt])
3056fi 3025fi
3057 3026
3027# PKCS11/U2F depend on OpenSSL and dlopen().
3028enable_pkcs11=yes
3029enable_sk=yes
3030if test "x$openssl" != "xyes" ; then
3031 enable_pkcs11="disabled; missing libcrypto"
3032 enable_sk="disabled; missing libcrypto"
3033fi
3034if test "x$openssl_ecc" != "xyes" ; then
3035 enable_sk="disabled; OpenSSL has no ECC support"
3036fi
3037if test "x$ac_cv_func_dlopen" != "xyes" ; then
3038 enable_pkcs11="disabled; missing dlopen(3)"
3039 enable_sk="disabled; missing dlopen(3)"
3040fi
3041if test "x$ac_cv_have_decl_RTLD_NOW" != "xyes" ; then
3042 enable_pkcs11="disabled; missing RTLD_NOW"
3043 enable_sk="disabled; missing RTLD_NOW"
3044fi
3045if test ! -z "$disable_pkcs11" ; then
3046 enable_pkcs11="disabled by user"
3047fi
3048if test ! -z "$disable_sk" ; then
3049 enable_sk="disabled by user"
3050fi
3051
3052AC_MSG_CHECKING([whether to enable PKCS11])
3053if test "x$enable_pkcs11" = "xyes" ; then
3054 AC_DEFINE([ENABLE_PKCS11], [], [Enable for PKCS#11 support])
3055fi
3056AC_MSG_RESULT([$enable_pkcs11])
3057
3058AC_MSG_CHECKING([whether to enable U2F])
3059if test "x$enable_sk" = "xyes" ; then
3060 AC_DEFINE([ENABLE_SK], [], [Enable for U2F/FIDO support])
3061fi
3062AC_MSG_RESULT([$enable_sk])
3063
3058AC_CHECK_FUNCS([ \ 3064AC_CHECK_FUNCS([ \
3059 arc4random \ 3065 arc4random \
3060 arc4random_buf \ 3066 arc4random_buf \