diff options
-rw-r--r-- | configure.ac | 74 |
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(). | ||
1913 | AC_SEARCH_LIBS([dlopen], [dl]) | 1912 | AC_SEARCH_LIBS([dlopen], [dl]) |
1914 | AC_CHECK_FUNCS([dlopen]) | 1913 | AC_CHECK_FUNCS([dlopen]) |
1915 | AC_CHECK_DECL([RTLD_NOW], [], [], [#include <dlfcn.h>]) | 1914 | AC_CHECK_DECL([RTLD_NOW], [], [], [#include <dlfcn.h>]) |
1916 | 1915 | ||
1917 | enable_pkcs11=yes | ||
1918 | enable_sk=yes | ||
1919 | if test "x$openssl" != "xyes" ; then | ||
1920 | enable_pkcs11="disabled; missing libcrypto" | ||
1921 | enable_sk="disabled; missing libcrypto" | ||
1922 | fi | ||
1923 | if test "x$ac_cv_func_dlopen" != "xyes" ; then | ||
1924 | enable_pkcs11="disabled; missing dlopen(3)" | ||
1925 | enable_sk="disabled; missing dlopen(3)" | ||
1926 | fi | ||
1927 | if test "x$ac_cv_have_decl_RTLD_NOW" != "xyes" ; then | ||
1928 | enable_pkcs11="disabled; missing RTLD_NOW" | ||
1929 | enable_sk="disabled; missing RTLD_NOW" | ||
1930 | fi | ||
1931 | if test ! -z "$disable_pkcs11" ; then | ||
1932 | enable_pkcs11="disabled by user" | ||
1933 | fi | ||
1934 | if test ! -z "$disable_sk" ; then | ||
1935 | enable_sk="disabled by user" | ||
1936 | fi | ||
1937 | |||
1938 | AC_MSG_CHECKING([whether to enable PKCS11]) | ||
1939 | if test "x$enable_pkcs11" = "xyes" ; then | ||
1940 | AC_DEFINE([ENABLE_PKCS11], [], [Enable for PKCS#11 support]) | ||
1941 | fi | ||
1942 | AC_MSG_RESULT([$enable_pkcs11]) | ||
1943 | |||
1944 | AC_MSG_CHECKING([whether to enable U2F]) | ||
1945 | if test "x$enable_sk" = "xyes" ; then | ||
1946 | AC_DEFINE([ENABLE_SK], [], [Enable for U2F/FIDO support]) | ||
1947 | fi | ||
1948 | AC_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() |
1951 | AC_CHECK_FUNCS([gai_strerror], [ | 1917 | AC_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]) |
3056 | fi | 3025 | fi |
3057 | 3026 | ||
3027 | # PKCS11/U2F depend on OpenSSL and dlopen(). | ||
3028 | enable_pkcs11=yes | ||
3029 | enable_sk=yes | ||
3030 | if test "x$openssl" != "xyes" ; then | ||
3031 | enable_pkcs11="disabled; missing libcrypto" | ||
3032 | enable_sk="disabled; missing libcrypto" | ||
3033 | fi | ||
3034 | if test "x$openssl_ecc" != "xyes" ; then | ||
3035 | enable_sk="disabled; OpenSSL has no ECC support" | ||
3036 | fi | ||
3037 | if test "x$ac_cv_func_dlopen" != "xyes" ; then | ||
3038 | enable_pkcs11="disabled; missing dlopen(3)" | ||
3039 | enable_sk="disabled; missing dlopen(3)" | ||
3040 | fi | ||
3041 | if test "x$ac_cv_have_decl_RTLD_NOW" != "xyes" ; then | ||
3042 | enable_pkcs11="disabled; missing RTLD_NOW" | ||
3043 | enable_sk="disabled; missing RTLD_NOW" | ||
3044 | fi | ||
3045 | if test ! -z "$disable_pkcs11" ; then | ||
3046 | enable_pkcs11="disabled by user" | ||
3047 | fi | ||
3048 | if test ! -z "$disable_sk" ; then | ||
3049 | enable_sk="disabled by user" | ||
3050 | fi | ||
3051 | |||
3052 | AC_MSG_CHECKING([whether to enable PKCS11]) | ||
3053 | if test "x$enable_pkcs11" = "xyes" ; then | ||
3054 | AC_DEFINE([ENABLE_PKCS11], [], [Enable for PKCS#11 support]) | ||
3055 | fi | ||
3056 | AC_MSG_RESULT([$enable_pkcs11]) | ||
3057 | |||
3058 | AC_MSG_CHECKING([whether to enable U2F]) | ||
3059 | if test "x$enable_sk" = "xyes" ; then | ||
3060 | AC_DEFINE([ENABLE_SK], [], [Enable for U2F/FIDO support]) | ||
3061 | fi | ||
3062 | AC_MSG_RESULT([$enable_sk]) | ||
3063 | |||
3058 | AC_CHECK_FUNCS([ \ | 3064 | AC_CHECK_FUNCS([ \ |
3059 | arc4random \ | 3065 | arc4random \ |
3060 | arc4random_buf \ | 3066 | arc4random_buf \ |