Update SoftHSM v2.0 to the latest version
[aaf/sshsm.git] / SoftHSMv2 / m4 / acx_botan_eddsa.m4
1 AC_DEFUN([ACX_BOTAN_EDDSA],[
2         AC_MSG_CHECKING(for Botan EDDSA support)
3
4         tmp_CPPFLAGS=$CPPFLAGS
5         tmp_LIBS=$LIBS
6
7         CPPFLAGS="$CPPFLAGS $CRYPTO_INCLUDES"
8         LIBS="$CRYPTO_LIBS $LIBS"
9
10         AC_LANG_PUSH([C++])
11         AC_CACHE_VAL([acx_cv_lib_botan_eddsa_support],[
12                 acx_cv_lib_botan_eddsa_support=no
13                 AC_RUN_IFELSE([
14                         AC_LANG_SOURCE([[
15                                 #include <botan/init.h>
16                                 #include <botan/ed25519.h>
17                                 #include <botan/version.h>
18                                 int main()
19                                 {
20                                         Botan::secure_vector<uint8_t> k(32);
21                                         try {
22                                                 Botan::Ed25519_PrivateKey* key =
23                                                 new Botan::Ed25519_PrivateKey(k);
24                                         } catch(...) {
25                                                 return 1;
26                                         }
27                                         return 0;
28                                 }
29                         ]])
30                 ],[
31                         AC_MSG_RESULT([Found Ed25519])
32                         acx_cv_lib_botan_eddsa_support=yes
33                 ],[
34                         AC_MSG_RESULT([Cannot find Ed25519])
35                         AC_MSG_ERROR([
36 Botan library has no valid EDDSA support. Please upgrade to a later version
37 of Botan with EDDSA support.
38 Alternatively disable EDDSA support in SoftHSM with --disable-eddsa
39 ])
40                 ],[
41                         AC_MSG_WARN([Cannot test, assuming EDDSA])
42                         acx_cv_lib_botan_eddsa_support=yes
43                 ])
44         ])
45         AC_LANG_POP([C++])
46
47         CPPFLAGS=$tmp_CPPFLAGS
48         LIBS=$tmp_LIBS
49 ])